3 translation: vec2<f32>, 7 @location(0) position: vec2<f32>, 8 @location(1) uv: vec2<f32>, 9 @location(2) color: vec4<f32>, 13 @builtin(position) position: vec4<f32>, 14 @location(0) color: vec4<f32>, 15 @location(1) uv: vec2<f32>, 18@group(0) @binding(0) var<uniform> transform: Transform; 19@group(1) @binding(0) var image_texture: texture_2d<f32>; 20@group(1) @binding(1) var image_sampler: sampler; 22fn linear_from_srgb(srgb: vec3<f32>) -> vec3<f32> { 23 let cutoff = srgb < vec3<f32>(0.04045); 24 let lower = srgb / 12.92; 25 let higher = pow((srgb + 0.055) / 1.055, vec3<f32>(2.4)); 26 return select(higher, lower, cutoff); 30fn vs_main(in: VertexInput) -> VertexOutput { 31 let position = in.position * transform.scale + transform.translation; 32 let color = vec4<f32>(linear_from_srgb(in.color.rgb), in.color.a); 33 return VertexOutput(vec4<f32>(position, 0.0, 1.0), color, in.uv); 37fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> { 38 let texture_color = textureSample(image_texture, image_sampler, in.uv); 40 let color = in.color * vec4<f32>(texture_color.rgb * texture_color.a, texture_color.a);