Open Ardoos opened 2 years ago
Hi, so this script allows you to set lightmaps regardless of the UVs so the code inside takes care of assigning lightmaps with the right uvs and all, so you technically can record different lightmaps in different lightmap scripts and load them independently. It is not something working out of the box but you can do it. Let me know if that makes sense. The script takes the lightmap it has reference to and loads it. So you could make different prefabs with different lighting and just use the serialized data for each to load each different lighting
Hi, thanks for the reply! I think I solved my problem, but I'm not sure why it works that way. So my idea was to:
I did it before opening this thread, because everything worked fine except 1 thing. Even if I didn't change anything _Lightmap-0_complight.exr file was different than previously baked copy. Just now I found a way to solve this problem, but it's a little annoying. To resolve this issue I have to bake lighmaps before I create prefab of an object. So basically I have to unpack my prefab, perform steps 1 and 2, then create new prefab. Somehow this way generated files have exactly same layout and everything works fine. It would be nice to find out how to do this without unpacking prefab.
Is there a way to generate lighmaps with the same UV layout? Right now when I bake lightmap again, without any changes, it looks slightly different. I'm trying to swap lightmaps on runtime and I need to generate few lighmaps with the same UV layout.