verify existence of dm

This commit is contained in:
2011-12-10 01:00:12 +00:00
parent 965c287630
commit 82b9e4d16f
3 changed files with 12 additions and 5 deletions

View File

@@ -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