From df7dc0f1069e6ed8ea24c152eb4c3a5a97e80b91 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sat, 19 Jun 2021 17:54:16 +0200 Subject: Split on the largest axis on BVH generation --- shaders/compute.comp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'shaders/compute.comp') diff --git a/shaders/compute.comp b/shaders/compute.comp index c43d48b..2c56fbf 100644 --- a/shaders/compute.comp +++ b/shaders/compute.comp @@ -198,7 +198,7 @@ bool hit_node(ray r, float min_t, float max_t, out hit_info info) { } int stack_id = -1; - int stack[64]; + int stack[512]; bvh_node current_node = nodes[0]; bool hit = false; @@ -237,7 +237,7 @@ bool hit_node(ray r, float min_t, float max_t, out hit_info info) { current_node = nodes[stack[stack_id]]; stack_id--; } else { - return false; + return hit; } } } @@ -245,19 +245,6 @@ bool hit_node(ray r, float min_t, float max_t, out hit_info info) { } bool hit_spheres(ray r, float min_t, float max_t, out hit_info info) { - float closest_t = max_t; - hit_info temp_info; - // bool hit = false; - // for (uint sphere_index = 0; sphere_index <= spheres_count; sphere_index++) { - // if (spheres[sphere_index].radius > 0.0 && hit_sphere(spheres[sphere_index], r, min_t, closest_t, temp_info)) { - // info = temp_info; - // closest_t = temp_info.t; - // hit = true; - // } - // } - // - // return hit; - return hit_node(r, min_t, max_t, info); } -- cgit v1.3