Error ShadowMap Sampling in Additional Lights - URP Unity 2021.1.2

Hello, I am using Unity 2021.1.2. I wrote a custom URP lit shader that is capable of shading multiple lights and casting shadows. It works fine just as my expectation when the point light mode is set to Baked.

However, when I am testing the new Realtime mode, the shading result became incorrect.

Is this a bug or an error in my code?

No idea. Does it happen if you use the included Lit shader? And by “custom” Lit shader, do you mean a vertex fragment shader or a Shader Graph shader? And is there a reason why you’re not using the one that comes with the URP as it can do all the things you listed already?

The original Lit shader doesn’t have the problem. The shader I wrote is a vertex fragment shader. Its point light shading works well in Bake mode, but not in the Realtime mode. I’m actually writing a Toon shader, so I can’t use the URP Lit directly.