mirror of
https://github.com/bevyengine/bevy.git
synced 2026-07-21 00:46:09 -04:00
e6ec2c181d
Use a shader def for the material bind group index to make it easier for when we want to switch back to group 2 in the future without breaking everyone again. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: atlv <email@atlasdostal.com> Co-authored-by: atlas dostal <rodol@rivalrebels.com>
15 lines
641 B
WebGPU Shading Language
15 lines
641 B
WebGPU Shading Language
#import bevy_pbr::forward_io::VertexOutput
|
|
// we can import items from shader modules in the assets folder with a quoted path
|
|
#import "shaders/custom_material_import.wgsl"::COLOR_MULTIPLIER
|
|
|
|
@group(#{MATERIAL_BIND_GROUP}) @binding(0) var<uniform> material_color: vec4<f32>;
|
|
@group(#{MATERIAL_BIND_GROUP}) @binding(1) var material_color_texture: texture_2d<f32>;
|
|
@group(#{MATERIAL_BIND_GROUP}) @binding(2) var material_color_sampler: sampler;
|
|
|
|
@fragment
|
|
fn fragment(
|
|
mesh: VertexOutput,
|
|
) -> @location(0) vec4<f32> {
|
|
return material_color * textureSample(material_color_texture, material_color_sampler, mesh.uv) * COLOR_MULTIPLIER;
|
|
}
|