I have a outdoor village on a terrain with 70+ point lights. They are on a day/night cycle so when dusk comes they gradually come to full intensity and when dawn comes their intensity goes to zero. My question is when the intensity goes to zero are they still consuming cpu resources? Should I deactivate these lights during they day when they are not needed? They are all set to real time with no shadows, should I changes these to mixed? I guess I’m looking for the best was to handle all of these lights.
@Nitrox32
Okay. Is this for mobile or PC?
PC
@Nitrox32
Sorry I took so long to reply.
Okay, from what I know, if you deactivate/switch off the lights, it’s supposed to use less cpu or none at all. And if you lower the intensity of the lights, the cpu is supposed to use less cpu and resources. I hope that helps.
In general, if a light source is enabled, it costs performence. So yes, you should disable all lights which are not needed during the daylight phase in your game. Intensity does not matter, if it’s either 0.1 or 1000, the pixels still have to be calculated and illuminated. Also the question is, if you really need so much lights to sell the mood. Maybe you can fake the light sources in the distance with emissive materials (glowing windows) and billboards (sprites of lamp shine). Also favor spot lights over points lights where you can. Combine lights which are close to each other.
This isn’t entirely true. A light with the intensity set to 0.0 costs about the same as a disabled light component. There might be some small overhead cost difference between the two, but I suspect you won’t be able to profile it. I would just try it with zero intensity lights and with the light game object or components disabled and see.
Maybe, but probably not? If you had lights with shadows, then light maps have some benefits. But if you’re going to want to change the intensity you have to use the shadowmask variant, and really these are more expensive than unshadowed real-time lights because mixed lights are real-time lights still. It’s just the shadows on static surfaces that there’s any benefit to using mixed over real time if you need to support dynamic light intensities.
Basically, no. Don’t use mixed.
This is what most AAA games do. Any light that’s far enough away / small enough is just an additive sprite. Games like GTA V do this so they can have cities with what looks like thousands, or even millions of lights. It’s all fake.
Unshadowed spot lights are technically more expensive than unshadowed point lights, on both the CPU in total and GPU for affected pixel. But they can be more easily confined to a smaller area so them being “more expensive” can be compensated for, and they’ll end up being less expensive. For shadow casting lights, spot lights are likely always less expensive than point lights.
Thanks everyone. I’ll take a look and try these suggestions. I’m sure I’ll have more questions once I dive into this a bit more.