Shaders

Add support for Zephyr to your shaders in a few easy steps!

Overview

The Zephyr Wind System provides a unified and physically consistent approach to calculating wind within shaders. Instead of relying on simple directional vectors or random noise fields, Zephyr simulates a layered, dynamic wind field that accounts for gusts, turbulence, flutter, and localized wind zones.

When integrating Zephyr into a custom shader, you can achieve consistent wind motion across terrain, foliage, particles, and volumetric effects — all driven by the same underlying wind data. This ensures that your entire environment “breathes” together under a shared simulation rather than feeling disconnected or artificial.

Background

Zephyr is far from the first wind solution, but it does several things in a unique way. Before starting with Zephyr, it is good to have a baseline understanding of how wind typically behaves in a shader (or skip to How is it Doneto get to integrating faster!).

How Wind Is Typically Calculated in Shaders

Wind in a shader is typically a simple vertex offset that is added to each vertex of a mesh. This gives the effect that the mesh is swaying in the wind.

In most shader implementations, wind is represented in one of the following simplified ways:

  1. Constant Direction + Sinusoidal Offset

    This gives a uniform sway effect — simple and cheap, but visually repetitive and disconnected from world context.

  2. Noise-Based Wind

    This improves variation but lacks directionality, continuity, and responsiveness to world conditions.

These methods are isolated — they don’t synchronize across objects, and they fail to represent complex weather behavior such as gusts, turbulence, or localized storms.

What Zephyr Does Differently

Zephyr generates wind as a hierarchical vector field composed of several interacting layers:

Component
Description

Base Wind

The large-scale, directional flow of air across the scene. Controls overall wind direction and strength.

Gust Wind

Intermittent bursts that add natural variability over time.

Flutter Wind

Small-scale, high-frequency oscillations used for leaves, grass blades, and cloth edges.

Wind Zones

Localized wind sources or blockers that modify the field (e.g., mountain valleys, city streets, or storms).

When sampled in a shader, these components combine into a coherent, time-evolving vector that remains consistent across all materials and meshes. Zephyr handles all world-space transformations, turbulence modeling, and blending between wind types automatically.

This means you can simply query Zephyr for the wind vector at any position — and get realistic, synchronized motion with zero manual tuning.


Why This Matters

Without Zephyr:

  • Each shader calculates its own arbitrary wind.

  • Foliage, clouds, and particles move independently and inconsistently.

  • Artists waste time tuning curves that never truly match.

With Zephyr:

  • Every element in your scene responds to a single, world-driven wind simulation.

  • Wind feels alive — gusts ripple through forests, smoke bends in the same direction as swaying trees, and clouds drift naturally overhead.

  • Developers can build custom shaders (for grass, cloth, particles, fog, etc.) that plug into the same global system, ensuring cohesion and realism.

How is it Done

Zephyr can be integrated into your shaders in a number of ways. If you already have an existing wind simulation that takes in a vector for direction and a float for strength, you can simply pass Zephyr directly into your shader. If not, Zephyr comes with several pre-built wind functions called Mediums. These function as quick, easy ways to add wind support for various types of materials (such as trees, vegetation, cloth, etc.)

Last updated