#pragma multi_compile_instancing //ADD struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID //ADD }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID //ADD }; v2f vert (appdata_t v) { v2f o; UNITY_SETUP_INSTANCE_ID(v); //ADD UNITY_TRANSFER_INSTANCE_ID(v, o); //ADD o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); return o; } fixed4 frag (v2f i) : SV_Target { UNITY_SETUP_INSTANCE_ID(i); //ADD fixed4 c = tex2D(_MainTex, i.texcoord) * _Color; c.a *= _AlphaMix; return c; }