when loading a scene additively, how do you activate its baked occlusion ?

so a game level is composed of a gameplay scene that loads additively an environment scene.
i bake occlusion in the environment scene.
when i run this level with occlusion visualizaion on main camera i don’t see objects disappearing by occlusion
what’s the secret sauce?
7205641--865471--upload_2021-6-3_21-21-54.png

Occlusion culling shares the same limitation as light baking, the data is stored per scene, but only the data from the active scene will be used. Which means you can’t bake OC for individual scenes that are additively loaded, and expect all the data to be combined at runtime. One of the cumbersome things about Unity in regards to large worlds.

You’d have to open your game’s “main” scene (whichever is active at runtime) in edit mode. Then add all the scenes with renderers in them, then bake OC. This way every renderer object in the game gets included in the bake of the active scene.

2 Likes

Just to add to this, according to the docs dynamic occlusion can be used with ocludee’s, so only occluders should need to be loaded and baked in the manner outlined by @StaggartCreations .

If you have a bunch of smaller objects that are loaded dynamically and will not need to occlude other objects, these shouldn’t need to be added to the bake. With that said, there may be a performance benefit to adding them to the bake vs relying on dynamic occlusion culling.

Roger that