I’ve tried lighting scenarios blending recently, it’s great. But I have to create lighting scenarios for different scene lighting manually and bake them one by one. Is there any way to do all these things in script?
It is possible to bake by script, I recently suggested an API change to help with this but I haven’t updated my own setup for this yet.
I’ve always had issues trying to bake by script for a batch, but maybe APV is easier. I’ll let you know if I get a chance to fix my old script to work as a batch bake.
At minimum though it should be easy to make a list of the needed bakes so your scene can be configured, then pressing a button to bake that scene.
Thank you for your reply! I’ve found that I can get current baking set and add lighting scenario through ProbeReferenceVolume.instance.currentBakingSet.TryAddScenario("Test")
. And I’ve tried AdaptiveProbeVolumes.BakeAsync()
, it seems to bake APV only and just work fine. But after baking for one scenario, the others were infected and lost the previous baking results. I don’t know why, maybe it’s a bug or need further investigation.
It seems that AdaptiveProbeVolumes.BakeAsync()
need some time schedule.I use Lightmapping.Bake()
instead, and it works fine.
I think APV needs the setting “do not recalculate probes” when baking scenarios, the function may do this by default.