pub struct ClusteredLightGrid {
pub tiles_x: u32,
pub tiles_y: u32,
pub depth_slices: u32,
pub tile_size: u32,
pub screen_width: u32,
pub screen_height: u32,
pub near: f32,
pub far: f32,
}Fields§
§tiles_x: u32§tiles_y: u32§depth_slices: u32§tile_size: u32§screen_width: u32§screen_height: u32§near: f32§far: f32Implementations§
Source§impl ClusteredLightGrid
impl ClusteredLightGrid
pub fn new( screen_width: u32, screen_height: u32, tile_size: u32, depth_slices: u32, near: f32, far: f32, ) -> Self
pub fn total_clusters(&self) -> u32
pub fn cluster_index(&self, tile_x: u32, tile_y: u32, depth_slice: u32) -> u32
Sourcepub fn depth_slice_from_linear(
linear_depth: f32,
near: f32,
far: f32,
num_slices: u32,
) -> u32
pub fn depth_slice_from_linear( linear_depth: f32, near: f32, far: f32, num_slices: u32, ) -> u32
Convert linear depth to cluster depth slice index
Sourcepub fn cluster_view_aabb(
&self,
tile_x: u32,
tile_y: u32,
depth_slice: u32,
proj: Mat4,
) -> (Vec3, Vec3)
pub fn cluster_view_aabb( &self, tile_x: u32, tile_y: u32, depth_slice: u32, proj: Mat4, ) -> (Vec3, Vec3)
Compute the AABB of a cluster in view-space
pub fn memory_requirements(&self, max_lights_per_cluster: u32) -> u64
Trait Implementations§
Source§impl Clone for ClusteredLightGrid
impl Clone for ClusteredLightGrid
Auto Trait Implementations§
impl Freeze for ClusteredLightGrid
impl RefUnwindSafe for ClusteredLightGrid
impl Send for ClusteredLightGrid
impl Sync for ClusteredLightGrid
impl Unpin for ClusteredLightGrid
impl UnsafeUnpin for ClusteredLightGrid
impl UnwindSafe for ClusteredLightGrid
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.