pub struct SpriteShade<'a> {
pub materials: &'a MaterialTable,
pub material: u8,
pub alpha_mul: u8,
pub lights: CpuLights<'a>,
pub shadow: Option<&'a dyn WorldOccluder>,
}Expand description
Material context for a translucent sprite draw (TV stage): the global
MaterialTable plus this instance’s uniform material id and per-frame
alpha multiplier. Passed (as Some) to draw_sprite_dense_shaded /
ClipFlipbook::draw_frame_shaded to enable front-to-back
accumulate-and-continue compositing; None (or an all-opaque effective
material) takes the existing first-hit opaque path byte-for-byte.
Fields§
§materials: &'a MaterialTableGlobal voxel-material palette (per-voxel id → opacity + blend mode).
material: u8Uniform material id for every voxel of this sprite whose dense
per-voxel mat array is empty (the TV.1 whole-sprite material).
alpha_mul: u8Per-instance opacity multiplier (255 = unscaled), so an effect can
fade out by cheap per-frame updates without re-uploading the volume.
lights: CpuLights<'a>DL.7 — world-space dynamic lights. When enabled, the opaque hit is
lit (sun + point lights + cel + ramp, flat per voxel) instead of the
baked shade. CpuLights::default() (disabled) ⇒ unchanged.
shadow: Option<&'a dyn WorldOccluder>XS.2 — world-space scene occluder for sprites receiving hard
shadows: a lit sprite voxel marches a shadow ray (world space) against
this and is darkened where terrain / other sprites block the caster.
None (the default) ⇒ unshadowed sprites (the pre-XS.2 look).
Trait Implementations§
Source§impl<'a> Clone for SpriteShade<'a>
impl<'a> Clone for SpriteShade<'a>
Source§fn clone(&self) -> SpriteShade<'a>
fn clone(&self) -> SpriteShade<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for SpriteShade<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for SpriteShade<'a>
impl<'a> !UnwindSafe for SpriteShade<'a>
impl<'a> Freeze for SpriteShade<'a>
impl<'a> Send for SpriteShade<'a>
impl<'a> Sync for SpriteShade<'a>
impl<'a> Unpin for SpriteShade<'a>
impl<'a> UnsafeUnpin for SpriteShade<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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