Page cover

Culling Pipeline

An overview of each available culling pipeline used in Flora.

Flora supports multiple rendering pipelines to accommodate different project needs. Each has its own performance profile, memory characteristics, and compatibility trade-offs.


Render Mesh

The default pipeline uses Unity’s legacy RenderMeshIndirect 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


Batch Renderer Group

Flora includes experimental support for Unity’s BatchRendererGroup (BRG).

You can enable it per scene via the SceneSettings component:

Batch Renderer Group settings

To make BRG the default project-wide pipeline, go to Edit → Project Settings → Graphics and update the default.

See also: FloraGraphicsSettings


Setup

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

  1. Keep BRG shader variants

    • Edit → Project Settings → Graphics

    • Set BatchRendererGroup variants to Keep all

  2. If using URP, disable variant stripping:

    • Edit → Project Settings → URP Global Settings

    • Disable Strip Unused Variants

  3. Allow unsafe code

    • Enable Allow ‘unsafe’ Code in Player Settings

See Unity’s BRG Getting Started Guide for more info.


Performance

BRG significantly reduces CPU overhead by batching draw calls and minimizing state changes.

  • 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 more memory-efficient, especially at scale:

Metric
Legacy Pipeline
BRG

Per-instance size

48 bytes

96 bytes

With motion vectors

96 bytes

192 bytes

  • BRG stores inverse matrices 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 or Amplify Shader Editor


Known Limitations

Selection

Selection outlines still rely on the RenderMesh pipeline.

  • If your shaders are not properly configured, selection outlines may not be visible

  • ShaderGraph shaders do not have this issue, as Flora modifies them automatically


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

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.


Debug Visualization

Flora’s debug shading modes (used in the Rendering Debugger) do not function when BRG is active.

To use these debug views:

Last updated