Table of Contents

Terrain


The BRG Terrain Registerer component enables GPU-instanced rendering for Unity Terrain trees and details. Trees are extracted once at startup, while details stream dynamically around the camera using C# Jobs and Burst Compiler.

Setup

1. Add the Component

Add the BRG Terrain Registerer component to any GameObject that has a Terrain component. One registerer per terrain.

2. Configure Settings

Setting Description
Disable Built-In Rendering Disables the terrain's native tree and detail rendering so BRG takes over (default: enabled)
Detail Chunk Size World-space size of detail streaming cells in meters (default: 32m). Snapped to terrain patch boundaries.

3. Enter Play Mode

Trees are extracted and uploaded automatically when the component initializes. Details begin streaming around the active camera.

That's it — no conversion step needed. The component handles everything on its own.

How Trees Work

Tree instances are read from the terrain data once at startup. They are spatially batched into chunks and uploaded as permanent instances. Trees use the prefab assigned in Unity's terrain tree prototype settings.

If you paint or remove trees in the editor, the registerer detects the change and performs an incremental update automatically.

How Details Work

Terrain details (grass, flowers, small vegetation) are streamed in and out of GPU memory based on camera proximity. The system:

  1. Divides the terrain into a grid of patches based on Detail Chunk Size
  2. Loads patches near the camera using Burst-compiled extraction jobs
  3. Unloads patches as the camera moves away

This streaming approach allows millions of detail instances without loading everything upfront.

Per-Prefab Settings

Just like prefab instances, terrain tree and detail prototypes support per-prefab customization via BRG Prototype Extra Data. Add the component to the prefab referenced by your terrain prototype to control shadow cascades, dynamic density, crossfade, and more.

Tips

  • Detail chunk size should match the scale of your terrain. Smaller values stream more precisely but create more chunks. 32m is a good default for most terrains.
  • For grass and small details, consider setting Max Shadow Cascade to 1 and disabling motion vectors via BRG Prototype Extra Data for significant performance gains.
  • Tree changes made with the terrain paint tool in the editor are detected automatically. Detail changes are also detected and updated incrementally.