Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Susano Pinto <andresusanopinto@gmail.com>2009-08-04 21:24:49 +0400
committerAndre Susano Pinto <andresusanopinto@gmail.com>2009-08-04 21:24:49 +0400
commit7e9dc51cd1a9c35eb54660ea650570f81d102e2e (patch)
tree82c82b62640b9736ebf9aa1e90b340c9089fffce /source/blender/render/intern/raytrace
parent5e21e68f834d80e264e0cb222e65d2767419f046 (diff)
Skip BB tests on primitives
the efficiency of this depends on ray-bb and ray-triangle functions efficiency
Diffstat (limited to 'source/blender/render/intern/raytrace')
-rw-r--r--source/blender/render/intern/raytrace/rayobject_vbvh.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
index 2dde485d3d1..774a465092d 100644
--- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
@@ -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;
+ }
}
}