varying vec2 DepthTextureCoord;
varying float FragLightDepth, ViewDist;

uniform mat4 Eng_ObjectLightViewProjMatrix;

void main()
{
	vec4 d = Eng_ObjectLightViewProjMatrix * gl_Vertex;
	DepthTextureCoord = ((d.xy / d.w) + 1.0) * 0.5;
	
	FragLightDepth = (((d.z / d.w)+1.0)*0.5);
	
	gl_Position = ftransform();
	
 	ViewDist = -(gl_ModelViewMatrix * gl_Vertex).z;
}
