Table of Contents

Culling


BRG Instanced Renderer uses a multi-level GPU-driven culling pipeline to ensure only visible instances consume rendering resources. All culling runs entirely on the GPU via compute shaders, keeping CPU overhead near zero regardless of instance count.

Seven types of culling work together in a hierarchical pipeline:

Frustum Culling

Instances outside the camera's field of view are excluded. Tested at both the chunk level and per-instance level for maximum efficiency.

Frustum Culling

3-Stage Occlusion Culling

Occlusion culling runs across three stages, progressively narrowing down what needs to be drawn:

  1. CPU Occlusion (Baked) — Chunks are tested against Unity's baked occlusion data on the CPU before any GPU work begins. Entire chunks hidden behind static occluders are discarded immediately. Enable via Use Baked Occlusion Culling on the Config.

  2. GPU Chunk Occlusion (HZB) — Surviving chunks are tested on the GPU against a Hierarchical Z-Buffer (depth pyramid) built from the previous frame's depth buffer. This catches chunks hidden behind dynamic geometry that baked data cannot account for.

  3. GPU Per-Instance Occlusion (HZB) — Individual instances within visible chunks are tested against the same HZB, culling instances hidden behind other objects even when their chunk is partially visible.

The HZB depth pyramid is constructed each frame using a compute shader based on AMD FidelityFX Single Pass Downsampler (SPD) for the fastest possible performance, and pixel expansion compensates for camera movement between frames. Enable via Use GPU Occlusion Culling on the Config.

An optional HZB Retest Pass adds a second phase: after the current frame's depth prepass, instances that were occluded in the first pass are re-tested against the fresh depth buffer. This recovers instances that were falsely occluded due to camera movement, reducing temporal artifacts. Enable via Use HZB Retest Pass on the Config.

Note

In HDRP, the retest pass requires patching the HDRP package to inject a depth prepass event. An editor script is included to apply and revert this patch automatically via Tools > BRG Instanced Renderer > HDRP Patches. URP supports the retest pass without any patching.

Occlusion Culling

Distance Culling

Instances beyond a configurable distance are not rendered. Set per-group via BRG GameObject Group or per-terrain via BRG Terrain Registerer.

Screen-Size Culling

Instances too small on screen are culled automatically, with optional fade-out. Configured per-prefab via BRG Prototype Extra Data / LOD Overrides.

Dynamic Density Culling

Gradually thins out instances at distance using a deterministic hash. Instances can be crossfaded in and out for smooth transitions. It helps as both a performance optimization, as well as a way to help make detail render distance blend more naturally. See Dynamic Density for details.

Dynamic Density Culling

Shadow Culling

Shadow rendering has its own dedicated culling pass, with per-cascade frustum testing and per-prototype cascade limits. See Shadow Optimization for details.

For culling settings, see BRG Instanced Renderer Config and BRG Prototype Extra Data / Density.

Tip

Culling can be viewed in scene view by ticking Debug Visualize Culling In Scene View in your Config file!