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.
655 stars 91 forks source link

Lightmaps not working in build with Generated Lightmap UV's #48

Closed Eldirfar closed 3 years ago

Eldirfar commented 3 years ago

I don't know if it's a bug in Unity or not. But when I have generated lightmap UV's in mesh lightmaps are not working in build. image

I'm instantiating prefab in runtime and have disabled static bathing. I also prepared a sample project. It is possible that Unity generated different UV's in build than in Editor?

I'm using Unity 2020.3.17 and URP PrefabLightmapping.zip

Ayfel commented 3 years ago

So the repo you shared had a modified lightmapping script in it, and simply changing the script to the original makes it work. so I would investigate how the modified code you added changed things image

Eldirfar commented 3 years ago

Those are realtime shadows. On the right you see realtime and baked.

Wiadomość napisana przez Ayfel @.***> w dniu 20.10.2021, o godz. 17:10:

 So the repo you shared had a modified script in it, and simply changing the script to the original makes it work. so I would investigate how the modified code you added changed things

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Ayfel commented 3 years ago

So in URP there are some strange issues that are not clear all they way to me yet, here the only thing I did was to add the baked scene to the build list and it made it work, with your modified script or the original

image

Eldirfar commented 3 years ago

Oh so probably they are not included in the build somehow? Thanks, that helps a lot.