pub struct ShadowWedge {
pub quad: [Vec2; 4],
pub weight: f32,
pub tap: u32,
}Expand description
One triangle-fan quad of a light’s shadow, in world space, drawn as
[near_a, near_b, far_b, far_a].
Fields§
§quad: [Vec2; 4]Corners: two on the occluder edge, two extruded away from the light.
weight: f32This tap’s share of the shadow: taps sum to 1.0.
tap: u32Which tap this quad belongs to, 0..taps-1 in the order
shadow_wedges emitted them.
Implementations§
Source§impl ShadowWedge
impl ShadowWedge
Sourcepub fn mask_weights(&self) -> [f32; 4]
pub fn mask_weights(&self) -> [f32; 4]
The quad’s contribution to the shadow mask, one entry per mask channel:
weight in Self::tap’s channel and zero in the others.
Overlapping quads of one tap max-blend into their shared channel, so a solid occluder’s edges union per tap (a point is shadowed when the ray to the light crosses any edge), and the light shader sums the channels, which is the taps’ average.
Trait Implementations§
Source§impl Clone for ShadowWedge
impl Clone for ShadowWedge
impl Copy for ShadowWedge
Source§impl Debug for ShadowWedge
impl Debug for ShadowWedge
Source§impl PartialEq for ShadowWedge
impl PartialEq for ShadowWedge
impl StructuralPartialEq for ShadowWedge
Auto Trait Implementations§
impl Freeze for ShadowWedge
impl RefUnwindSafe for ShadowWedge
impl Send for ShadowWedge
impl Sync for ShadowWedge
impl Unpin for ShadowWedge
impl UnsafeUnpin for ShadowWedge
impl UnwindSafe for ShadowWedge
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.