Bevy Sky Gradient
A simple and beautiful procedural sky shader for the Bevy game engine.

Features
- Skybox: Everything is rendered using skyboxes. Supports gradient coloring, sun, stars, and auroras.
- Day-Night Cycle: Animate the sky from sunrise to sunset and through the night. You can easily configure the duration of the cycle.
- Procedural Sun: A sun that moves across the sky, synchronized with the day-night cycle, casting a directional light in your scene.
- Stars & Auroras: As night falls, stars and procedural auroras will light up the sky.
- Modular by Design: Enable or disable features you don't need. If you want a static sky, you can disable the day-night cycle. If you don't need auroras, you can remove them to save performance.
- Easy Customization: Modify sky parameters at runtime to change its appearance dynamically.
Quick Start
Add the bevy_sky_gradient crate to your Cargo.toml:
[]
= "0.2.0"
Then, add the SkyPlugin to your app and add the SkyboxMagnetTag to your camera.
use *;
use *;
Customization
bevy_sky_gradient is designed to be modular. You can easily enable, disable, or configure features using the SkyPlugin::builder().
builder
.set_sun_driver
.set_aurora.build,
Features Explained
-
Sky Cycle (
SkyCyclePlugin): This plugin introduces a timer that drives the day-night cycle. It controls the position of the sun and the color of the sky gradient. You can customize the length of the day, night, sunrise, and sunset via theSkyTimeSettingsresource. -
Sun Driver (
SunDriverPlugin): This plugin spawns aDirectionalLightentity and updates its position and intensity based on the time of day from theSkyCyclePlugin. It also updates the sun's appearance in the skybox shader. -
Aurora (
AuroraPlugin): This plugin adds a beautiful procedural aurora effect to the night sky. The aurora is rendered to a separate texture for better performance and is then blended with the main skybox. You can adjust the render quality of the aurora via theAuroraSettingsresource. -
Rendering to a Texture: For advanced use cases like screen-space fog or reflections, you can have the skybox render to a texture instead of directly to the screen. Use the
.with_render_sky_to_texture()method on theSkyPluginBuilder.
Bevy support table
| bevy | Bevy Sky Gradient |
|---|---|
| 0.17 | 0.2.0 |
| 0.16 | 0.1.0 |
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.