XWindfield
XWindfield provides a shared, camera-centred 3D wind field for materials and GPU Niagara effects. It combines scene wind, turbulence and temporary local emitters, with separate trunk, branch and leaf bending responses for vegetation materials.
Open Control Panel > X:VFX > XWindfield to adjust the field and visualize it. XWindfield is the displayed name; existing console variables, material expressions and source identifiers retain WindField naming.
What It Currently Offers
| Capability | Current implementation |
|---|---|
| Shared wind simulation | A camera-centred 64 × 64 × 32-cell field updated at 30 Hz |
| Ambient wind | Uses the scene's directional wind sources, including the private XFSDK Wind actor |
| Turbulence | Configurable velocity scale, length scale and evolution rate |
| Local forcing | Temporary directional/radial emitters through the renderer API |
| Vegetation response | Separate trunk, branch and leaf bend fields for material use |
| Material sampling | Direction, velocity, speed, relative strength, gust and bend outputs |
| Niagara sampling | GPU-only Shared Wind Field data interface |
| Execution | Primary-GPU simulation or experimental worker-GPU execution |
| Debugging | Viewport wind vectors with spacing, scale and speed-reference controls |
The field follows the camera rather than covering the entire world. Its default 400 cm cell size gives a 256 × 256 × 128 metre simulation window. Changing cell size restarts the field.
Enable and Configure
[ConsoleVariables]
x.WindField=1
Configure a scene wind source to supply the prevailing wind. Materials and Niagara systems must explicitly sample the field and use its outputs; enabling it does not automatically animate existing assets.
The simulation advances at 30 Hz. With x.WindField.PresentEveryFrame=1, sampled volumes ease toward the newest step each frame. Setting it to 0 skips that per-frame unpack work and presents new simulation steps as they arrive.
Foliage and Materials
The Wind Field material expression supports surface materials and exposes:
| Output | Meaning |
|---|---|
| Direction | Normalized wind direction, with an ambient/default fallback |
| Speed | Sampled wind speed in metres per second |
| Strength | Sampled speed relative to ambient speed; not a fixed 0–1 mask |
| Gust | Gust value in the wind sample |
| Wind | World-space velocity in XYZ and gust in W |
| Trunk Bend | Horizontal trunk response |
| Branch Bend | Horizontal branch response |
| Leaf Bend | Horizontal leaf response |
Use the relevant outputs to drive World Position Offset. Mesh masks, vertex colours or Pivot Painter data can determine which parts bend and how strongly. A wind sample is an input to the material's animation, not a complete foliage deformation setup.
Pivot Painter-Style Bending
The shared shader helpers support sampling at hierarchy pivots:
- Trunk:
WindField_GetBend(Pivot).xy. - Branches:
WindField_GetBend(Pivot).zw. - Leaves:
WindField_GetLeaf(Pivot).
WindField_ApplyBend(Position, Pivot, Bend, MaxAngle) rotates a position around its pivot, with MaxAngle in radians. These helpers are defined in /Engine/Private/WindField/WindFieldSample.ush.
This provides the inputs/helpers for Pivot Painter integration; it does not automatically replace an asset's existing wind material.
Niagara
Add the Shared Wind Field data interface to a GPU Niagara system. Its SampleWind function takes a world position and returns:
- Velocity: world-space wind velocity in centimetres per second.
- Gust: sampled gust value.
- FieldWeight: contribution of the simulated field at that position.
Convert local-space particle positions to world space before sampling. Use the returned velocity in the system's own force or velocity logic; sampling alone does not move particles.
The data interface samples the previous completed shared volume, including turbulence and bursts. Outside the simulation window it returns ambient wind with zero field weight. CPU Niagara simulation is not supported by this interface.
Material/shader wind velocity uses metres per second. The Niagara interface converts its velocity output to centimetres per second. Keep that difference when sharing response settings.
NVIDIA Flow
Flow shares ambient wind and local directional/radial emitter forcing through the renderer API. Its actors expose their own wind-coupling controls.
The integration shares forcing inputs, not the complete evolving XWindfield simulation volume. Simulated turbulence is not fully transferred to Flow, and fire-generated flow does not feed back into XWindfield.
Simulation Controls
| Console variable | Source default | Purpose |
|---|---|---|
x.WindField | 1 | Enable the simulated field |
x.WindField.CellSize | 400 | Cell size in centimetres; changing it restarts the field |
x.WindField.Turbulence.Speed | 2 | Turbulence velocity scale in metres per second; zero disables generation |
x.WindField.Turbulence.Length | 3200 | Turbulence length in centimetres; clamped to at least four cells |
x.WindField.Turbulence.Rate | 0.15 | Evolution rate in noise cells per second |
x.WindField.PresentEveryFrame | 1 | Ease sampled volumes toward the newest simulation step every frame |
x.MultiAdapter.WindField | 1 | Use a worker GPU when available and enabled |
Source defaults can be overridden by project configuration and per-scene turbulence settings.
Worker GPU
[ConsoleVariables]
x.MultiAdapter.Enabled=1
x.MultiAdapter.WindField=1
Worker execution requires the fork's supported secondary-GPU setup. Setting x.MultiAdapter.WindField=0 selects primary-GPU simulation. Compare simulation, transfer and presentation cost on the intended hardware; worker execution is not a guaranteed improvement.
Viewport Visualization
Enable Show wind vectors in Control Panel.
| Console variable | Purpose |
|---|---|
x.WindField.Debug | Show vectors |
x.WindField.Debug.Stride | Vector spacing |
x.WindField.Debug.Scale | Vector size |
x.WindField.Debug.MaxSpeed | Speed reference for visualization |
Arrow direction shows wind direction; colour and length indicate speed. Calm cells do not draw arrows. Visualization requires an enabled field, realtime viewport rendering and ShaderPrint support.
Current Limits
- This is a local camera-centred simulation, not a persistent world-wide wind volume.
- Outside the window, or while the simulated field is disabled, material sampling falls back to ambient wind and steady bending responses.
- Existing foliage materials need explicit integration; Niagara sampling is GPU-only.
- Flow coupling shares forcing inputs and is not bidirectional fluid coupling.
- These capabilities are identified from the current source. No build or runtime validation was performed for this documentation update.