From 744872b43d4b538a828dad116c46eed3d6d35436 Mon Sep 17 00:00:00 2001
From: Ptolemy <ptolemy@lindenlab.com>
Date: Fri, 13 Mar 2020 11:46:13 -0700
Subject: [PATCH] SL-12850

---
 .../app_settings/shaders/class1/deferred/softenLightF.glsl | 6 +++---
 .../app_settings/shaders/class2/deferred/softenLightF.glsl | 7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 547a159f3a3..69a694a6cdf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -154,8 +154,6 @@ vec3 post_diffuse = color.rgb;
         }
        
  vec3 post_spec = color.rgb;
- 
-        color.rgb = mix(color.rgb, diffuse_srgb.rgb, diffuse_srgb.a);
 
         if (envIntensity > 0.0)
         { //add environmentmap
@@ -165,7 +163,9 @@ vec3 post_diffuse = color.rgb;
             color = mix(color.rgb, reflected_color, envIntensity*0.75); // MAGIC NUMBER SL-12574; ALM: On, Quality <= Mid+
 #endif
         }
-        
+        else
+            color.rgb = mix(color.rgb, diffuse_srgb.rgb, diffuse_srgb.a);
+
 vec3 post_env = color.rgb;
 
         if (norm.w < 1)
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 15a3bc349a0..63b0f0b5c8a 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -161,8 +161,6 @@ vec3 post_diffuse = color.rgb;
         }
        
  vec3 post_spec = color.rgb;
- 
-        color.rgb = mix(color.rgb, diffuse_srgb.rgb, diffuse_srgb.a);
 
         if (envIntensity > 0.0)
         { //add environmentmap
@@ -170,9 +168,12 @@ vec3 post_diffuse = color.rgb;
             vec3 reflected_color = textureCube(environmentMap, env_vec).rgb;
 #if !defined(SUNLIGHT_KILL)
             color = mix(color.rgb, reflected_color, envIntensity*0.75); // MAGIC NUMBER SL-12574; ALM: On, Quality >= High
+//color.rgb = reflected_color.rgb;
 #endif
         }
-        
+        else
+            color.rgb = mix(color.rgb, diffuse_srgb.rgb, diffuse_srgb.a);
+
 vec3 post_env = color.rgb;
 
         if (norm.w < 1)
-- 
GitLab