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:
authorMorten Mikkelsen <mikkelsen7@gmail.com>2011-12-10 05:00:12 +0400
committerMorten Mikkelsen <mikkelsen7@gmail.com>2011-12-10 05:00:12 +0400
commit82b9e4d16f08e8ca1b3fee84226334b3012aaed3 (patch)
tree23645a68a5a6dff0edea555df4e9cb35d01927bc /source/blender/render/intern
parent965c287630b7528a4a0b146212e8f1783a904948 (diff)
verify existence of dm
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r--source/blender/render/intern/source/render_texture.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index e55d2676b17..fe9312e37d5 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -1960,13 +1960,16 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
}
if(found_deriv_map) {
- float dBdu, dBdv, auto_bump;
+ float dBdu, dBdv, auto_bump = 1.0f;
float s = 1; // negate this if flipped texture coordinate
texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt);
rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, texres);
- auto_bump = shi->obr->ob->derivedFinal->auto_bump_scale;
- auto_bump /= sqrtf((float) (dimx*dimy));
+ if(shi->obr->ob->derivedFinal)
+ {
+ auto_bump = shi->obr->ob->derivedFinal->auto_bump_scale;
+ auto_bump /= sqrtf((float) (dimx*dimy));
+ }
// this variant using a derivative map is described here
// http://mmikkelsen3d.blogspot.com/2011/07/derivative-maps.html