2023-11-14 02:18:25 +00:00
|
|
|
#import bevy_sprite::mesh2d_vertex_output::VertexOutput
|
|
|
|
// we can import items from shader modules in the assets folder with a quoted path
|
|
|
|
#import "shaders/custom_material_import.wgsl"::COLOR_MULTIPLIER
|
|
|
|
|
2023-12-02 22:21:53 +00:00
|
|
|
@group(2) @binding(0) var<uniform> material_color: vec4<f32>;
|
|
|
|
@group(2) @binding(1) var base_color_texture: texture_2d<f32>;
|
|
|
|
@group(2) @binding(2) var base_color_sampler: sampler;
|
2023-11-14 02:18:25 +00:00
|
|
|
|
|
|
|
@fragment
|
|
|
|
fn fragment(mesh: VertexOutput) -> @location(0) vec4<f32> {
|
|
|
|
return material_color * textureSample(base_color_texture, base_color_sampler, mesh.uv) * COLOR_MULTIPLIER;
|
|
|
|
}
|