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.
- 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.
- 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?
-
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?
-
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.
- 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!