12 lines
187 B
GLSL
12 lines
187 B
GLSL
#version 330 core
|
|
|
|
in vec4 fragPos;
|
|
|
|
uniform vec3 lightPos;
|
|
uniform float farPlane;
|
|
|
|
void main() {
|
|
float dist = length(fragPos.xyz - lightPos);
|
|
dist /= farPlane;
|
|
gl_FragDepth = dist;
|
|
} |