I finally figured out what causes the issues in Lumen GI and Reflections feedback thread - #48 by Yaeko - after only 4 months of pain and suffering.
Short explanation:
- If there are too many lights (Point, Spot, Rect etc.) in your world lumen will stop working.
- It does not matter if they are in view or not, just existing (and being visible/enabled) is enough.
Long Explanation (including how I got to this conclusion and how I can reproduce it etc.):
I always had a lot of “decorative” lights in my games and this never was a performance issue since only a few of them were “in view”, the others got culled even though the UE4/5 “cull distance” for lights is set to 0 by default.
So I started from scratch with my game and did “the ususal thing” and the issue did not appear since i built smaller maps. This allowed me to figure out the exact moment when this issue starts to appear, which then allowed me to go through the objects/assets that I recently added to investigate.
To be more specific, I had a small section of a level that I added which made the issue appear.
The section (Lumen clearly broken):
The section itself is nothing special, a bunch of static meshes, ISMs and lights, but lumen broke.
While going through “the possible offenders” I noticed that removing some of the lights made the issue go away, or be less visible.
This here is the maximum amount of lights I can have before the issue appears (see the lights at the wall, on the floor.)
2 more lights and you can already see lumen start to “break” on the wall to the left (in comparison, there are dark spots caused by lumen)
I then went and tested “if it is this specific area”, but no it isnt. I removed lights somewhere else in the level and re-added the ones in our “testing area”.
Removed lights in another part of the world:
“Testing Area” now working fine with all the lights being there:
At this point it was clear that I found the underlying issue, could reproduce it, but still went on to verify further.
-
When loading a level “pushes” you over the “unknown limit” of lights that lumen can handle the issue also appears. (For example: player is walking into another level, so you make it visible.)
-
Disabling the lights fixes the issue when loading levels, further verifying what I figured out earlier.
-
Giving your lights a “cull distance” (default is 0) also fixed the issue for me, as long as there are not n+1 lights within the cull distance around you. (n+1 is the amount of lights lumen can handle +1)
Conclusion:
This is a rather annoying bug, since it can appear literally everywhere without any hint to what is causing it, which is why it took me 4 months to nail it down…
This issue becomes even more problematic because Lumen means that we need more lights in general, especially if your game is not a 1:1 scale, but 2:1 for gameplay reasons (like mine is, and many others).
This issue actually goes against everything that UE5 is supposed to enable, which is “larger worlds”, since having larger areas also means that you have more lights in general, which will break lumen at some point. (Remember: I reached the limit while actively trying to avoid it, building smaller areas than I ever would have in UE4 in the past.)
The “workaround” currently is:
- Set your lights cull distances to something useful and reasonable, the engine sets them to 0 by default.
- make sure your levels are spread out more, so that you dont end up reaching n+1 in within your culling distance.
Solution (starting point) for Epic:
Lumen should not use all the lights it can find for its GI, or it should be able to handle far more of them.
I am well aware that this is not a trivial issue, but this needs to be sorted out.
Answers to some questions that might have come up, regarding my lights:
Q: Why do you have so many lights instead of just scaling them up?
A: For performance reasons. The game has dynamic light sources (the lasers) which have relatively large attenuation radius (radius = laser length/2), so the lights need to have smaller ones to keep the performance in check - its simply a trade off.