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

Non directional lightmaps not working #47

Closed Eldirfar closed 3 years ago

Eldirfar commented 3 years ago

When I bake nondirectional lightmaps in runtime they are all black. With directional, everything works fine. image

Ayfel commented 3 years ago

Very strange, what render pipeline? The script is supposed to only bake non-directional, do you have the latest commit?

Also feel free to share a repo simple case to see the issue.

Eldirfar commented 3 years ago

I mean Directional Mode -> Non-Directional.

The script is supposed to only bake non-directional

What do you mean? Script have this field for directional lightmaps. [SerializeField] Texture2D[] m_LightmapsDir;

I'm using Unity 2020.3.17 and Universal Render Pipline.

Ayfel commented 3 years ago

Yes the script has an option for directional maps but some versions and combinations of Unity version and render pipeline were having issues with directional.

So just to make sure, it works only in Directional Mode-> Non-Directional? I think that might be right with URP but let me know so we can narrow it down more.

Eldirfar commented 3 years ago

No, it works only with directional.

Wiadomość napisana przez Ayfel @.***> w dniu 19.10.2021, o godz. 18:25:

 Yes the script has an option for directional maps but some versions and combinations of Unity version and render pipeline were having issues with directional.

So just to make sure, it works only in Directional Mode-> Non-Directional? I think that might be right with URP but let me know so we can narrow it down more.

— 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

Is this something easy to reproduce? If so can you provide a simple repo project for me to check?

Eldirfar commented 3 years ago

I will try to prepare something tomorrow

Eldirfar commented 3 years ago

When I was preparing a simple repro I found the issue. Lightmaps weren't applied after changing the active scene. Don't know why this occurs only with non-directional ones. Anyway, problem solved. Thanks for your support.