diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 50b43f6a8d280e166568f3e3d1d1b0e1764b9c0a..84e83d4c8b6a3385f5749c9e06cf8d5f01f03f09 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -60,14 +60,10 @@ VARYING vec3 vary_ambient;
 VARYING vec3 vary_directional;
 VARYING vec3 vary_fragcoord;
 VARYING vec3 vary_position;
-VARYING vec3 vary_pointlight_col;
+VARYING vec4 vary_pointlight_col;
 VARYING vec2 vary_texcoord0;
 VARYING vec3 vary_norm;
 
-#ifdef USE_VERTEX_COLOR
-VARYING vec4 vertex_color;
-#endif
-
 uniform vec4 light_position[8];
 uniform vec3 light_direction[8];
 uniform vec3 light_attenuation[8]; 
@@ -216,7 +212,7 @@ void main()
 	diff.rgb = pow(diff.rgb, vec3(2.2f, 2.2f, 2.2f));
 
 #ifdef USE_VERTEX_COLOR
-	float vertex_color_alpha = vertex_color.a;	
+	float vertex_color_alpha = vary_pointlight_col.a;	
 #else
 	float vertex_color_alpha = 1.0;
 #endif
@@ -225,7 +221,7 @@ void main()
 	
 	vec3 l = light_position[0].xyz;
 	vec3 dlight = calcDirectionalLight(normal, l) * 2.6;
-	dlight = dlight * vary_directional.rgb * vary_pointlight_col;
+	dlight = dlight * vary_directional.rgb * vary_pointlight_col.rgb;
 
 #if HAS_SHADOW
 	vec4 col = vec4(vary_ambient + dlight * shadow, vertex_color_alpha);
@@ -250,7 +246,7 @@ void main()
 	LIGHT_LOOP(6)
 	LIGHT_LOOP(7)
 
-	color.rgb += diff.rgb * vary_pointlight_col * col.rgb;
+	color.rgb += diff.rgb * vary_pointlight_col.rgb * col.rgb;
 
 	frag_color = color;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 77d02b36ff103136be754e85141ce7c61fe692ee..6ed2ad519209d42f475e8a9e61c8bc7bb6462996 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -69,11 +69,8 @@ VARYING vec3 vary_ambient;
 VARYING vec3 vary_directional;
 VARYING vec3 vary_fragcoord;
 VARYING vec3 vary_position;
-VARYING vec3 vary_pointlight_col;
+VARYING vec4 vary_pointlight_col;
 
-#ifdef USE_VERTEX_COLOR
-VARYING vec4 vertex_color;
-#endif
 
 VARYING vec2 vary_texcoord0;
 
@@ -186,9 +183,9 @@ void main()
 
 	
 
-	vary_pointlight_col = diff;
+	vary_pointlight_col.rgb = diff;
+	vary_pointlight_col.a = diffuse_color.a;
 
-	
 	col.rgb = vec3(0,0,0);
 
 	// Add windlight lights
@@ -200,9 +197,7 @@ void main()
 	
 	col.rgb = col.rgb*diff.rgb;
 	
-#ifdef USE_VERTEX_COLOR
-	vertex_color = col;
-#endif
+
 	
 #ifdef HAS_SKIN
 	vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index 4030324ecbd414526db0f37d2ad3175116110488..cd7825ba9f6d59fca7f596e22cf28c94f816ef52 100755
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -441,7 +441,7 @@ list OpenGLPre15
 RenderVBOEnable				1	0
 
 list OpenGLPre30
-RenderDeferred				0	0
+RenderDeferred				1	0
 RenderMaxTextureIndex		1	1
 
 list Intel
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 302a4294e4c9062b084081ea08a7128adcb786f6..1d99e9d1622bf4cfc044c26574886397cf9c3146 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -657,6 +657,42 @@ void LLPanelFace::updateUI()
 		LLUUID normmap_id;
 		LLUUID specmap_id;
 
+		// Color swatch
+		{
+			getChildView("color label")->setEnabled(editable);
+		}
+		LLColorSwatchCtrl*	mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
+		LLColor4 color = LLColor4::white;
+		if(mColorSwatch)
+		{
+			struct f7 : public LLSelectedTEGetFunctor<LLColor4>
+			{
+				LLColor4 get(LLViewerObject* object, S32 face)
+				{
+					return object->getTE(face)->getColor();
+				}
+			} func;
+			identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, color );
+			
+			mColorSwatch->setOriginal(color);
+			mColorSwatch->set(color, TRUE);
+
+			mColorSwatch->setValid(editable);
+			mColorSwatch->setEnabled( editable );
+			mColorSwatch->setCanApplyImmediately( editable );
+		}
+
+		// Color transparency
+		{
+			getChildView("color trans")->setEnabled(editable);
+		}
+
+		F32 transparency = (1.f - color.mV[VALPHA]) * 100.f;
+		{
+			getChild<LLUICtrl>("ColorTrans")->setValue(editable ? transparency : 0);
+			getChildView("ColorTrans")->setEnabled(editable);
+		}
+
 		// Texture
 		{
 			struct f1 : public LLSelectedTEGetFunctor<LLUUID>
@@ -792,10 +828,17 @@ void LLPanelFace::updateUI()
 
 				if (combobox_alphamode)
 				{
+
+					if (transparency > 0.f)
+					{ //it is invalid to have any alpha mode other than blend if transparency is greater than zero ... 
+						alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND;
+					}
+
 					if (!mIsAlpha)
-					{
+					{ // ... unless there is no alpha channel in the texture, in which case alpha mode MUST ebe none
 						alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
 					}
+
 					
 					combobox_alphamode->selectNthItem(alpha_mode);
 				}
@@ -814,7 +857,7 @@ void LLPanelFace::updateUI()
 					texture_ctrl->setTentative( FALSE );
 					texture_ctrl->setEnabled( editable );
 					texture_ctrl->setImageAssetID( id );
-					getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha);
+					getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f);
 					getChildView("label alphamode")->setEnabled(editable && mIsAlpha);
 					getChildView("maskcutoff")->setEnabled(editable && mIsAlpha);
 					getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha);
@@ -836,7 +879,7 @@ void LLPanelFace::updateUI()
 					texture_ctrl->setTentative( TRUE );
 					texture_ctrl->setEnabled( editable );
 					texture_ctrl->setImageAssetID( id );
-					getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha);
+					getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f);
 					getChildView("label alphamode")->setEnabled(editable && mIsAlpha);
 					getChildView("maskcutoff")->setEnabled(editable && mIsAlpha);
 					getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha);
@@ -1281,42 +1324,6 @@ void LLPanelFace::updateUI()
 			getChildView("bumpyRot")->setEnabled(editable && normmap_id.notNull());
 		}
 
-		// Color swatch
-		{
-			getChildView("color label")->setEnabled(editable);
-		}
-		LLColorSwatchCtrl*	mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
-		LLColor4 color = LLColor4::white;
-		if(mColorSwatch)
-		{
-			struct f7 : public LLSelectedTEGetFunctor<LLColor4>
-			{
-				LLColor4 get(LLViewerObject* object, S32 face)
-				{
-					return object->getTE(face)->getColor();
-				}
-			} func;
-			identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, color );
-			
-			mColorSwatch->setOriginal(color);
-			mColorSwatch->set(color, TRUE);
-
-			mColorSwatch->setValid(editable);
-			mColorSwatch->setEnabled( editable );
-			mColorSwatch->setCanApplyImmediately( editable );
-		}
-
-		// Color transparency
-		{
-			getChildView("color trans")->setEnabled(editable);
-		}
-
-		F32 transparency = (1.f - color.mV[VALPHA]) * 100.f;
-		{
-			getChild<LLUICtrl>("ColorTrans")->setValue(editable ? transparency : 0);
-			getChildView("ColorTrans")->setEnabled(editable);
-		}
-
 		{
 			F32 glow = 0.f;
 			struct f8 : public LLSelectedTEGetFunctor<F32>
@@ -1586,7 +1593,19 @@ void LLPanelFace::updateUI()
 					childGetSelectionInterface("combobox alphamode");
 				if (combobox_alphamode)
 				{
-					combobox_alphamode->selectNthItem(material->getDiffuseAlphaMode());
+					U32 alpha_mode = material->getDiffuseAlphaMode();
+
+					if (transparency > 0.f)
+					{ //it is invalid to have any alpha mode other than blend if transparency is greater than zero ... 
+						alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND;
+					}
+
+					if (!mIsAlpha)
+					{ // ... unless there is no alpha channel in the texture, in which case alpha mode MUST ebe none
+						alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
+					}
+
+					combobox_alphamode->selectNthItem(alpha_mode);
 				}
 				else
 				{
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index a9b540507f707a1e55ce76ffbca70d6ecbb40c1f..c3c6747e997819d49581d13b66c3fda15d90b738 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1976,8 +1976,11 @@ S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow)
 void LLVOVolume::setTEMaterialParamsCallback(const LLMaterialID &pMaterialID, const LLMaterialPtr pMaterialParams, U32 te)
 {
 	LL_DEBUGS("MaterialTEs") << "materialid " << pMaterialID.asString() << " to TE " << te << LL_ENDL;
+	if (te >= getNumTEs())
+		return;
+
 	LLTextureEntry* texture_entry = getTE(te);
-	if (texture_entry && (texture_entry->getMaterialID().isNull() || (texture_entry->getMaterialID() == pMaterialID)))
+	if (texture_entry)
 	{
 		setTEMaterialParams(te, pMaterialParams);
 	}