// shadowmap debugging (viewing the depth)
// Original file:   view_fragment.glsl
// Author: Rouslan Dimitrov
// Email:  sdkfeedback@nvidia.com
// Copyright (c) NVIDIA Corporation. All rights reserved.
//----------------------------------------------------------------------------------

struct v2f
{
	float2 tc0 : TEXCOORD0;
	float4 pos : POSITION;
};

void main(
  in v2f IN,
  uniform sampler2D tex : TEXUNIT0,
  out float4 color : COLOR0)
{
  float zoom=0.60f; // zoom in on detail (range 0 to 0.99) DONT USE 1 !!
  //float zoom=0.90f; // zoom in on detail (range 0 to 0.99) DONT USE 1 !!
  color.rgb = (1.0f/(1.0f-zoom))*(tex2D(tex, IN.tc0).r-zoom);
//color.rgb=tex2D(tex,IN.tc0).w;
//color.rgb =float3(0,10,0);
  //color.rgb = (2 * znear) / (zfar + znear - color.rgb * (zfar - znear));
  color.a=1.0f;
}