pub struct LightmapInfo {
pub view: TextureView,
pub world_rect: [f32; 4],
pub layer_clamp: u32,
pub generation: u64,
}Expand description
The light map one frame produced, as its consumers see it.
Published in CallbackResources under the pass id and read back by
SpriteBatch::set_light_source.
view is a texture_2d_array<f32> of layer_clamp + 1 layers; the last
layer is always cleared to (0, 0, 0, 1), the identity for the consumer’s
maths, so an item that is lit by nothing can simply be pointed at it.
Fields§
§view: TextureViewAccumulator array texture view (Rgba8Unorm, one layer per mask bit).
world_rect: [f32; 4]World rect the map covers: [x, y, w, h], uv origin at its top-left.
layer_clamp: u32Highest layer an item may sample (the identity layer).
generation: u64Bumped whenever the underlying texture is recreated. Consumers compare it to know when a cached bind group is stale; the rect changes every frame and travels in the consumer’s own uniform instead.
Auto Trait Implementations§
impl !RefUnwindSafe for LightmapInfo
impl !UnwindSafe for LightmapInfo
impl Freeze for LightmapInfo
impl Send for LightmapInfo
impl Sync for LightmapInfo
impl Unpin for LightmapInfo
impl UnsafeUnpin for LightmapInfo
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> 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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.