Enum sierra::BlendFactor

source ·
pub enum BlendFactor {
Show 15 variants Zero, One, SrcColor, OneMinusSrcColor, DstColor, OneMinusDstColor, SrcAlpha, OneMinusSrcAlpha, DstAlpha, OneMinusDstAlpha, ConstantColor, OneMinusConstantColor, ConstantAlpha, OneMinusConstantAlpha, SrcAlphaSaturate,
}
Expand description

Defines how blend factor is calculated.

For each variant comment contains an equivalent Rust expression where Rs, Gs, Bs and As are value components from fragment shader’s color output, Rd, Gd, Bd and Ad are value components stored in attachment, and Rc, Gc, Bc and Ac are value components defined in constants.

Variants§

§

Zero

Color: (0.0, 0.0, 0.0) Alpha: 0.0

§

One

Color: (1.0, 1.0, 1.0) Alpha: 1.0

§

SrcColor

Color: (Rs, Gs, Bs) Alpha: As

§

OneMinusSrcColor

Color: (1.0 - Rs, 1.0 - Gs, 1.0 - Bs) Alpha: 1.0 - As

§

DstColor

Color: (Rd, Gd, Bd) Alpha: Ad

§

OneMinusDstColor

Color: (1.0 - Rd, 1.0 - Gd, 1.0 - Bd) Alpha: 1.0 - Ad

§

SrcAlpha

Color: (As, As, As) Alpha: As

§

OneMinusSrcAlpha

Color: (1.0 - As, 1.0 - As, 1.0 - As) Alpha: 1.0 - As

§

DstAlpha

Color: (Ad, Ad, Ad) Alpha: Ad

§

OneMinusDstAlpha

Color: (1.0 - Ad, 1.0 - Ad, 1.0 - Ad) Alpha: 1.0 - Ad

§

ConstantColor

Color: (Rc, Gc, Bc) Alpha: Ac

§

OneMinusConstantColor

Color: (1.0 - Rc, 1.0 - Gc, 1.0 - Bc) Alpha: 1.0 - Ac

§

ConstantAlpha

Color: (Ac, Ac, Ac) Alpha: Ac

§

OneMinusConstantAlpha

Color: (1.0 - Ac, 1.0 - Ac, 1.0 - Ac) Alpha: 1.0 - Ac

§

SrcAlphaSaturate

Color: {let f = min(As, 1.0 - Ad); (f,f,f)} Alpha: 1.0

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Checks if this value is equivalent to the given key. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.