Pack the bundle containing the scene (and only the scene) with the AssetBundleBrowser
Load the scene at runtime
Everything is working smoothly. My scene is even loading. However while loading it’s triggering errors :
Failed opening GI file at relative path: 'e8/e8285ee09500dd75eb204e5f2853b59b.rpc.sse'. Absolute path: 'archive:/BuildPlayer-CampMap-DefaultCamp/Lightmaps/e8/e8285ee09500dd75eb204e5f2853b59b.rpc.sse'.
Failed loading Enlighten probe set data for hash: 0xe8285ee09500dd75eb204e5f2853b59b
Error adding Enlighten probeset e8285ee09500dd75eb204e5f2853b59b: Data not available.
The ASsetBundleBrowser shows that the data should be within the bundle.
Hmm, well just from the initial look everything should work correctly. Hmm, so first thing I would suggest is to run
<Unity_Install_Path>\Editor\Data\Tools\WebExtract.exe on the bundle in question to see the contents. Then see if that file actually exists in path stated in the error: <extracted_path>/Lightmaps/e8/e8285ee09500dd75eb204e5f2853b59b.rpc.sse
If that is the case, then it’s possible something is wrong with the loading code. Can you post your loading code snippet?
Well, after discovering it was working well with the StandaloneWindows platform in the editor I went ahead and build the project for windows and android :
Editor StandaloneWindows => working fine
StandaloneWindows player => working fine
Editor Android => the error mentionned above
Android player => working fine
The bundles are the same for the editor and the player for each platform.
I unpacked the Android bundle as you asked (thanks for the tips btw, this is a really nice tool) and there is no e8/e8285ee09500dd75eb204e5f2853b59b.rpc.sse file, only a e8285ee09500dd75eb204e5f2853b59b.rpc.neo one.
So in Editor+Android it seems to expect a .sse file, while the bundle contains a .neo one. But it works fine after building the apk
Ah ok, so that is one of the general issues when working with asset bundles as they contain platform specific data that is not 100% compatible with the editor as the editor is just simulating the platform, but it’s still just running on Windows. Though in this case it’s reading lightmap data and it should have a list of which files it needs to load from the scene being loaded from the same bundle. So it seems a bit odd this would ask for a different file. Can you submit a fogbug with your repro information for us to dig into and see if it’s something we can fix and make work cleaner?
I have went through I feel every thread on google on this topic and there is no answer. Are we just out of luck on using baked lighting with asset bundles?
There were 2 problems for me there. The first one was that I was using android asset bundles in the editor, hence the shader / material problems. This one is “normal”.
However in Build I still have issues with my lightmaps. After disabling “automatic” shader stripping in the Graphics settings my lightmaps are partially working now.