According to the document Unity - Manual: Surface Shaders and rendering paths , unity uses ShadowCaster/ShadowCollector for casting/receiving shadows.
If I write a custom vertex/fragment shader, where is the default ShadowCaster/ShadowCollector? I’ve tested and the custom material with my shader can still have shadows, even without these two passes in my shader source. I’m wondering why…
ps. I’m not sure whether these two passes are just writing into every light sources’ lightmap and reading from them?
And when these two passes will be called in three different pipelines?
FYI for future search:
If shader does not have ShadowCaster pass, it will use the one found in Fallback. In such simple case if your shader is using “VertexLit” as fallback. It uses “VertexLit/SHADOWCASTER” pass. To look what’s inside, continue in shader archive of your Unity version.
(Unity 5.6 Doc) In order to cast shadows, a shader has to have a ShadowCaster pass type in any of its subshaders or any fallback.
Unity - Manual: Vertex and fragment shader examples
(Forum user: bgolus) By default a surface shader does not generate a shadowcaster pass, but instead uses the shadowcaster from the Fallback. Remove the Fallback, no more shadow. It’ll also prevent that shader from showing up in the camera depth texture when using the forward rendering path!
https://forum.unity.com/threads/how-to-turn-off-shadow-casting-in-a-surface-shader.451279/