Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Gerald's avatar
Gerald
Expert Protege
11 years ago

performance hit with multiple shadow sources

my game runs fine with one directional light and 2 lights as shadow sources - full 75FPS. but as soon as I turn on that 3rd light it goes down to 37.5 FPS (very stable) and remains there even when I turn on 5 other lights with shadows.
when I play the same scene in the editor I stay above 80 with all lights turned on!

I do not know how to solve this - anyone got an idea what might be the reason?

build is Unity 4.5.2 and SDK 0.4.3

5 Replies

Replies have been turned off for this discussion
  • It sounds like the extra shadow pass is making you miss the 13.3ms deadline. It should show up if you attach the profiler. Can you mark the directional light as "not important" and/or simplify your shadow quality settings?
  • I have run into the same issues recently and I wanted to keep all my light sources with shadows. So the solution that worked for me was, Bake almost everything to light maps except dynamic assets. After bake, turn off all lights except one, choose one main directional light to maintain your shadows (Hard or soft). Create a layer called character lighting or something like that. Set your light, your characters and dynamic assets to that layer.
    My scene now looked identical but I went from 45 frames back up to 80+ . Also look into your audio settings and compress what you can, I gained another 10 frames there.
  • Gerald's avatar
    Gerald
    Expert Protege
    thanks vrdaveb, will have a look and report back.

    jmorris - sadly I can not bake my lights since none of them are static. but I can see where I cut my passes shorter :)
  • Gerald's avatar
    Gerald
    Expert Protege
    setting the shadow quality to low solved the issue for me!
  • Are you using the Forward or Deferred renderer? Using deferred I've had good luck with several dynamic shadow casting point/spot lights. You can tell how much of a hit you're taking by looking at the stats in the game view and looking at your tri/vert counts. They will go up dramatically as you add lights.