Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Problem with Realtime GI and multi-scenes in build

Discussion in '2018.3 Beta' started by metroidsnes, Dec 10, 2018.

  1. metroidsnes

    metroidsnes

    Joined:
    Jan 5, 2014
    Posts:
    67
    Realtime GI used with scenes loaded additively works in editor but doesn't work in build (Unity 2018.3.0b12). I made a sample project where three scenes are loaded from a script:

    1. "Main" scene that contains only the camera. This scene is loaded first in sync. `Single` mode.
    2. "Geometry" scene that contains a cube marked as `Lightmap Static`. Loaded sync. additively.
    3. "Lighting" scene that contains a plane marked as `Lightmap Static` and emissive material on it set to `Realtime`. Loaded sync. additively.

    Lighting settings:



    Build Settings:



    There's a `Loader` scene that has a button to load those scenes as described above.

    Code (CSharp):
    1. public class SceneLoader : MonoBehaviour
    2. {
    3.     public string Main;
    4.  
    5.     public string Geometry;
    6.  
    7.     public string Lighting;
    8.  
    9.     private void Awake()
    10.     {
    11.         SceneManager.sceneLoaded += SceneManagerOnSceneLoaded;
    12.  
    13.         DontDestroyOnLoad(gameObject);
    14.     }
    15.  
    16.     private void SceneManagerOnSceneLoaded(Scene scene, LoadSceneMode mode)
    17.     {
    18.         if (scene.name == "Main")
    19.         {
    20.             SceneManager.LoadScene(Geometry, LoadSceneMode.Additive);
    21.             SceneManager.LoadScene(Lighting, LoadSceneMode.Additive);
    22.         }
    23.     }
    24.  
    25.     private void OnGUI()
    26.     {
    27.         if (GUILayout.Button("Load Main scene"))
    28.         {
    29.             LoadMainScene();
    30.         }
    31.     }
    32.  
    33.     public void LoadMainScene()
    34.     {
    35.         SceneManager.LoadScene(Main, LoadSceneMode.Single);
    36.     }
    37. }
    Realtime GI was built from the `Main` scene (set as the active scene), where `Geometry` and `Lighting` were also loaded.

    When entering Play mode and loading scenes from the `Loader` scene, GI works as expected.



    After making a Windows build, GI in the player doesn't work.



    I tested exact same assets and settings in Unity 2017 LTS and the Realtime GI works there as expected.
    Test project: https://1drv.ms/u/s!ApyPqduXdyo-k5Ivp2IVK1RBvKDvfA

    Reproduction steps:
    - Open project in Unity 2018.3.0b12
    - Build the project for Windows. `Loader` scene should be the first scene to load.
    - Run the player. Press the "Load Main scene" button in the top-left corner
    - See that the Realtime GI is not affecting the cube
     
    Last edited: Dec 10, 2018
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    Could you please submit a bug-report, including your test project, as described in this document:
    https://unity3d.com/unity/beta/guide-to-beta-testing#tab-3

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. Please post this Case number here (in this forum thread) for Unity staff to pick up.
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Yes, a bug report would be much appreciated.
     
  4. metroidsnes

    metroidsnes

    Joined:
    Jan 5, 2014
    Posts:
    67
    Case ticket number: 1108413
     
    LeonhardP and Peter77 like this.