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.
The body and the head are 2 seperated GameObjects(Quad) under one GameObject.
And here is the ShaderGraph for the material I am using for both GameObjects.
Also, I notice that if I move the head away from the range of the Spotlight, the shadow is normal again.
Could anyone help me with this? Is there anywhere I could have done wrong? Or is this a glitch in Unity? Or maybe it has something to do with the fact that I upgraded the project from an older version of Unity to 2020.1.13f1c1?
[This issue is also posted on Unity Forum]
----------Update 26/1/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?
question from:
https://stackoverflow.com/questions/65885632/unity-urp-casting-the-wrong-shadow 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…