Performance - High object density and dynamic lights

Hi,

I’ve been playing with a couple of paths to enhance performance in a project that contains well over 100 objects per room, half-dozen rooms visible (think corridor) at a time, and dynamic lights within relatively small rooms. (think about a naval vessel with dozens of valves and consoles…)

Combining meshes, culling parts of the scene at a time… those mostly did the trick, however I hit a problem.

Because there are so many objects and because I need to switch between “red lights” (eg. night time) and “normal lights” (day time), vertex lighting just doesn’t cut it. Boosting the Pixel Light count to >20 in order to make it “acceptable” kills the performance, and the same happens if I use LightRenderMode.ForcePixel of course. There can be as many as 5 point light sources per room so you can see how draw calls can increase fast. The ambient light color is pretty dark too, which is essential to the atmosphere.

Now, maybe I’m missing something but I cannot use the Beast to do lightmaps as I dynamically switch the color of the lights intensity range when I switch between red lights and normal lights.

Are my only solutions:

  • Remove “red lights” completely … thus shake and bake everything (sic)
  • Reduce number of lights so Pixel lighting is performance-manageable
  • Play with the range of each light to reduce draw calls, add 1 long range light to act as an “ambient” light
  • Ray-traced lights, possible? The cramped environment creates unneeded draw calls from objects behind walls… ect

Any input is greatly appreciated.
Thanks

This is being discussed elsewhere – you can bake different sets of lightmaps and save them in the project after each bake. Then at runtime, load the lightmaps and realtime light settings you want to use.

http://forum.unity3d.com/threads/63519-Beast-day-and-night

Thank you DocSWAB, this might do the trick.

From what I know, Beast only bake lights that are created in the editor and not at run-time… which is unfortunately my case. Is this correct? This means I need to “re-create” all my lights manually within the editor and bake them after, right?

Yup, Beast is a preprocessing tool only. No runtime baking.

You can, however script the lightmapper in the editor, so if you have to do a lot of this, you can speed up your pipeline during development. That’s my next step with my lightmap swapping system.