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/gpu
parent965c287630b7528a4a0b146212e8f1783a904948 (diff)
verify existence of dm
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 6a11010002f..2d2da3c592d 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -1156,11 +1156,14 @@ int GPU_enable_material(int nr, void *attribs)
if(gattribs && GMS.gmatbuf[nr]) {
/* bind glsl material and get attributes */
Material *mat = GMS.gmatbuf[nr];
+ float auto_bump_scale;
gpumat = GPU_material_from_blender(GMS.gscene, mat);
GPU_material_vertex_attributes(gpumat, gattribs);
GPU_material_bind(gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob->mode & OB_MODE_TEXTURE_PAINT));
- GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, GMS.gviewmat, GMS.gviewinv, GMS.gob->col, GMS.gob->derivedFinal->auto_bump_scale);
+
+ auto_bump_scale = GMS.gob->derivedFinal!=0 ? GMS.gob->derivedFinal->auto_bump_scale : 1.0f;
+ GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, GMS.gviewmat, GMS.gviewinv, GMS.gob->col, auto_bump_scale);
GMS.gboundmat= mat;
/* for glsl use alpha blend mode, unless it's set to solid and