1#import bevy_pbr::forward_io::VertexOutput3@group(2) @binding(0) var textures: binding_array<texture_2d<f32>>;4@group(2) @binding(1) var nearest_sampler: sampler;5// We can also have array of samplers6// var samplers: binding_array<sampler>;8@fragment9fn fragment(10 mesh: VertexOutput,11) -> @location(0) vec4<f32> {12 // Select the texture to sample from using non-uniform uv coordinates13 let coords = clamp(vec2<u32>(mesh.uv * 4.0), vec2<u32>(0u), vec2<u32>(3u));14 let index = coords.y * 4u + coords.x;15 let inner_uv = fract(mesh.uv * 4.0);16 return textureSample(textures[index], nearest_sampler, inner_uv);17}