summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl18
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
index cf8cf8364a..bced4a5577 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -29,11 +29,11 @@ out vec4 frag_color;
#define frag_color gl_FragColor
#endif
-uniform float minimum_alpha;
-
uniform sampler2D diffuseMap;
-VARYING vec4 post_pos;
+VARYING float pos_zd2;
+VARYING float pos_w;
+VARYING float target_pos_x;
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
@@ -41,12 +41,20 @@ void main()
{
float alpha = diffuseLookup(vary_texcoord0.xy).a * vertex_color.a;
- if (alpha < minimum_alpha)
+ if (alpha < 0.05) // treat as totally transparent
{
discard;
}
+ if (alpha < 0.88) // treat as semi-transparent
+ {
+ if (fract(0.5*floor(target_pos_x / pos_w )) < 0.25)
+ {
+ discard;
+ }
+ }
+
frag_color = vec4(1,1,1,1);
- gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
+ gl_FragDepth = max(pos_zd2/pos_w+0.5, 0.0);
}