cluster.wgsl
Import path
Constants
Structures
Indirect draw parameters in the format required by the WebGPU specification.
See the comments in bevy_pbr/src/cluster/gpu.rs for information on the
fields.
An axis-aligned bounding box.
This is used for cluster bounds.
Functions
See bevy_light::cluster::assign::cluster_space_clusterable_object_aabb.
fn
cluster_space_object_aabb
(
position:
vec3<f32>
,
radius:
f32
,
view_from_world:
mat4x4<f32>
,
clip_from_view:
mat4x4<f32>
,
view_from_world_scale:
vec3<f32>
)
->
Aabb
Computes the scale of the camera from the view matrix.
Returns the cluster coordinates corresponding to a position in normalized
device coordinates.
See bevy_light::cluster::assign::ndc_position_to_cluster.
Returns the AABB encompassing all clusters that intersect a sphere.
fn
calculate_sphere_cluster_bounds
(
position:
vec3<f32>
,
radius:
f32
,
view_from_world:
mat4x4<f32>
,
clip_from_view:
mat4x4<f32>
,
view_from_world_scale:
vec3<f32>
,
cluster_dimensions:
vec3<u32>
,
cluster_factors:
vec2<f32>
,
is_orthographic:
bool
)
->
AabbU
See the comments in
bevy_pbr/src/cluster/gpu.rsfor information on the fields.