# Bevy Fast Light
[](https://github.com/leomeinel/bevy_fast_light)
[](https://crates.io/crates/bevy_fast_light)
[](https://crates.io/crates/bevy_fast_light)
[](https://docs.rs/bevy_fast_light/latest/bevy_fast_light/)
Simple 2D lighting for Bevy focused on performance over features.
## Features
- Simple and fast `PointLight2d` light source with `falloff` configurable via inner and outer radius.
- Simple and fast `AmbientLight2d` light source.
## Limitations
- There is currently no light occluders or shadow casting at all.
## Usage
Take a look at [`/examples`](https://github.com/leomeinel/bevy_fast_light/tree/main/examples) to find out how to use this crate.
### Examples
#### `ambient_light.rs`
Scene with a blue `AmbientLight2d` with a lower intensity, a gray `Rectangle` as background and a red `PointLight2d`.
<img src="https://github.com/leomeinel/bevy_fast_light/blob/main/static/ambient_light.webp?raw=true" width="400" alt="ambient light example">
#### `point_light.rs`
Scene with a gray `Rectangle` as background and a red `PointLight2d`.
<img src="https://github.com/leomeinel/bevy_fast_light/blob/main/static/point_light.webp?raw=true" width="400" alt="point light example">
#### `texture_scale.rs`
Scene with a gray `Rectangle` as background and a red `PointLight2d` using a lower `texture_scale`.
<img src="https://github.com/leomeinel/bevy_fast_light/blob/main/static/texture_scale.webp?raw=true" width="400" alt="texture scale example">
## Alternatives
- [bevy_2d_screen_space_lightmaps](https://github.com/goto64/bevy_2d_screen_space_lightmaps)
- [bevy_light_2d](https://crates.io/crates/bevy_light_2d)
- [bevy_lit](https://crates.io/crates/bevy_lit)
## Inspired by
- [Bevy Example - CPU Drawing](https://bevy.org/examples/2d-rendering/cpu-draw/)
- [Bevy Example - 2d Shapes](https://bevy.org/examples/2d-rendering/2d-shapes/)
- [Bevy Example - Extended Material](https://bevy.org/examples/shaders/extended-material/)
- [aarthificial - Deferred Lights - Pixel Renderer Devlog #1](https://youtu.be/R6vQ9VmMz2w)
- [Barney Codes - Introduction to shaders: Learn the basics!](https://youtu.be/3mfvZ-mdtZQ)
- [Inkbox - Creating My Own 3D Graphics Engine](https://youtu.be/OJoZSRnU0is)
- [JohnBrx - Creating 3D Lighting for my 2D Game](https://youtu.be/UavoVWHrebM)
- [Shirley Leisurely Games - Overcoming Godot’s 2D Light Limit With a Custom Light System](https://youtu.be/Ux3IIhbZl34)
- [tEEvy - Understanding shaders is easy, actually](https://youtu.be/xnZfMRTmfJY)
- [github - motion-canvas/examples](https://github.com/motion-canvas/examples/tree/master/examples/deferred-lighting/src)
- [MDN - GLSL shaders](https://developer.mozilla.org/en-US/docs/Games/Techniques/3D_on_the_web/GLSL_Shaders)
- [slembcke.net - 2D Lighting Techniques](https://www.slembcke.net/blog/2DLightingTechniques/)
- [slembcke.net - 2D Lighting with Hard Shadows](https://www.slembcke.net/blog/SuperFastHardShadows/)