1import bevy_pbr::render::forward_io::VertexOutput; 2import bevy_pbr::render::mesh_bindings::mesh; 3import bevy_render::bindless::{bindless_samplers_filtering, bindless_textures_2d}; 11struct MaterialBindings { 14 color_texture_sampler: u32, 18@group(constants::MATERIAL_BIND_GROUP) @binding(0) var<storage> materials: array<MaterialBindings>; 19@group(constants::MATERIAL_BIND_GROUP) @binding(10) var<storage> material_color: binding_array<Color>; 22@group(constants::MATERIAL_BIND_GROUP) @binding(0) var<uniform> material_color: Color; 23@group(constants::MATERIAL_BIND_GROUP) @binding(1) var material_color_texture: texture_2d<f32>; 24@group(constants::MATERIAL_BIND_GROUP) @binding(2) var material_color_sampler: sampler; 28fn fragment(in: VertexOutput) -> @location(0) vec4<f32> { 30 let slot = mesh[in.instance_index].material_and_lightmap_bind_group_slot & 0xffffu; 31 let base_color = material_color[materials[slot].material].base_color; 32 let texture = bindless_textures_2d[materials[slot].color_texture]; 33 let color_sampler = bindless_samplers_filtering[materials[slot].color_texture_sampler]; 36 let base_color = material_color.base_color; 37 let texture = material_color_texture; 38 let color_sampler = material_color_sampler; 40 return base_color * textureSampleLevel(