Hi everyone,
I am using Unity 2020.1.13f1c1 and I am currently experiencing some shadow casting problems where the wrong shadow is cast.
When I enter play mode in Editor, this happens.
The shadow of the character body becomes the shadow of the head for the first key frame in my animation.
But it does not happen in Editor when I play the animation without entering play mode. The shadow is normal there.
Here is my ShaderGraph for the material I am using for this quad.
Could anyone help me with this? Is there anywhere I could have done wrong? Or is this a glitch in Unity?
[Also posted on StackOverflow]
--------------------UPDATE 25/01/2021--------------------
Forgot to mention that the body and the head are 2 seperate GameObjects which both use the ShaderGraph I posted above.
And I upgraded this project from an older version of Unity (2019.3.4f1).
Also, I notice that if I move the head out of the range of the Spotlight, the shadow is normal again.
Any thoughts maybe?
--------------------UPDATE 26/01/2021--------------------
FrameDebug reveals something strange. The rendering pipeline is actually using 2 different textures for shadow and opaque rendering. In shadow rendering pass, it uses the texture for the head. But in opaque rendering pass, it uses the texture from the body.
I am not very familiar with the insides of URP rendering pipeline, but how is it possible for the pipeline to switch the texture for the same mesh between shadow rendering pass and opaque rendering pass?