Updating Lightprobes during runtime (LightmapSettings.bakedProbes) doesn't work anymore after Unity 6 Upgrade

Hello!

So we have this setup where the user can switch off the lights in a scene.
We are using the Built-In Render Pipeline.

What it does in a nutshell is the following:

  1. deactivate light GOs (Mixed or sometimes even realtime lights)
  2. Swap baked lightmaps
  3. Swap Cubemaps of Reflection Probes
  4. Swap Lightprobe Data (using LightmapSettings.bakedProbes = something)

After the upgrade to Unity 6000.0.31f1, everything seems to still work except the Lightprobe Part, which makes all dynamic objects look like crap after switching off the lights (they are weirdly bright contrary to the rest of the room, so apparently the switch of the Lightprobe Data doesn’t work.)

We pretty much followed this tutorial (incorporated into our already existing software and scripts)

Does anyone know a quick fix?

I know that there have been a bunch of upgrades to the lighting but having to rework all the rooms is a bunch of work that we didn’t think we would have to do for every room right NOW, so it would be cool if anyone would know a quick fix to make our setup work again :((((

Thanks!!! <3

Try calling LightProbes.Tetrahedralize() after swapping the probes. Does it make a difference?

Hello and thanks for the answer! :slight_smile:
It seems like we’re already doing this!

This is the code snippet containing the lightprobe stuff btw:

// switch light probes
            if (isActive)
            {
                LightmapSettings.lightProbes.bakedProbes = roomSystem.Room.LightsOnLightProbes;
                if (roomSystem.Room.LightsOnSkybox)
                {
                    RenderSettings.skybox = roomSystem.Room.LightsOnSkybox;
                }
            }
            else
            {
                LightmapSettings.lightProbes.bakedProbes = roomSystem.Room.LightsOffLightProbes;
                if (roomSystem.Room.LightsOffSkybox)
                {
                    RenderSettings.skybox = roomSystem.Room.LightsOffSkybox;
                }
            }
            LightProbes.Tetrahedralize();

Then every room has a script that amongst other things has an inspector button that gets the currently baked lightprobe data for the bright room and the dark room (the sh values?)

(Button does this: LightsOnLightProbes = LightmapSettings.lightProbes.bakedProbes;
so workflow is: bake lighting, then hit the respective button for the lightprobes etc.)

Hmm. I don’t see any immediate issue here. I suggest you file a bug reporter using the built-in reporter.

Okay thanks, will do.

One other thing: we’re using packages for certain things like code and assets that are shared among Unity projects, which is also the case for the scenes and their lighting data etc.
(edited to add: these are later loaded as addressables in the build)

That shouldn’t matter for this issue, right? Or did something fundamentally change in that regard?

(Grasping as straws here :D)

I don’t see any major issue with that. Packages are technically supposed to be immutable when not being worked on, and will in some cases prevent you from modifying assets within, but as long as you are referencing these as local packages, it should be fine.

Just wanna give an Update, afer using the Bug Report Tool and communicating in the created Issue your colleague was able to figure out that NOT calling for LightProbes.Tetrahedralize() suddenly made the functionality work again, they’re still looking into it, but for anyone who has the same problem, comment that out.

Another thing that happened after the update is that the Lightmap UVs positioning on the atlases were suddenly completely different, theoretically easily fixable yet tedious as you can rebake, but I still hope that gets resolved because if not that means if you upgrade your project to Unity 6 you have to rebake all your scenes :frowning:
(or almost all of them if you have some where you visually can get away with the topsy turvy new lightmaps)

edit: typo

Just wanna give an Update, afer using the Bug Report Tool and communicating in the created Issue your colleague was able to figure out that NOT calling for LightProbes.Tetrahedralize() suddenly made the functionality work again, they’re still looking into it, but for anyone who has the same problem, comment that out.

Good to hear you have a workaround. It should still work calling Tetrahedralize, though, so seems there is valid bug here.

Another thing that happened after the update is that the Lightmap UVs positioning on the atlases were suddenly completely different, theoretically easily fixable yet tedious as you can rebake, but I still hope that gets resolved because if not that means if you upgrade your project to Unity 6 you have to rebake all your scenes.

There was a change to lightmap packing made in 6.0 that unintentionally worsened the quality of packing. Sounds like that’s what you ran into. We unfortunately discovered that after 6.0 was already an LTS, and we don’t make changes to packing in LTS versions, as it is deemed too intrusive. It was reverted in 6.1, so lightmaps from before 6.0 should match with lightmaps from 6.1+.

Ohh, thanks for the insight about the atlas packing!

Any idea when the 6.1 LTS will be released? 0:-)

this month I believe