From 272c555f6b893a05f6d6a6439d519036e9379075 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Fri, 12 Aug 2011 20:55:07 -0400 Subject: do not check child nodes of a node at which the distance to the bounding box is further than a triangle the ray/photon has already intersected --- src/alpha.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/alpha.h') diff --git a/src/alpha.h b/src/alpha.h index a9963eb..e4a3a40 100644 --- a/src/alpha.h +++ b/src/alpha.h @@ -57,7 +57,7 @@ __device__ int get_color_alpha(const float3 &origin, const float3& direction) float distance; - if (!intersect_node(origin, direction, g_start_node)) + if (!intersect_node(origin, direction, g_start_node, -1.0f)) return 0; unsigned int stack[STACK_SIZE]; @@ -85,7 +85,7 @@ __device__ int get_color_alpha(const float3 &origin, const float3& direction) { for (i=first_child; i < stop; i++) { - if (intersect_node(origin, direction, i)) + if (intersect_node(origin, direction, i, -1.0f)) { *node = i; node++; -- cgit