Skip BB tests on primitives

the efficiency of this depends on ray-bb and ray-triangle functions efficiency
This commit is contained in:
2009-08-04 17:24:49 +00:00
parent 5e21e68f83
commit 7e9dc51cd1
2 changed files with 15 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ extern "C" {
#define RE_RAY_LCTS_MAX_SIZE 256
#define RT_USE_LAST_HIT /* last shadow hit is reused before raycasting on whole tree */
#define RT_USE_LAST_HIT /* last shadow hit is reused before raycasting on whole tree */
//#define RT_USE_HINT /* last hit object is reused before raycasting on whole tree */
#define RE_RAYCOUNTER

View File

@@ -81,12 +81,23 @@ template<class Node>
inline static void bvh_node_push_childs(Node *node, Isect *isec, Node **stack, int &stack_pos)
{
Node *child = node->child;
while(child)
if(!RayObject_isAligned(child))
{
stack[stack_pos++] = child;
if(RayObject_isAligned(child))
}
else
{
while(child)
{
//Skips BB tests on primitives
if(!RayObject_isAligned(child->child))
stack[stack_pos++] = child->child;
else
stack[stack_pos++] = child;
child = child->sibling;
else break;
}
}
}