All projects
Engine · library In development

Leefield

Real-time GPU wind and weather for games

A wind field that knows about obstacles — and everything it carries: smoke, dust, snow, rain, fog, fire and grass. Every model is checked against a protocol written before the code.

Leefield

Most games have one global wind vector. Leefield computes a full wind field around the player on the GPU, so the world reacts to its shape: air is calm behind a house, speeds up between two buildings, curls into eddies and flows over a hill.

Effects ride on the same wind: volumetric smoke behind a house, dust from wheels, blasts and gunshots, blowing snow and drifts, rain on a windshield, fog, sparks, wildfire across grass and forest with water suppression and embers jumping firebreaks, room flashover and fireballs, and grass with waves rolling across the field. Gameplay code reads the wind through probes; shaders read it straight from a texture.

For online games there is a shared world wind and a weather director: every player gets bit-identical weather on any CPU. For weak GPUs there is a frame-budget regulator and quality presets; integrated graphics get the light preset by default.

Every model is checked against a protocol written before the code: thresholds are frozen and failures are recorded honestly. References include wind-tunnel experiments (EnFlo), field measurements of wheat, 30 years of hourly KNMI weather-station data, fireball tests and room flashover experiments.

Leefield grew out of the wind engine of our own wind-farm game and is now a standalone library for Bevy, the browser and other engines through a C API.

What it does

  • 2D lattice Boltzmann wind that follows the player, plus a 3D box around buildings for flow over roofs
  • Volumetric smoke, dust with reservoirs (wheels, blasts, gunshots), rain on a windshield, snow with blowing, ageing and drifts, fog, sparks
  • Wildfire across grass, shrub and forest: driven by wind and slope, water suppression, embers jumping firebreaks, rain wetting the fuel
  • Room flashover, fireballs, muzzle blast, heating of metal
  • Grass and crops: saturating bend and waves rolling across the field
  • Shared world wind and a weather director for multiplayer — identical on macOS, Linux, Windows and in the browser
  • Frame-budget regulator and quality presets for integrated GPUs
  • Bevy plugin, WebGPU browser build (Rust to WASM, rendered by three.js), C API for Unity and Godot; shaders portable to HLSL, GLSL and SPIR-V

Screenshots