pub enum MaskBackend {
None,
Stencil,
Coverage,
}Expand description
How a scene rasterises mask coverage.
The two working backends implement the same semantics from opposite ends:
MaskBackend::Stencil is the hardware stencil, and
MaskBackend::Coverage is written for engines that never lend one.
Which is available is a property of the host’s render pass, not of the
animation — the same .ssab must look the same either way.
Variants§
None
No masking. Pure masks draw nothing and masked targets draw unclipped.
Stencil
The host’s stencil buffer. Needs
SceneConfig::stencil_format and a matching attachment on every pass.
Coverage
A coverage bitmap the player rasterises for itself.
Needs no stencil from the host, and so is the backend for a pass that has
none to give — Bevy’s 2d depth is Depth32Float, and a WebGPU engine that
composes its own passes may expose no depth at all. The cost is one extra
pass per masking player per frame, which is why it is not the default.
The host must call SSScene::encode_offscreen between update
and draw: the bitmap is rasterised into its own render pass, and under
the borrow model only the host has an encoder to open one with.
Trait Implementations§
Source§impl Clone for MaskBackend
impl Clone for MaskBackend
impl Copy for MaskBackend
Source§impl Debug for MaskBackend
impl Debug for MaskBackend
Source§impl Default for MaskBackend
impl Default for MaskBackend
impl Eq for MaskBackend
Source§impl PartialEq for MaskBackend
impl PartialEq for MaskBackend
impl StructuralPartialEq for MaskBackend
Auto Trait Implementations§
impl Freeze for MaskBackend
impl RefUnwindSafe for MaskBackend
impl Send for MaskBackend
impl Sync for MaskBackend
impl Unpin for MaskBackend
impl UnsafeUnpin for MaskBackend
impl UnwindSafe for MaskBackend
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.