[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22213] branches/soc-2009-jaguarandi/ source/blender/render: Skip BB tests on primitives
André Pinto
andresusanopinto at gmail.com
Tue Aug 4 19:24:50 CEST 2009
Revision: 22213
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22213
Author: jaguarandi
Date: 2009-08-04 19:24:49 +0200 (Tue, 04 Aug 2009)
Log Message:
-----------
Skip BB tests on primitives
the efficiency of this depends on ray-bb and ray-triangle functions efficiency
Modified Paths:
--------------
branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h
branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
Modified: branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h
===================================================================
--- branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h 2009-08-04 15:40:49 UTC (rev 22212)
+++ branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h 2009-08-04 17:24:49 UTC (rev 22213)
@@ -37,7 +37,7 @@
#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
Modified: branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
===================================================================
--- branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_vbvh.cpp 2009-08-04 15:40:49 UTC (rev 22212)
+++ branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_vbvh.cpp 2009-08-04 17:24:49 UTC (rev 22213)
@@ -81,12 +81,23 @@
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;
+ }
}
}
More information about the Bf-blender-cvs
mailing list