What is the best way to do fully dynamic lighting?

I’m working on a game that takes place in a average sized suburban house, I’d like to have the lights dynamic so they can be turned on and off, but with about 20 lights, I get really low fps, is there any way to optimize this setup?

The problem is most likely all 20 are casting dynamic shadows and none of the lights are being culled. Either turn most of the shadows off or use some kind of volume trigger to turn shadows of specific lights on/off when needed not needed.

My day night cycle only uses 2 directional lights, one for the sun and one for the moon. When either one goes below the terrain I turn off shadows for that light to improve performance.

The same goes for if I had a large house with dynamic directional lights in each room, shadows would be set to off by default but walking into or close to a room would switch them on.

I know it sounds like a ball ache but I don’t see how your going to have a level filled with dynamic shadow casting directional lights and still have good fps otherwise.

So I have to physically tell the lights to stop producing shadows? Is there not a system to do that automatically like with static meshes?

Take a look at the “Dynamic Shadow Distance Movable Light” setting, under “Cascaded Shadow Maps” found on each directional light’s settings. Each one can be set independently, so your sun light can have quite a large number, but the ones inside the house can be set quite small so you only see the shadows when you get close enough.

Isn’t the directional light only used for the sun? None of the point lights or spotlights have the Dynamic Shadow Distance Movable Light in their settings, or am I missing something?