Shader "Escape Room Engine/FullScreenDepth" {
	Properties {}
	
	SubShader {
		Pass {
            ColorMask 0
		    Cull Off
            ZWrite On
			ZTest Always
			
            Stencil {
                Ref 1
                Comp LEqual
            }

            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #include "UnityCG.cginc"

            void vert(appdata_img v, out float4 pos : SV_POSITION) {
                #ifdef UNITY_REVERSED_Z // clip space [near 1, 0 far]
                float far = 0;
                #else // clip space [near -1, 1 far]
                float far = 1;
                #endif
                pos = float4(v.vertex.xy * 2.0, far, 1); // quad xy goes from -0.5 to 0.5, clip space from -1 to 1
            }

            fixed4 frag() : SV_Target {
                return 0;
            }
            ENDCG
		}
	}
}