Search Unity

Using Lightmaps from Multiple Scenes in One Scene?

Discussion in 'General Graphics' started by ZackLaznick, Jan 5, 2015.

  1. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    I have an issue with building a multiple scene setup GI data in a Asset Bundle instead. I'm able to make an Asset Bundle with the data, but it gets built in the game anyway. Here's more details about the issue. Anybody had success doing something similar?
     
  2. Deleted User

    Deleted User

    Guest

    v5.4.2f2: We are having the same/similar problem as the original poster:

    upload_2016-11-22_18-37-24.png

    1. create "RoomScene" (no GI bake)
    2. create "destination_02" (light map baked)
    3. run "RoomScene"
    4. SceneManger.LoadLevelAsync("destination_02", LoadSceneMode.Additive)
    ==> Scene 2 appears black and white in editor and at run-time

    Note: While in editor, if we set "destination_02" to be "active" (via menu), in editor/play looks fine (but not on Android).
    upload_2016-11-22_18-40-56.png

    Note: if we view the Lighting inspector, the lightmap is from "destination_02" and looks fine.

    I saw one very complex solution to the problem and another that suggested Lightmap tiling and offset is the key. But, both of these seem like far too much effort. Do we need to set the loaded scene as active to make it work? (makes no sense to me)

    NOTE: If we change GI to Directional, the problem goes away.

    Any updates or suggestions?
     
    r137 and mbbmbbmm like this.
  3. Deleted User

    Deleted User

    Guest

    Update: If we insert a SceneManager.SetActiveScene() on the second scene, the problem goes away. I assume this "fix" would not work if we loaded more than two scenes.

    Update: If I bake GI for the RoomScene, the problem goes away.

    So, it's possible that when the first scene is non-baked (lightmap index = -1) and you add a baked scene, this causes the problem.
     
    Last edited by a moderator: Nov 23, 2016
    xucian, devotid, r137 and 1 other person like this.
  4. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    I can confirm this is still not fixed in 2018.3.13f1.
    But baking the lightmaps for the second scene worked! I needed to mark the directional light there (which I don't use) as Baked to have something to bake. Thanks!
     
  5. Bshsf_9527

    Bshsf_9527

    Joined:
    Sep 6, 2017
    Posts:
    43
    Open the Lighting Window select BakedLightmaps tab ,delect the reference of Lighting Data Asset ,and back to Scene tab pulldown the toggle beside Generate lighting button ,select "Clear baked Data", with these operation you can delect the reference of lightmap data towords the specific scene.