> 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

Includes both baked and runtime GPU-based occlusion culling.

Flora supports GPU dynamic occlusion and Unity's baked occlusion data.

## GPU dynamic occlusion

Standalone GPU occlusion tests instances against the previous frame's depth buffer. When sharing GPU Resident Drawer's pyramid in Unity 6.3 or later with URP RenderGraph or HDRP, Flora also retests rejected instances against current-frame depth.

### Enable GPU occlusion

Standalone GPU occlusion requires both of the following settings:

1. Enable **GPU Occlusion Culling** in **Edit > Project Settings > Graphics > Flora**.
2. Enable **Occlusion Culling** on the Camera.

Each Camera can opt out of standalone GPU occlusion through `Camera.occlusionCulling`. The shared GRD path follows the render pipeline's camera eligibility independently of this baked-occlusion switch; Flora's project-wide setting still applies. There is no scene-level Flora setting.

### Performance considerations

It helps scenes with significant occlusion or expensive instances. In open scenes, the compute pass may cost more than it saves. Profile both settings.

### Compatibility with GPU Resident Drawer

On Unity 6.3 or later with URP RenderGraph or HDRP, Flora shares [GPU Resident Drawer](/rendering/gpu-resident-drawer.md)'s depth pyramid for eligible cameras, avoiding duplicate pyramid generation. Configurations outside this integration retain separate occlusion resources. HDRP requires **Custom Pass** enabled in the camera's Frame Settings.

## CPU baked occlusion

Bake data with Unity's Occlusion Culling window. Flora uses valid baked data automatically.

See Unity's [Occlusion Culling documentation](https://docs.unity3d.com/Manual/OcclusionCulling.html).

## Diagnose occlusion

In the [Rendering Debugger](/rendering/debugging.md), enable **Disable GPU Occlusion Culling**. If missing instances reappear, GPU occlusion rejected them.

For depth and occlusion diagnostics, use the **Occlusion Overlay**, **Count Visible**, and **Depth Overlay** controls in the Rendering Debugger.

Enable **Occlusion Overlay** and turn **Count Visible** off to inspect rejected tests. This example adds an opaque wall to Container Prefab Sample.

<figure><img src="https://2882982566-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fyo4B7EVXffipTxnJzee6%2Fuploads%2Fgit-blob-e8d8f2f543c65440388450222f548ab2351f88ec%2Focclusion-normal-6-4-5.webp?alt=media" alt="Wall obscuring part of Container Prefab Sample"><figcaption><p>Normal rendering: the wall obscures part of the instance grid.</p></figcaption></figure>

<figure><img src="https://2882982566-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fyo4B7EVXffipTxnJzee6%2Fuploads%2Fgit-blob-6bbff4b276c587c56b90b542d0678d5bca58603d%2Focclusion-overlay-6-4-5.webp?alt=media" alt="Occlusion-test heatmap behind the wall"><figcaption><p>Rejected-test footprints behind the wall. Warmer colors indicate more overlapping tests, not object outlines.</p></figcaption></figure>
