+ | Texture better coede

This commit is contained in:
TheRedShip
2025-01-28 22:28:35 +01:00
parent ae83d7d9f1
commit 23f2a9a5c6
5 changed files with 5 additions and 9 deletions

View File

@ -91,8 +91,8 @@ bool intersectTriangle(Ray ray, GPUTriangle obj, out hitInfo hit)
hit.v = v;
hit.t = t;
hit.position = ray.origin + ray.direction * t;
// hit.normal = vec3(u, v, 1 - (u + v)); //texture mapping
hit.normal = obj.normal * sign(-dot(ray.direction, obj.normal));
// hit.normal = vec3(u, v, 1 - (u + v)); //texture mapping
return (valid);
}