Shader "Custom/FrontfaceCulling"
{
    Properties
    {
        _Color ("Color", Color) = (1,1,1,1)
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        Pass {
            Cull Front

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

            fixed4 _Color;

            struct Data
            {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
            };

            struct V2F
            {
                float4 position : SV_POSITION;
                float4 screenPosition : TEXCOORD0;
            };

            V2F vert(Data v)
            {
                V2F o;
                o.position = UnityObjectToClipPos(v.vertex);
                o.screenPosition = ComputeScreenPos(o.position);
                return o;
            }

            fixed4 frag(V2F i) : SV_TARGET
            {
                float2 textureCoordinate = i.screenPosition.xy / i.screenPosition.w;
                fixed4 colour = _Color;
                return colour;
            }
            ENDCG
        }
    }
    FallBack "Diffuse"
}
