calculate hi-res vertex positions. reduces shaking of polygons when rendering at a higher res.

This commit is contained in:
Arisotura
2019-05-11 15:14:59 +02:00
parent 5c9df6a4e5
commit 53b2262917
3 changed files with 19 additions and 1 deletions

View File

@ -1120,9 +1120,13 @@ void BuildPolygons(RendererPolygon* polygons, int npolys)
u32 zshift = 0;
while (z > 0xFFFF) { z >>= 1; zshift++; }
u32 x = vtx->HiresPosition[0] >> 3;
u32 y = vtx->HiresPosition[1] >> 3;
*vptr++ = x | (y << 16);
// TODO hires-upgraded positions?
//*vptr++ = vtx->FinalPosition[0] | (vtx->FinalPosition[1] << 16);
*vptr++ = (vtx->FinalPosition[0] << 1) | (vtx->FinalPosition[1] << 17);
//*vptr++ = (vtx->FinalPosition[0] << 1) | (vtx->FinalPosition[1] << 17);
//*vptr++ = (vtx->FinalPosition[0] << 2) | (vtx->FinalPosition[1] << 18);
*vptr++ = z | (w << 16);