Switch Light Probes Data at Runtime in HDRP

Hello,

In my project I load two scenes additively with different light probe data at the same point in space.

Is there a way to switch light probe data at runtime without impacting FPS too much and without unloading one of the two scenes?

Tracks I have explored:

  • Light probes off: the object will pick the ambient probe of the last loaded scene only, which is not the right one usually.
  • Light probe off + ambient probe off: my objects have no indirect light information whatsoever and that looks just disgusting.
  • Light probes on: the object is not picking the right light probe info when the second scene is loaded. Disabling the other probes and tetrahedrizing doesn’t work. This problem is independent on whether or not I have configured light layers correctly.
  • Light probes custom provided: No idea how that works, found little to no documentation about this.
  • Use enlighten (deprecated): I’ll be stuck with Unity 2019 and HDRP 7 and I can’t even manage to get it working properly. I’m trying to avoid that.
  • I found this: https://github.com/laurenth-personal/lightmap-switching-tool/tree/2019.3. Haven’t tried yet, would that work for light probes light information?

Does anybody have any other track I could explore? I’m kinda stuck right now. I feel like only a proper realtime GI would solve my issue.

I may have found a way, but this feels hacky.

I added a public LightProbes lightProbes attribute to an object in the scene that is updated onValidate if a boolean is set to true, after assignation, the boolean is set back to false. (basically a button).

When loading the scene I can then choose between my lightprobes data using LightmapSettings.lightprobes = lightProbes.

I’m interested why you need two sets of light probes with all the same positions? What’s the use case of this?
Normally, you would use Unity - Scripting API: LightProbes.TetrahedralizeAsync

Personal advice: Enlighten works fine with 2019.4 and HDRP 7.5.1. So it’s maybe worth trying it.

Yeah well it’s because of the particularity of my project :slight_smile:

It’s a game set in multiple dimensions and they can intersect at the player will. Which mean at some point I display both dimensions and each one of those has different lighting values at the same point. A bit like that:

6622888--754618--DissolveTheWorld_Part02_11_AryATSOS_02.gif

This is Ary And The Secret Of Seasons, not my game.

Tetrahedrize is different, It’s used when adding probes to an existing set of probes, usually not a the same locations.

I tried Enlighten but since I found a solution that could keep me on track with latest update and not use a deprecated solution I’ll stick with it.