I’m experiencing flickering shadows (i.e shadows turning on and off) when moving a (realtime) spotlight. This already happened in 2022.1 and 2022.2 (not sure about earlier versions), but I still experience this issue in 2023.1
This happens if I move a bit away from the world origin (0,0). It already happens if I’m roughly 3000-3500 units from the world origin (which really isn’t that much), and get worse the further I move away. It does not happen with point lights, only with spotlights.
There was a thread about the same issue a few years ago: HDRP Spotlight Shadow Flickering
Unfortunately the thread is already locked… apparently this is a general Unity issue and not related to the HDRP directly?
@AxonGenesis did you ever get a response to your bug report and was the bug accepted? Did you get a link to a ticket in the public issue tracker?
Yes, the issue was deferred indefinitely. This was their response:
Hi,
Thanks for getting in touch, we actually know about this issue. Unfortunately, we cannot provide an Issue Tracker link, as this issue is only tracked internally.
The issue is currently postponed for the following reasons:
Our C++ code is not equipped to handle camera-relative rendering. So that is a missing feature, not a bug.
Adding camera-relative rendering support to our C++ code is a huge task that we are not willing to undertake at this point in time.
I can’t say I understand the response and can only hope that they understood my report.
In addition to the shadow flicker, I am fairly convinced that it has to do with rounding errors in the underlying transformation matrix calculations (not HDRP). My guess is that it manifests in spotlights more dramatically due to how the frustrum is calculated, or at least it tracks with noticeable jitter that can be seen on any transform at a certain scale.
I’ve found that when world units are kept within -1000 to 1000 that things operate smoothly as expected, but moving beyond that introduces the risk of jitter creeping in. The larger the units, the greater the jitter.