Page cover

ball-pileCulling Pipeline

An overview of each available culling pipeline used in Flora.

Batch Renderer Group

BRG-compatible shaders generally work out of the box, but you must take steps to prevent Unity from stripping required variants in builds:

Keep BRG shader variants

  • Edit → Project Settings → Graphics

  • Set BatchRendererGroup variants to Keep all

See Unity’s BRG Getting Started Guidearrow-up-right for more info.


Performance

BRG significantly reduces CPU overhead by minimizing state change overhead.

  • Particularly beneficial in scenes with many unique instance types

  • May provide less benefit in scenes with only a few prefab types

  • However, BRG scales more efficiently as project complexity increases


Lights

A major benefit of BRG is per-light shadow culling:

  • The legacy pipeline only determines if an instance should be rendered in any shadow pass

  • BRG allows Flora to cull instances per light, improving performance in scenes with multiple shadow-casting lights


Memory

The legacy pipeline is slightly more memory-efficient:

Metric
Legacy Pipeline
BRG

Per-instance size

48 bytes

96 bytes

With motion vectors

96 bytes

192 bytes

  • BRG requires inverse matrices stored in the instance buffer

  • The legacy pipeline reconstructs the inverse matrices in-shader, saving memory but increasing ALU instructions


Shader Compatibility

BRG supports a wide range of shaders without modification, including:

  • Built-in URP and HDRP shaders

  • ShaderGraph shaders

  • Third-party shaders that support DOTS Instancing (Amplify Shader Editor)


Known Limitations

Child LOD Renderer Transforms

Child renderers under an LODGroup with non-identity transforms do not render using their local transforms in BRG mode.

To resolve this:

  • Bake child transforms directly into the mesh. A convienient way to do this from Unity is through FBX Exporterarrow-up-right package.

This is due to Flora treating the entire LODGroup as a single instance, whereas Unity’s default behavior treats each child renderer as separate.

Current DOTS matrix limitations prevent overriding this behavior.


Render Mesh

The legacy pipeline uses Unity’s RenderMeshIndirectarrow-up-right API.

Requirements

To use this pipeline, shader passes must include:

  • #include "Packages/ma.com.flora/ShaderLibrary/Instancing.hlsl"

  • #pragma multi_compile_instancing

  • #pragma instancing_options procedural:SetupFloraInstancingData

Additionally, materials must have GPU Instancing enabled.

Features

  • Compatible with Flora’s runtime debug shaders

  • Supports LODGroups with child renderers that use custom local transformations

Last updated