Files
vb01/depthMap.frag
2021-10-19 19:06:41 +03:00

16 lines
225 B
GLSL

#version 330 core
uniform float farPlane;
uniform bool point;
uniform vec3 lightPos;
in vec4 fragPos;
void main(){
if(point){
float dist = length(lightPos - fragPos.xyz);
dist /= farPlane;
gl_FragDepth = dist;
}
}