Of course, this setting is for ALL light sources, which is a bummer. I wish the shadows from trees to be visible on ground, yet 250 distance for candle lights (which have radius like 5 units), well it doesnât make sense they would have 250 units for shadows.
Is there any possible way to somehow set the max distance for lights not to be 250?
Have you tried decreasing the range of the additional lights? If the lightâs range bound doesnât intersect camera view frustum (you cannot see it in view), it will not draw shadows.
Yes, that is not the issue, range is like 10, and it works to cull the lights (and hence shadows).
Original issue is this:
Focus is on URP setting âShadows: max distance = 250â, which is obviously huge, but needed for large trees.
So I tried spawning lots of point lights (like 7), and then compare performance when adjusting this âmaxDistanceâ parameter to less, like 25 (similar to range of point lights), and performance gain is quite a lot (like 5%).
So I am suspecting somehow URP is using distance of 250 (frustum culling?) to render all point lights shadow casters (each requiring 6 depth renders).
So unless I am missing something fundamentally, shouldnât shadow casters render distance be capped to as much as it needs to be? Maybe that updated in newer URP versions?
Ok, after more testing, I discovered I still had Sun light enabled somewhere (seems like it was inverted or something, it was not visible.
After disabling it, I see that âMax Distanceâ parameter wasnât main culprit of the point light performance.
As for separate âMax Distanceâ parameter, I will just code up my own lights distance script for spot light shadows and disable the shadows, if lights are far away from player.