Files
NixOS-configs/modules/wallpaper-engine/shaders/shadowcaster.frag
2025-02-07 17:04:43 -06:00

17 lines
367 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.0001) + 0.5;
gl_FragColor = albedo;
#if GLSL
if (gl_FragColor.a < 0.5) discard;
#endif
#endif
}