#[repr(C)]pub struct ClusterParams {}Expand description
Per-frame uniform for the clustered light-binning compute pass and the forward
pass that reads the per-cluster lists. The compute kernel unprojects each
cluster’s screen tile through inv_view_proj and walks camera rays to the
slice’s near/far depth to build a world-space AABB (same convention as the fog
froxel kernel), then tests each GpuLight sphere against it. The forward pass
reads the grid dims + depth range + screen size to map a fragment to its
cluster. 128 bytes; packed_float3 keeps cam_pos / view_forward inside their
16-byte lanes. Must match the ClusterParams struct in the light-cull and
forward shaders.
Fields§
§inv_view_proj: [[f32; 4]; 4]Inverse view-projection; unprojects a clip-space corner to world space.
cam_pos: [f32; 3]Camera world position; ray origin for the cluster-AABB build.
z_near: f32Camera near plane in view units (positive distance).
view_forward: [f32; 3]Camera forward axis (world space, unit); projects a ray onto view depth.
z_far: f32Far bound of the clustered range in view units (positive distance).
grid_x: u32Cluster tiles across the screen.
grid_y: u32Cluster tiles down the screen.
grid_z: u32Exponential depth slices per cluster column.
num_lights: u32Number of valid GpuLight entries the kernel bins.
screen_w: f32Render-target size in pixels; maps a fragment’s position.xy to a tile.
screen_h: f32Render-target height in pixels.
use_clusters: u321 = the forward pass reads the per-cluster list (main camera); 0 = it
falls back to iterating all num_lights lights (planar / probe re-renders,
whose viewpoint differs from the grid the main camera binned).
_pad: u32Padding so the field layout matches the shader-side struct.
Implementations§
Source§impl ClusterParams
impl ClusterParams
Sourcepub const ZERO: ClusterParams
pub const ZERO: ClusterParams
Neutral params for context construction before the first per-frame update. use_clusters = 0 so the forward pass falls back to brute-force iteration until a real frame’s camera fills the grid.
Trait Implementations§
Source§impl Clone for ClusterParams
impl Clone for ClusterParams
Source§fn clone(&self) -> ClusterParams
fn clone(&self) -> ClusterParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ClusterParams
Source§impl Debug for ClusterParams
impl Debug for ClusterParams
impl NoUninit for ClusterParams
Auto Trait Implementations§
impl Freeze for ClusterParams
impl RefUnwindSafe for ClusterParams
impl Send for ClusterParams
impl Sync for ClusterParams
impl Unpin for ClusterParams
impl UnsafeUnpin for ClusterParams
impl UnwindSafe for ClusterParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more