diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 759c49a0faae03c411c3efa96fb4c1699cfbaeed..0c4707098bff090e87a7c3808318ed1d220cfe36 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -53,7 +53,9 @@ VARYING vec3 vary_position;
 VARYING vec2 vary_texcoord0;
 VARYING vec3 vary_norm;
 
+#ifdef USE_VERTEX_COLOR
 VARYING vec4 vertex_color;
+#endif
 
 uniform mat4 proj_mat;
 uniform mat4 inv_proj;
@@ -203,9 +205,13 @@ void main()
     
     vec3 light_dir = (sun_up_factor == 1) ? sun_dir: moon_dir;
 
-    float final_alpha = diffuse_linear.a * vertex_color.a;
+    float final_alpha = diffuse_linear.a;
+
+#ifdef USE_VERTEX_COLOR
+    final_alpha *= vertex_color.a;
     diffuse_srgb.rgb *= vertex_color.rgb;
     diffuse_linear.rgb *= vertex_color.rgb;
+#endif
 
     vec3 sunlit;
     vec3 amblit;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 619c4e97385dc2246166455fa5f1a98fcff452dd..506118d381deb83ef7db62fc92acf6586016c751 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -40,7 +40,11 @@ void passTextureIndex();
 #endif
 
 ATTRIBUTE vec3 normal;
+
+#ifdef USE_VERTEX_COLOR
 ATTRIBUTE vec4 diffuse_color;
+#endif
+
 ATTRIBUTE vec2 texcoord0;
 
 #ifdef HAS_SKIN
@@ -53,7 +57,11 @@ mat4 getSkinnedTransform();
 
 VARYING vec3 vary_fragcoord;
 VARYING vec3 vary_position;
+
+#ifdef USE_VERTEX_COLOR
 VARYING vec4 vertex_color;
+#endif
+
 VARYING vec2 vary_texcoord0;
 VARYING vec3 vary_norm;
 
@@ -110,7 +118,9 @@ void main()
 	vary_norm = norm;
 	vary_position = pos.xyz;
 
+#ifdef USE_VERTEX_COLOR
 	vertex_color = diffuse_color;
+#endif
 	
 #ifdef HAS_SKIN
 	vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 5297e59e1878c49502f5182501215ed34906b2df..c874b3cf59c0204e1c41e9ebb019a6fc5f198f70 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1485,6 +1485,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredSkinnedAlphaProgram.clearPermutations();
 		gDeferredSkinnedAlphaProgram.addPermutation("USE_DIFFUSE_TEX", "1");
 		gDeferredSkinnedAlphaProgram.addPermutation("HAS_SKIN", "1");
+        gDeferredSkinnedAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1");
 
 		if (use_sun_shadow)
 		{
@@ -1951,7 +1952,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
         gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB));
 
         gDeferredAlphaProgram.clearPermutations();
-
+        gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1");
         gDeferredAlphaProgram.addPermutation("USE_INDEXED_TEX", "1");
         if (use_sun_shadow)
         {
@@ -2012,6 +2013,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
         gDeferredAlphaImpostorProgram.clearPermutations();
         gDeferredAlphaImpostorProgram.addPermutation("USE_INDEXED_TEX", "1");
         gDeferredAlphaImpostorProgram.addPermutation("FOR_IMPOSTOR", "1");
+        gDeferredAlphaImpostorProgram.addPermutation("USE_VERTEX_COLOR", "1");
 
         if (use_sun_shadow)
         {
@@ -2060,6 +2062,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAlphaWaterProgram.clearPermutations();
 		gDeferredAlphaWaterProgram.addPermutation("USE_INDEXED_TEX", "1");
 		gDeferredAlphaWaterProgram.addPermutation("WATER_FOG", "1");
+        gDeferredAlphaWaterProgram.addPermutation("USE_VERTEX_COLOR", "1");
 		if (use_sun_shadow)
 		{
 			gDeferredAlphaWaterProgram.addPermutation("HAS_SHADOW", "1");