- Home /
where is the default ShadowCaster/ShadowCollector
According to the document http://docs.unity3d.com/Manual/SL-RenderPipeline.html , 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?
Answer by Wappenull · Apr 14, 2020 at 11:28 AM
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.
https://docs.unity3d.com/560/Documentation/Manual/SL-VertexFragmentShaderExamples.html(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.
https://forum.unity.com/threads/how-to-turn-off-shadow-casting-in-a-surface-shader.451279/(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!
Your answer
Follow this Question
Related Questions
Custom Shadow Effects 1 Answer
Android Build Problem 0 Answers
Shadow's quality bug? Or just wrong settings? 1 Answer
Strange black spot on quads, only on mobile devices 1 Answer