- Add model rendering to the software renderer

This commit is contained in:
Magnus Norddahl 2017-11-27 23:47:26 +01:00
commit d43ac8b9ae
32 changed files with 792 additions and 87 deletions

View file

@ -178,6 +178,7 @@ namespace swrenderer
double curyfrac = baseyfrac + ystepscale * (x1 - minx);
double distance = viewport->PlaneDepth(y, planeheight);
float zbufferdepth = 1.0f / (distance * Thread->Viewport->viewwindow.FocalTangent);
drawerargs.SetTextureUStep(distance * xstepscale / drawerargs.TextureWidth());
drawerargs.SetTextureUPos((distance * curxfrac + pviewx) / drawerargs.TextureWidth());
@ -274,6 +275,7 @@ namespace swrenderer
drawerargs.SetDestX2(x2);
drawerargs.DrawSpan(Thread);
drawerargs.DrawDepthSpan(Thread, zbufferdepth);
}
/////////////////////////////////////////////////////////////////////////