The scene contains two spotlights with nearly identical parameters, yet they produce completely different lighting effects - one exhibits mosaic artifacts while the other renders normally. I have provided the test level for verification.
Thank you for the repro. There is potentially an issue with the chosen mip level of the VSMs under certain cases. You can alleviate some of these issues by increasing the local light resolution bias or by enabling raytraced shadows. There are performance implications in both of these cases.
I have reported the issue and reply with a tracking link when one becomes available.
In this case (or with VSM in general), adjusting the local light resolution bias has no effect.
However, when I set
r.Shadow.Virtual.ResolutionLodBiasLocal -1
, the issue is resolved. That said, I don’t believe either of these is the correct solution, especially since the two lights in question have very similar parameters.
Hi, I’ve found directional lights have the same issue, and the quality paradoxically improves when zooming out. Can you consolidate this with the existing feedback, or should I submit a new ticket?
I need to explain that the mosaic effect of this directional light only occurs on translucent objects. If we replace the translucent material with an opaque one, the issue disappears.
However, in the case of the spotlight, the problem appears on opaque materials.
Thanks for the repro. The spotlight case is caused by the approximation that decides if a light should be considered “distant”, which forces it to the lowest resolution mips. In this case it’s a poor approximation to the long skinny cone coming near the camera. Switching to a more conservative approximation via “r.Shadow.Virtual.UseConservativeDistantLightThreshold 1” will fix these cases. This is probably something we’ll enable by default soon but just haven’t gotten around to doing enough testing. If you run into issues with it, please let us know!
Low res shadows on forward shaded translucent objects is “expected” in various cases, as these objects do not mark high res VSM pages by default. As your scene demonstrates, if there happen to be opaque objects near them they will get a higher res shadow due to those objects marking the relevant pages. Forwarded shaded translucency also does not get any shadow filtering as it is very expensive in forward shading.
There is a mode - r.Shadow.Virtual.TranslucentQuality 1 - that will force front layer deferred transparency and filtering on forward rendered VSM shadows, but it is extremely expensive, and it’s a read-only cvar that has to be changed globally since it affects shaders and permutations. It’s meant more for offline stuff.
All of that stuff will just be what I mentioned before - opaque surfaces will mark higher resolution pages and sometimes those pages will also overlap the places it needs shadow data for the translucent surfaces. As you zoom out the pages become bigger and this becomes more likely to some extent, but you can still set up views where it will not be the case. How much of a problem it is depends entirely on the scene.
The translucent quality mode is the only way to guarantee you get high res data and filtering, and even with that on, only for the first layer of translucency (as with Lumen first layer).