mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 18:48:36 +02:00
~ | dfghjkl
This commit is contained in:
@ -80,7 +80,7 @@ struct GPUBvh
|
||||
int first_primitive;
|
||||
int primitive_count;
|
||||
};
|
||||
layout(std430, binding = 5) buffer BvhBuffer
|
||||
layout(std430, binding = 3) buffer BvhBuffer
|
||||
{
|
||||
GPUBvh bvh[];
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ bool intersectTriangle(Ray ray, GPUObject obj, out hitInfo hit)
|
||||
{
|
||||
vec3 vertex1 = obj.vertex1 - obj.position;
|
||||
vec3 vertex2 = obj.vertex2 - obj.position;
|
||||
|
||||
|
||||
vec3 pvec = cross(ray.direction, vertex2);
|
||||
float det = dot(vertex1, pvec);
|
||||
vec3 tvec = ray.origin - obj.position;
|
||||
|
@ -130,10 +130,11 @@ hitInfo traceRay(Ray ray)
|
||||
hitScene = traceScene(ray);
|
||||
|
||||
hit = hitBVH.t < hitScene.t ? hitBVH : hitScene;
|
||||
#if 0
|
||||
#if 1
|
||||
if (hit.obj_index == -1 || objects[hit.obj_index].type != 5)
|
||||
break ;
|
||||
ray = portalRay(ray, hit);
|
||||
ray.inv_direction = (1.0 / ray.direction);
|
||||
#else
|
||||
return (hit);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user