Bevy Fast Light
Simple 2D lighting for Bevy focused on performance over features.
:warning: | This is still in development and not at all feature complete.
Features
Lights
| Purpose | Component | Config |
|---|---|---|
| Ambient light | AmbientLight2d |
color and intensity |
| Mesh light | MeshLight2d |
color, intensity and attached Mesh2d that determines shape |
Occluders
| Purpose | Component | Config |
|---|---|---|
| Mesh occluder | MeshOccluder2d |
Attached Mesh2d that determines shape |
Sprites are rendered above occluders if they are on the same or a higher z-level. Also see Showcase.
Limitations
- There is currently no shadow casting for light occluders.
Usage
Take a look at /examples to find out how to use this crate.
Showcase
I am using most features in my learning project Slimy Mist and have also successfully implemented a day/night cycle.
This also visualizes how Sprites are rendered above occluders if they are on the same or a higher z-level.
Examples
ambient_light.rs
Scene with a light sky colored AmbientLight2d with a lower intensity, a green Rectangle as background and an amber MeshLight2d.
mesh_light.rs
Scene with a green Rectangle as background and an amber MeshLight2d.
mesh_occluder.rs
Scene with a light sky colored AmbientLight2d with a lower intensity, a green Rectangle as background, an amber MeshLight2d and a MeshOccluder2d.
texture_scale.rs
Scene with a green Rectangle as background and an amber MeshLight2d using a lower texture_scale.