diff options
author | rodri <rgl@antares-labs.eu> | 2024-03-21 11:58:10 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-03-21 11:58:10 +0000 |
commit | 764afe37e2438498bcace9de56b9618565b7cd34 (patch) | |
tree | 5c0ac0a454eae6a2dfe4198dd9fda926e44c878a /render.c | |
parent | 2b19d1a580c0e281010fd200128081b8e3f4af7f (diff) | |
download | libgraphics-764afe37e2438498bcace9de56b9618565b7cd34.tar.gz libgraphics-764afe37e2438498bcace9de56b9618565b7cd34.tar.bz2 libgraphics-764afe37e2438498bcace9de56b9618565b7cd34.zip |
use the new libgeometry berp routines. add a frame counter to the camstats.
Diffstat (limited to 'render.c')
-rw-r--r-- | render.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -323,7 +323,7 @@ rasterize(SUparams *params, Triangle t) if(bc.x < 0 || bc.y < 0 || bc.z < 0) continue; - z = t[0].p.z*bc.x + t[1].p.z*bc.y + t[2].p.z*bc.z; + z = fberp(t[0].p.z, t[1].p.z, t[2].p.z, bc); depth = fclamp(z, 0, 1); lock(¶ms->fb->zbuflk); if(depth <= params->fb->zbuf[p.x + p.y*Dx(params->fb->r)]){ @@ -334,7 +334,7 @@ rasterize(SUparams *params, Triangle t) unlock(¶ms->fb->zbuflk); /* interpolate z⁻¹ and get actual z */ - z = t[0].p.w*bc.x + t[1].p.w*bc.y + t[2].p.w*bc.z; + z = fberp(t[0].p.w, t[1].p.w, t[2].p.w, bc); z = 1.0/(z < 1e-5? 1e-5: z); /* perspective-correct attribute interpolation */ |