Search Unity

Lighting gets rebuilt on every run

Discussion in 'General Graphics' started by VCC_Geek, Apr 2, 2018.

  1. VCC_Geek

    VCC_Geek

    Joined:
    Apr 30, 2013
    Posts:
    29
    We have a VR project that has a rather large scene. Every time I click Play, the lighting looks fine and everything, but after I stop it, Unity insists on rebuilding lighting - which takes upward of twenty to thirty minutes, since we have so many large models. If I turn off Auto Generate, then the light maps disappear and we have no GI or baked lighting at all. It's like as if it invalidates the light map data every time it runs. I've not marked anything as a lighting static. I do move the light at runtime, but I've tried leaving it stationary, too, and it still does it. I have several different projects that do this, but this one's the most impacted, and also the most important. Builds look fine. I'm not even sure where to start troubleshooting this one.

    Any ideas what could be causing this? I'm on Unity 2017.3.0f3. Thanks!
     
  2. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Unchecked Auto Generate option and press build button
     
  3. VCC_Geek

    VCC_Geek

    Joined:
    Apr 30, 2013
    Posts:
    29
    I believe I already tried that - it would invalidate it when I ran it, and then I would have to manually click rebuild in order to get it to build again. I'm not in a position to test right now, but I'll give it another shot and see what happens.
     
  4. VCC_Geek

    VCC_Geek

    Joined:
    Apr 30, 2013
    Posts:
    29
    Okay, so you're mostly right, BUT I had to goof around with it a bit in order to get it to go. Just in case someone else is having the same thing, what I ended up having to do (on both projects) was:

    1. Disable automatic building
    2. Rebuild lighting
    3. Run the game, and let it invalidate the lighting
    4. Rebuild the lighting again
    5. Save the scene
    6. Restart Unity.

    And that got it. Not sure why it was doing this, but I haven't had any problems with it since I did that.
     
    Minchuilla and mohammad-dabiri like this.