pub struct LightClusters {
pub cells: Vec<u32>,
pub dims: [u32; 3],
}Expand description
One frame’s clustered light assignment, in storage the caller reuses.
Fields§
§cells: Vec<u32>The cell records, dims.x * dims.y * dims.z * CELL_WORDS long.
dims: [u32; 3]The grid the records were written for.
Implementations§
Source§impl LightClusters
impl LightClusters
Sourcepub fn update(
&mut self,
cfg: &ClusterConfig,
clip_from_view: &Mat4,
view_from_world: &Mat4,
size: (u32, u32),
lights: &mut [PackedLight],
)
pub fn update( &mut self, cfg: &ClusterConfig, clip_from_view: &Mat4, view_from_world: &Mat4, size: (u32, u32), lights: &mut [PackedLight], )
Assign lights to the cells of cfg’s grid for this frame’s camera.
clip_from_view and view_from_world are the camera’s two transforms:
depth and the screen extent come from them, so both are needed. size is
the target’s pixel size.
lights is ranked by importance in place, so the caller passes them in
any order and the weakest are what a full cell drops.
Trait Implementations§
Source§impl Clone for LightClusters
impl Clone for LightClusters
Source§impl Debug for LightClusters
impl Debug for LightClusters
Source§impl Default for LightClusters
impl Default for LightClusters
impl Eq for LightClusters
Source§impl PartialEq for LightClusters
impl PartialEq for LightClusters
impl StructuralPartialEq for LightClusters
Auto Trait Implementations§
impl Forget for LightClusters
impl Freeze for LightClusters
impl RefUnwindSafe for LightClusters
impl Send for LightClusters
impl Sync for LightClusters
impl Unpin for LightClusters
impl UnsafeUnpin for LightClusters
impl UnwindSafe for LightClusters
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
Mutably borrows from an owned value. Read more
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
Converts
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> ⓘ
Converts
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