viewport-lib-wind
Smooth, cyclical wind-like motion for meshes in viewport-lib. Geometry sways and ripples the way grass, foliage, cloth, and banners move in a breeze, driven by repeating vertex displacement rather than a physics sim. Handy for animation, rendering, and games.
Under the hood it is a single global wind vector with gust modulation, mirrored to the GPU as a small uniform buffer and to a CPU sampler that consumers can use directly.
Use
use ViewportRuntime;
use ;
let wind = new;
let runtime = new
.with_plugin
.with_gpu_plugin;
// Sample the field from anywhere on the CPU:
let v = wind.field.sample;
The CPU sampler and the WGSL helper (SHARED_WIND_WGSL) use the same formula, so vertex shaders and any CPU consumer (spring bones, particles, cloth) see the same field at the same world position.
License
viewport-lib-wind is a part of the viewport-lib ecosystem.
GPL-3.0