- Home /
Occlusion Culling in a Web Player
I am attempting to use Occlusion Culling for a project that is going onto the web. As far as I can tell, occlusion culling is baking and working fine in editor and in standalones, but as soon as I build a web player, it no longer occludes anything beyond basic frustum culling.
Does anyone have any idea either A) whether or not occlusion culling works in the web player builds from Unity or B) how to get them to work?
Any help would be much appreciated, the documentation is sorely lacking on this feature.
Okay, upon further exa$$anonymous$$ation, my question is a little more specific.
In my specific case I am using additive level loading in a webplayer and want to use occlusion culling on the geometry that is loaded in additively. If the geometry I want to apply culling to is in the same level as the camera attached to my player, it works just fine.
Unfortunately, I need the player and its camera to be in one level, and the geometry I want to apply culling to in another level (which I additively load. I suspect that occlusion culling in a level either A) requires a camera to calculate and retain information on what can be culled or B) culling data is embedded directly into the camera, meaning if the geometry and camera aren't together in one level that occlusion culling will not work.
Does anyone have any idea if there is a way around this?
Answer by Dreamora · Jun 23, 2011 at 03:14 AM
You can not stream occlusion culling, its not mergable. Also occlusion culling data storage has nothing to do with the camera, its part of the scene and scene only
Occlusion culling is only present in the level thats loaded with LoadLevel / LoadLevelAsync, any level thats loaded with LoadLevelAdditive or its forms will lose all occlusion culling data.
So if you want to use the additive level functions and have occlusion culling, the initial scene you load with LoadLevel must have all the OC data in already ie all baked within it.
Yupp I know, fully understand that one.
Was one of my initial questions when occlusion culling was mentioned, on how the strea$$anonymous$$g is gonna work. Didn't like the question either as our scene was too detailed to even being PVS generated without streamed in subsections.
I wonder if its something they'll improve in the future, or if that's just the way its always going to be. $$anonymous$$akes occlusion culling pretty limited use, especially for larger scale games where there is too much to load all at once without making the player wait forever.
Answer by nawash · Jul 19, 2012 at 04:59 AM
To solve this, I tried: - adding the dynamically loaded scene prefab in the base scene - bake OC - delete the prefab from the base scene
It appears that OC is not working proceeding like this. Is there any trick to solve this ?