laurenth-personal / lightmap-switching-tool

Tool that allows switching different baked lightmap sets on a unity scene at runtime.
MIT License
657 stars 88 forks source link

Still supported in 2021? #35

Closed khjeldnes closed 1 year ago

khjeldnes commented 1 year ago

Hi! So, this tool looked promising, and seemed to do what it should. However, when I bake the 2nd and 3rd lighting scene in your example map, then unity will remove the existing lightmap data for the static scene, and move the reference to the last baked lighting scene. So, I end up with lighting 1 and 2 pointing to data located in lighting 3. So, when I rebake your example scene, I get Lightmap-1_xxx only in the last bake (lighting 3) Is this a new behavour from unity that breaks your script? I also get a warning on "Store", where it's recommended to instantiate a scriptable object instead of creating a new.

Do you have any solutions? Thanks! Kjetil

laurenth-personal commented 1 year ago

Hello, Thank you for reporting these issues. I have indeed not tested the tool actively on 2021 and 2022 releases of unity so I am not sure if anything changed. There used to be a line in the script explicitly there to remove the reference to the lighting data from the previous bake in order to avoid unity detecting its existence and delete it. Maybe I broke that in an update. I can run some tests but I might not have time before next week.

I can probably fix the warning easily but it should not cause any issue with the functionality.

Le jeu. 24 nov. 2022 à 20:20, khjeldnes @.***> a écrit :

Hi! So, this tool looked promising, and seemed to do what it should. However, when I bake the 2nd and 3rd lighting scene in your example map, then unity will remove the existing lightmap data for the static scene, and move the reference to the last baked lighting scene. So, I end up with lighting 1 and 2 pointing to data located in lighting 3. So, when I rebake your example scene, I get Lightmap-1_xxx only in the last bake (lighting 3) Is this a new behavour from unity that breaks your script? I also get a warning on "Store", where it's recommended to instantiate a scriptable object instead of creating a new.

Do you have any solutions? Thanks! Kjetil

— Reply to this email directly, view it on GitHub https://github.com/laurenth-personal/lightmap-switching-tool/issues/35, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFUMAT4LYUSMDZCTSZNOA53WJ65XLANCNFSM6AAAAAASKVYH7A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

laurenth-personal commented 1 year ago

Hello, I just tested the exact same steps as shown in the quick start video in unity 2021.3 and I didn't get any issue, no lightmap got deleted.

laurenth-personal commented 1 year ago

I have noticed Unity light probe volumes in 2022.2 support multiple lighting scenarios and blending between scenarios. This will probably be a better solution in the future than my package.