- Fix depth values when screenblocks less than 11

This commit is contained in:
Magnus Norddahl 2018-04-08 13:45:23 +02:00
commit 1a5f679d43
2 changed files with 6 additions and 1 deletions

View file

@ -178,7 +178,8 @@ namespace swrenderer
double curyfrac = baseyfrac + ystepscale * (x1 - minx);
double distance = viewport->PlaneDepth(y, planeheight);
float zbufferdepth = 1.0f / (distance * Thread->Viewport->viewwindow.FocalTangent);
float zbufferdepth = (float)(1.0 / fabs(planeheight / Thread->Viewport->ScreenToViewY(y, 1.0)));
drawerargs.SetTextureUStep(distance * xstepscale / drawerargs.TextureWidth());
drawerargs.SetTextureUPos((distance * curxfrac + pviewx) / drawerargs.TextureWidth());