bevy_elements 0.7.8

Living environments for Bevy: sun, moon and stars, climate-driven weather, GPU wind, volumetric clouds, rain, snow and fog, lightning, terrain with hydraulic and thermal erosion, flooding, snow cover, wetness and dust — simulated in compute shaders.
Documentation

bevy_elements

⚠️ Vibe Coded. Written by AI agents working from a human's direction, covered by tests rather than a line-by-line human review. Read the code before you rely on it for something you care about.

Living environments for Bevy 0.20: a sun and moon on real ephemerides, the bright-star sky, a seeded climate that schedules hourly weather, a GPU wind field, volumetric clouds, rain and snow, lightning and thunder, fog, heightfield terrain with erosion and flooding, ground cover, rocks, dust, paths and trails — all in compute shaders, for anyone building an open world that has to look alive without a weather artist.

crates.io docs.rs CI Bevy License

The sky over one morning: a clear sky, then a broken cumulus deck, then full stratus cover, then fog, the preset named on screen and the HUD printing the temperature, cover, wind and visibility

weather_tour forcing WeatherPreset::Clear, PartlyCloudy, Overcast and Fog in turn at 10.00 h on 20 April 2026 — the first three hours of its tour of all ten presets.

Status: usable · Bevy 0.20 · MSRV 1.97.1

Why: the obvious alternative is a sky shader plus a rain particle system, which gives you weather but not a world — nothing to ask about the ground, the water, the light or the wind, and nothing that survives a save. This crate keeps one simulation behind an Environment query, so gameplay reads the weather instead of guessing at it.

Quick start

cargo add bevy_elements
use bevy::prelude::*;
use bevy_elements::*;

fn main() {
    App::new()
        .add_plugins((DefaultPlugins, ElementsPlugins))
        .insert_resource(WorldClock::new(CivilDate::new(2026, 6, 21)).at_hour(7.0))
        .insert_resource(Climate::temperate())
        .add_systems(Startup, setup)
        .run();
}

fn setup(mut commands: Commands) {
    // The environment follows and renders for the `ElementsCamera`.
    commands.spawn((
        Camera3d::default(),
        ElementsCamera::default(),
        Transform::from_xyz(0.0, 160.0, 0.0).looking_at(Vec3::new(100.0, 100.0, 0.0), Vec3::Y),
    ));
    // 2 km of rolling hills, centred on the origin.
    commands.spawn(Terrain::procedural(ProceduralTerrain::hills(42)));
}

Try it

cargo run --release --example quickstart

The example lifts the camera to 6 m above the ground and holds it there while the clock runs; add ELEMENTS_FRAMES=600 ELEMENTS_SHOT=/tmp/x.png to capture it unattended.

What you can do

  • Put a living sky over any scene — sun, moon and 8 404 stars from real ephemerides, with exposure that keeps night dark: sky, weather and light.
  • Let a seeded climate schedule the weather — Clear through Blizzard, hourly, with seasons and a snow season a game sets by date: climate, seasons and weather.
  • Rain, snow, fog and lightning that read from every camera — including an orthographic, isometric or strategy view, with PrecipitationLook::readable() for far-off cameras: precipitation.
  • Generate, sculpt and save a terrain — procedural presets, a height map or flat ground, brushes that edit the live heightfield, snapshots to save and restore it: terrain.
  • Wear the ground down realistically — snow that drifts and melts, wetness and puddles, wind-blown sand, trodden paths and pressed footprints: ground cover, paths.
  • Flood it, and answer what the water is doing — shallow-water hydrology with erosion, lakes, rivers, and wakes from anything moving through: rivers, lakes and waves.
  • Ask the simulation anything — ground height and normal, water depth and velocity, snow depth, cloud shadow, light needed for a night lamp: gameplay queries.

An isometric town 1500 m from its camera, which follows the walker: rain, snow, fog and a partly cloudy afternoon

Clear at 10.00 h on 20 April: cover 0.05, 40 000 m visibility, wind 3.0 m/s, the sun 40.1° up

The isometric example: an orthographic camera 1 500 m back, following a walker, in the crate's rain, snow and fog.

Part of the Coven

bevy_elements is one crate in the coven, a family of Bevy crates that cover the parts of a game only human authoring scales: world, life, interface and spectacle. In Grimoire it is an optional cargo feature whose map environment panel edits this crate's own serde settings — the clock, the climate, the forced weather, snow, wetness, rocks and dust.

Bevy compatibility

bevy_elements bevy notes
0.7 0.20 current
0.1 – 0.6 0.20 isomesh needs isomesh/bevy_isomesh 0.0.11; flora needs bevy_flora 0.46

Learn more

Who and licence

Maintained by @Ladvien. Questions and bugs: the issue tracker. Contributions follow the org's CONTRIBUTING.md; docs follow DOCUMENTATION.md.

MIT OR Apache-2.0, at your option.