diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
index e44a6fcec83c15f370f893c7243b23ff08900dda..393d1e69da76417d2f2b63f170ac1fff80a13c5f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
@@ -43,10 +43,10 @@ uniform mat4 modelview_projection_matrix;
 uniform mat4 modelview_matrix;
 #endif
 
-#endif
-
 VARYING vec3 vary_position;
 
+#endif
+
 uniform mat4 texture_matrix0;
 
 ATTRIBUTE vec3 position;
@@ -84,14 +84,15 @@ void main()
 	mat = modelview_matrix * mat;
 
 	vec3 pos = (mat*vec4(position.xyz,1.0)).xyz;
-	vary_position = pos;
 
+#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
+	vary_position = pos;
+#endif
 
 	gl_Position = projection_matrix*vec4(pos,1.0);
 
 #else
 	//transform vertex
-	vary_position = (modelview_projection_matrix * vec4(position.xyz, 1.0)).xyz;
 	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); 
 
 #endif
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 4464358b1ec69ccab0699bf0b477a21c4dd6317b..08aaa2237d16c55bf01764f9eeb0fb7187d26c49 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -133,13 +133,6 @@ vec4 getPosition(vec2 pos_screen)
 	return getPosition_d(pos_screen, depth);
 }
 
-#ifdef WATER_FOG
-vec3 getPositionEye();
-vec3 getSunlitColor();
-vec3 getAmblitColor();
-vec3 getAdditiveColor();
-vec3 getAtmosAttenuation();
-#else
 vec3 getPositionEye()
 {
 	return vary_PositionEye;
@@ -160,7 +153,6 @@ vec3 getAtmosAttenuation()
 {
 	return vary_AtmosAttenuation;
 }
-#endif
 
 void setPositionEye(vec3 v)
 {
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 3815548dba2e7e6434efbd174d89a56fbaf33305..86776b7e42324d4b8cb8b7be3b5b424765fcdb5e 100755
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -299,10 +299,10 @@ void LLDrawPoolAvatar::beginDeferredRiggedMaterialAlpha(S32 pass)
 
 	sVertexProgram = &gDeferredMaterialProgram[pass];
 
-	if (LLPipeline::sUnderWaterRender)
-	{
-		sVertexProgram = &(gDeferredMaterialWaterProgram[pass]);
-	}
+	//if (LLPipeline::sUnderWaterRender)
+	//{
+	//	sVertexProgram = &(gDeferredMaterialWaterProgram[pass]);
+	//}
 
 	gPipeline.bindDeferredShader(*sVertexProgram);
 	sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
@@ -1099,10 +1099,10 @@ void LLDrawPoolAvatar::beginDeferredRiggedMaterial(S32 pass)
 	}
 	sVertexProgram = &gDeferredMaterialProgram[pass+LLMaterial::SHADER_COUNT];
 
-	if (LLPipeline::sUnderWaterRender)
-	{
-		sVertexProgram = &(gDeferredMaterialWaterProgram[pass]);
-	}
+	//if (LLPipeline::sUnderWaterRender)
+	//{
+	//	sVertexProgram = &(gDeferredMaterialWaterProgram[pass]);
+	//}
 
 	sVertexProgram->bind();
 	normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP);