#ifdef ALPHA_MASK uniform sampler2D alphaMask; in vec2 varTexCoord; #endif #ifdef POINT_LIGHT in vec4 fragPos; flat in int fcolor_idx; uniform float far_plane; #endif void main() { #ifdef ALPHA_MASK if(texture(alphaMask, varTexCoord).r < 0.5) discard; #endif #ifdef POINT_LIGHT //gl_FragDepth = float(fcolor_idx)/6; gl_FragDepth = length(fragPos.xyz)/far_plane; #else gl_FragDepth = gl_FragCoord.z; #endif }