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.

Constants

CLUSTER_COUNT_SIZE

#
const CLUSTER_COUNT_SIZE: u32 = 9u

Structures

ClusterableObjectIndexRanges

#

These offsets must be monotonically nondecreasing. That is, indices are always sorted into the following order: point lights, spot lights, rect lights, reflection probes, irradiance volumes.

struct ClusterableObjectIndexRanges {
first_point_light_index_offset: u32 ,
first_spot_light_index_offset: u32 ,
first_rect_light_index_offset: u32 ,
first_reflection_probe_index_offset: u32 ,
first_irradiance_volume_index_offset: u32 ,
first_decal_offset: u32 ,
last_clusterable_object_index_offset: u32 ,
}

Functions

view_z_to_z_slice

#

NOTE: Keep in sync with bevy_pbr/src/light.rs

fn view_z_to_z_slice (
cluster_factors: vec2<f32>
, 
z_slices: u32
, 
view_z: f32
, 
is_orthographic: bool
) -> u32

view_fragment_cluster_index

#
fn view_fragment_cluster_index (
frag_coord: vec2<f32>
, 
view_z: f32
, 
is_orthographic: bool
) -> u32

fragment_cluster_index

#

Given a cluster XYZ position, returns its index in the cluster list.

fn fragment_cluster_index (
p: vec3<u32>
, 
cluster_dimensions: vec4<u32>
) -> u32

unpack_clusterable_object_index_ranges

#

Note that if fewer than 3 SSBO bindings are available (in WebGL 2, primarily), light probes aren’t clustered, and therefore both light probe index ranges will be empty.

fn unpack_clusterable_object_index_ranges (
cluster_index: u32
) -> ClusterableObjectIndexRanges

get_clusterable_object_id

#

Note that, in the case of a light probe, the index refers to an element in one of the two light_probes sublists, not the clustered_lights list.

fn get_clusterable_object_id (
index: u32
) -> u32

cluster_debug_visualization

#
fn cluster_debug_visualization (
input_color: vec4<f32>
, 
view_z: f32
, 
is_orthographic: bool
, 
clusterable_object_index_ranges: ClusterableObjectIndexRanges
, 
cluster_index: u32
) -> vec4<f32>
Contents