[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21438] branches/soc-2009-jaguarandi/ source/blender/render: Enabled #ifdefs to test LAST_HIT, LAST_HINT
André Pinto
andresusanopinto at gmail.com
Wed Jul 8 21:39:37 CEST 2009
Revision: 21438
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21438
Author: jaguarandi
Date: 2009-07-08 21:39:37 +0200 (Wed, 08 Jul 2009)
Log Message:
-----------
Enabled #ifdefs to test LAST_HIT, LAST_HINT
Disable last_hint as it only slow downs
Modified Paths:
--------------
branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h
branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject.c
branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_bvh.c
branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayshade.c
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-07-08 19:21:39 UTC (rev 21437)
+++ branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h 2009-07-08 19:39:37 UTC (rev 21438)
@@ -31,7 +31,9 @@
#ifndef RE_RAYTRACE_H
#define RE_RAYTRACE_H
-#define RT_USE_HINT /* 1 level hint */
+#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/source/rayobject.c
===================================================================
--- branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject.c 2009-07-08 19:21:39 UTC (rev 21437)
+++ branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject.c 2009-07-08 19:39:37 UTC (rev 21438)
@@ -288,7 +288,9 @@
is->hit.ob = face->ob;
is->hit.face = face->face;
+#ifdef RT_USE_LAST_HIT
is->last_hit = (RayObject*) RayObject_unalignRayFace(face);
+#endif
return 1;
}
@@ -315,7 +317,7 @@
isec->bv_index[2*i+1] = i+3*isec->bv_index[2*i+1];
}
-
+#ifdef RT_USE_LAST_HIT
/* Last hit heuristic */
if(isec->mode==RE_RAY_SHADOW && isec->last_hit)
{
@@ -328,6 +330,7 @@
return 1;
}
}
+#endif
#ifdef RT_USE_HINT
isec->hit_hint = 0;
Modified: branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_bvh.c
===================================================================
--- branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_bvh.c 2009-07-08 19:21:39 UTC (rev 21437)
+++ branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_bvh.c 2009-07-08 19:39:37 UTC (rev 21438)
@@ -173,7 +173,9 @@
{
if(RE_rayobject_bb_intersect(isec, (const float*)node->bb) != FLT_MAX)
{
+#ifdef RT_USE_HINT
last_processed_node = node;
+#endif
//push nodes in reverse visit order
if(isec->idot_axis[node->split_axis] < 0.0f)
{
Modified: branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayshade.c
===================================================================
--- branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayshade.c 2009-07-08 19:21:39 UTC (rev 21437)
+++ branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayshade.c 2009-07-08 19:39:37 UTC (rev 21438)
@@ -606,7 +606,9 @@
isec.labda = dist_mir > 0 ? dist_mir : RE_RAYTRACE_MAXDIST;
isec.mode= RE_RAY_MIRROR;
isec.skip = RE_SKIP_VLR_NEIGHBOUR;
+#ifdef RT_USE_HINT
isec.hint = 0;
+#endif
isec.orig.ob = obi;
isec.orig.face = vlr;
@@ -1512,7 +1514,9 @@
isec.mode= RE_RAY_MIRROR;
isec.orig.ob = ship->obi;
isec.orig.face = ship->vlr;
+#ifdef RT_USE_HINT
isec.hint = 0;
+#endif
RE_RC_INIT(isec, shi);
for(a=0; a<8*8; a++) {
@@ -1722,7 +1726,9 @@
isec.orig.ob = shi->obi;
isec.orig.face = shi->vlr;
isec.skip = RE_SKIP_VLR_NEIGHBOUR;
+#ifdef RT_USE_HINT
isec.hint = 0;
+#endif
isec.hit.ob = 0;
isec.hit.face = 0;
@@ -1857,7 +1863,9 @@
isec.orig.ob = shi->obi;
isec.orig.face = shi->vlr;
isec.skip = RE_SKIP_VLR_NEIGHBOUR;
+#ifdef RT_USE_HINT
isec.hint = 0;
+#endif
isec.hit.ob = 0;
isec.hit.face = 0;
@@ -2294,7 +2302,9 @@
RE_RC_INIT(isec, *shi);
if(shi->mat->mode & MA_SHADOW_TRA) isec.mode= RE_RAY_SHADOW_TRA;
else isec.mode= RE_RAY_SHADOW;
+#ifdef RT_USE_HINT
isec.hint = 0;
+#endif
if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW))
isec.lay= lar->lay;
@@ -2380,7 +2390,9 @@
/* setup isec */
RE_RC_INIT(isec, *shi);
isec.mode= RE_RAY_SHADOW_TRA;
+#ifdef RT_USE_HINT
isec.hint = 0;
+#endif
if(lar->mode & LA_LAYER) isec.lay= lar->lay; else isec.lay= -1;
More information about the Bf-blender-cvs
mailing list