Hello, I’ve been testing around and developing a scene in Unity URP, and i’ve hit a weird visual glitch which seems to be related to the shadow cascade and shadow distance configuration and a directional light. In a scene with a single directional light and a spotlight, using real-time shadows and lightning, The cast shadow behaves normally.
The glitch arises on the built project. Using Foward+ Render Path and Vulkan or DX11, both show the same behavior, all with high fidelity quality in the options. (4096 shadowmap etc.)
Shadow artifacts appear and flicker as the camera moves, as shown in the link bellow.
This behavior seems to be directly linked to the first shadow cascade segment, as I increase it, the artifacts stop but, as expected, the shadow quality plummets. I have also made adjustments in the near clip of the directional light, and it doesn’t seem to do anything. The build is already in maximum quality and retaining all shader variants.
What is confusing me is why this behavior only happens on the build and not on the editor. It goes away if the directional light is disabled completely or its shadows. Does anyone know anything about it, or what might be causing it?
I tried taking the cascade count down to 1, and then took Depth Bias down to 0, and then finally the shadows would remain, but they look absolutely awful.
I have the exact same problem since I upgraded to 6000.0.36f1. I tried everything but nothing works. Shadows are great on Editor and Development Build but when i build without Development this problem occurs. I thought it will be about shader stripping but i can’t try it because when i turn off stripping it compiles huge amount of shaders, and it probably will take forever to complete. I also tried tweaking cascade settings but didn’t work.
Same here! I spent an unbelievable 7 hours yesterday testing different settings, building, getting frustrated, and repeating the process. Today, I just switched back to my old Unity 2022 version
I can confirm too, the issue still happens in 6000.0.37f1. I tried tweaking cascade values and as I saw it only respects to first distance of cascade. So if “Split 1” set to 10m, after 10m shadows completely cutting off without any fading. But this only happen when you build while “Development Mode” unchecked.
Same behavior for me, doesn’t matter if the develop mode is checked or not. I also thought it could be shader stripping, but I disabled any form of shader stripping and after almost a hour of compilation, it still stayed the same way.
I didn’t see that there was already a question about this, so I accidentally opened one too, the problem is also present for me in version 6000.0.37f1.
I can confirm that checking the Development Build checkbox fixes the issue in version 6000.0.37f1, but it’s not a real solution because you’ll still see “Development Build” in the bottom right corner of the screen, and the game size has increased from 94MB to 133MB. Unity definitely needs to fix this and release a new LTS version.