Hello,
So URP has been around for a few years, and I hear it’s the next standard.
How come something so basic like light shadows still doesn’t work correctly compared to b built-in?
If I set the shadow distance more than 55 units, shadows from directional start to disappear?
Is Unity telling me that I am only supposed to use shadows within a 50 diameter range?
Thanks
Certainly not. I’ve set shadow max distance to >= 100 and that all works out.
Where it may be failing is perhaps low-end (integrated) GPUs, running out of VRAM, buggy drivers, or simply and most commonly low quality settings and especially if the shadow mask texture resolution is low, the shadows themselves get more coarse and this could lead to “holes”.
There’s also a shadow layering option which divides shadow quality based on distance into three or four groups. If you modified that distribution revert it to its default settings.
To test the limits create a blank project and place a few scaled primitives into the scene, then play around with shadow distance without changing any other graphics settings. This ought to work fine and if so, it indicates the issue is in your project, perhaps conflicting or extreme settings.
Too many realtime lights could also cause this. Keep in mind that depending on whether you use Deferred(+) or Forward(+) rendering paths the behaviour, performance and maximum number of realtime lights differs significantly.
Note that editor and each platform can choose different default quality levels, eg for Editor + PC builds it’s the same but mobile and web use lower quality settings.
With 4 cascade shadows in URP, I can get far shadows from sun (even 2000m).
But URP shadow quality is no really good :
- no transition between cascade, get the transition visible when you move
- smooth shadows tend to produce shadow artifacts at distance not so manageable with bias, and smoothing is not so beautiful even near camera.
- non smooth shadows are more accurate, but really not beautiful near camera
- at distance shadows produced by near to receiver objects, or shadows projected on large objects can disappear.
Also shadows from other lights are really not good nor performant.
At least it’s my percpetion from testing in 6000.0 with forward+ and deferred.