aboutsummaryrefslogtreecommitdiffstats
path: root/shaders/compute.comp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-06-19 17:54:16 +0200
committerladevieq <ladevie.quentin@gmail.com>2021-06-19 17:55:13 +0200
commitdf7dc0f1069e6ed8ea24c152eb4c3a5a97e80b91 (patch)
tree14cdd713b35911fbec90307c5ad08a89682f7dbb /shaders/compute.comp
parent9f71d88c35c04685c9d482588befad34759e0b7a (diff)
Split on the largest axis on BVH generation
Diffstat (limited to 'shaders/compute.comp')
-rw-r--r--shaders/compute.comp17
1 files changed, 2 insertions, 15 deletions
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);
}