[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17159] branches/sim_physics/source/ blender: * Fixed a crash with using light cache on a plane (which doesn' t really make sense, but shouldn't crash at least)

Matt Ebb matt at mke3.net
Wed Oct 22 02:09:14 CEST 2008


Revision: 17159
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17159
Author:   broken
Date:     2008-10-22 02:09:12 +0200 (Wed, 22 Oct 2008)

Log Message:
-----------
* Fixed a crash with using light cache on a plane (which doesn't really make sense, but shouldn't crash at least)

Modified Paths:
--------------
    branches/sim_physics/source/blender/render/intern/source/volumetric.c
    branches/sim_physics/source/blender/src/drawnode.c

Modified: branches/sim_physics/source/blender/render/intern/source/volumetric.c
===================================================================
--- branches/sim_physics/source/blender/render/intern/source/volumetric.c	2008-10-21 23:41:09 UTC (rev 17158)
+++ branches/sim_physics/source/blender/render/intern/source/volumetric.c	2008-10-22 00:09:12 UTC (rev 17159)
@@ -245,7 +245,7 @@
 	const int res = shi->mat->vol_precache_resolution;
 	CLAMP(x, 0, res-1);
 	CLAMP(y, 0, res-1);
-	CLAMP(y, 0, res-1);
+	CLAMP(z, 0, res-1);
 	return shi->obi->volume_precache[rgb*res*res*res + x*res*res + y*res + z];
 }
 
@@ -864,12 +864,13 @@
 	float i = 1.0f;
 	double time, lasttime= PIL_check_seconds_timer();
 	const int res = ma->vol_precache_resolution;
+	RayTree *tree;
 	
 	R = *re;
 
 	/* create a raytree with just the faces of the instanced ObjectRen, 
 	 * used for checking if the cached point is inside or outside. */
-	RayTree *tree = create_raytree_obi(obi, bbmin, bbmax);
+	tree = create_raytree_obi(obi, bbmin, bbmax);
 	if (!tree) return;
 
 	/* Need a shadeinput to calculate scattering */
@@ -893,6 +894,8 @@
 	res_3f = (float)res_3;
 	
 	VecSubf(voxel, bbmax, bbmin);
+	if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON))
+		return;
 	VecMulf(voxel, 1.0f/res);
 	
 	obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache");

Modified: branches/sim_physics/source/blender/src/drawnode.c
===================================================================
--- branches/sim_physics/source/blender/src/drawnode.c	2008-10-21 23:41:09 UTC (rev 17158)
+++ branches/sim_physics/source/blender/src/drawnode.c	2008-10-22 00:09:12 UTC (rev 17159)
@@ -1550,7 +1550,7 @@
 				  &nbd->maxspeed, 0, 1024, 0, 0, "If not zero, maximum speed in pixels");
 		uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "BlurFac:",
 				  butr->xmin, dy+19, dx, 19, 
-				  &nbd->fac, 0.0f, 2.0f, 10, 2, "Scaling factor for motion vectors, actually 'shutter speed' in frames");
+				  &nbd->fac, 0.0f, 10.0f, 10, 2, "Scaling factor for motion vectors, actually 'shutter speed' in frames");
 		uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Curved",
 				  butr->xmin, dy, dx, 19, 
 				  &nbd->curved, 0.0f, 2.0f, 10, 2, "Interpolate between frames in a bezier curve, rather than linearly");





More information about the Bf-blender-cvs mailing list