From 90536f6cdf7fc6039deefb9c528347fa54111af5 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 1 Mar 2013 17:34:03 -0500 Subject: protect against missing mNormalMap or mSpecularMap --- indra/newview/lldrawpoolmaterials.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/newview/lldrawpoolmaterials.cpp') diff --git a/indra/newview/lldrawpoolmaterials.cpp b/indra/newview/lldrawpoolmaterials.cpp index 52f476f589..f0e1221f15 100644 --- a/indra/newview/lldrawpoolmaterials.cpp +++ b/indra/newview/lldrawpoolmaterials.cpp @@ -89,11 +89,17 @@ void LLDrawPoolMaterials::renderDeferred(S32 pass) mShader->uniform4f(LLShaderMgr::SPECULAR_COLOR, params.mSpecColor.mV[0], params.mSpecColor.mV[1], params.mSpecColor.mV[2], params.mSpecColor.mV[3]); mShader->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, params.mEnvIntensity); - params.mNormalMap->addTextureStats(params.mVSize); - bindNormalMap(params.mNormalMap); + if (params.mNormalMap) + { + params.mNormalMap->addTextureStats(params.mVSize); + bindNormalMap(params.mNormalMap); + } - params.mSpecularMap->addTextureStats(params.mVSize); - bindSpecularMap(params.mSpecularMap); + if (params.mSpecularMap) + { + params.mSpecularMap->addTextureStats(params.mVSize); + bindSpecularMap(params.mSpecularMap); + } diffuse_channel = mShader->enableTexture(LLShaderMgr::DIFFUSE_MAP); pushBatch(params, VERTEX_DATA_MASK, TRUE); -- cgit v1.2.3