varying vec2 		texcoord;
uniform sampler2D 	/*tex,*/
					pos;
uniform float		focus;
uniform float		wFar;
uniform float		DLen;
uniform float		FLen;	

void main()
{
	float depth=-texture2D(pos, texcoord).r;
/*	float t0=(depth-focus)/focus;
	float t1=(FLen-depth)/FLen;
	float t2=(depth-FLen)/FLen;
	float coc=clamp(min(t0,t1),0.0,1.0);
	coc=min(max(coc,t2),1.0);
*/
	float t0=smoothstep(0.0,focus,depth);
	float t1=1.0-smoothstep(FLen,DLen/*FLen+10000.0*/,depth);
	float coc=min(t0,t1);
	
	gl_FragColor.a = coc;
}
