Toon shader with Transparency

I have a Character i’m using the Toon Basic on, how do I get alpha channels or maps to work on it? Sorry if this has been asked before, I’m no shader expert.

Hi, this is pretty easy to do.

What you need to do is set a blending mode (in this case srcAlpha oneMinusSrcAlpha) change the render type to transparent, and change he queue that it is rendering in. You then need to output the alpha to use also when writing the fragment.

Here is the modified shader, have a look at how it differs from the original and you should be able to figure out what you want to do from here.

	SubShader {
		Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
		Pass {
			Name "BASE"
			Cull Off
			Blend SrcAlpha OneMinusSrcAlpha
			
			CGPROGRAM
			#pragma vertex vert
			#pragma fragment frag
			#pragma fragmentoption ARB_precision_hint_fastest 

			#include "UnityCG.cginc"

			sampler2D _MainTex;
			samplerCUBE _ToonShade;
			float4 _MainTex_ST;
			float4 _Color;

			struct appdata {
				float4 vertex : POSITION;
				float2 texcoord : TEXCOORD0;
				float3 normal : NORMAL;
			};
			
			struct v2f {
				float4 pos : POSITION;
				float2 texcoord : TEXCOORD0;
				float3 cubenormal : TEXCOORD1;
			};

			v2f vert (appdata v)
			{
				v2f o;
				o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
				o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
				o.cubenormal = mul (UNITY_MATRIX_MV, float4(v.normal,0));
				return o;
			}

			float4 frag (v2f i) : COLOR
			{
				float4 col = _Color * tex2D(_MainTex, i.texcoord);
				float4 cube = texCUBE(_ToonShade, i.cubenormal);
				return float4(2.0f * cube.rgb * col.rgb, col.a);
			}
			ENDCG			
		}
	}

Im not a shader writer so this is completely foreign to me. No clue what to do with this at all

The thing is that this modification only works when there are two objects that don’t share the same mesh.
If you use the same mesh, there still will be obscuring no matter how transparent your shader is.