Well, I´ve look into the internet a lot, but wasn´t able to find this for Unity 5, mobile.
This is what I need:
I want the ground plane not to render, BUT I do need to render the shadows.
The reason for this is that I´m doing a 2.5 game, i.e. the background is 2D but the character is 3D, so I only want to render the character and the shadow, but leave the floor out, since it will come from a 2D texture.
Every 3D renderer has this feature, but can´t find it in unity.
I´ve seen a material made by someone, but Unity 5 doesn´t read it.
This is what the old material used to do:
This was the code. My knolowedge of code is pretty short, so I couldn´t wrap my head around it to make it work:
[LIST=1]
[*]Shader "FX/Matte Shadow" {
[*]Properties {
[*] _Color ("Shadow Color", Color) = (1,1,1,1)
[*] _ShadowInt ("Shadow Intensity", Range(0,1)) = 1.0
[*] _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
[*]}
[*]
[*]
[*]SubShader {
[*] Tags {
[*] "Queue"="AlphaTest"
[*] "IgnoreProjector"="True"
[*] "RenderType"="TransparentCutout"
[*] }
[*] LOD 200
[*] ZWrite off
[*] Blend zero SrcColor
[*]
[*]CGPROGRAM
[*]#pragma surface surf ShadowOnly alphatest:_Cutoff
[*]
[*]fixed4 _Color;
[*]float _ShadowInt;
[*]
[*]struct Input {
[*] float2 uv_MainTex;
[*]};
[*]
[*]inline fixed4 LightingShadowOnly (SurfaceOutput s, fixed3 lightDir, fixed atten)
[*]{
[*] fixed4 c;
[*] c.rgb = lerp(s.Albedo, float3(1.0,1.0,1.0), atten);
[*] c.a = 1.0-atten;
[*] return c;
[*]}
[*]
[*]
[*]void surf (Input IN, inout SurfaceOutput o) {
[*] o.Albedo = lerp(float3(1.0,1.0,1.0), _Color.rgb, _ShadowInt);
[*] o.Alpha = 1.0;
[*]}
[*]ENDCG
[*]}
[*]
[*]Fallback "Transparent/Cutout/VertexLit"
[*]}
[*]
[/LIST]