#version 330 core

in vec4 fragPosition;

uniform float farPlane;
uniform vec3 worldLightPosition;

void main(){
	float distanceFromLight = length(fragPosition.xyz - worldLightPosition);
	float normalized = distanceFromLight/farPlane;
	gl_FragDepth = normalized;
}