#version 450 core

in vec3 vWorldPos;

uniform vec3 uLightPosition;
uniform float uLightFar;

void main()
{
    gl_FragDepth = clamp(length(vWorldPos - uLightPosition) / max(uLightFar, 0.001), 0.0, 1.0);
}
