mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 10:48:34 +02:00
+ | truc
This commit is contained in:
@ -60,6 +60,10 @@ struct GPUTriangle
|
||||
vec3 vertex2;
|
||||
vec3 normal;
|
||||
|
||||
vec2 texture_vertex1;
|
||||
vec2 texture_vertex2;
|
||||
vec2 texture_vertex3;
|
||||
|
||||
int mat_index;
|
||||
};
|
||||
layout(std430, binding = 2) buffer TriangleBuffer
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user