Skip to main content
Up and Coming
October 25, 2014

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
    This topic has been closed for replies.

    5 replies

    Inspiring
    October 25, 2014
    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?
    Up and Coming
    October 25, 2014
    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.
    j.j. morris - tekrok - https://share.oculus.com/app/tekrok
    GeraldAuthor
    Up and Coming
    October 25, 2014
    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 :)
    check out my Mobile VR Jam 2015 title Guns N' Dragons
    GeraldAuthor
    Up and Coming
    October 25, 2014
    setting the shadow quality to low solved the issue for me!
    check out my Mobile VR Jam 2015 title Guns N' Dragons
    Participant
    November 3, 2014
    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.