GraphicsAPI reference
Class BlendState
Namespace: MicroEngine.Graphics.Devices
Assembly: MicroEngine.Graphics.dll
Guide: The graphics device
Fixed-function blending: result = src·SrcFactor (op) dst·DstFactor, separately for colour and alpha, computed
in float and quantised to the target format. The presets assume premultiplied colours.
public sealed record BlendState : IEquatable<BlendState>Inheritance
Implements
Constructors
BlendState(BlendFactor, BlendFactor, BlendOp, BlendFactor, BlendFactor, BlendOp)
Fixed-function blending: result = src·SrcFactor (op) dst·DstFactor, separately for colour and alpha, computed
in float and quantised to the target format. The presets assume premultiplied colours.
public BlendState(BlendFactor SrcColor, BlendFactor DstColor, BlendOp ColorOp, BlendFactor SrcAlpha, BlendFactor DstAlpha, BlendOp AlphaOp)Parameters
SrcColor BlendFactor
Factor applied to the source colour.
DstColor BlendFactor
Factor applied to the destination colour.
ColorOp BlendOp
Colour operation.
SrcAlpha BlendFactor
Factor applied to the source alpha.
DstAlpha BlendFactor
Factor applied to the destination alpha.
AlphaOp BlendOp
Alpha operation.
Fields
Additive
Additive light: colour src + dst; destination alpha kept.
public static readonly BlendState AdditiveField Value
AlphaPremultiplied
Premultiplied “over”, the default: src + dst·(1 − srcA) for colour and alpha.
public static readonly BlendState AlphaPremultipliedField Value
Multiply
Premultiplied multiply: colour src·dst + dst·(1 − srcA); destination alpha kept.
public static readonly BlendState MultiplyField Value
Opaque
Replace: src.
public static readonly BlendState OpaqueField Value
Properties
AlphaOp
Alpha operation.
public BlendOp AlphaOp { get; init; }Property Value
ColorOp
Colour operation.
public BlendOp ColorOp { get; init; }Property Value
DstAlpha
Factor applied to the destination alpha.
public BlendFactor DstAlpha { get; init; }Property Value
DstColor
Factor applied to the destination colour.
public BlendFactor DstColor { get; init; }Property Value
Presets
The four presets. Every tier supports them with every built-in pipeline (they are the minimum of BuiltInBlendStates).
public static IReadOnlyList<BlendState> Presets { get; }Property Value
SrcAlpha
Factor applied to the source alpha.
public BlendFactor SrcAlpha { get; init; }Property Value
SrcColor
Factor applied to the source colour.
public BlendFactor SrcColor { get; init; }Property Value
Methods
<Clone>$()
public BlendState <Clone>$()Returns
Deconstruct(out BlendFactor, out BlendFactor, out BlendOp, out BlendFactor, out BlendFactor, out BlendOp)
public void Deconstruct(out BlendFactor SrcColor, out BlendFactor DstColor, out BlendOp ColorOp, out BlendFactor SrcAlpha, out BlendFactor DstAlpha, out BlendOp AlphaOp)Parameters
SrcColor BlendFactor
DstColor BlendFactor
ColorOp BlendOp
SrcAlpha BlendFactor
DstAlpha BlendFactor
AlphaOp BlendOp
Equals(object?)
public override bool Equals(object? obj)Parameters
obj object?
Returns
Equals(BlendState?)
public bool Equals(BlendState? other)Parameters
other BlendState?
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(BlendState?, BlendState?)
public static bool operator ==(BlendState? left, BlendState? right)Parameters
left BlendState?
right BlendState?
Returns
operator !=(BlendState?, BlendState?)
public static bool operator !=(BlendState? left, BlendState? right)Parameters
left BlendState?
right BlendState?