summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2020-03-06 17:30:55 +0000
committerDave Parks <davep@lindenlab.com>2020-03-06 17:30:55 +0000
commitfd043095c6d5c3f5b065322c6c9332a7170e3d0a (patch)
treea07bac4e4ea4b095d93dcde6aeff07786f00e1d1 /indra/newview/app_settings/shaders/class2
parentc1a3797b304f95e4ed025596d611bb2861d322b8 (diff)
parent7d0cf70e4f335056e0d81b0b48264e5dda5be668 (diff)
Merged in davep/BUG-228263 (pull request #23)
Davep/BUG-228263 Approved-by: Dave Houlton <euclid@lindenlab.com>
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl3
3 files changed, 10 insertions, 11 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 7cde67d11b..5d7a28c359 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -192,8 +192,9 @@ void main()
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);
+ // We can't switch to linear here unless we do it everywhere*
+ // *gbuffer IS sRGB, convert to linear since this shader outputs linear
+ diff_tex.rgb = srgb_to_linear(diff_tex.rgb);
vec4 spec = texture2DRect(specularRect, frag.xy);
@@ -296,6 +297,7 @@ void main()
//not sure why, but this line prevents MATBUG-194
col = max(col, vec3(0.0));
- frag_color.rgb = col;
+ //output linear
+ frag_color.rgb = col;
frag_color.a = 0.0;
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index bacdb6f70f..9ebacd59c7 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -106,7 +106,7 @@ void main()
vec3 atten;
calcAtmosphericVars(pos.xyz, light_dir, ambocc, sunlit, amblit, additive, atten, true);
-
+
float ambient = da;
ambient *= 0.5;
ambient *= ambient;
@@ -127,7 +127,7 @@ vec3 post_ambient = color.rgb;
vec3 post_sunlight = color.rgb;
- color.rgb *= diffuse_linear.rgb;
+ color.rgb *= diffuse_srgb.rgb;
vec3 post_diffuse = color.rgb;
@@ -162,11 +162,7 @@ vec3 post_diffuse = color.rgb;
vec3 post_spec = color.rgb;
-#ifdef WATER_FOG
- color.rgb += diffuse_srgb.rgb * diffuse_srgb.a * 0.25;
-#else
color.rgb = mix(color.rgb, diffuse_linear.rgb, diffuse_linear.a);
-#endif
if (envIntensity > 0.0)
{ //add environmentmap
@@ -218,6 +214,6 @@ vec3 post_atmo = color.rgb;
//output linear RGB as lights are summed up in linear space and then gamma corrected prior to the
//post deferred passes
- frag_color.rgb = color.rgb;
+ frag_color.rgb = srgb_to_linear(color.rgb);
frag_color.a = bloom;
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 77f6e6f7ac..5ab0b5c5b4 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -189,7 +189,7 @@ void main()
lv = normalize(lv);
float da = dot(norm, lv);
- vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
+ vec3 diff_tex = srgb_to_linear(texture2DRect(diffuseRect, frag.xy).rgb);
vec4 spec = texture2DRect(specularRect, frag.xy);
vec3 dlit = vec3(0, 0, 0);
@@ -287,6 +287,7 @@ void main()
//not sure why, but this line prevents MATBUG-194
col = max(col, vec3(0.0));
+ //output linear colors as gamma correction happens down stream
frag_color.rgb = col;
frag_color.a = 0.0;
}