summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-21 12:48:10 -0500
committerDave Parks <davep@lindenlab.com>2022-09-21 12:48:10 -0500
commitd72c0f1d6aff3fc3ea011e38f58b209ffa0bb639 (patch)
tree1681d31e215b2db62ba0ed177d56023799e2e413 /indra
parent709bf22084aa38f09cc317a26704dba9b8ec124d (diff)
SL-18190 Fix for fullbright alpha blended legacy materials appearing in wrong color space
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl15
1 files changed, 4 insertions, 11 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
index fcda50c4de..07f50af7e3 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
@@ -244,11 +244,6 @@ void main()
}
#endif
-#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
- vec3 gamma_diff = diffcol.rgb;
- diffcol.rgb = srgb_to_linear(diffcol.rgb);
-#endif
-
#ifdef HAS_SPECULAR_MAP
vec4 spec = texture2D(specularMap, vary_texcoord2.xy);
spec.rgb *= specular_color.rgb;
@@ -293,7 +288,7 @@ void main()
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
- //forward rendering, output just lit sRGBA
+ //forward rendering, output lit linear color
vec3 pos = vary_position;
float shadow = 1.0f;
@@ -355,7 +350,7 @@ void main()
color += sun_contrib;
- color *= gamma_diff.rgb;
+ color *= diffcol.rgb;
float glare = 0.0;
@@ -378,9 +373,6 @@ void main()
#endif
}
-
- color = mix(color.rgb, diffcol.rgb, diffuse.a);
-
#ifdef HAS_REFLECTION_PROBES
if (envIntensity > 0.0)
{ // add environmentmap
@@ -439,12 +431,13 @@ void main()
al = temp.a;
#endif
+ color = mix(color.rgb, srgb_to_linear(diffcol.rgb), diffuse.a);
frag_color = vec4(color, al);
#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer
// deferred path // See: C++: addDeferredAttachment(), shader: softenLightF.glsl
- frag_data[0] = final_color; // gbuffer is sRGB
+ frag_data[0] = final_color; // gbuffer is sRGB for legacy materials
frag_data[1] = final_specular; // XYZ = Specular color. W = Specular exponent.
frag_data[2] = final_normal; // XY = Normal. Z = Env. intensity. W = 1 skip atmos (mask off fog)
#endif