GDOC is a dynamic GPU occlusion culling solution that increases FPS by hiding objects that are not visible by the camera, drastically reducing draw calls.
Compared to the built-in occlusion culling, GDOC works at runtime and doesn’t need baking.
Features
— No baking, works with procedurally generated or streamed scenes
— No raycasting, doesn’t need colliders
— Supports dynamic occluders and occludees
— Most of the work is done on GPU
— Culls shadow casters for 1 directional light
— Supports LWRP
— Supports VR multi pass & single pass (non-instanced)
Testing scene: Viking Village City
Made from assets from the Viking Village demo:
It’s not really fair because scene view kills the performance. Check out the video to see how it works in builds.
Requirements
Supported platforms: DX11 on Windows x64
Not supported yet: Vulkan, HDRP, Linux/Mac, consoles
Won’t be supported: OpenGL, Metal, mobile devices
Best practices
To achieve the best results with GDOC, make sure:
Scenes are big and have many objects that can be potentially occluded (like in the demo scene)
Objects exist in the scene hierarchy as MeshRenderers or other supported components
You have a Directional Light with realtime shadows
The number of draw calls is high and seems to be the main bottleneck
You can PM me in case you’re not sure if it will work well for your game
It culls things fine for regular rendering, but does nothing for the shadow pass
And it leads to 1500+ extra drawcalls that contribute nothing to the final picture
Oh boy have I got a scene to test this out on for YOU.
I’m working on a huge scene for a real world city building project with millions of tris visible almost every frame and full of geometry not optimized for an interactive Unity environment. Our standard baked occlusion culling isn’t really doing the best job, we think, so I’m always on the lookout for new solutions.
I’m afraid it can’t optimize your scene for you. If baked OC doesn’t improve performance, this one can’t as well. Can you show some screenshots of your scenes?
No, it currently supports only 1 non-vr camera. More features will be added later.
You can easily test this manually: disable chunks which are inside the camera frustum, but occluded by other objects (i.e. can’t be seen by the camera). Are there such chunks? Does disabling improve performance?
I could do this with StartCoroutine. I just don’t know if the method CheckChunksVisibleis useful this way. Or if there is a better way. Maybe also hide chunks that are behind other chunks etc.
No, what you’re doing is regular frustum culling, it’s already done by Unity. Doing it twice can’t increase FPS
What I mean is to select 1 camera position and compare FPS with all chunks enabled and some chunks manually disabled in the hierarchy. Not the ones which are outside camera frustum, but the ones which are inside, but can’t be seen. Example: https://i.imgur.com/N0Zmdbb.png
That’s exactly what OC does
Yeah but the outcome is disabled chunks. And you can do it yourself to approximate the potential effect of OC.
If I disable my some of my chunks it get’s more performant, yes
I believe when walking on the surface, a big problem is chunks that are under the “surface ground chunks” which I cannot see anyway but I guess they are all rendered…
Does your asset help with These? Then I guess my performance should be a lot better (for GPU, the other stuff is already good)…
Does your asset work with transparent parts also? In my case like a Ground chunk under a water chunk? Or a large Building but with big windows on all sides?
I would really like to test and give you feedback and when it is helping and not too expensive I will gladly buy it.
By default, it consumes 0.050 ms per frame to scan currently active scenes to detect new objects and process them according to the layer rules you mentioned and other settings.
Also it spends another 0.050 ms to validate active occludees and remove them from the GPU buffers when their gameobjects are removed from the scene.
You can change the time limits or completely disable the first feature if it doesn’t fit your game (there are other ways to manage objects).
The real time consumer is dynamic occludees because their transforms must be checked every frame and all changes must be sent to GPU. It’s expensive and most likely it’s faster to simply draw them, especially for instanced objects. More details in documentation (soon™).
Other than these 3 things, nothing important is done on CPU.