After reading some literature about lighting and asset bundles (I’ve attached a few links below), I couldn’t get the lighting from a scene (or even a prefab) from an asset bundle previously uploaded to a server.
After baking the scene in my AssetBundle builder project I have something like this:
I’ve played with different options from “Shader Stripping” switching from “Automatic” to “Custom”, clicking on the “Import From Current Scene” button, enabling “Baked Non-directional”, “Baked Directional”, “Baked Shadowmask” and “Bake Subtractive”, switching also between those lighting modes in the lighting tab.
I don’t mind getting the lights from two different scenes or from two different prefabs (it would be better for me to get it from prefabs, but it could be both options).
I’m using:
Universal Render Pipeline (using most of the materials with shader Universal Render Pipeline/Lit) Unity 2020.3.0f1
I’ve been reading those links but I don’t know which one could be the problem that causes this. Can anybody help me with this?
Thanks!
P.S. I wasn’t sure if I should post this into this subforum instead of lighting.
If you want to bake in the prefab then you need to have the same settings in both projects, the one where you baked and the one where you load the bundle. Specifically the Lightmap encoding setting and the included shaders in both. I do know it works because we do the same, bake prefabs, assetbundle to server and load in a different project, and with the Ayfel tool you pointed out
I’ve just done an identical copy of the project and downloaded the AssetBundle using the PrefabLightmapping from Ayfel but it still happens the same thing. Do you have any kind of compression when you build the bundles? Could be related to the weight of the AssetBundles?
I’ve tried saving the lights into the prefab and exporting the AssetBundle into a new empty project, and the lights are correctly shown. But if I try to instantiate the prefab after downloading it from the AssetBundle the lights are totally corrupted.