
#version 330
in vec4 FragPosition;

uniform vec3 lightPosition;
uniform float farPlane;

void main()
{
	float lightDistance = length(FragPosition.xyz - lightPosition);

	lightDistance = lightDistance / farPlane;

	gl_FragDepth = lightDistance;
}