~ | BVH optimizing again

This commit is contained in:
TheRedShip
2025-01-19 00:34:35 +01:00
parent 388ad5fc7d
commit 08c0ce1d83
11 changed files with 95 additions and 2836 deletions

View File

@ -66,7 +66,7 @@ hitInfo traceBVH(Ray ray)
hit.t = 1e30;
hit.obj_index = -1;
int stack[64];
int stack[32];
int stack_ptr = 0;
stack[0] = 0;
@ -84,7 +84,7 @@ hitInfo traceBVH(Ray ray)
GPUTriangle obj = triangles[node.first_primitive + i];
hitInfo temp_hit;
if (intersectTriangle(ray, obj, temp_hit) && temp_hit.t > 0.0f && temp_hit.t < hit.t + 0.0001)
if (intersectTriangle(ray, obj, temp_hit) && temp_hit.t < hit.t)
{
hit.t = temp_hit.t;
hit.last_t = temp_hit.last_t;