- Home /
The question is answered, right answer was accepted.
http://forum.unity3d.com/threads/matte-shadow.14438/#post-768204
invisible/transparent plane, receiving and rendering shadows - which shader?
I need a 100% transparent plane. Only the shadows of the objects that are placed on it shall be visible. I just tried to use klakos shader, as it seems to be the one that works. But I just get a grey plane. I dont know how to turn it transparent.
This one looks promising.
What am I doing wrong? Or do you have any proposals for a better solution?
My fallback would be blob shadow projection. It is already working on my transparent plane.
Answer by UnityIsSlow · Feb 09, 2013 at 06:27 AM
You would need a custom lighting function (aka ShadowOnly) and a surface function. These are snippets from my program. The custom lighting function colors the shadow while the surf() makes your plane invisible. Is this what you're asking for?
inline fixed4 LightingShadowOnly (SurfaceOutput s, fixed3 lightDir, fixed atten) {
fixed4 color;
color.rgb = s.Albedo * atten;
color.a = s.Alpha;
return color;
}
void surf (Input IN, inout SurfaceOutput o) {
fixed4 color = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = color.rgb;
o.Alpha = 0;
}
Have fun!