pub enum ShadowFilter {
None,
Pcf4,
}Expand description
Shadow edge filtering (Godot Light2D.ShadowFilter).
The filter is angular: the silhouette is re-derived for
ShadowFilter::tap_count rotations around the light, spaced over the
penumbra and each weighted 1 / taps, so the penumbra width in world units
is Light2d::shadow_softness at every occluder distance instead of a
screen-space blur.
Within one tap the edges of a solid occluder overlap, and the shadow there
is their union (a point is shadowed when the ray to the light crosses any
edge); only the taps themselves sum, as the average over the rotations. The
mask pass in lightpass implements exactly that: one
channel per tap, combined with max blending, summed by the light shader.
Each edge spaces its taps from its own midpoint’s distance to the light, not from one rotation for the whole occluder, so on a solid body two silhouette edges’ bands overlap and the union can reach full cover a few pixels sooner on the shadow side than a lone edge would. The penumbra’s mid level still sits on the silhouette: the closed-polygon golden measures it 1.5 px from the geometric edge, against a 3 px tolerance.
Variants§
Implementations§
Source§impl ShadowFilter
impl ShadowFilter
Trait Implementations§
Source§impl Clone for ShadowFilter
impl Clone for ShadowFilter
impl Copy for ShadowFilter
Source§impl Debug for ShadowFilter
impl Debug for ShadowFilter
Source§impl Default for ShadowFilter
impl Default for ShadowFilter
impl Eq for ShadowFilter
Source§impl PartialEq for ShadowFilter
impl PartialEq for ShadowFilter
impl StructuralPartialEq for ShadowFilter
Auto Trait Implementations§
impl Freeze for ShadowFilter
impl RefUnwindSafe for ShadowFilter
impl Send for ShadowFilter
impl Sync for ShadowFilter
impl Unpin for ShadowFilter
impl UnsafeUnpin for ShadowFilter
impl UnwindSafe for ShadowFilter
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<T> Brush for T
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>
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.