diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index b1dce665a12083284b0732224d6180d691aba0fb..705cc2f04e5d7a3aa27a84e02f94f19053b68db6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -81,11 +81,7 @@ void main()
     norm.xyz = getNorm(tc);
     
     vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
-    float da = dot(normalize(norm.xyz), light_dir.xyz);
-          da = clamp(da, -1.0, 1.0);
-
-    float final_da = da;
-          final_da = clamp(final_da, 0.0, 1.0);
+    float da = clamp(dot(normalize(norm.xyz), light_dir.xyz), 0.0, 1.0);
 
     vec4 diffuse_srgb = texture2DRect(diffuseRect, tc);
     vec4 diffuse_linear = vec4(srgb_to_linear(diffuse_srgb.rgb), diffuse_srgb.a);
@@ -108,7 +104,7 @@ void main()
         ambient *= ambient;
         ambient = (1.0 - ambient);
 
-        vec3 sun_contrib = final_da * sunlit;
+        vec3 sun_contrib = da * sunlit;
 
 #if !defined(AMBIENT_KILL)
         color.rgb = amblit;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index f49fad55171ecc44e3a9d4205199e21e961b2dca..593706867d137ef7294b94a6a8c9ba3aa7e6219a 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -85,11 +85,7 @@ void main()
     float scol = 1.0;
     vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
 
-    float da = dot(normalize(norm.xyz), light_dir.xyz);
-          da = clamp(da, -1.0, 1.0);
-
-    float final_da = da;
-          final_da = clamp(final_da, 0.0, 1.0);
+    float da = clamp(dot(normalize(norm.xyz), light_dir.xyz), 0.0, 1.0);
 
     vec4 diffuse_srgb   = texture2DRect(diffuseRect, tc);
     vec4 diffuse_linear = vec4(srgb_to_linear(diffuse_srgb.rgb), diffuse_srgb.a);
@@ -116,7 +112,7 @@ void main()
         ambient *= ambient;
         ambient = (1.0 - ambient);
 
-        vec3 sun_contrib = min(scol, final_da) * sunlit;
+        vec3 sun_contrib = min(scol, da) * sunlit;
 
 #if !defined(AMBIENT_KILL)
         color.rgb = amblit;