summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2020-03-13 21:09:24 +0000
committerDave Houlton <euclid@lindenlab.com>2020-03-13 21:09:24 +0000
commit0ac71ec5e3ce8ac4f8122b8a26248ab97dea2989 (patch)
treee095470f6a36a5af2e63ef03c7038958f5c2d354 /indra/newview/app_settings/shaders
parent48c5e7ae4c88d54cae9dccf061c346bceb01b502 (diff)
parent09b13b3981f121f20674b874f47f96bef2ac73ce (diff)
Merged in euclid_SL-12784 (pull request #35)
SL-12784 disambiguate vertex_color.a of 0
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl11
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index ca11f58888..a8a5cc22db 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -217,7 +217,16 @@ void main()
vec2 pos_screen = vary_texcoord0.xy;
vec4 diffuse_srgb = texture2D(diffuseMap, vary_texcoord0.xy);
- diffuse_srgb *= vertex_color;
+ diffuse_srgb.rgb *= vertex_color.rgb;
+
+ // For some reason the Transparency slider sets vertex_color.a to 0.0 both for
+ // fully opaque and for fully transparent objects. This code assumes the 0 alpha
+ // is always from the opaque end of the scale. TODO: Remove the conditional once
+ // the root cause of the slider ambiguity is fixed.
+ if (vertex_color.a > 0.0)
+ {
+ diffuse_srgb.a *= vertex_color.a;
+ }
vec4 diffuse_linear = vec4(srgb_to_linear(diffuse_srgb.rgb), diffuse_srgb.a);
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK)