I posted this same bug a year ago when updating to Unity 2021.3 and got no replies. I updated to 2022.3 (HDRP 14.0.8) and it’s still present. I don’t experience it with 2020.3.
When a scene has a lot of lights (> about 30 point lights), shadows flicker. A lot. This is in both scene view and game/play mode. This video shows the problem.
Does anyone else have this? Just me? I’m sure I have a setting messed up somewhere. Would be great to have any kind of pointer. Happy to post any info that would be relevant.
Also… this is my third frustration post today about 2022.3. I’ve used Unity since 3.x and only posted 10 times. I completely understand bug, quirks, and annoyances-- but every release, Unity is more broken. I try new Unity versions on personal projects before using them on professional projects. As of now I’m recommending my company stay on 2020.3 because of bugs in the last two LTS versions.
I don’t have my HDRP project open right now - but basically you need to check the settings in your HDRP asset to allow enough simultaneous lights. Also side note, if you have 30+ point lights, I’m assuming they are not real-time shadow-casting.
Thanks for replying! I had set my max light count well above what I needed. They are real time shadow casting lights. In build, I have a culling system. Flickering is annoying in scene view while editing, but the frustration is from behavior changing version to version and not being able to figure out why. Of all my 2022.3 problems, this was the one I was most sure was simply not finding the right setting.
After some trial and error, I’ve found that increasing the Light Atlas Resolution removes flickering. So for anyone who comes across this in the future, you can add up your shadow-casting light resolutions, and make sure they will fit in the Light Atlas size you pick (see image below for setting location). This is the documentation. https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@14.0/manual/Shadows-in-HDRP.html
I’m still trying to find all the parameters. If I add the more lights than fit in my atlas size, it flickers at close range, but there’s a distance threshold beyond which the flickering stops. But I don’t know what that distance is or where to change it. Maybe the light’s shadow resolution halves at some range? If anyone knows, that would be very useful information.
If you have your own culling system going, maybe you can set the lights to non shadow-casting in the editor, and enable shadow casting for the nearest X lights to the camera as part of your culling system.
If you have reached the limit then it may be a case of combing the light fall or multiple lights in a different way, instead of 1:1 representatives, like an area light for multiple low priority lights.
You can only have 24 lights per 8x8 tile, it Will just cull otherwise or behave weirdly.