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.
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.
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.
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!
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?
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.
Funny enough, Unity decided to break customer’s current feature.
In my case, I want to unload a scene and its light probes then load a new scene with its new light probes.
It does not make sense to unload a scene and keep its light probes.
Hopefully it will be fixed by this issue:
This IS NOT fixed - even thought the issuetracker says it is.
Unity 2019.4.8f1.
Trying with the working without luck… Lightprobes from previous scene comes stays permanent.
EDIT:
The correct answer would be to read this, and call LightProbes.TetrahedralizeAsync(); after loading a scene async.
Thank you ! I had the issue because I was going from scene A to scene B and the scene B was taking the lighprobes data from scene A.
I did that : LightProbes.TetrahedralizeAsync(); at the beginning of each scenes.