Browse Source

Forgot to update the texture inversion to the non perspective corrected code.

Godzil 3 years ago
parent
commit
1e5141283c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      source/triangle.c

+ 1 - 1
source/triangle.c

@@ -166,7 +166,7 @@ static void drawTexel(int32_t x, int32_t y, vec4_t a, vec4_t b, vec4_t c, tex2_t
     else
     {
         interpolatedU = ta.u * alpha + tb.u * beta + tc.u * gamma;
-        interpolatedV = ta.v * alpha + tb.v * beta + tc.v * gamma;
+        interpolatedV = (1 - ta.v) * alpha + (1 - tb.v) * beta + (1 - tc.v) * gamma;
     }
 
     texX = abs((int32_t)(interpolatedU * textureWidth));