Hello, I have a Unity project created in URP. I have around 150 spotlights and 2 directional lights simulating the sun and the moon.
I know it’s a lot of lights, but I have a day and night cycle where the lights turn off at a certain time and then turn on again at another time, so using baked lights was complicated.
I’m using the Forward+ renderer, which theoretically has a limit of 256 lights. I have also tried the Deferred renderer, but I’m experiencing the same issue with both renderers, and I don’t know why. I’m using Unity 2022. Here’s a video showing it.
I thought it had something to do with occlusion culling, which would render the lights when they were in front of me, but that wasn’t the case. The lights’ importance is also set to “Important,” but none of this changes the behavior.
Is this on windows?
Did you try dx12 instead of dx11?
If you are under the limit and it gives issues, make a bug report so it can be fixed.
After you’ve done that, some personal tips:
Use 1 directional light for sun and moon. Just switch it at midnight to start casting moon shadows or something.
You can still use baked light for the spotlights when using mixed lights. Definitely a lot better than a crazy amount of lights.
Perhaps you are exceeding the per-object limit of additional lights in the quality settings?
try turning it up or spearing youre lights apart so that the maximum amount of lights casting on each object in your scene does not exceed the max value in the quality settings
This is/should be ignored by forward+ since it doesn’t have this limit
The video you mention is not showing up for me, can you post a link to it? Which platform are you seeing this on?
Doing some necromancy here in case somebody sees this, and since this is one of the first results when searching “unity urp lights flicker”.
It could also be due to the Camera’s Near Plane being too small. Try setting it to 0.1
Happy coding