This commit is contained in:
RedShip
2025-01-28 18:35:46 +01:00
parent 7b81995724
commit ff9ab9251f
5 changed files with 12 additions and 8 deletions

View File

@ -89,8 +89,8 @@ bool intersectTriangle(Ray ray, GPUTriangle obj, out hitInfo hit)
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
// hit.normal = obj.normal * sign(-dot(ray.direction, obj.normal));
return (valid);
}