calculate texture coordinates

This commit is contained in:
StapleButter
2017-02-28 00:50:54 +01:00
parent fb9dddc360
commit f16d2aec61
5 changed files with 48 additions and 5 deletions

View File

@ -333,6 +333,8 @@ void RenderPolygon(Polygon* polygon)
perspfactor2 = 0;
}
//z = 0x1000000 / (perspfactor1 + perspfactor2);
// possible optimization: only do color interpolation if the depth test passes
u32 vr = ((perspfactor1 * rl) + (perspfactor2 * rr)) / (perspfactor1 + perspfactor2);
u32 vg = ((perspfactor1 * gl) + (perspfactor2 * gr)) / (perspfactor1 + perspfactor2);