bevy_lit 0.9.1

A lighting 2d library for Bevy
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#import bevy_sprite::mesh2d_vertex_output::VertexOutput

@group(2) @binding(0) var alpha_texture: texture_2d<f32>;
@group(2) @binding(1) var alpha_sampler: sampler;

@fragment
fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
    let mask = textureSample(alpha_texture, alpha_sampler, in.uv).a;

    if mask <= 0. {
        discard;
    }

    return vec4(mask);
}