Skip to content

leomeinel/bevy_fast_light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

134 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bevy Fast Light

License Crates.io Downloads Docs

Simple 2D lighting for Bevy focused on performance over features.

⚠️ | This is still in development and not at all feature complete.

Features

Lights

Purpose Component Config
Ambient light AmbientLight2d color and intensity
Mesh light MeshLight color, intensity

Occluders

Purpose Component
Mesh occluder MeshOccluder

Sprites are rendered above occluders if they are on the same or a higher z-level. Also see Showcase.

Mesh2d

The following Components allow the customization of their shape via attaching a Mesh2d:

  • MeshLight
  • MeshOccluder

The Mesh2d is required for the Components to render.

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.

slimy mist example

Examples

ambient_light.rs

Scene with a light sky colored AmbientLight2d with a lower intensity, a green Rectangle as background and an amber MeshLight.

ambient light example

mesh_light.rs

Scene with a green Rectangle as background and an amber MeshLight.

mesh light example

mesh_occluder.rs

Scene with a light sky colored AmbientLight2d with a lower intensity, a green Rectangle as background, an amber MeshLight and a MeshOccluder.

mesh occluder example

Alternatives

Resources

Code

Articles

About

Simple 2D lighting for Bevy focused on performance over features.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors