Page cover

Occlusion

Occlusion techniques used in Flora.

GPU Dynamic

GPU occlusion uses compute shaders and the previous frame's depth buffer to exclude objects from rendering when they’re occluded behind other objects.

The effectiveness of GPU occlusion is highly dependent on the characteristics of your scene. In scenes with significant occlusion, particularly where occluded objects have a high vertex count, occlusion culling can substantially reduce the rendering workload by eliminating unnecessary instances. If occlusion culling won't have a big effect on your scene, rendering time might increase due to the extra passes and compute logic the GPU does to cull by occlusion.

If using GPU Resident Drawer's occlusion culling, it's important to understand that these systems are separate and thus each will have their own sampling pass.

Usage

By default GPU occlusion is always enabled, however there are a few places where this can be changed.

  1. FloraGraphicsSettings: Can disable GPU occlusion for the entire project.

  2. FloraSceneSettings: Can control GPU occlusion per-scene.

  3. FloraAdditionalCameraSettings: Can control GPU occlusion per-camera.

CPU Baked

Unity provides a built-in system for occlusion culling, which involves pre-baking occlusion data for your scene. This method is particularly beneficial for lower-end platforms, such as mobile devices, where GPU based occlusion may be too resource-intensive.

This feature is used automatically if the scene contains baked occlusion data. No particular configuration is required.

For more information on how to bake occlusion data in Unity, refer to the Unity Occlusion Culling Documentation.

Last updated