2018-10-16 20:23:31 +00:00
#version 120
uniform sampler2D diffuseMap;
varying vec2 diffuseMapUV;
varying float alphaPassthrough;
uniform bool useDiffuseMapForShadowAlpha;
2020-04-10 14:45:37 +00:00
uniform bool alphaTestShadows;
2018-10-16 20:23:31 +00:00
void main()
{
gl_FragData[0].rgb = vec3(1.0);
if (useDiffuseMapForShadowAlpha)
gl_FragData[0].a = texture2D(diffuseMap, diffuseMapUV).a * alphaPassthrough;
else
gl_FragData[0].a = alphaPassthrough;
2018-10-17 13:02:26 +00:00
2020-04-21 17:18:55 +00:00
// Prevent translucent things casting shadow (including the player using an invisibility effect). For now, rely on the deprecated FF test for non-blended stuff.
if (alphaTestShadows && gl_FragData[0].a <= 0.5)
2018-10-17 13:02:26 +00:00
discard;
2018-10-16 20:23:31 +00:00
}