Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Light probe bug with load scene additive

Discussion in 'Global Illumination' started by Rodolfo-Rubens, Aug 20, 2019.

  1. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,103
    When loading scenes additive, the light probe data from a scene that was unloaded stays in the world.

    I tried, setting the new scene active, tried putting a light probe group in the new scene (even though I don't need), but nothing prevents the old light probe data from affecting the new scene.

    Is there any workaround for this?

    version 2018.3.12f1
     
    Last edited: Aug 20, 2019
  2. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,103
    We got it fixed by making a backup of the LightmapSettings.lightprobes where the lightprobes got messed up, and then restoring it when we reloading this level.
     
    michwisz and thefranke like this.
  3. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    90
    Hey Rodolfo-Rubens,

    so what you encountered is the default behavior: Since we do not support merging/unmerging of LightProbes from additive scenes, whatever the main scene carried is being transferred to scenes that were set to active. If an active scene is unloaded, one of the remaining ones becomes active and takes over all the probes, which is why they stick around.

    I see you solved your issue though!

    Cheers
     
    Rodolfo-Rubens likes this.
  4. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,103
    Hi thefranke

    Thinking about I can understand why this is the default and how this could be useful.

    Thanks for replying, everything is working now!
     
  5. michwisz

    michwisz

    Joined:
    Mar 15, 2018
    Posts:
    1
    Hi Rudolfo-Rubens, I've recently faced very similar problem - I'm working on a project which had to be dispersed into a couple of scenes (too many objects, lightmaps became too big to bake everything on one scene). So I've made a system which is loading scenes asynchronously according to the player position. And there comes the issue - when I load another scene, old lightprobes get affected by the new ones (form the newly loaded scene), and this makes some dynamic objects look very dark (looks like the new ones totally overwrite the old ones). Could you write something more about your workaround of the issue? Thank you in advance!

    Cheers
     
  6. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,103
    Hey @michwisz, all we are doing is on the beginning of our level (right after setting the new scene loaded active) is this:
    LightmapSettings.lightProbes = null;

    Every time we go from the main menu (which has lightprobe data) to any other level that doesn't have lightprobe data it was leaving the lightprobe data from the main menu.

    Maybe in your case, before you set the new scene active, cache whats in the LightmapSettings.lightProbes, then after setting the new scene active you could insert the cached lightProbes onto the existing one somehow?
     
  7. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    369
    I’ve found a work around for this issue and have incorporated it into my current project. I’m loading all my scenes additively and my lighting from light probes is correct.

    The solution is a bit complicated, but gets the job done. Since this is a long standing issue with Unity, I’ve been thinking about packaging it up and providing it as an asset on the store.

    I know that Unity added in merging light probes from different scenes in 2019.3 So this solution would have a limited run and audience.

    Just not sure how much Interest there would be for this sort of thing.
     
    Last edited: Nov 12, 2019
    Rodolfo-Rubens likes this.