MainScene is empty, no lighting.
Room1 is baked with lightprobes.
Room2 is baked with lightprobes.
All baking is Full (direct and indirect, no realtime GI. Using latest URP on 2019.3.11 for Android).
Scene flow:
MainScene additively loads Room1 > Room1 is set active. > Room1 unloads > Room2 additively loads, sets active.
Expectation:
We load into Room1, get Room 1’s lighting, when Room2 loads, we get Room2’s lighting.
Reality:
We load into Room1, get Room1’s lighting, when Room2 loads, we still get Room1’s lighting.
Fix attempts:
Removing lightprobes from Room1 causes Room2 to have no probes at all, black lighting on dynamic objects.
After 1’s results, running LightProbes.Tetrahedralize(); broke all lightprobe data, throwing probes all over the space and rendering insane harmonics values (super ringed, negative blacks, full whites etc.) (see gif at the bottom)
After unloading Room1 before loading Room2 causes Room2’s probes to load correctly (can see the lightprobegroup gizmos in scene view), but not actually contributing lighting to the scene.
4. Running LightProbes.Tetrahedralize(); at this stage keeps Room2’s probes in correct locations but resets their values to some default skybox gradient value by the looks of it (nothing is exposed so can’t say for sure) but does make them contribute the newly-wrong reset lighting to the scene.
Here’s results of step 2 for your amusement:
I’ve wasted the whole day trying to debug this. Please don’t suggest I put everything into a single scene to bake. What I expect is the flow I describe, as it used to be default behavior. Something changed and that’s no longer how Unity works, what is going on?
My problem almost exactly. After room 2 loads async I unload room 1 async.
Then room 2 is set active. I run LightProbes.TetrahedralizeAsync(); which eliminates room 1 light probes and correctly establishes room 2 light probes.
Only problem is all my probes are black and they make all dynamic objects black.
This is on 2019.3.7
That sounds like a bug. Could you perhaps open a ticket and add a reproducible project? I’d expect this to be the correct workflow and so it should not produce black SH or any ringing.
Impeccable timing. We run into this issue on Thursday and I’m running a task to try and find a solution today. Has this been reported as a bug yet? If not I shall need to do it, it’s entirely blocking my task…
@DanielMcPeters@AlkisFortuneFish Are you using addressables?
I’ve done multiple tests today trying to replicate this flow using offline assets in a new project, and the issues don’t surface there. Our suspicion is on addressables right now.
We are using Bakery, but I tested both Bakery and Unity’s native Progressive light mapper and in one context, both setups failed to load probes, and in an offline context, both work fine. I passed it onto our engineering team to figure out if there’s a scene loading pathway that causes it. Their initial suspicion is on addressables.
Here’s a quick script I mocked up to load/setActive/unload/load/setActive using the flow described above if it’s of any use to you. Didn’t even need to run Tetrahedralize() on the probes to have them show up during this test:
Base scene - No lighting data, always loaded.
Scene 1 - Lightmaps + Reflection Probes, no light probes
Scene 2 - Lightmaps + Reflection Probes + Light probes.
Same loading flow as yours but without the Tetrahedralize call.
All scenes set to Non-directional, Subtractive (URP no shadowmask).
Oh, there is one difference, both Scene 1 and Scene 2 have lightprobes for me.
Also, one other thing that explains why I need to call Tetrahydralize there, Base Scene had ended up with lighting data, probably from one of the previous tests I was doing trying to get this to work.
Still, the first Light Probe data loaded is stuck and doesn’t change no matter what. Just tried to make it so that the first scene is unloaded after the first scene becomes active to see if that changes anything and it doesn’t.
Also, main game uses URP Subtractive No Shadowmask but the test project just uses built-in and I’ve tested all lighting modes. No difference in behaviour, which there shouldn’t be anyway as this stuff is quite low level.
Getting this as well in Unity 2019.3.15f1, Addressables 1.9.2. The problem seems to be with Addressables. Using Addressables, if RootScene(no light probes) loads EnvironmentScene(light probes) and then sets EnvironmentScene to active light probes are black. If I load the EnvironmentScene without using addressables then lighting works as expected.
Edit: Maybe my issue is different. Calling LightProbes.TetrahedralizeAsync(); fixed it for me. Leaving this up here in case anyone else is having the same problem.
Our issue is not but we have been given a workaround. Our probe positions are the same, since they represent different environments, so the system rejects them and the old ones stick.
Jittering the probe positions a bit fixes it, until the actual fix lands.
Thanks. Possibly to clarify for others running into this with addressables, it wasn’t enough for us to Tetrahedralize after setting the active scene to the newly loaded scene. I had to also do a TetrahedralizeAsync right after awaiting the Task in the AsyncOperationHandle returned by Addressables.UnloadSceneAsync. We unload the previous scene before loading the next (additively)