bevy_fast_light 0.6.0

Simple 2D lighting for Bevy focused on performance over features.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#import bevy_sprite::{mesh2d_functions::{get_world_from_local, mesh2d_position_local_to_clip}}

#import bevy_fast_light::types::{Light2dOccluderVertex, Light2dOccluderVertexOutput}

@vertex
fn vertex(vertex: Light2dOccluderVertex) -> Light2dOccluderVertexOutput {
    let world_from_local = get_world_from_local(vertex.instance_index);
    let clip_position = mesh2d_position_local_to_clip(world_from_local, vec4<f32>(vertex.position, 1.0));
    return Light2dOccluderVertexOutput (
        clip_position,
    );
}

@fragment
fn fragment() -> @location(0) vec4<f32> {
    return vec4(1.0);
}