The Forest That Isn't Really Moving
You're sprinting through a game forest and the canopy on your left is alive: branches bowing, leaves chattering, the whole thing breathing like something woke it up. Ten metres to your right, the trees are perfectly still. Step into the calm patch and the motion stops. Step back and it starts again.
You didn't notice. That's the entire job.
So how does an engine decide, in real time, which branches to animate and which to leave frozen? The answer isn't a physics simulation. It's something considerably more devious.
Wind Zones and the Invisible Volume
Most major engines, including Unity and Unreal Engine, use a concept called a wind zone: a defined volume in the game world that carries wind parameters inside it. Strength, turbulence, frequency, direction. When a tree's root position falls inside that volume, the engine flags it as a wind recipient. Outside the boundary, no flag, no animation.
That boundary can be a simple box, a sphere, or a directional field stretching across an entire level. A designer drops a wind zone over a clifftop area, sets the turbulence to 0.7 and the main strength to 1.4, and every flagged object inside it gets those values passed to a shader. Objects outside get nothing.
The key word is shader. The branches aren't being animated by the CPU running physics calculations on each twig. They're being moved by a vertex shader on the GPU, displacing the geometry of the mesh itself according to a mathematical wave function. No rigid body, no joint system, just vertices sliding in space according to a sine curve that takes the wind parameters as inputs.
This is sometimes called vertex animation or, in Unreal's terminology, World Position Offset. The branch doesn't move in any physics sense. Its vertices move. Fast, cheap, and convincing at normal play distances.
The Hierarchy Inside a Single Tree
Now zoom in on one tree sitting inside that wind zone. Not every branch sways equally, and that gap between a convincing forest and a collection of identically wobbling lollipops comes down to one thing: painted weights.
When an artist builds a tree, they assign each vertex a value between 0 and 1, stored in the mesh's vertex colour channel (or a dedicated UV channel, depending on the pipeline). Vertices near the trunk get values close to zero. Vertices at the tips of thin outer branches get values close to one.
The shader multiplies the wind displacement by that weight. Simple multiplication. A trunk vertex with weight 0.05 barely moves; a leaf cluster vertex with weight 0.95 swings dramatically. The result is a natural-looking hierarchy where thick structural wood resists and delicate growth responds, without the engine simulating any actual material stiffness. It's less like physics and more like a puppeteer who memorised which strings to pull hard.
SpeedTree, the software generating most of the vegetation you see in AAA titles, automates this weighting during the tree's generation step. It calculates three separate motion layers: primary (whole-tree sway), secondary (individual branch oscillation), and tertiary (leaf flutter). Each layer runs at a different frequency and amplitude. The primary sway might complete a full cycle every three seconds; leaf flutter might cycle twelve times per second. Layered together, they produce the chaotic-but-structured quality of real wind-blown foliage.
Here's a worked example. Two vertices on the same oak tree: one sits where a major limb meets the trunk, the other is at the tip of a thin outer twig. The wind zone is pushing a strength value of 1.2 into the shader. The trunk vertex has weight 0.04, so it receives 0.048 units of displacement. The twig tip has weight 0.91, so it receives 1.092 units. Same wind, same tree, same frame, radically different movement. Multiply that across eighty thousand vertices and you get a tree that looks like it's obeying physics without a single physics calculation happening.
What the Camera Sees (And What Gets Skipped Entirely)
Even with cheap vertex shaders, animating every tree in a large open world is wasteful. So engines stack several culling layers to trim the work, and this is where the real efficiency lives.
Distance is the first cut. Trees beyond a certain render distance get swapped to a Level of Detail (LOD) mesh with far fewer vertices, and the wind shader simplifies accordingly. At LOD2 or LOD3, a tree might be a single flat billboard: a texture of foliage that rotates to face the camera. Animating a billboard is a single rotation calculation, essentially free.
Frustum culling handles trees outside the camera's field of view entirely. If a tree isn't in the frame, its shader doesn't run. The engine maintains a spatial index (typically a BVH, a bounding volume hierarchy) to answer the question "which objects are in this camera frustum" in microseconds rather than checking every object in the level.
Occlusion culling goes further. Even in-frustum objects hidden behind solid geometry can be skipped. A tree behind a cliff face doesn't need its vertices displaced this frame.
The upshot: on a typical open-world scene with two thousand trees visible, perhaps four hundred are getting full wind shader treatment, six hundred are running simplified LOD shaders, and the rest aren't being processed at all. The player sees a coherent, living forest. The GPU is doing a fraction of the work the visual complexity implies.
What People Assume (And Why It's Backwards)
The most common assumption is that games with realistic-looking wind are running some kind of physics simulation, similar to cloth or ragdoll systems.
This is almost entirely wrong for vegetation, and it matters that people understand why.
Physics simulation is expensive because it's stateful: the engine has to track velocity, acceleration, and constraints for every joint across every frame. A single cloth object with a modest mesh can consume more GPU time than fifty wind-animated trees. Vegetation shaders are stateless. Each frame, the shader just evaluates: given this wind strength, this frequency, and this vertex weight, where should this vertex be right now? No memory of where it was last frame, no accumulated forces.
The trade-off is that vertex-animated branches can't respond to the player pushing through them with any physical accuracy. They can fake it with a proximity-based repulsion term added to the shader, but that's still just math nudging vertices, not a simulation. Look closely in most games and you'll catch it: walk through a bush and the bush animates around you, completely indifferent to your presence. You're not parting anything. You're a ghost with good shoes.
And honestly? That's fine. The goal was never to simulate a forest. It was to make you believe in one long enough to keep playing. Do you notice the branches when you're being chased? Exactly.
The real craft isn't in the simulation. It's in knowing precisely how much reality you can leave out.