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.
618 stars 88 forks source link

Baking lightning on a prefab overwrite other prefabs lightmaps #52

Closed EmptyBottleInc closed 2 years ago

EmptyBottleInc commented 2 years ago

Hi I don't really know if I'm trying to do something the script is not supposed to, or if I'm missing something.

I used this script to bake lightmaps on a level of my project which is loaded at runtime, and I didn't got any issues. But, once I bake another level, the lightmaps of all the previous are overwritten. I think it's because I use the same scene to bake all the levels, but if so, should I create a scene for every levels I need ?

Ayfel commented 2 years ago

Yes, that's the issue, since the lightmaps are "linked" to a scene, another thing you can do is bake and then move those lightmaps somewhere else in your project, because the new bakes will only override them in that specific folder where they get created

EmptyBottleInc commented 2 years ago

It works, I can actually move the lightmaps in another folder, I didn't think in that way. Thank you for your quick help.