diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index d613def1bd6adf4487a1b8f44eec51553f63a762..fcc81dc723fb9fe909e7ba3805cd50b766419a1a 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -677,6 +677,7 @@ BOOL LLDrawPoolBump::bindBumpMap(U8 bump_code, LLViewerTexture* texture, F32 vsi
 		break;
 	case BE_CUSTOM:
 		bump = tex;
+		bump->addTextureStats(vsize);
 		break;
 	default:
 		if( bump_code < LLStandardBumpmap::sStandardBumpmapCount )
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index 2c4f6754eceb37e5fb88a2e75be9d13671ea9ec1..a71ca60d85cfa4d42b3cc09026efed292995b2ea 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -120,7 +120,7 @@ class LLDrawInfo : public LLRefCount
 	F32 mDistance;
 	U32 mDrawMode;
 		
-	LLMaterialID *mMaterialID; // If this is false, the following parameters are unused.
+	const LLMaterialID *mMaterialID; // If this is false, the following parameters are unused.
 	LLPointer<LLViewerTexture> mSpecularMap;
 	const LLMatrix4* mSpecularMapMatrix;
 	LLPointer<LLViewerTexture> mNormalMap;
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 5c684326e2f128fd417504f239fa8812263d2cc1..78c5b3ac53c30d20fbe07d80bc53b4a6f8ab0f01 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -4110,8 +4110,8 @@ S32 LLViewerObject::setTENormalMapCore(const U8 te, const LLUUID& uuid, LLHost h
 {
 	LL_INFOS("Materials") << "Maybe normal maps! " << uuid << LL_ENDL;
 	S32 retval = 0;
-	if (uuid != getTE(te)->getMaterialParams()->getNormalID() ||
-		uuid == LLUUID::null)
+	//if (uuid != getTE(te)->getMaterialParams()->getNormalID() ||
+		//uuid == LLUUID::null)
 	{
 		LL_INFOS("Materials") << "Normal maps! " << uuid << LL_ENDL;
 		retval = TEM_CHANGE_TEXTURE;
@@ -4380,6 +4380,7 @@ S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMateri
 	else if (pMaterialParams != tep->getMaterialParams())
 	{
 		retval = LLPrimitive::setTEMaterialParams(te, pMaterialParams);
+		setTENormalMap(te, tep->getMaterialParams()->getNormalID());
 		setChanged(TEXTURE);
 		if (mDrawable.notNull() && retval)
 		{
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index c90ca48b01b91a7b710755a9b0761f4404e2e81d..8cf22d9808df3d6b41ba98a071b6fd724f7a6b48 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1989,6 +1989,18 @@ S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow)
 	return  res;
 }
 
+void LLVOVolume::setTEMaterialParamsCallback(const LLMaterialID &pMaterialID, const LLMaterialPtr pMaterialParams)
+{
+	for (U8 i = 0; i < getNumTEs(); i++)
+	{
+		if (getTE(i)->getMaterialID() == pMaterialID)
+		{
+			LL_INFOS("Materials") << "Material params callback triggered!" << LL_ENDL;
+			setTEMaterialParams(i, pMaterialParams);
+		}
+	}
+}
+
 S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
 {
 	if (!pMaterialID.isNull())
@@ -1998,8 +2010,8 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
 		if (res)
 		{
 			LL_INFOS("Materials") << "We have a material!" << LL_ENDL;
-			LLMaterialPtr pMatParam = LLMaterialMgr::instance().get(getRegion()->getRegionID(), pMaterialID);
-			setTEMaterialParams(te, pMatParam);
+			LLMaterialMgr::instance().get(getRegion()->getRegionID(), pMaterialID, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2));
+			//setTEMaterialParams(te, pMatParam);
 			gPipeline.markTextured(mDrawable);
 			mFaceMappingChanged = TRUE;
 		}
@@ -4083,7 +4095,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
 
 	U8 index = facep->getTextureIndex();
 	
-	LLMaterialID matid = facep->getTextureEntry()->getMaterialID();
+	const LLMaterialID* matid = &facep->getTextureEntry()->getMaterialID();
 
 	bool batchable = false;
 
@@ -4118,7 +4130,8 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
 		draw_vec[idx]->mFullbright == fullbright &&
 		draw_vec[idx]->mBump == bump &&
 		draw_vec[idx]->mTextureMatrix == tex_mat &&
-		draw_vec[idx]->mModelMatrix == model_mat)
+		draw_vec[idx]->mModelMatrix == model_mat &&
+		draw_vec[idx]->mMaterialID == matid)
 	{
 		draw_vec[idx]->mCount += facep->getIndicesCount();
 		draw_vec[idx]->mEnd += facep->getGeomCount();
@@ -4146,22 +4159,25 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
 		draw_vec.push_back(draw_info);
 		draw_info->mTextureMatrix = tex_mat;
 		draw_info->mModelMatrix = model_mat;
-		
-		if (!facep->getTextureEntry()->getMaterialID().isNull() && facep->getTextureEntry()->getMaterialParams() != NULL)
-		{
-			// We have a material.  Update our draw info accordingly.
-			//draw_info->mMaterialID = facep->getTextureEntry()->getMaterialID();
-			LLVector4 specColor;
-			specColor.mV[0] = facep->getTextureEntry()->getMaterialParams()->getSpecularLightColor().mV[0] * (1.0 / 255);
-			specColor.mV[1] = facep->getTextureEntry()->getMaterialParams()->getSpecularLightColor().mV[1] * (1.0 / 255);
-			specColor.mV[2] = facep->getTextureEntry()->getMaterialParams()->getSpecularLightColor().mV[2] * (1.0 / 255);
-			specColor.mV[3] = facep->getTextureEntry()->getMaterialParams()->getSpecularLightExponent() * (1.0 / 255);
-			draw_info->mSpecColor = specColor;
-			draw_info->mEnvIntensity = facep->getTextureEntry()->getMaterialParams()->getEnvironmentIntensity() * (1.0 / 255);
-			draw_info->mAlphaMaskCutoff = facep->getTextureEntry()->getMaterialParams()->getAlphaMaskCutoff() * (1.0 / 255);
-			draw_info->mDiffuseAlphaMode = facep->getTextureEntry()->getMaterialParams()->getDiffuseAlphaMode();
-			draw_info->mNormalMap = facep->getViewerObject()->getTENormalMap(facep->getTextureIndex());
-			draw_info->mSpecularMap = facep->getViewerObject()->getTESpecularMap(facep->getTextureIndex());
+		if (!facep->getTextureEntry()->getMaterialID().isNull())
+		{
+			
+			if (facep->getTextureEntry()->getMaterialParams() != NULL)
+			{
+				// We have a material.  Update our draw info accordingly.
+				draw_info->mMaterialID = &facep->getTextureEntry()->getMaterialID();
+				LLVector4 specColor;
+				specColor.mV[0] = facep->getTextureEntry()->getMaterialParams()->getSpecularLightColor().mV[0] * (1.0 / 255);
+				specColor.mV[1] = facep->getTextureEntry()->getMaterialParams()->getSpecularLightColor().mV[1] * (1.0 / 255);
+				specColor.mV[2] = facep->getTextureEntry()->getMaterialParams()->getSpecularLightColor().mV[2] * (1.0 / 255);
+				specColor.mV[3] = facep->getTextureEntry()->getMaterialParams()->getSpecularLightExponent() * (1.0 / 255);
+				draw_info->mSpecColor = specColor;
+				draw_info->mEnvIntensity = facep->getTextureEntry()->getMaterialParams()->getEnvironmentIntensity() * (1.0 / 255);
+				draw_info->mAlphaMaskCutoff = facep->getTextureEntry()->getMaterialParams()->getAlphaMaskCutoff() * (1.0 / 255);
+				draw_info->mDiffuseAlphaMode = facep->getTextureEntry()->getMaterialParams()->getDiffuseAlphaMode();
+				draw_info->mNormalMap = facep->getViewerObject()->getTENormalMap(facep->getTextureIndex());
+				draw_info->mSpecularMap = facep->getViewerObject()->getTESpecularMap(facep->getTextureIndex());
+			}
 		}
 		
 		if (type == LLRenderPass::PASS_ALPHA)
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index c996fac6f2361ccfb1953e087b02f2d9385a598f..d1bfefdc707561b419b26530b021b4454fe1ddc0 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -187,6 +187,7 @@ class LLVOVolume : public LLViewerObject
 	/*virtual*/ S32		setTEMediaFlags(const U8 te, const U8 media_flags);
 	/*virtual*/ S32		setTEGlow(const U8 te, const F32 glow);
 	/*virtual*/ S32		setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID);
+				void	setTEMaterialParamsCallback(const LLMaterialID& pMaterialID, const LLMaterialPtr pMaterialParams);
 	/*virtual*/ S32		setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams);
 	/*virtual*/ S32		setTEScale(const U8 te, const F32 s, const F32 t);
 	/*virtual*/ S32		setTEScaleS(const U8 te, const F32 s);