after upgrading to 5.2 Beta (I tried it with all releases so far, up to Beta 6), I can’t get my scene baked for real-time GI any more. After hours of calculation, I find the following error message repeated hundreds of times (which is about the number of static objects that should be baked) in the console:
This assert is related to some changes we did for MultiLevel lightmap bake. Can you file a bug with the repro project so we can better understand the situation in which these assert happens?
How exactly do you mean that?
The tooltip says that if I set scaleInLightmap to zero, it will disable lightmapping for that object. It is set to one for the objects to be baked.
Upgrading to release candidate 1 did not fix the problem.
My colleague and me did some more experiments to further narrow down the problem. Our scene is a virtual city that consists of a terrain (grass and street surface), several meshes on top of the terrain for pedestrian walks, around 300 buildings and additional objects like traffic signs and traffic lights.
The funny thing is that real-time GI baking works fine if we remove either the terrain or the pedestrian walk or the buildings. Only when we include all of it together, we experience the problems described before.
Two more observations we made:
The errors appear in one of the final stages of baking, after all the expensive calculations have been done. I can’t tell you exactly in which stage, because in the end, they finish very quickly.
After the errors have been generated, the entire scene seems fine in the editor’s scene view. It looks like the baking did work and the result is in memory, but somehow Unity has trouble saving it. Because as soon as I start the game, half of the objects are just black, and after stopping the game, the editor crashes.
I’m still trying to create a smaller version of the scene so that you can reproduce it. I don’t want to upload several gigabytes of data …
In the meantime, if anyone encounters this “limitation”: I managed to bake my scene by reducing the real-time GI resolution from its default value of 1 to 0.5.
It was a snafu introduced with the multi-scene lighting build. It will happen with large scenes that end up using more than 1 uber atlas for realtime GI. I have a fix in 5.2p1 which is going out mid september. There is no real workaround other than using 5.1 as it is due to ordering in a set of hashes, sometimes it will work sometimes not so much.