bevy_light_2d 0.2.0-rc.2

General purpose 2d lighting for the Bevy game engine.
docs.rs failed to build bevy_light_2d-0.2.0-rc.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: bevy_light_2d-0.9.0

bevy_light_2d

Discord Crates.io docs license GitHub Actions Workflow Status Crates.io

General purpose 2D lighting for the bevy game engine. Designed to be simple to use, yet expressive enough to fit a variety of needs.

Features

Usage

In the basic example, all we need is the plugin, a camera, and a light source.

# Cargo.toml
[dependencies]
bevy = "0.14"
bevy_light_2d = "0.2"
use bevy::prelude::*;
use bevy_light_2d::prelude::*;

fn main() {
    App::new()
        .add_plugins((DefaultPlugins, Light2dPlugin))
        .add_systems(Startup, setup)
        .run()
}

fn setup(mut commands: Commands) {
    commands.spawn(Camera2dBundle::default());
    
    commands.spawn(PointLight2dBundle {
        point_light: PointLight2d {
            radius: 100.0,
            intensity: 3.0,
            ..default()
        },
        ..default()
    });
}

To see an in depth example, use cargo run --example dungeon.

Web support

WebGL2 and WebGPU are both supported.

Motiviation

When I first started experimenting with Bevy, the lack of a first party 2D lighting implementation left me wanting. While there were some rather impressive experimental 2D lighting crates out there, there wasn't much in the way of drop in options available.

My goal with this crate is to fill that void, prioritizing ease of use and general application over depth of features.

Future goals

  • Light occluders + shadows
  • Sprite lights

Bevy compatibility

bevy bevy_light_2d
0.14 0.2
0.13 0.1

Acknowledgements

I'd like to thank the authors of the below crates; they were a significant source of inspiration.

Asset credits