#ifndef FX_DEPTH_INCLUDED
#define FX_DEPTH_INCLUDED
uniform sampler2D _CameraDepthTexture;
uniform float _Depth;
half Depth(half4 projPos)
{
	half sceneZ = max(0,LinearEyeDepth (UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(projPos)))) - _ProjectionParams.g);
	half partZ = max(0,projPos.z - _ProjectionParams.g);
	return saturate((sceneZ-partZ)/_Depth);
    //return 1;
}
#endif