Hi, I am building a game world in Unity and used point lights as torches to light up the area. I have a few problems. By default, the lights are set to “auto” however I found that the lights were not always on when I needed them to be. I then changed all the lights to important however my frame rate dropped significantly. (Note: I have over 100 point lights). Currently, I am using realtime GI for the sun while the torches are using baked GI. What can I do to optimize the game better and what are the best settings I should use?
I looked into some settings such as pixel light count but are there any other things I can do to improve performance? Thanks in advance.
Do you need to see all the lights at once? If not, you can disable them when far away or change them to have less computational impact. Have you looked into vertex lighting? It might look ugly at first glance but it’s a good solution for distant objects when you want a smaller impact. A while back there was a whole fiasco about blending Baked Lighting and Realtime based on distance, a functionality covered by Beast, but was unable to make it to Unity 5. I’m not sure if any progress was made on this, but last time I checked it was still delayed to a further version of Unity.
I don’t need to see all the lights at once. I tried limiting the clipping distance on the camera and that seemed to help. By disabling it, do you mean make a script that would destroy the object when it is far away? I will also look into vertex lighting, thanks.
Not necessarily destroying it, simply disabling the light component with .enabled–you could also find areas where the lights are close together and dynamically assign larger lights to cover areas of light, instead of each one separately. I’d also recommend taking a look at the Profiler if you haven’t already!