uniform sampler2D depthMap;
uniform float depthMapWidth, depthMapHeight;
uniform float depthMapScale;
uniform sampler2D texture;

void main(void)
{
	float d = (texture2D(depthMap, vec2(gl_FragCoord.x/depthMapWidth, gl_FragCoord.y/depthMapHeight)).x);


	float k = clamp(d*depthMapScale, 0.0, 1.0);
	vec4 c = vec4(1.0, 0.0, 0.0, 1.0); //texture2D(texture, gl_TexCoord[0].xy);

	gl_FragColor = vec4(k*c.r, k*c.g, k*c.b, 1.0);
	//gl_FragColor = vec4(d, 0, 0, 1);

}
