Custom Surface Shader with Alpha

I’ve been trying to write a simple custom surface shader that lets me place a hole in my mesh for where the hole is on a golf green, and it’s working as expected, except when I enable alpha in the pragma line I get some weird artifacts. It looks like some of my triangles are being rendered before triangles in front and I’m not sure why.

 Shader "Example/Diffuse Texture" {
    Properties {
      _MainTex ("Main", 2D) = "white" {}
    }
    SubShader {
      Tags { "RenderType" = "Transparent" "Queue" = "Transparent" }  
      CGPROGRAM
      #pragma surface surf Standard fullforwardshadows alpha
      #pragma target 3.0
      struct Input {
          float2 uv_MainTex;
      };
      sampler2D _MainTex;

      void surf (Input IN, inout SurfaceOutputStandard o) {
              o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb;     
          o.Alpha = 1.0;
      }
      ENDCG
    }
    Fallback "Diffuse"
  }

It’s possible that is exactly what’s happening. When using the alpha parameter for surface shaders, ZWrite is disabled on the shader. That means the depth buffer is no longer helping to sort, and the order of the triangles being rendered is all that matters. However it also kind of looks like z fighting. From that picture alone I certainly couldn’t tell you exactly what is happening, but I can say generally speaking you do not want to have larger areas of otherwise opaque surfaces use a transparent shader. If you want to use alpha blending, it’s best to keep the transparent material localized to the few polygons just the area around the hole rather than the entire mesh. This is really true even for alpha tested materials for performance reasons, though you can often get away without it.