Advanced search tips: use spaces to require multiple terms (AND), | for alternatives (OR), wrap phrases in quotes (="a b"), =term for exact match, 'term to include, !term to exclude, ^term to match prefix, !^term to exclude prefix, .ext$ to match suffix, and !.ext$ to exclude suffix.

clustered.wgsl

Import path

Structures

ClusteredDecalIterator

#

An object that allows stepping through all clustered decals that affect a single fragment.

struct ClusteredDecalIterator {
texture_index: i32 ,
tag: u32 ,
decal_index_offset: i32 ,
end_offset: i32 ,
world_position: vec3<f32> ,
}

Functions

clustered_decal_iterator_new

#

Shader defs requirments:

🟢 CLUSTERED_DECALS_ARE_USABLE

let cluster_index = clustered_forward::fragment_cluster_index(frag_coord, view_z, is_orthographic); var clusterable_object_index_ranges = clustered_forward::unpack_clusterable_object_index_ranges(cluster_index);

fn clustered_decal_iterator_new (
world_position: vec3<f32>
clusterable_object_index_ranges: ptr<function,ClusterableObjectIndexRanges>
) -> ClusteredDecalIterator

clustered_decal_iterator_next

#

Shader defs requirments:

🟢 CLUSTERED_DECALS_ARE_USABLE

Returns true if another decal was found or false if no more decals were found for this position.

fn clustered_decal_iterator_next ( ) -> bool

get_view_z

#

Returns the view-space Z coordinate for the given world position.

fn get_view_z (
world_position: vec3<f32>
) -> f32

view_is_orthographic

#

Returns true if the current view describes an orthographic projection or false otherwise.

fn view_is_orthographic () -> bool

apply_decal_base_color

#

Returns the new base color with decals taken into account. If no decals overlap the current world position, returns the supplied base color unmodified.

fn apply_decal_base_color (
world_position: vec3<f32>
frag_coord: vec2<f32>
initial_base_color: vec4<f32>
) -> vec4<f32>