Back home 🏡 WGSL Spec Bevy WGSL Functions

clustered_forward.wgsl

Import path

Constants

Name Type Value
CLUSTER_COUNT_SIZE # u32 9u

Functions

view_z_to_z_slice

#
NOTE: Keep in sync with bevy_pbr/src/light.rs
fn view_z_to_z_slice(view_z: f32, is_orthographic: bool) -> u32
Parameter Type
view_z f32
is_orthographic bool
Returns: u32

fragment_cluster_index

#
fn fragment_cluster_index(frag_coord: vec2<f32>, view_z: f32, is_orthographic: bool) -> u32
Parameter Type
frag_coord vec2<f32>
view_z f32
is_orthographic bool
Returns: u32

unpack_offset_and_counts

#
fn unpack_offset_and_counts(cluster_index: u32) -> vec3<u32>
Parameter Type
cluster_index u32
Returns: vec3<u32>

get_clusterable_object_id

#
fn get_clusterable_object_id(index: u32) -> u32
Parameter Type
index u32
Returns: u32

cluster_debug_visualization

#
fn cluster_debug_visualization(input_color: vec4<f32>, view_z: f32, is_orthographic: bool, offset_and_counts: vec3<u32>, cluster_index: u32) -> vec4<f32>
Parameter Type
input_color vec4<f32>
view_z f32
is_orthographic bool
offset_and_counts vec3<u32>
cluster_index u32
Returns: vec4<f32>