summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-06-06 19:57:03 -0500
committerDave Parks <davep@lindenlab.com>2022-06-06 19:57:03 -0500
commit616f2b639bc6907e810664522304305337646292 (patch)
tree29c98de959f080d07784687a838e01b5280cd17a /indra/newview/app_settings/shaders/class1/deferred
parent0fe8493b5a531bb0fbc431f54ee25f8e2923b5bf (diff)
SL-17532 Potential fix for some rigged mesh draw order issues.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl13
1 files changed, 7 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 02d83925ea..b26194f278 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -202,7 +202,7 @@ VARYING vec2 vary_texcoord2;
uniform float env_intensity;
uniform vec4 specular_color; // specular color RGB and specular exponent (glossiness) in alpha
-#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK)
+#ifdef HAS_ALPHA_MASK
uniform float minimum_alpha;
#endif
@@ -227,11 +227,12 @@ void main()
vec4 diffcol = texture2D(diffuseMap, vary_texcoord0.xy);
diffcol.rgb *= vertex_color.rgb;
-#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK)
-
- // Comparing floats cast from 8-bit values, produces acne right at the 8-bit transition points
- float bias = 0.001953125; // 1/512, or half an 8-bit quantization
- if (diffcol.a < minimum_alpha-bias)
+#ifdef HAS_ALPHA_MASK
+#if DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND
+ if (diffcol.a*vertex_color.a < minimum_alpha)
+#else
+ if (diffcol.a < minimum_alpha)
+#endif
{
discard;
}