> 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/scripts/terrain-provider.md).

# Terrain Provider

The **Terrain Provider** component connects a Unity `Terrain` object to the [FloraSystem](/scripts/system.md), enabling Flora to take over **tree** and **detail mesh** rendering.

> This component is typically added automatically when the [SceneSettings](/scripts/scene-settings.md) singleton is present and **Auto Register Terrains** is enabled.
>
> **Scope:** This page applies to Unity `Terrain` integration (terrain trees/details).\
> For non-Terrain workflows, use [Instance Container](/scripts/instance-container.md) or [Instance Renderer](/scripts/instance-renderer.md). See [Container Samples](/samples/container-samples.md).

***

## Trees

Tree instances are **loaded** from the terrain when a camera, and its far plane, are within distance of the terrain’s [`treeDistance`](https://docs.unity3d.com/ScriptReference/Terrain-treeDistance.html) value.

<figure><img src="/files/5shpYrLGpIZxRzT8nTaO" alt="Terrain tree distance UI"><figcaption></figcaption></figure>

***

## Details

Detail instances (e.g. grass, rocks, debris) are loaded when a camera, and its far plane, are within the terrain’s [`detailObjectDistance`](https://docs.unity3d.com/ScriptReference/Terrain-detailObjectDistance.html) range.

* When a detail cell goes **out of range**, it is **unloaded after 3 seconds**
* This helps reduce **GPU memory usage** in large terrain scenes

> ⚠️ For large environments, keep **detailObjectDistance** at a reasonable level to avoid unnecessary memory usage.

Unlike Unity’s built-in rendering system, Flora **supports detail meshes with LODGroups**.

* If Flora is disabled, Unity will fall back to its built-in rendering
* However, only the **first LOD mesh** will be used in that fallback path

<figure><img src="/files/Mg95slUuUdWvGTSHBEKS" alt="Detail mesh preview with LODs"><figcaption></figcaption></figure>
