Search Unity

Baked lighting disappears with addressables 1.1.5

Discussion in 'Addressables' started by RobbyZ, Jul 25, 2019.

  1. RobbyZ

    RobbyZ

    Joined:
    Apr 17, 2015
    Posts:
    38
    When I attempt to load a scene in a standalone build or in Packed mode in editor, the baked lightmap vanishes:

    upload_2019-7-24_21-34-48.png

    Loading in virtual mode seems to work fine:

    upload_2019-7-24_21-34-59.png

    Unlike prior reported issues, all the maps in the baked list appear to be loaded okay according to the preview images. They just don't show up in-game.

    Two things that do change are Enlighten/Progressive setting and LightingDataAsset setting -- however, I don't think these would be needed during runtime...?

    upload_2019-7-24_21-35-41.png

    upload_2019-7-24_21-35-30.png

    Each spot light is set to the same settings, using mixed mode in Enlighten with Baked GI in shadowmask lighting mode. Realtime GI is not enabled for this scene. Unity version is 2018.4.2f1 LTS with Addressables 1.1.5. Both the scene and its lightmaps have been enabled for the addressables system, with bundles packed separately per asset. I have tried with LightingData.asset both included and not included in addressables with no change.

    upload_2019-7-24_21-44-51.png

    My loader code looks like as follows:

    Code (CSharp):
    1. AssetReference levelToLoadReference = GetAddressableSceneReference(levelName);
    2.         if (levelToLoadReference != null)
    3.         {
    4.             AsyncOperationHandle loadScene = Addressables.LoadSceneAsync(levelToLoadReference, LoadSceneMode.Additive);
    5.  
    6.             yield return new WaitUntil(() => loadScene.IsDone);
    7.         }
    8. SceneManager.SetActiveScene(SceneManager.GetSceneByName(levelName));
    9.  
     
  2. RobbyZ

    RobbyZ

    Joined:
    Apr 17, 2015
    Posts:
    38
    So I think I managed to resolve this by switching to manual shader stripping for the lightmap under project settings > graphics > custom lightmap mode (copying from one of my game scenes).
     
    fiezi and phobos2077 like this.
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    You can submit the bug from Unity Editor. I think Addressables should work by default without a lot of tedious settings and hacks.
     
  4. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    350
    Your comment saved me from a few extra hours of pain! I had a strange issue where I loaded a scene in additive mode and then switched to it using SetActiveScene. The target scene had specific lighting settings that should be applied when I set it as active. But after I've moved this specific scene from "In Build" to addressable bundle - these lighting settings stopped working. I was pulling my hair out until I've switched shader stripping options to Custom and checked only the things that my scenes used manually.

    Real shame that Addressables package doesn't solve this issue automatically. I can see a large portion of users stumbling upon this at least once.
     
    fiezi likes this.