> 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/rendering/speedtree-wind.md).

# SpeedTree Wind

Configure and diagnose SpeedTree wind for Flora-rendered trees.

Flora animates compatible SpeedTree instances using Unity's wind system, including wind history for motion vectors.

## Requirements

A compatible render source must have:

* A Unity `Tree` component that reports SpeedTree wind and has a valid wind asset.
* An enabled wind renderer owned by an `LODGroup` beneath the render source.
* A DOTS-instanced SpeedTree material. Custom shaders must consume Unity's current `DOTS_ST_WindParam*` and history `DOTS_ST_WindHistoryParam*` properties.

All wind-enabled renderers in one render source must belong to the same `LODGroup` and use compatible wind data. Split renderers into separate render prototypes when they use different wind assets, geometry, bounds, or LODGroups.

Flora applies this support to Terrain trees, scene-backed [Instance Renderers](/scripts/instance-renderer.md), [Instance Containers](/scripts/instance-container.md), and instances created through the runtime API.

## Sampling modes

A wind proxy has a world position. This position matters when a `WindZone` produces position-dependent wind.

| Mode              | Sampling position                                                                | Use when                                                                                 |
| ----------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| **Per Prototype** | World origin                                                                     | Wind is global or directional and maximum batching is the priority. This is the default. |
| **Per Terrain**   | Center of each Terrain                                                           | Terrain trees need different samples across position-dependent wind.                     |
| **Per Instance**  | The Instance Renderer's wind anchor, or its transform when no anchor is assigned | Individual scene-backed trees need position-dependent wind.                              |

**Per Terrain** and **Per Instance** require additional wind proxies and rendering bindings. Use **Per Instance** sparingly because it reduces batching. Prefer **Per Prototype** for forests and repeated vegetation.

Instance Containers and instances created directly through the runtime API use shared per-prototype sampling at the world origin. They do not currently expose a per-container or per-instance sampling override.

## Terrain trees

Open the [Scene Settings](/scripts/scene-settings.md) and select **Global > Terrain Foliage > Trees > Terrain Wind Proxies**:

* **Per Prototype** shares wind between matching tree render prototypes.
* **Per Terrain** samples separately at the center of each Terrain. All instances of a matching tree prototype on that Terrain share its terrain-positioned sample.

Terrain trees do not create per-tree wind proxies. With **Per Terrain**, proxy and binding cost scales with the number of distinct wind prototypes on each Terrain.

Changing this setting refreshes tracked terrain foliage automatically.

## Scene-backed instances

Use **Scene Settings > Global > SpeedTree Wind > Scene Wind Proxies** to set the default for scene-backed `FloraInstanceRenderer` components:

* **Per Prototype** shares wind between matching render prototypes.
* **Per Instance** samples wind at each Instance Renderer.

An individual Instance Renderer can choose **Use Scene Settings**, **Per Prototype**, or **Per Instance**. When using **Per Instance**, assign **Proxy Anchor** to sample at another transform; leave it unassigned to use the component's transform.

```csharp
var sceneSettings = FloraSceneSettings.GetOrCreate();
sceneSettings.TerrainSpeedTreeWindProxyMode = FloraTerrainSpeedTreeWindProxyMode.PerTerrain;
sceneSettings.SceneSpeedTreeWindProxyMode = FloraSceneSpeedTreeWindProxyMode.PerInstance;

instanceRenderer.SpeedTreeWindProxyMode = FloraSpeedTreeWindProxyOverride.PerInstance;
instanceRenderer.SpeedTreeWindProxyAnchor = windSampleAnchor;
```

Runtime changes refresh the affected registrations. Moving a Terrain, Instance Renderer, or assigned proxy anchor also moves its positioned proxy.

## Diagnose wind support

Open the [Rendering Inspector](/rendering/rendering-inspector.md), select a render prototype, and check **SpeedTree Wind LODs**. Each LOD also reports **SpeedTree Wind: Supported** or **Not present**.

If Flora does not enable wind:

1. Confirm the imported source has a `Tree` component with wind and a valid wind asset.
2. Confirm the wind renderer is enabled and belongs to an `LODGroup` beneath the registered render source.
3. Confirm every wind-enabled LOD uses compatible wind data and the same owning `LODGroup`.
4. Confirm every material supports [DOTS instancing](/rendering/shaders-and-materials.md).

Flora logs a warning and disables wind when it finds a wind renderer without an owning `LODGroup`. Incompatible wind renderers in one render source produce an error that identifies the affected LODs and renderers.
