How to optimize lights in Unity

1.4k views Asked by At

I'm building a virtual exhibition platform in unity. There are about 50 stalls and I used a directional light and 124 point lights light up the scene. I didn't use any real time lighting, only baked lighting is used. But at runtime frames get dropped. when I inactivate all pointlights it works smoothly. How can I optimize lights?

enter image description here

2

There are 2 answers

0
Jayasurya On BEST ANSWER

You can improve your performance by doing the following,

  1. Add Light Probes, this can minimize the number of point lights in use.
  2. Change Render Mode to Auto, this will reduce the load significantly in your case as there are a lot of point lights in use.
  3. Apply a culling mask, make sure the light affects only the required object in the stall.
  4. Use Fake Shadow instead of using Soft Shadow.
  5. Switch to URP or HDRP.

Alternate way : Build and bake each stall separately in Blender or Maya. Then add them to unity. This way you don't need to add that many point lights and bake.

0
Michael Urvan On

124 Point Lights that is a LOT of lights, but you could use Deferred Rending path on your Camera (but if you need VR I'm not sure its supported).. You can set the Point Lights to be Baked, use Baked lighting and light probes instead. Set everything that won't move in your scene to be Static objects (very top right corner box). also remember to go into Rendering -> Lighting and Generate the Lighting and look at the options presented there. Light probes video