#[non_exhaustive]pub enum BlendMode {
Show 17 variants
Alpha,
Screen,
Overlay,
Darken,
Lighten,
ColorDodge,
ColorBurn,
HardLight,
SoftLight,
Difference,
Exclusion,
Hue,
Saturation,
Color,
Luminosity,
Add,
Multiply,
}Expand description
Blend mode for a VectorMesh, following the CSS mix-blend-mode
vocabulary used by SVG/Lottie-style artwork. All variants are wired into
the renderer: separable modes use fixed-function blending, the rest
(marked below) isolate the mesh into a graphics layer and composite it
with a custom shader.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Alpha
Standard premultiplied alpha blending (normal).
Screen
screen: 1 - (1 - S) * (1 - D). Fixed-function.
Overlay
overlay: Multiply for dark backdrops, Screen for light ones.
Darken
darken: per-channel min(S, D). Fixed-function.
Lighten
lighten: per-channel max(S, D). Fixed-function.
ColorDodge
color-dodge: brightens the backdrop toward the source color.
ColorBurn
color-burn: darkens the backdrop toward the source color.
HardLight
hard-light: Overlay with source and backdrop swapped.
SoftLight
soft-light: subtle Overlay variant.
Difference
difference: per-channel |S - D|.
Needs the backdrop (fixed-function subtract only covers S - D),
so it composites via an isolated layer.
Exclusion
exclusion: like difference with lower contrast.
Hue
hue: source hue with backdrop saturation and luminosity.
Saturation
saturation: source saturation with backdrop hue and luminosity.
Color
color: source hue and saturation with backdrop luminosity.
Luminosity
luminosity: source luminosity with backdrop hue and saturation.
Add
Additive (screen-space light). Fixed-function.
Multiply
multiply: per-channel S * D. Fixed-function.
Implementations§
Source§impl BlendMode
impl BlendMode
Sourcepub fn needs_isolation(self) -> bool
pub fn needs_isolation(self) -> bool
Modes implemented with fixed-function hardware blending on the mesh pipeline. Everything else isolates the mesh into a graphics layer and composites it with the backdrop-blend shader.
Sourcepub fn shader_mode(self) -> u32
pub fn shader_mode(self) -> u32
Discriminant consumed by blend_layer.wgsl (mode flat varying).