Hello guys, we need help.
I have a mayor issue with the lighting pipeline of Unreal, when it comes to lighting with movable lights. I have been stuck on this for maybe 2 years now, and never found a solution.
In this game world, houses get randomly spawned on a map, and each house needs about 4 - 5 dynamic lights. They can’t be static, or stationary, because light is not baked in this game, due to level streaming and for the ability tu turn them on and off.
Some points here and there:
- They need to be shadow casters, otherwise their light clips out of the house and into other rooms.
- Their attentuation radius, needs to be larger to light up the whole room, otherwise corners of the room stay dark.
- I can’t place more smaller lights instead, because it doesn’t really make any difference - room with 4 smaller lights vs. room with 1 large light = same performace.
- Larger lights are already spotlights.
- I can’t make the attentuation radius smaller, and use post process effect, like exposure instead - the external environment has weather that the player needs to see, such as skylight effects.
- If I set r.shadowquality from 1 to 4, makes pretty much no difference on the performance, except for 0, where it goes from 50 FPS to 110 FPS. Though, shadows are off.
- If I set shadow resolution and other settings inside of the light, makes pretty much no difference.
- The scene is pretty low poly, nothing too crazy, about 1000 draw calls and 500k triangles drawn.
- I could turn the lights off upstairs when the player is for example downstairs, though still at least 3 lights would have to be active, -40 FPS anyway.
Basically, if I add one light into the scene, which a room in a hut with few models, it eats 15 FPS away. How is that possible?
The card is GTX 970, 12 core intel, etc etc.
The room, for illustration looks like this:
The only solution that came into my mind, is for the light to stop updating it’s shadow maps every frame. I searched around a bit, and found about 3 posts where Unreal developers are stating that this would be actually a solution.
“Each movable light should cache its shadowmaps as long as it isn’t moving. We could even separate static objects from ones that are moving and re-rendering the moving ones every frame, that way the ‘locking’ is automatic.” Such as here:
We have a programmer on the team, is there a possibility to change that in-engine? I am more of a tech art myself so I wouldn’t be sure. We build from source. Or any docs avalaible somewhere?
Thanks so much for any input.