Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1#define_import_path bevy_pbr::mesh_view_bindings
3#import bevy_pbr::mesh_view_types as types
4#import bevy_pbr::atmosphere::types as atmosphere_types
5#import bevy_render::{
6 view::View,
7 globals::Globals,
8}
10@group(0) @binding(0) var<uniform> view: View;
11@group(0) @binding(1) var<uniform> lights: types::Lights;
12#ifdef NO_CUBE_ARRAY_TEXTURES_SUPPORT
13@group(0) @binding(2) var point_shadow_textures: texture_depth_cube;
14#else
15@group(0) @binding(2) var point_shadow_textures: texture_depth_cube_array;
16#endif
17@group(0) @binding(3) var point_shadow_textures_comparison_sampler: sampler_comparison;
18#ifdef PCSS_SAMPLERS_AVAILABLE
19@group(0) @binding(4) var point_shadow_textures_linear_sampler: sampler;
20#endif // PCSS_SAMPLERS_AVAILABLE
21#ifdef NO_ARRAY_TEXTURES_SUPPORT
22@group(0) @binding(5) var directional_shadow_textures: texture_depth_2d;
23#else
24@group(0) @binding(5) var directional_shadow_textures: texture_depth_2d_array;
25#endif
26@group(0) @binding(6) var directional_shadow_textures_comparison_sampler: sampler_comparison;
27#ifdef PCSS_SAMPLERS_AVAILABLE
28@group(0) @binding(7) var directional_shadow_textures_linear_sampler: sampler;
29#endif // PCSS_SAMPLERS_AVAILABLE
31#if AVAILABLE_STORAGE_BUFFER_BINDINGS >= 3
32@group(0) @binding(8) var<storage> clustered_lights: types::ClusteredLights;
33@group(0) @binding(9) var<storage> clusterable_object_index_lists: types::ClusterableObjectIndexLists;
34@group(0) @binding(10) var<storage> cluster_offsets_and_counts: types::ClusterOffsetsAndCounts;
35#else
36@group(0) @binding(8) var<uniform> clustered_lights: types::ClusteredLights;
37@group(0) @binding(9) var<uniform> clusterable_object_index_lists: types::ClusterableObjectIndexLists;
38@group(0) @binding(10) var<uniform> cluster_offsets_and_counts: types::ClusterOffsetsAndCounts;
39#endif
41@group(0) @binding(11) var<uniform> globals: Globals;
42@group(0) @binding(12) var<uniform> light_probes: types::LightProbes;
44#ifdef DISTANCE_FOG
45@group(0) @binding(13) var<uniform> fog: types::Fog;
46#endif
48const VISIBILITY_RANGE_UNIFORM_BUFFER_SIZE: u32 = 64u;
49#if AVAILABLE_STORAGE_BUFFER_BINDINGS >= 6
50@group(0) @binding(14) var<storage> visibility_ranges: array<vec4<f32>>;
51#else
52@group(0) @binding(14) var<uniform> visibility_ranges: array<vec4<f32>, VISIBILITY_RANGE_UNIFORM_BUFFER_SIZE>;
53#endif
55#ifdef SCREEN_SPACE_REFLECTIONS
56@group(0) @binding(15) var<uniform> ssr_settings: types::ScreenSpaceReflectionsSettings;
57#endif
59#ifdef CONTACT_SHADOWS
60@group(0) @binding(16) var<uniform> contact_shadows_settings: types::ContactShadowsSettings;
61#endif
63#ifdef SCREEN_SPACE_AMBIENT_OCCLUSION
64@group(0) @binding(17) var screen_space_ambient_occlusion_texture: texture_2d<f32>;
65#endif
67#ifdef TONEMAP_IN_SHADER
68// NB: If you change these, make sure to update `tonemapping_shared.wgsl` too.
69@group(0) @binding(18) var dt_lut_texture: texture_3d<f32>;
70@group(0) @binding(19) var dt_lut_sampler: sampler;
71#endif
73#ifdef MULTISAMPLED
74#ifdef DEPTH_PREPASS
75@group(0) @binding(20) var depth_prepass_texture: texture_depth_multisampled_2d;
76#endif // DEPTH_PREPASS
77#ifdef NORMAL_PREPASS
78@group(0) @binding(21) var normal_prepass_texture: texture_multisampled_2d<f32>;
79#endif // NORMAL_PREPASS
80#ifdef MOTION_VECTOR_PREPASS
81@group(0) @binding(22) var motion_vector_prepass_texture: texture_multisampled_2d<f32>;
82#endif // MOTION_VECTOR_PREPASS
84#else // MULTISAMPLED
86#ifdef DEPTH_PREPASS
87@group(0) @binding(20) var depth_prepass_texture: texture_depth_2d;
88#endif // DEPTH_PREPASS
89#ifdef NORMAL_PREPASS
90@group(0) @binding(21) var normal_prepass_texture: texture_2d<f32>;
91#endif // NORMAL_PREPASS
92#ifdef MOTION_VECTOR_PREPASS
93@group(0) @binding(22) var motion_vector_prepass_texture: texture_2d<f32>;
94#endif // MOTION_VECTOR_PREPASS
96#endif // MULTISAMPLED
98#ifdef DEFERRED_PREPASS
99@group(0) @binding(23) var deferred_prepass_texture: texture_2d<u32>;
100#endif // DEFERRED_PREPASS
102@group(0) @binding(24) var view_transmission_texture: texture_2d<f32>;
103@group(0) @binding(25) var view_transmission_sampler: sampler;
105#ifdef OIT_ENABLED
106@group(0) @binding(26) var<uniform> oit_settings: types::OrderIndependentTransparencySettings;
107@group(0) @binding(27) var<uniform> oit_nodes_capacity: u32;
108@group(0) @binding(28) var<storage, read_write> oit_nodes: array<types::OitFragmentNode>;
109@group(0) @binding(29) var<storage, read_write> oit_heads: array<atomic<u32>>;
110@group(0) @binding(30) var<storage, read_write> oit_atomic_counter: atomic<u32>;
111#endif // OIT_ENABLED
113#ifdef ATMOSPHERE
114@group(0) @binding(31) var atmosphere_transmittance_texture: texture_2d<f32>;
115@group(0) @binding(32) var atmosphere_transmittance_sampler: sampler;
116@group(0) @binding(33) var<storage> atmosphere: atmosphere_types::Atmosphere;
117#endif // ATMOSPHERE
119#ifdef BLUE_NOISE_TEXTURE
120@group(0) @binding(34) var blue_noise_texture: texture_2d_array<f32>;
121#endif // BLUE_NOISE_TEXTURE
123#ifdef AREA_LIGHT_LUTS
124@group(0) @binding(35) var area_light_luts: texture_2d_array<f32>;
125@group(0) @binding(36) var area_light_luts_sampler: sampler;
126#endif
128#ifdef DFG_LUT
129@group(0) @binding(37) var dfg_lut: texture_2d<f32>;
130@group(0) @binding(38) var dfg_lut_sampler: sampler;
131#endif // DFG_LUT
133#ifdef ENVIRONMENT_MAP
134#ifdef MULTIPLE_LIGHT_PROBES_IN_ARRAY
135@group(1) @binding(0) var diffuse_environment_maps: binding_array<texture_cube<f32>, 8u>;
136@group(1) @binding(1) var specular_environment_maps: binding_array<texture_cube<f32>, 8u>;
137#else
138@group(1) @binding(0) var diffuse_environment_map: texture_cube<f32>;
139@group(1) @binding(1) var specular_environment_map: texture_cube<f32>;
140#endif
141@group(1) @binding(2) var environment_map_sampler: sampler;
142#endif
144#ifdef IRRADIANCE_VOLUME
145#ifdef IRRADIANCE_VOLUMES_ARE_USABLE
146#ifdef MULTIPLE_LIGHT_PROBES_IN_ARRAY
147@group(1) @binding(3) var irradiance_volumes: binding_array<texture_3d<f32>, 8u>;
148#else
149@group(1) @binding(3) var irradiance_volume: texture_3d<f32>;
150#endif
151@group(1) @binding(4) var irradiance_volume_sampler: sampler;
152#endif
153#endif
155#ifdef CLUSTERED_DECALS_ARE_USABLE
156@group(1) @binding(5) var<storage> clustered_decals: types::ClusteredDecals;
157@group(1) @binding(6) var clustered_decal_textures: binding_array<texture_2d<f32>, 8u>;
158@group(1) @binding(7) var clustered_decal_sampler: sampler;
159#endif // CLUSTERED_DECALS_ARE_USABLE
Contents