Foliage Wind
Trees built as foliage composites, or meshes with a Wind Skeleton, carry a small skeleton of bones from the trunk out to the twigs. Every frame a GPU pass moves each bone of each tree as a damped spring, pulled toward the bend that the wind and touch ask for at that bone. The material then moves each vertex with its bone. Because the bend of every bone is limited, the renderer knows at build time how far any vertex can move, so culling stays exact while the tree sways.
The wind comes from the scene's wind system: a Simple Wind component sets the base wind and gusts, and wind volumes add local wind. See Wind.
Setting up a tree for wind
- Put a Foliage Bones component (category Effects > Wind) on the object with the tree's mesh component. Dragging a Foliage Composite asset into a scene adds it for you. The component has no properties; it does nothing for meshes without a skeleton.
- Give the mesh materials that apply bone wind (see below).
- Make sure the scene has a wind system, for example a Simple Wind component.
Material setup
Bone wind is applied by the Vegetation shader (Shaders/Materials/Vegetation.plShader) when its USE_FOLIAGE_BONES option is on. Base your bark and leaf materials on the Vegetation base material and turn USE_FOLIAGE_BONES on. Materials with any other shader draw the tree in its rest pose.
The Vegetation shader also has a Wind group of per-vertex settings (bend stiffness, branch and edge flutter). These drive the older per-vertex wind for meshes without a skeleton.
Touch and shockwaves
Bones also bend away from things that push into the plant:
- Touch. Characters, vehicles and physics bodies splat a push into a camera-centred touch map, which decays over time. Bones bend away from the push at their tips. With the
plasma.vegetationpackage, add a Vegetation Touch component to anything that should push plants, and dynamic physics bodies push them too. Touch sources can be spheres or capsules (a body lying down, a log, the side of a vehicle). - Shockwaves. A shockwave is a wind volume. Because bones sample the wind field, a sphere wind volume bursting next to a tree bends it away from the centre.
Distance tiers
Simulating every tree in a forest every frame is not needed:
- Frozen tier. Trees further than
Vegetation.Bones.AnimationDistance(200 m) from the wind focus, the main camera, ease back to rest and hold it. Their shadows can then stay cached in the virtual shadow map. - Shared wind variants (with
plasma.vegetation). Trees of one type in a vegetation layer share a few wind-animated variants per wind tile, which differ in phase and stiffness. Each drawn tree borrows one, so a forest of thousands of trees runs only a few simulations per type and tile. - Own simulation near the camera. A tree near the camera, touched or pinned, gets its own bone instance at its real position. It starts bent as its variant showed it and simulates with the variant's wind sample point, stiffness and phase at first, then moves to its own over
Vegetation.Composite.ControlBlendTime. It moves back before it rejoins the variant, so the hand-off does not pop.

CVars
Bone wind (engine):
| CVar | Default | Description |
|---|---|---|
Vegetation.Bones.Enabled | on | Animates foliage with its bone skeleton. Off holds every tree in its rest pose. |
Vegetation.Bones.AnimationDistance | 200 | Foliage further than this many metres from the wind focus (main camera) stops animating and rests. |
Vegetation.Bones.WindScale | 1 | Multiplier on the wind the bones feel. |
Vegetation.Bones.TouchScale | 1 | Multiplier on the touch push the bones feel. |
Vegetation.Bones.Damping | 0.35 | Damping ratio of the bone springs: 0 never settles, 1 is critically damped. |
Vegetation.Bones.FixedTimeStep | 0 | When above 0, the bones advance by this many seconds per frame instead of the frame time. For tests and captures. |
Vegetation.Touch.Enabled | on | Advances the touch map each frame. Off leaves plants unbent by characters. |
Vegetation.Touch.MapExtent | 64 | Size in metres of the touch map around the main camera. |
Wind.Debug.PinTime | -1 | When 0 or more, the wind field, the per-vertex wind and the bones use this time every frame. For comparing captures. |
Shared variants (plasma.vegetation package):
| CVar | Default | Description |
|---|---|---|
Vegetation.Composite.WindTileSize | 256 | Side in metres of the square tiles whose trees of one type share wind variants. |
Vegetation.Composite.WindVariants | 8 | Shared wind variants per composite type and tile, 1 to 32. |
Vegetation.Composite.PromoteRadius | 25 | Trees this close to the main camera get their own bone instance. 0 = only touched or pinned trees. |
Vegetation.Composite.BlendTime | 0.5 | Seconds a tree takes to blend between its variant's pose and its own. |
Vegetation.Composite.DemoteDelay | 2 | Seconds a tree must go without a touch, the camera nearby or a pin before it blends back to its variant. |
Vegetation.Composite.ControlHandOff | on | A promoted tree starts bent with its variant's wind control and then moves to its own. Off, it starts unbent with its own at once. |
Vegetation.Composite.ControlBlendTime | 1.5 | Seconds the wind control takes to move between the variant's and the tree's own. Keep it below DemoteDelay. |
Vegetation.Touch.Physics | on | Dynamic physics bodies and characters inside the touch map bend vegetation. |
Vegetation.Touch.MaxPhysicsSources | 32 | Most physics bodies that bend vegetation per frame, nearest to the camera first. |
Troubleshooting
| Problem | Cause and fix |
|---|---|
| The tree stands still | Check for a Foliage Bones component, a mesh with a skeleton (a Foliage Composite, or a mesh with Wind Skeleton set), materials with USE_FOLIAGE_BONES, and a wind system in the scene. |
| Distant trees stop moving | They are past Vegetation.Bones.AnimationDistance. Raise it if far trees must move, at the cost of shadow caching. |
| A tree jumps when the camera comes close | The hand-off to its own simulation is off (Vegetation.Composite.ControlHandOff), or ControlBlendTime is longer than DemoteDelay. |
| Shading does not change as branches bend | Bone wind moves positions only; normals stay in the rest pose. |