Shadow transparency for custom shader

I have a custom surface shader which uses transparency.
Unlike Unitys Standard shader the casted shadows are always fully rendered.

I would like to achieve the same effect like the shadows from the standard shader (green box)


Does someone know how to do this?

What you can do (a bit of a hack, but easier than writing a separate shadow caster) is set your shader fallback to “Standard”. Now, that alone won’t do anything. However, if you switch your material’s shader to the Standard shader and set the transparency option to “Fade” you should get transparent shadows. The thing is; when you switch shaders back, the shadows will actually remain the same as those from the Standard shader.