~ | Working toplevel with transformed obj

This commit is contained in:
TheRedShip
2025-01-23 15:38:39 +01:00
parent 1783037bdf
commit 1f23592883
3 changed files with 32 additions and 13 deletions

View File

@ -342,8 +342,7 @@ vec3 debugColor(vec2 uv)
Ray ray = initRay(uv);
Stats stats = Stats(0, 0);
// hitInfo hit = traceBVH(ray, BvhData[0], stats);
// hitInfo hit = traverseBVHs(ray, BvhData[0], stats);
// hitInfo hit = traverseBVHs(ray, BvhData[0], stats); //working with scaling offset transfo
hitInfo hit = traceTopBVH(ray, stats);
float box_display = float(stats.box_count) / float(debug.box_treshold);
@ -354,6 +353,8 @@ vec3 debugColor(vec2 uv)
case 0:
return (hit.normal * 0.5 + 0.5) * int(hit.obj_index != -1);
case 1:
if (hit.obj_index != -1)
return (hit.normal * 0.5 + 0.5);
return (box_display < 1. ? vec3(box_display) : vec3(1., 0., 0.));
case 2:
return (triangle_display < 1. ? vec3(triangle_display) : vec3(1., 0., 0.));