// Fragment Shader @group(1) @binding(0) var t_diffuse: texture_2d; @group(1) @binding(1) var s_diffuse: sampler; struct VertexOutput { @builtin(position) clip_position: vec4, @location(0) tex: vec2, @location(1) sprite: vec2 } @fragment fn main(in: VertexOutput) -> @location(0) vec4 { let color = textureSample(t_diffuse, s_diffuse, in.tex); let gray = dot(vec3(0.299, 0.587, 0.114), color.rgb); return vec4(gray, gray, gray, color.a); }