From d7b2016e39cb298a0a105e624ecc7bcf9d7db187 Mon Sep 17 00:00:00 2001
From: Ptolemy <ptolemy@lindenlab.com>
Date: Fri, 29 Jan 2021 13:04:39 -0800
Subject: [PATCH] SL-14731: Fix sun gamma -- merge Sovereign Engineer's patch:
 Fix sun gamma space for accurate color reproduction of sun textures

---
 doc/contributions.txt                                         | 1 +
 .../app_settings/shaders/class1/deferred/sunDiscF.glsl        | 4 ----
 .../app_settings/shaders/class1/windlight/sunDiscF.glsl       | 1 -
 3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 81c44d2961b..2f506e16ae4 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1356,6 +1356,7 @@ Sovereign Engineer
 	SL-11625
 	SL-14705
 	SL-14707
+	SL-14731
 SpacedOut Frye
 	VWR-34
 	VWR-45
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
index 454af2a9bce..b2fa5d8a256 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
@@ -49,10 +49,6 @@ void main()
     vec4 sunDiscB = texture2D(altDiffuseMap, vary_texcoord0.xy);
     vec4 c     = mix(sunDiscA, sunDiscB, blend_factor);
 
-    c.rgb = srgb_to_linear(c.rgb);
-    c.rgb = clamp(c.rgb, vec3(0), vec3(1));
-    c.rgb = pow(c.rgb, vec3(0.7f));
-
     //c.rgb = fullbrightAtmosTransport(c.rgb);
     c.rgb = fullbrightScaleSoftClip(c.rgb);
 
diff --git a/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl b/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl
index b9ae7a02262..5a41dc644a5 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl
@@ -51,7 +51,6 @@ void main()
 // SL-9806 stars poke through
 //    c.a *= sun_fade;
 
-    c.rgb = pow(c.rgb, vec3(0.7f));
     c.rgb = fullbrightAtmosTransport(c.rgb);
     c.rgb = fullbrightScaleSoftClip(c.rgb);
     frag_color = c;
-- 
GitLab