mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-28 11:08:36 +02:00
+ | texture
This commit is contained in:
@ -87,10 +87,12 @@ bool intersectTriangle(Ray ray, GPUTriangle obj, out hitInfo hit)
|
||||
v >= 0.0 && (u + v) <= 1.0 &&
|
||||
t > 0.0;
|
||||
|
||||
hit.u = u;
|
||||
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
|
||||
hit.normal = obj.normal * sign(-dot(ray.direction, obj.normal));
|
||||
|
||||
return (valid);
|
||||
}
|
||||
|
Reference in New Issue
Block a user