diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 9afa7e36f8ed77148b892d7b1c2f239de47c1d53..dd424b6fe788577559354c257ca385f5e86fea84 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -216,12 +216,9 @@ void main()
 
     calcAtmosphericVars(pos.xyz, light_dir, 1.0, sunlit, amblit, additive, atten, false);
 
-    float da = dot(norm.xyz, light_dir.xyz);
-          da = clamp(da, -1.0, 1.0);
-          da = pow(da, 1.0/1.3);
- 
-    float final_da = da;
-          final_da = clamp(final_da, 0.0f, 1.0f);
+
+    float da = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0);
+    da = pow(da, 1.0 / 1.3);
 
     vec4 color = vec4(0.0);
 
@@ -232,7 +229,7 @@ void main()
     ambient *= ambient;
     ambient = (1.0 - ambient);
 
-    vec3 sun_contrib = min(final_da, shadow) * sunlit;
+    vec3 sun_contrib = min(da, shadow) * sunlit;
 
 #if !defined(AMBIENT_KILL)
     color.rgb = amblit;