#ifdef ALPHA_MASK uniform sampler2D alphaMask; in vec2 varTexCoord; #endif out float fragmentdepth; #ifdef POINT_LIGHT in vec4 FragPos; uniform vec3 pointLight; uniform float far_plane; #endif void main() { #ifdef ALPHA_MASK if(texture(alphaMask, varTexCoord).r < 0.5) discard; #endif #ifdef POINT_LIGHT fragmentdepth = length(FragPos.xyz - pointLight)/far_plane; #else fragmentdepth = gl_FragCoord.z; #endif }