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.
645 stars 90 forks source link

It shows black on Android devices. #24

Closed kishorpd closed 4 years ago

kishorpd commented 4 years ago

Works perfect on Windows and was amazed by the ease provided.

My steps for repro: I have two independent Android Unity projects. I am exporting from one project and importing in other. Both projects contain the lightmapping script. Works on the Windows device[tested only in Editor with build settings set to Android ] but after making a build for Android it shows black on the Android device, only the skybox is colored, all the baked static items are black.

I have made sure via runtime Hierarchy that the script is loading correctly and that all the parameters are set correctly. Tested on all three Graphics Api : Opengl3, 2 & Vulkan. Got same results on the Android device. Using Unity 2019.4.10 (LTS).

Please see the attached images.

[ Lucky to find this repo after spending almost 6+ hours on this issue. Thank you for the great work! ]

image WhatsApp Image 2020-09-21 at 7 33 51 PM

Ayfel commented 4 years ago

Did you check the shader stripping? This normally happens in builds, check the readme of the repository for a picture of the menu item to unlock.

kishorpd commented 4 years ago

Yes, I did the Strip Unused setting right before starting in both the projects.

image

Ayfel commented 4 years ago

Try with Custom instead of automatic for "Lightmap Modes" since mobile might be stripping it regardless, you will get a dropdown and can select all lightmapping modes

kishorpd commented 4 years ago

Thank you so much!! 🤩

Here are the settings I am on, for future reference : image

image

WhatsApp Image 2020-09-21 at 10 20 07 PM