Files
NixOS-configs/modules/wallpaper-engine/shaders/shadowcasterfoliage4.frag
2025-04-29 13:39:02 -05:00

17 lines
373 B
GLSL

#if ALPHATOCOVERAGE
uniform sampler2D g_Texture0; // {"material":"albedo"}
varying vec2 v_TexCoord;
#endif
void main() {
#if ALPHATOCOVERAGE
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
albedo.a = (albedo.a - 0.5) / max(fwidth(albedo.a - 0.9), 0.0001) + 0.5;
gl_FragColor = albedo;
#if GLSL
if (gl_FragColor.a < 0.5) discard;
#endif
#endif
}