Hi,
My question is about occlusion culling. Is there an efficient (automated) way to calculate the Potentially Visible Sets.
I´ve been searching in the forum but i didn´t find what i was looking for. I´m developing a racing game with outdoors environments and in some points of the track if have problems with the FPS.
I´ve readed the section of the manual that talks about occlusion culling (Unity Manual > Advanced > Using Occlusion Culling) also i´ve readed all the post of the forum that talk about occlusion.
My project is not an indoor environment, is a racing game with a lot of geometry. The tracks have a very complex route.
I have a lot of questions about occlusion.
Height each viewing area? I´ve seen the occlusion culling project of iphone and the height of each viewing area doesn´t have the same height of each room.
Cell size? I´ve readed (1 to 2)
The best way to set the viewing areas.
Viewing area height: Make it as height as required to move your cam within it. The only requirement they have is that the camera must never be outside of view areas or occlusion culling will be disabled.
cell size: depends on the size of the area. The larger the area / the larger the static objects, the larger you can make the cells. A common rule of thumb for the is in the range of the size of the smallest object (or if the smallest is significantly smaller than the largest and not that common, the average size).
Most important with occlusion culling is that it occludes on object level, not on geometry level. That means if you make the whole scenery one massive object, the whole object will be rendered. Unity will not split the model itself to only render what is within the view.
PVS: Above what you have with occlusion culling the onBecameVisible / onBecameInvisible callback, no there is no functionality. Unity has no PVS functionality.
I know that occlusion works at object level.
According what you say, if I create a view area that includes the entire scenario, taking into account the constraints that you’ve said me, the occlusion should work.
But it doesn´t work.
A single view area won’t do much (at least I think so, never tried it with one)
The concept behind the areas is to mark different “areas” (commonly called rooms / cells in articles on the topic) and form portals at intersection areas of the view areas. The idea behind this is that you want to be able to complete remove whole rooms from the world without checking every single object in the world on its visibility, as only those rooms connected to your current one through a portal potentially can be visible at all.
The warehouse example gives a good idea of how it works if you use the occlusion culling view mode and move the main camera in the editor.
Also the occlusion requires static (thats a checkbox only available on Unity iphone) objects that block the view. They are the actual occluders. Affected by those occluders are dynamic objects.
If both those things are present and the occlusion data is calculated (requires NVIDIA or ATI gpu, intel can’t do that) it actually should work.
Do you have a screenshot that shows your setup including the areas?
I opted from using occlusion culling mainly because i got more control through capsule based levels .
instead you can take you level and segment it into areas that load based on player progress, you can seperate with a small loading notification ( think zones ) it works well for larger worlds, just seperate the rooms into game objects and use SetActiveRecursively() on your rooms based on triggers when you enter the room.
Just deactive the old room and set the new room to active.
(even if you dont have rooms you can just seperate the whole world) you will have objects popping in, so you can use some sort of transition effect to reduce this.