Hi
I am using a shader to apply shadows in transparent objects. This shade works very well until Unity 5.3.6
After move to 5.4, it does not behaviour at the same way.
If I switch the camera mode from Forward to Deferred, the shader fail.
You can say that’s ok becaue that shader only works in Forward mode. But it worked in both until Unity 5.4
My question is: what changed?
I have looked at Unity 5.4 release notes and search for the reason but I didn’t find a solution.
I need the shadows working on transparent object but I can’t move from Deferred Rendering to Forward ![]()
I have made two scenes showing the problem
He is the shader
Shader "Custom/InvisibleShadowReceiver"
{
Properties
{
_ShadowColor ("Shadow Color (A = Intensity)", Color) = (0,0,0,0.6)
}
SubShader
{
Tags{ "RenderType" = "Opaque" }
Pass
{
Tags{ "LightMode" = "ForwardBase" }
Cull Back
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fwdbase
#include "UnityCG.cginc"
#include "AutoLight.cginc"
uniform float4 _ShadowColor;
struct v2f
{
float4 pos : SV_POSITION;
LIGHTING_COORDS(0, 1)
};
v2f vert(appdata_base v)
{
v2f o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
TRANSFER_VERTEX_TO_FRAGMENT(o);
return o;
}
fixed4 frag(v2f i) : COLOR
{
float attenuation = LIGHT_ATTENUATION(i);
return fixed4(_ShadowColor.r, _ShadowColor.g, _ShadowColor.b, (1 - attenuation)*_ShadowColor.a);
}
ENDCG
}
}
Fallback "VertexLit"
}
I have created the most basic scene with the shader and camera to show this issue.
I would appreciate any help
Thanks


2856286–208838–Matte_536.zip (26.7 KB)
2856286–208839–Matte_542.zip (28.5 KB)