1import package::render::mesh_view_types as types; 2import package::atmosphere::types as atmosphere_types; 8@if(MULTIPLE_LIGHT_PROBES_IN_ARRAY || CLUSTERED_DECALS_ARE_USABLE) 9enable wgpu_binding_array; 11@group(0) @binding(0) var<uniform> view: View; 12@group(0) @binding(1) var<uniform> lights: types::Lights; 13@if(NO_CUBE_ARRAY_TEXTURES_SUPPORT) 14@group(0) @binding(2) var point_shadow_textures: texture_depth_cube; 16@group(0) @binding(2) var point_shadow_textures: texture_depth_cube_array; 17@group(0) @binding(3) var point_shadow_textures_comparison_sampler: sampler_comparison; 18@if(PCSS_SAMPLERS_AVAILABLE) 19@group(0) @binding(4) var point_shadow_textures_linear_sampler: sampler; 20@if(NO_ARRAY_TEXTURES_SUPPORT) 21@group(0) @binding(5) var directional_shadow_textures: texture_depth_2d; 23@group(0) @binding(5) var directional_shadow_textures: texture_depth_2d_array; 24@group(0) @binding(6) var directional_shadow_textures_comparison_sampler: sampler_comparison; 25@if(PCSS_SAMPLERS_AVAILABLE) 26@group(0) @binding(7) var directional_shadow_textures_linear_sampler: sampler; 28@if(AVAILABLE_STORAGE_BUFFER_BINDINGS__GE_3) { 29@group(0) @binding(8) var<storage> clustered_lights: types::ClusteredLights; 30@group(0) @binding(9) var<storage> clusterable_object_index_lists: types::ClusterableObjectIndexLists; 31@group(0) @binding(10) var<storage> cluster_offsets_and_counts: types::ClusterOffsetsAndCounts; 33@if(!AVAILABLE_STORAGE_BUFFER_BINDINGS__GE_3) { 34@group(0) @binding(8) var<uniform> clustered_lights: types::ClusteredLights; 35@group(0) @binding(9) var<uniform> clusterable_object_index_lists: types::ClusterableObjectIndexLists; 36@group(0) @binding(10) var<uniform> cluster_offsets_and_counts: types::ClusterOffsetsAndCounts; 39@group(0) @binding(11) var<uniform> globals: Globals; 40@group(0) @binding(12) var<uniform> light_probes: types::LightProbes; 43@group(0) @binding(13) var<uniform> fog: types::Fog; 45const VISIBILITY_RANGE_UNIFORM_BUFFER_SIZE: u32 = 64u; 46@if(AVAILABLE_STORAGE_BUFFER_BINDINGS__GE_6) 47@group(0) @binding(14) var<storage> visibility_ranges: array<vec4<f32>>; 49@group(0) @binding(14) var<uniform> visibility_ranges: array<vec4<f32>, VISIBILITY_RANGE_UNIFORM_BUFFER_SIZE>; 51@if(SCREEN_SPACE_REFLECTIONS) 52@group(0) @binding(15) var<uniform> ssr_settings: types::ScreenSpaceReflectionsSettings; 55@group(0) @binding(16) var<uniform> contact_shadows_settings: types::ContactShadowsSettings; 57@if(SCREEN_SPACE_AMBIENT_OCCLUSION) 58@group(0) @binding(17) var screen_space_ambient_occlusion_texture: texture_2d<f32>; 60@if(TONEMAP_IN_SHADER) { 62@group(0) @binding(18) var dt_lut_texture: texture_3d<f32>; 63@group(0) @binding(19) var dt_lut_sampler: sampler; 66@if(MULTISAMPLED && DEPTH_PREPASS) 67@group(0) @binding(20) var depth_prepass_texture: texture_depth_multisampled_2d; 68@if(MULTISAMPLED && NORMAL_PREPASS) 69@group(0) @binding(21) var normal_prepass_texture: texture_multisampled_2d<f32>; 70@if(MULTISAMPLED && MOTION_VECTOR_PREPASS) 71@group(0) @binding(22) var motion_vector_prepass_texture: texture_multisampled_2d<f32>; 73@if(!MULTISAMPLED && DEPTH_PREPASS) 74@group(0) @binding(20) var depth_prepass_texture: texture_depth_2d; 75@if(!MULTISAMPLED && NORMAL_PREPASS) 76@group(0) @binding(21) var normal_prepass_texture: texture_2d<f32>; 77@if(!MULTISAMPLED && MOTION_VECTOR_PREPASS) 78@group(0) @binding(22) var motion_vector_prepass_texture: texture_2d<f32>; 81@group(0) @binding(23) var deferred_prepass_texture: texture_2d<u32>; 83@if (VIEW_TRANSMISSION_TEXTURE) { 84@group(0) @binding(24) var view_transmission_texture: texture_2d<f32>; 85@group(0) @binding(25) var view_transmission_sampler: sampler; 89@group(0) @binding(26) var<uniform> oit_settings: types::OrderIndependentTransparencySettings; 90@group(0) @binding(27) var<uniform> oit_nodes_capacity: u32; 91@group(0) @binding(28) var<storage, read_write> oit_nodes: array<types::OitFragmentNode>; 92@group(0) @binding(29) var<storage, read_write> oit_heads: array<atomic<u32>>; 93@group(0) @binding(30) var<storage, read_write> oit_atomic_counter: atomic<u32>; 97@group(0) @binding(31) var atmosphere_transmittance_texture: texture_2d<f32>; 98@group(0) @binding(32) var atmosphere_transmittance_sampler: sampler; 99@group(0) @binding(33) var<storage> atmosphere: atmosphere_types::Atmosphere; 102@if(BLUE_NOISE_TEXTURE) 103@group(0) @binding(34) var blue_noise_texture: texture_2d_array<f32>; 105@if(AREA_LIGHT_LUTS) { 106@group(0) @binding(35) var area_light_luts: texture_2d_array<f32>; 107@group(0) @binding(36) var area_light_luts_sampler: sampler; 111@group(0) @binding(37) var dfg_lut: texture_2d<f32>; 112@group(0) @binding(38) var dfg_lut_sampler: sampler; 115@if(ENVIRONMENT_MAP && MULTIPLE_LIGHT_PROBES_IN_ARRAY) { 116@group(1) @binding(0) var diffuse_environment_maps: binding_array<texture_cube<f32>, 8u>; 117@group(1) @binding(1) var specular_environment_maps: binding_array<texture_cube<f32>, 8u>; 119@if(ENVIRONMENT_MAP && !MULTIPLE_LIGHT_PROBES_IN_ARRAY) { 120@group(1) @binding(0) var diffuse_environment_map: texture_cube<f32>; 121@group(1) @binding(1) var specular_environment_map: texture_cube<f32>; 124@group(1) @binding(2) var environment_map_sampler: sampler; 126@if(IRRADIANCE_VOLUME && IRRADIANCE_VOLUMES_ARE_USABLE && MULTIPLE_LIGHT_PROBES_IN_ARRAY) 127@group(1) @binding(3) var irradiance_volumes: binding_array<texture_3d<f32>, 8u>; 128@if(IRRADIANCE_VOLUME && IRRADIANCE_VOLUMES_ARE_USABLE && !MULTIPLE_LIGHT_PROBES_IN_ARRAY) 129@group(1) @binding(3) var irradiance_volume: texture_3d<f32>; 130@if(IRRADIANCE_VOLUME && IRRADIANCE_VOLUMES_ARE_USABLE) 131@group(1) @binding(4) var irradiance_volume_sampler: sampler; 133@if(CLUSTERED_DECALS_ARE_USABLE) { 134@group(1) @binding(5) var<storage> clustered_decals: types::ClusteredDecals; 135@group(1) @binding(6) var clustered_decal_textures: binding_array<texture_2d<f32>, 8u>; 136@group(1) @binding(7) var clustered_decal_sampler: sampler;