Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Does LoadSceneMode.Additive ignore Skyboxes?

Discussion in 'Global Illumination' started by orionburcham, Jun 30, 2017.

  1. orionburcham

    orionburcham

    Joined:
    Jan 31, 2010
    Posts:
    488
    Hi folks! I'm noticing that lights is treated differently when they're part of an additively loaded scene. Any help understanding what's going on here would be sincerely appreciated!

    A quick breakdown:
    Scene0: Loaded first. Empty scene- contains no GameObjects.
    Scene1: Contains a grid of spheres resting on a plane. In the editor, it's getting dynamic light from a skybox and directional light.

    Scene0 is always loaded first. Then, I load Scene1, either using LoadSceneMode.Single or LoadSceneMode.Additive.

    Result when loading using LoadSceneMode.Single:
    LoadSceneMode_Single.png


    Result when loading using LoadSceneMode.Additive:
    LoadSceneMode_Additive.png

    Quick notes:
    - what you see in the "LoadSceneMode.Single" image is also what I see when I view Scene1 in the editor.
    - I'm not baking lighting in either of these scenes.

    What's going on here? I haven't done lighting in Unity for a good while- I'm probably out of the loop, or missing something obvious.

    Many thanks for any help. :)
     

    Attached Files:

    Last edited: Jul 4, 2017
  2. orionburcham

    orionburcham

    Joined:
    Jan 31, 2010
    Posts:
    488
    So! I spoke with some other devs over the weekend, who suggested a workaround: bake lighting for both scenes, while both are loaded in the Editor.

    This worked - I got the expected lighting when loading Scene1 additively over Scene0 - but I'm unsure if this is the intended workflow.

    If it is, there are cases in which I might not know what which scenes to bake together. For instance: Say I have one "BaseScene", and 30 "Other" scenes which might each be loaded additively on top of BaseScene. Should I perform 30 bakes, one for each Other scene, with BaseScene also loaded in the editor? What if Some of those Other scenes might also appear with each other, or without BaseScene? Will I need to split those into several duplicate scenes?

    I'm sure there are great answers, and that I've just been out of the lighting loop for too long. :) If anyone knows better, I sincerely thank you for any education on the subject.
     
    Last edited: Jul 4, 2017
  3. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    153
    Hey orionburcham,

    first things first: Did you have Auto enabled in the Lighting settings for any of the scenes?

    Cheers
     
  4. orionburcham

    orionburcham

    Joined:
    Jan 31, 2010
    Posts:
    488
    Hi, thefranke!

    In my first post I did have Auto Generation on. By the time of my second post, I had turned Auto off, to support manually baking multiple scenes together.

    What should I be doing here? Thank you for any help. :)
     
    Last edited: Jul 4, 2017
  5. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    153
    Hi!

    I'm assuming you're watching all of this in the Editor. If you have Auto enabled, small scenes are quickly baked automatically and therefore show up as in the Scene1 screenshot you've posted. However, Auto by itself does not save generated bake data in a LightingDataAsset with the scene. That only happens once you press Bake/Build (depending on which version of Unity you are running).

    So, if you switch to Scene0, Unity throws away the baking results of Scene1 and starts baking this one (it's empty, so there won't be much to see here). Then you additively load Scene1, but since it now contains no baked data it looks like in the second shot. All of this won't happen if you bake each scene by pressing the Bake/Build button, because then the data is actually available when you additively load Scene1.

    Whether you bake them all together or independently is another interesting topic. If you bake scenes independently, they may each have their own little setting that are different from other scenes. So, let's say you have one scene that has a indirect multiplier set to 5, but all the other scenes have it at 1, then when you load them together one scene will stick out (maybe that's what you want, maybe you don't). If you load all the scenes together in the Editor, they all get their baking settings from the active scene. But this comes at one important change! For multiple scenes baked together all the Lighting data resides with the active scene, which means if you load another scene alone, it won't show up with its baked lightmaps. So to recap:
    • Load BaseScene and all Other together in the Editor and press Build/Bake: All LightingData is with BaseScene, BaseScene must be loaded so that all Other get their data, all scenes were baked with the same settings.
    • Load each scene individually and press Build/Bake: Each scene can be loaded individually, each scene has its own data, each scene can be baked with wildly different settings. May create incompatible look, may be on purpose.
    Cheers
     
    rainisto and fsidler like this.