> For the complete documentation index, see [llms.txt](https://flora.magneticarcade.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flora.magneticarcade.com/rendering/occlusion.md).

# Occlusion

Flora supports two forms of occlusion culling: **GPU-based dynamic occlusion** and **Unity’s CPU-based baked occlusion**. Both systems help skip rendering instances that are not visible to the camera, improving performance in scenes with overdraw or high instance counts.

***

### GPU Dynamic Occlusion

Flora’s GPU occlusion system uses **compute shaders** and the **previous frame’s depth buffer** to determine visibility. Occluded instances are skipped during rendering.

#### Performance Considerations

* In scenes with **significant occlusion** and **high-vertex instances**, GPU occlusion can greatly reduce rendering cost.
* In scenes with **minimal occlusion**, the extra compute pass may **increase** GPU load unnecessarily.

> GPU occlusion is **scene-dependent** — always profile with and without it to measure the impact in your project.

#### Compatibility with [GPU Resident Drawer](/rendering/gpu-resident-drawer.md)

If you're using Unity’s **GPU Resident Drawer**, be aware:

* Flora and GPU Resident Drawer each maintain **separate occlusion resources.**
* Both systems perform **their own depth sampling passes.**
* This can result in **redundant GPU work**, particularly on lower-end hardware.

> **Recommendation:** Use **only one** GPU occlusion system per scene to avoid unnecessary overhead.

***

### Usage

GPU occlusion is **enabled by default**, but can be configured at multiple levels:

* **Project-wide:**\
  Via [`FloraRuntimeSettings`](/scripts/runtime-settings.md) → *Disable GPU Occlusion*
* **Per Scene:**\
  Via [`FloraSceneSettings`](/scripts/scene-settings.md) → *Allow GPU Occlusion*
* **Per Camera:**\
  Via [`FloraAdditionalCameraSettings`](/scripts/instancing-camera-settings.md) → *Allow GPU Occlusion*

***

### CPU Baked Occlusion

Flora also supports Unity’s built-in **CPU-based occlusion culling**, which uses pre-baked visibility data to cull geometry blocked by static objects.

#### Advantages

* Ideal for **lower-end platforms** (e.g., mobile) where GPU compute may be too costly.
* Requires **no runtime compute passes.**
* Automatically used by Flora if baked occlusion data is present in the scene.

#### Setup

No special configuration is needed.

As long as occlusion data is baked using Unity's built-in tools, Flora will use it automatically.

For more information, see Unity’s [Occlusion Culling documentation](https://docs.unity3d.com/Manual/OcclusionCulling.html).
