

layout(location = 0, index = 0) out vec4 outcolor0;

uniform sampler2D depthtex;

in vec2 texcoord_nm;

// http://www.humus.name/temp/Linearize%20depth.txt
void main()
{
	float depth_sample = texture( depthtex, texcoord_nm ).r;
	outcolor0 = vec4( 20*vec3(depth_sample-0.95), 1 ); //DEBUG, was anything written?
	
	// const float n = 1;
	// const float f = 15;
	// float z = ( 2 * n ) / ( f + n - depth_sample * (f-n) );
	// outcolor0 = vec4( vec3(z), 1 );
	
	//outcolor0 = vec4( vec3(depth_sample), 1 );
}
