Occlusion Culling basic questions.

So I recently implemented occlusion culling into my game because there is now 3 camera options, 2 of which may include a ton of objects within the camera frustum.

Although it seems to be working decently, it is not working exactly as expected. I will try to list my individual problems/concerns in hopes that people might respond even if they only know the answer to one of them.

  1. How much of a CPU performance hit is caused by using automatic portal generation? If I have a scene with around 50 enemies and my game is aimed for mobile platforms would automatic portal generation be too CPU intensive to consider?

I have noticed that I get slightly better results with automatic portal generation in most my scenes but I have opted to use PVS and dynamic objects for now because I don’t want any added CPU cost.

  1. All the tutorials and even the official documentation I have seen show two button options in the Occlusion Edit mode in scene view. They show “View Volumes” and “View Targets” or perhaps just “View” and Target".

For some reason my Occlusion Edit only shows “View Volumes” even though I only have one Occlusion Area Object with both “Is View Volume” and “Is Target Volume” checked. I am also not seeing the Target’s “colorful boxes” that are supposed to show in Visualize mode according to documentation and all videos I’ve seen.

So have they simply updated Unity’s UI to no longer include those things I’m not seeing? The target occlusion culling is working, but not perfectly so I don’t know whether I am somehow doing something wrong or if they just removed that UI stuff?

  1. Why does the Occlusion Visualize “Camera Volume” change based on it’s y coordinate height? In my highest camera setting it seems to stretch around the entire area except even much higher than the camera (and “Is View Volume”) actually goes? The lower you move the camera the smaller the camera volume becomes. Once again I am unsure whether this is normal or if I did something wrong here?

  2. Why does the occlusion not work accurately based on what the camera can actually see? When I enable “Visibility Lines” in the Visualize settings some of the lines actually curve up above the “Camera Volume”. So they are allowing the camera to see over things higher than the camera volume which makes no sense.

All my camera option settings are rotated on the X-axis between 60-15 degrees, so they are looking towards the ground at least slightly. Does occlusion culling not take into account camera rotation whatsoever? This is causing my results to be even more unexpected because it is rendering objects which are very obviously not in my camera’s sight.

I just don’t understand why the visibility lines are jumping over objects that clearly are higher than the camera and “Camera View”. They are able to jump over walls and go downwards behind them, and sometimes stop at the wall yet still render enemies behind them…

5)Some enemies disappear and reappear at various points of their patrol path even though the entire time they should be invisible. Maybe this is normal without automatic portal generation, but even that does not work as expected.

  1. What are the best Occlusion Bake settings for accurate occlusion? I am using an Occlusion Area with both View and Target Volumes enabled and “High” target Resolution. Strangely changing the “High” to “Extremely High” seemed to at times make things worst. I think I did a test where “Medium” had better results than “High” and “Extremely High”. How is that even possible?

For the Occlusion Bake settings I am using the default memory Limit with the exact near clip and far clip settings as my camera. I am using View Cell Size 3 because using 1 seems to take at least 10 times as long which is unacceptable at this stage of development.

I have spent basically an entire day trying out every possible solution imaginable with combinations of settings. So far the best results seem to come from automatic portal generation but I am not sure if that option is suitable for mobile phone games?

These problems have forced me to raise the height of the walls in all my levels even though the original ones should have been tall enough according to the Visualize “Camera Volume” and what the camera actually can see in the game.

Why am I experiencing this unexpected behavior? Is the Umbra Occlusions system simply not as accurate as it would seem to be based on their videos?

Hopefully someone has answers to these questions in the next few days, I want to focus on other areas of code right now because it seems I’ve tried every solution I can think of and it just doesn’t seem to make sense.

I guess I could try to bake with cell size 1, but I already did that early on in my testing with no positive results…

Please help me!

Finally got around to trying out the improved occlusion system in 4.3 last night!

I could not be more impressed. Whatever Unity team was in charge of this new version of occlusion should be promoted or receive a huge bonus or something.

It doesn’t even seem like the same program the difference is night and day!

Scenes bake like 100 times faster literally. And the results are about 10 times better! It seems like it actually works like how it’s supposed to now. Although I’m sure I might have to make some slight adjustments as I test all my scenes, so far just using the default occlusion settings with my old projects occlusion areas seems to be working amazingly well!

Keep up the great work! Really nice to see my “Visualize” occlusion previews actually occluding all my scenes and enemies as expected. And even the options have been simplified!

Just read through all my previous problems from this post, and I think 4.3 has solved all this stuff for me.

I still don’t exactly understand the Camera volume as the purple box looks quite large in relation to where the camera is, but if I’m seeing the desired results I’m not too worried about it.

The only thing I’m wondering about now is why am I seeing such a huge difference of the bake size in some of my scenes. Some scenes are only like 50-450kb occlusion size while others are a bit over 1MB. Gonna chalk that up to just the scene layouts.

Gonna need to study the occlusion stuff and all the details about static objects a tad bit more before final version of game, but wow 4.3 just made this a lot nicer to work with!