Просмотр исходного кода

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

Godzil 3 лет назад
Родитель
Сommit
1e5141283c
1 измененных файлов с 1 добавлено и 1 удалено
  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));