summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-11-14 23:51:13 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-11-14 23:58:14 +0200
commit24993a914f4d3a08bad658c21f2070504a8ad654 (patch)
treeaa661126227bb546697592bacf1c2b2a285c7a15 /indra/newview
parentbedbd98017bc331d129ba066323636eeb3607f20 (diff)
SL-18637 Reverted material shader changes
original fix by Beq Janus
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl13
1 files changed, 6 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index b26194f278..b30d7655db 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
-#ifdef HAS_ALPHA_MASK
+#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK)
uniform float minimum_alpha;
#endif
@@ -227,12 +227,11 @@ void main()
vec4 diffcol = texture2D(diffuseMap, vary_texcoord0.xy);
diffcol.rgb *= vertex_color.rgb;
-#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
+#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 (SL-18637)
+ if (diffcol.a < minimum_alpha-bias)
{
discard;
}