From 5f0303eea5a30c914b61d5de6ade3697e551f9c6 Mon Sep 17 00:00:00 2001
From: Runitai Linden <davep@lindenlab.com>
Date: Fri, 13 Mar 2020 16:39:58 -0500
Subject: [PATCH] SL-12005 Fix for projectors getting brighter when switching
 to single light shader.

---
 .../app_settings/shaders/class1/deferred/spotLightF.glsl    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index 2216afe6090..694b19cdfb7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -177,9 +177,8 @@ void main()
 	float da = dot(norm, lv);
 		
 	vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
-    // SL-12005 Projector light pops as we get closer, more objectionable than being in wrong color space.
-    //          We can't switch to linear here unless we do it everywhere
-    //diff_tex.rgb = srgb_to_linear(diff_tex.rgb);
+	//light shaders output linear and are gamma corrected later in postDeferredGammaCorrectF.glsl
+    diff_tex.rgb = srgb_to_linear(diff_tex.rgb);
 
 	vec4 spec = texture2DRect(specularRect, frag.xy);
 
@@ -274,6 +273,7 @@ void main()
 	}
 #endif
 
+	//col.r = 1.0;
 	frag_color.rgb = col;	
 	frag_color.a = 0.0;
 }
-- 
GitLab