- Home /
Occlusion Culling not working, only frustum culling
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
Answer by DarthDisembowel · Jul 23, 2015 at 10:54 AM
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?
Answer by DarthDisembowel · Jul 23, 2015 at 11:01 AM
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
$$anonymous$$e again :-)
Have you heard anything further from the folks at Unity?
They did reply that I should play with the settings, since the test case I sent was at default values, though I had tried many variations previously. For whatever reason, I'm getting much better results these days, mostly through trial and error, finding issues with my meshes. But there are still some mysteries. I just replied to them with more information and asking for an ETA on visibility lines and confirmation about my transparent submesh theory.
Thanks for that Darth. Good news your getting somewhere now, it would be nice to get those tools running. Fingers crossed they'll be sorted soon. I'll let you know if we have a 'eureka' moment here.
Answer by Desktopdaydreams · Jul 21, 2015 at 10:57 AM
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
Cheers Tim! I can't find a bug either (aside from an old one that was resolved) , despite all of the complaints in the forums. People seem hesitant to report it for some reason. I will put together a level that reproduces the bug and submit a report tonight.
Hi Darth,
Did you manage to get a bug report submitted?
I had a reply in the forums from a unity member:
http://forum.unity3d.com/threads/visibility-lines-dont-show-up-for-occlusion-culling.313303/
"If this is still broken in 5.1.2 can you please bug report it and post the bug number here."
We're still using 5.0.3f2 what version are you you using and did you get a bug number?
Cheers
Answer by DarthDisembowel · Jul 23, 2015 at 08:43 AM
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. :(
Hmmm, we have done some tests here and it seems to be a very intermittent.
Sometimes we'll run the test scene and the occlusion is working and we get solid performance 120 fps +. Then other times we'll run the test scene again and the occlusion fails and we drop to 30fps.
I must admit due to time constraints,its intermittent nature and that none of the tools are working at the moment I haven't looked into it further.
I did read somewhere that occlusion data wasn't being cleared properly from the editor and that a manual deletion of the files was necessary before a fresh bake.
I'll clear some time today and have a go at running some tests and report back.
Best, Tim
Your answer
Follow this Question
Related Questions
Occlusion Culling 1 Answer
Unity Occlusion unable to recognize Occludee and Occluder? 1 Answer
Hide Objects behind Wall (without using static Objects) 0 Answers
How to fix weird culling problem? 1 Answer
Interior appears larger than exterior 2 Answers