+ | Texture finally working entirely

This commit is contained in:
RedShip
2025-01-29 18:38:55 +01:00
parent 645c621d4f
commit 6f42d10836
7 changed files with 10 additions and 6 deletions

View File

@ -113,8 +113,8 @@ vec3 getTextureColor(int texture_index, hitInfo hit)
{
GPUTriangle tri = triangles[hit.obj_index];
uv = hit.u * tri.texture_vertex2 + hit.v * tri.texture_vertex3 + (1 - (hit.u + hit.v)) * tri.texture_vertex1;
uv = vec2(uv.x, 1-uv.y);
}
return (texture(textures[texture_index], uv).rgb);
}