Hello, My current project involve a toon shader that have transparency for my ragdolls to vanish. Unfortunatly the shadow it casts doesn't vanish as the body does. i reall know nothing about shaders, here are the toon shaders i found on internet. Code (CSharp): Shader "Toon/Basic Alpha" { Properties { _Color ("Main Color", Color) = (.5,.5,.5,1) _MainTex ("Base (RGB)", 2D) = "white" {} _ToonShade ("ToonShader Cubemap(RGB)", CUBE) = "" { Texgen CubeNormal } } SubShader { Tags {"Queue"="Transparent" "RenderType"="Transparent"} Pass { Name "BASE" 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 } } SubShader { Tags {"Queue"="Transparent" "RenderType"="Transparent"} Pass { Name "BASE" Blend SrcAlpha OneMinusSrcAlpha SetTexture [_MainTex] { constantColor [_Color] Combine texture * constant } SetTexture [_ToonShade] { combine texture * previous DOUBLE, previous } } } Fallback "VertexLit" } and Code (CSharp): Shader "Toon/Basic Outline Alpha" { Properties { _Color ("Main Color", Color) = (.5,.5,.5,1) _OutlineColor ("Outline Color", Color) = (0,0,0,1) _Outline ("Outline width", Range (.002, 0.03)) = .005 _MainTex ("Base (RGB)", 2D) = "white" { } _ToonShade ("ToonShader Cubemap(RGB)", CUBE) = "" { Texgen CubeNormal } } CGINCLUDE #include "UnityCG.cginc" struct appdata { float4 vertex : POSITION; float3 normal : NORMAL; }; struct v2f { float4 pos : POSITION; float4 color : COLOR; }; uniform float4 _Color; uniform float _Outline; uniform float4 _OutlineColor; v2f vert(appdata v) { v2f o; o.pos = mul(UNITY_MATRIX_MVP, v.vertex); float3 norm = mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal); norm.x *= UNITY_MATRIX_P[0][0]; norm.y *= UNITY_MATRIX_P[1][1]; o.pos.xy += norm.xy * o.pos.z * _Outline; o.color = float4(_OutlineColor.rgb, _Color.a); return o; } ENDCG SubShader { Tags {"Queue"="Transparent" "RenderType"="Transparent"} UsePass "Toon/Basic Alpha/BASE" Pass { Name "OUTLINE" Tags { "LightMode" = "Always" } Cull Front ZWrite On ColorMask RGB Blend SrcAlpha OneMinusSrcAlpha CGPROGRAM #pragma vertex vert #pragma fragment frag half4 frag(v2f i) :COLOR { return i.color; } ENDCG } } SubShader { Tags {"Queue"="Transparent" "RenderType"="Transparent"} UsePass "Toon/Basic Alpha/BASE" Pass { Name "OUTLINE" Tags { "LightMode" = "Always" } Cull Front ZWrite On ColorMask RGB Blend SrcAlpha OneMinusSrcAlpha CGPROGRAM #pragma vertex vert #pragma exclude_renderers gles xbox360 ps3 ENDCG SetTexture [_MainTex] { combine primary } } } Fallback "Toon/Basic Alpha" } I've been told here http://answers.unity3d.com/answers/846945/view.html that asking here is a good idea since it's a bit difficult and that i may have to change the recceiver shader instead. My walls/floor shaders are the toon shading lighted from unity. What should i add on my shaders to make it possible? Is it a good idea anyway in term of costs? (knowing it's going to be a IOS/Android game)
You would need to hack or replace the built in Unity shadows (which is possible) but requires a bit of knowledge. I think the easiest solution might be using the projector shadows or look around the asset store or you can do some dissolve effect using the Cutout shaders.