- Add model rendering to the software renderer
This commit is contained in:
parent
0667f2ec55
commit
d43ac8b9ae
32 changed files with 792 additions and 87 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue