Search Unity

Ambient light (Skybox mode) gets darker after loading a scene in play mode

Discussion in 'Universal Render Pipeline' started by Xtro, Aug 28, 2021.

  1. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    450
    Hello.

    My project uses URP and I have several lighting related problems but I want to start asking from the simplest question.

    My scene "MainMenu" is set to these settings:

    Auto Generate Lightmap = disabled
    Baked GI = disabled
    Skybox Material = Default-Skybox
    Environment Lighting Source = Skybox

    Since the equator color of the default skybox is white, vertical surfaces of objects looks bright due to white ambient light.

    This is true in edit mode.
    This is true in play mode too if I just start play mode using this scene.

    The problem is... if I start the play mode from another scene "RunOnce" and a script in this scene loads the "MainMenu" scene (not additive), ambient light calculation isn't affected by the skybox and the vertical surfaces looks very dark.

    RunOnce scene doesn't have any 3D object or light object in it. It's just a bootstrap scene which loads MainMenu scene.

    This problem only happens when the Environment Lighting Source is set to Skybox. When it's set to Gradient, the problem disappears but obviously this is not a solution for me because I want the dynamic skybox ambient color calculation in my scene.

    How it looks in edit mode:
    upload_2021-8-27_21-17-51.png

    How it looks in play mode when starting from this scene:
    upload_2021-8-27_21-19-44.png

    How it looks in play mode when starting from another scene and the other scene loading this scene:
    upload_2021-8-27_21-20-37.png
     
  2. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    740
  3. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    450
    Wait WHAT? That actually worked but it doesn't make sense at all. I don't even have a baked light in the scene. The only single light is set to Realtime. This is clearly a bug.

    Generating the lighting data operation also created large lightmap files for the terrain. I don't need such things. I deleted them and kept only the lighting data asset. It's kind of a workaround solution but this is clearly a Unity bug. Why the ambient lighting works without having the lighting data when the scene is first loaded scene and why is doesn't work when the scene is second loaded scene.

    Also, I noticed that if I build the game and run it without having the lighting data asset, it still works fine. So the "lighting data" related bug is only happens in the editor.

    I'll report this.
     
  4. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    450
  5. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    740
    I have reported similar issue a while ago (Case 1350731), but Unity said it is "By Design". Sadly.
     
  6. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    450
    Yea. They said "By Design" for some of my reports which are OBVIOUS bugs. So sad :(
     
unityunity