Struct ShadowAtlasAllocator
pub struct ShadowAtlasAllocator<const MAX_SLOTS: usize = 16> {
pub atlas_resolution: u32,
pub grid_dim: u32,
pub allocated_count: usize,
pub slots: [SpotPointShadowAtlasSlot; MAX_SLOTS],
}Expand description
Zero-heap tile allocator for a square spot/point light shadow atlas (e.g. 2048x2048 split into grid_dim x grid_dim tiles).
Fields§
§atlas_resolution: u32§grid_dim: u32§allocated_count: usize§slots: [SpotPointShadowAtlasSlot; MAX_SLOTS]Implementations§
§impl<const MAX_SLOTS: usize> ShadowAtlasAllocator<MAX_SLOTS>
impl<const MAX_SLOTS: usize> ShadowAtlasAllocator<MAX_SLOTS>
pub fn new( atlas_resolution: u32, grid_dim: u32, ) -> ShadowAtlasAllocator<MAX_SLOTS>
pub fn reset(&mut self)
pub fn allocate_slot(
&mut self,
light_view_projection: [[f32; 4]; 4],
light_index: u32,
face_index: u32,
receiver_bias: f32,
) -> Option<SpotPointShadowAtlasSlot>
pub fn allocate_slot( &mut self, light_view_projection: [[f32; 4]; 4], light_index: u32, face_index: u32, receiver_bias: f32, ) -> Option<SpotPointShadowAtlasSlot>
Allocates the next tile in the grid_dim x grid_dim shadow atlas for a local light caster.
Trait Implementations§
§impl<const MAX_SLOTS: usize> Clone for ShadowAtlasAllocator<MAX_SLOTS>
impl<const MAX_SLOTS: usize> Clone for ShadowAtlasAllocator<MAX_SLOTS>
§fn clone(&self) -> ShadowAtlasAllocator<MAX_SLOTS>
fn clone(&self) -> ShadowAtlasAllocator<MAX_SLOTS>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<const MAX_SLOTS: usize> Copy for ShadowAtlasAllocator<MAX_SLOTS>
Auto Trait Implementations§
impl<const MAX_SLOTS: usize> Freeze for ShadowAtlasAllocator<MAX_SLOTS>
impl<const MAX_SLOTS: usize> RefUnwindSafe for ShadowAtlasAllocator<MAX_SLOTS>
impl<const MAX_SLOTS: usize> Send for ShadowAtlasAllocator<MAX_SLOTS>
impl<const MAX_SLOTS: usize> Sync for ShadowAtlasAllocator<MAX_SLOTS>
impl<const MAX_SLOTS: usize> Unpin for ShadowAtlasAllocator<MAX_SLOTS>
impl<const MAX_SLOTS: usize> UnsafeUnpin for ShadowAtlasAllocator<MAX_SLOTS>
impl<const MAX_SLOTS: usize> UnwindSafe for ShadowAtlasAllocator<MAX_SLOTS>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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