I am trying to lightmap a long tunnel with repeating segments.
Baking the complete tunnel would result lightmaps being duplicated a lot.
Is there any good way to make each segment use the same lightmap?
My current workflow is to use GitHub - Ayfel/PrefabLightmapping: Script for saving lightmapping data to prefabs. Used through the Assets tab in Unity. Place your prefbas in the scene with this script at the root. Set up your lighting and in the editor go to Assets->Bake Prefab Lightmaps. After is processed you can now spawn your prefabs in different scenes and they will use the lightmapping from the original scene. to bake the segment prefab in a separate scene.
This works for the lightmaps.
I can even bake additional objects in the scene by setting the LightmapScale of the prefab to 0 after baking it to prevent it from being baked again.
I do not have a solution for lightprobes however.
They cannot be baked with the prefab as they wont be loaded with the prefab nor can they be baked in the final scene as they dont use the correct light bounces from tunnel segments when set to LightmapScale 0.
It seems like Elder Scroll Blades uses a custom LightProbe provider (Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite 2019 | PPT)
but I would like to avoid this workaround if possible as its quite elaborate.
Would be greatfull for any simpler solutions or hints.
Thanks,
Pascal