Transparent vertex shader does not blend consistently

I’m creating a mesh that consists of a bunch of cubes. I want to make the cubes transparent based on the alpha channel. I’ve tried a bunch of different things, but I have been have some weird issues. I haven’t found a whole lot of documentation that deals with this, but I’m also fairly new to shaders, so any help would be appreciated!

I’ve set the alpha channel to 1 (fully opaque), yet the color of some background cubes still appears on top of foreground cubes. This behavior appears to be inconsistent.

I’ve circled two regions in the above screenshot. The one on the lower-left shows a foreground cube that properly occludes background cubes. The one in the upper-middle shows a foreground cube that does not properly occlude background cubes.

2895453--212962--upload_2016-12-22_18-57-41.png

This is shader I am using currently, but have tried a bunch of different iterations (taking lines out, etc.):

Shader "Custom/Vertex Transparent" {
    Properties{
        _Color("Color", Color) = (0,0,0,1)
        _MainTex("Base (RGB)", 2D) = "white" {}
    }
    SubShader{
        Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" "AllowProjectors" = "False" }
        Blend One OneMinusSrcAlpha
        CGPROGRAM

            #pragma surface surf Standard alpha:fade
       
            sampler2D _MainTex;
       
            struct Input
            {
                float2 uv_MainTex;
                float4 color : COLOR;
            };
       
            void surf(Input IN, inout SurfaceOutputStandard o)
            {
                half4 c = tex2D(_MainTex, IN.uv_MainTex);
                o.Albedo = IN.color.rgb;
                o.Alpha = IN.color.a;
            }
        ENDCG
    }
}

Any idea where I’m going wrong?

As surprising as it sounds this is working as expected. I posted a longer explanation here:

If your mesh really is going to be just a bunch of squares you probably want to look into instancing.