Skip BB tests on primitives
the efficiency of this depends on ray-bb and ray-triangle functions efficiency
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user