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:
authorMatt Ebb <matt@mke3.net>2008-10-22 04:09:12 +0400
committerMatt Ebb <matt@mke3.net>2008-10-22 04:09:12 +0400
commit094fda8cd9c1e6f5f452bf6c47ad53bebb8dd4e6 (patch)
tree94ba4046c25485938d1068fcf86551b445b16612 /source/blender
parentb12d9bfa9caf6d99ca2e19b9cb456d037c17f049 (diff)
* Fixed a crash with using light cache on a plane (which doesn't really make sense, but shouldn't crash at least)
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/render/intern/source/volumetric.c7
-rw-r--r--source/blender/src/drawnode.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
index ebaf70f1cfe..cd35bc027d1 100644
--- a/source/blender/render/intern/source/volumetric.c
+++ b/source/blender/render/intern/source/volumetric.c
@@ -245,7 +245,7 @@ static float D(ShadeInput *shi, int rgb, int x, int y, int z)
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 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m
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 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m
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");
diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c
index 618eca15ac6..7decec3f0e3 100644
--- a/source/blender/src/drawnode.c
+++ b/source/blender/src/drawnode.c
@@ -1550,7 +1550,7 @@ static int node_composit_buts_vecblur(uiBlock *block, bNodeTree *ntree, bNode *n
&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");