I scoured the forums and though I’ve seen several posts about similar issues, there were no solutions, or they were out of date (i.e. pre-Umbra).
I have a typical interior level where each room is a separate model with several smaller detail objects within them; normally ideal for occlusion culling, and at one point it did seem to work. But lately the only objects that get culled are the ones outside the camera frustum. I don’t know at what point it stopped working so I don’t know what caused it.
I have checked and rechecked all of the obvious potential causes: all the relevant objects are marked as static occluders/occludees, I’ve tried all combinations of bake settings, the camera is set to use Occlusion Culling, the models themselves are clean and have no holes, the models are separate, etc. There are hardly any options to play with regarding occlusion, so I assume it is an issue with my composition or some other unrelated option that is interfering with the culling.
I am using the Virtual Reality Supported option as it is an Oculus Rift project, but I have the same issues even if I disable it.
There are a few random spots where the culling works properly, but even if I duplicate the same models in another area, it won’t work in the other area. It seems like some occlusion cells work and most others don’t.
Is there anything else I can check? Is there an up-to-date occlusion troubleshooting guide somewhere?
Thanks!
~James
Found the culprit (at least in my case). Many of my rooms and corridor segments had materials with multiple elements. Some of these sub-materials were cutout materials. I guess the occlusion baking will ignore any objects that include any transparent sub-materials since it assumes that these objects won’t hide objects behind them. In my case the walls, floors and ceilings are all opaque, but I have some catwalks and floor panels within the rooms that are metal grills (but the rooms and catwalks are exported as a single mesh). They don’t allow the camera to see outside of the rooms, but maybe Umbra doesn’t bother to test that. Maybe this is a known to everyone and you all make sure to create these types of assets as separate objects within the rooms, but it definitely seems to be what has been causing me all the headaches.
Is this a bug or as designed?
Here is the ID of the bug I entered for the occlusion issues (I managed to reproduce it even after making all materials opaque in the first test project I made, though that same workaround works in my original level and the second test. Baffling.):
714284_tkugg8l2vvil2kjd
Good Morning,
I think there are some ongoing issues wit OC at the moment.
We have a very similar scene/project setup to yourself and are experiences the same problem. Even the tools, camera volumes, visibility lines and portals aren’t displaying in scene. From reading the forums, it seems OC is a bit buggy and Unity are aware of it.
Here’s one of the threads: http://forum.unity3d.com/threads/visibility-lines-dont-show-up-for-occlusion-culling.313303/
The only thing I can’t find is an actual bug to vote on in the bug tracker. It may be because its multiple problems with OC.
Best,
Tim
So I spent a few hours stripping down my game to just the geometry, cleaning out unused assets and using a single texture for everything, so that I would have a small enough package to submit with the bug report.
Guess what? Now the culling works perfectly. Of course I didn’t rebuild the occlusion after deleting every single asset, so now I don’t know at what point the problem disappeared. Very frustrating.
I had exported my map to a new project (and I did rebuild at that point just to make sure the problem still existed, and it did). Then I dumped all of my textures and assigned a single standard grey material to everything (I rebuilt occlusion at this point and I still had the problem). I then deleted all textures, materials, scripts, and unused geometry from the project.
I accidently deleted the terrain at one point, and since it could affect occlusion I rebuilt the occlusion to make sure, and lo and behold occlusion was working perfectly! So then I assumed the terrain was causing the problem all along. But when I reimported the terrain and rebuilt the occlusion, it was still working properly, so I’m stumped.
I guess I’ll start over. 