bevy_atmos · for Bevy 0.19

Atmos

Sky, weather and water for Bevy

Time of day, a physical sky with volumetric clouds, rain and snow that soak the ground, modern water with flowing rivers, fog, sun shafts and a colour grade. Add it in one line, then tune it live in your game from an editor anyone can use.

Free & open source MIT or Apache-2.0 Mouse, keyboard & gamepad
Golden hour over the demo scene: low warm sun, long shadows, clouds lit orange
One plugin lineplus a tag on your camera and sun
App::new().add_plugins((DefaultPlugins, AtmosPlugin::new("my_level", "looks")))
Features

Everything outdoors, in one plugin

Each part works on its own and every value is a live slider. Nothing changes until you change it, so a level without a saved look looks exactly as your game made it.

A look editor anyone can use

Press F9. Six plain-English tabs, a help line on every slider, click to reset, presets, Save, Revert and hold-to-compare.

Time of day

Set the hour or let the clock run. The sun follows a real path for your latitude and the moon lights the night.

Sky & volumetric clouds

A physical sky whose colours follow the sun, and 3D clouds raymarched per pixel: cover, greyness, wisps, height and drift.

Rain, snow & wet surfaces

Rain and snow slant in the wind. Surfaces darken as they soak, collect puddles that ripple, and dry slowly after.

Modern water & rivers

Wind-driven waves, shore and crest foam, reflections, sun glitter, rain rings and underwater fog. Rivers flow downhill into white water.

Fog, shafts & reflections

Distance fog tinted by the sky, beams of sunlight through the haze, and screen-space reflections on wet ground.

Colour grade

Exposure, warmth, tint, contrast and saturation as the final touch.

A saved look per level

Looks are small text files, one value a line: easy to read, diff and commit, or ship inside your game.

Fly camera

Press F8 to fly round the level and judge the look from anywhere, with mouse and keys or a pad.

The look editor panel on the Weather tab: presets, sliders with units and a help line
The editor

Made for people who aren't graphics programmers

  • Tabs with plain names: Time & Sun, Sky & Clouds, Weather, Water, Fog & Light, Colour. Extra settings wait under Advanced.
  • Every slider shows its unit, says what it does when you hover it, and resets with one click.
  • Hold Compare to see the level as your game made it. Save, or Revert to the last save.
  • The status line says which level's look is loaded and whether it has unsaved changes.
Clear DayOvercastGolden HourNightStormSnow
Download & install

Up and running in three steps

You need Bevy 0.19, a recent stable Rust (edition 2024, from rustup.rs) and a GPU that runs Bevy's default renderer on Vulkan, DirectX 12 or Metal. WebGL2 isn't supported.

Add the dependency

In your game's Cargo.toml:

[dependencies]
bevy_atmos = { git = "https://github.com/Nilbong/bevy_atmos" }

Add the plugin and tag your camera and sun

The level's name names its saved look; the folder is where looks go.

use bevy::prelude::*;
use bevy_atmos::{AtmosCamera, AtmosPlugin, AtmosSun};

fn main() {
    App::new()
        .add_plugins((DefaultPlugins, AtmosPlugin::new("my_level", "looks")))
        .add_systems(Startup, setup)
        .run();
}

fn setup(mut commands: Commands) {
    commands.spawn((Camera3d::default(), bevy::camera::Hdr, AtmosCamera));
    commands.spawn((DirectionalLight { shadow_maps_enabled: true, ..default() }, AtmosSun));
}

Run your game and press F9

Pick a preset, move some sliders and press Save. The look is written to looks/my_level.txt.

Just want to see it first?

Clone the repo and run the demo scene: a few boxes, a pool and a river under the full sky.

git clone https://github.com/Nilbong/bevy_atmos
cd bevy_atmos
cargo run --release --example demo
F9  look editor
F8  fly camera
H  hold to compare
Ctrl+S  save the look

Saved looks are plain text

# my_level's look (bevy_atmos)
time.hour = 17.5
sky.cover = 0.6
weather.rain = 0.4

Only what you changed is written. Set the AtmosLevel resource when the level changes and its look loads. Ship looks inside your game with AtmosSettings::builtin.

Get it running in your project

Opt in to the parts you want

The sky, clouds, fog, shafts, rain, snow and grade work with just the camera and sun tagged. These make the rest of your level join in.

Wet surfaces WetMaterial

A StandardMaterial extension. Use Wet::ground() for floors that collect puddles and Wet::surface() for walls and props.

Water AtmosWater

Put it on each water mesh. With Modern water on, Atmos draws modern water over it; turn it off and your own water shows again.

Rivers WaterFlow

Beside AtmosWater, the water keeps the mesh's slope and flows: from your texture's UV scroll, a UV axis, a world velocity or a flow map. You can also paint flow in the editor.

Shelter map weather::Shelter

A heights image so rain stops at roofs and drips off their edges. Without one, rain falls everywhere.

Reflections SSR

On by default for the tagged camera (it adds a depth prepass). Tune it or turn it off on the Fog & Light tab.

Your own systems knobs::get

Read any value anywhere, e.g. knobs::get("weather.rain", 0.0). Skip your mouse look while editor::open() is true.

Limitations

What it doesn't do (yet)

Honest notes, so nothing surprises you.

FAQ

Troubleshooting

The sky is black or far too bright.

Add bevy::camera::Hdr to the camera with AtmosCamera. The sky's brightness is in real units.

My camera spins when I drag a slider.

Your mouse look is still running. Skip it while bevy_atmos::editor::open() or flycam::active() is true.

My water didn't change.

Turn on Modern water on the Water tab, and make sure the water mesh entity has AtmosWater.

My saved look didn't load.

It's <save_dir>/<level>.txt, relative to the folder the game runs from, and the name must match AtmosLevel. The log prints atmos: N knobs for <level> on load.

It's slow on my laptop.

Lower Cloud quality or turn Volumetric clouds off (Sky & Clouds > Advanced), and lower Sun shaft quality (Fog & Light > Advanced).

Licence

Free and open, for any project

bevy_atmos is dual-licensed under MIT or Apache-2.0, the same as Bevy. Use it in any game, commercial or not, without asking.