Struct BlendStateDescription
A description of a Blend State, which defines how colors are blended when rendering to one or multiple Render Targets.
[DataContract]
public struct BlendStateDescription : IEquatable<BlendStateDescription>
- Implements
- Inherited Members
- Extension Methods
Remarks
This structure controls transparency, color mixing, and blend modes across all the Render Targets. Modify this to achieve effects like alpha blending, additive blending, or custom shader-based blends. It also controls whether to use alpha-to-coverage as a multi-sampling technique when writing a pixel to a Render Target.
Constructors
BlendStateDescription()
Initializes a new instance of the BlendStateDescription structure with default values.
public BlendStateDescription()
Remarks
<ul><li><span class="term">Alpha-to-Coverage</span>Disabled</li><li><span class="term">Independent Blending</span>Disabled. Only enable blend for the first Render Target</li><li>Disable blending for all the Render Targets.</li></ul>
</remarks>
BlendStateDescription(Blend, Blend)
Initializes a new instance of the BlendStateDescription structure with default values, and the specified blending for the first Render Target.
public BlendStateDescription(Blend sourceBlend, Blend destinationBlend)
Parameters
Remarks
<ul><li><span class="term">Alpha-to-Coverage</span>Disabled</li><li><span class="term">Independent Blending</span>Disabled. Only enable blend for the first Render Target</li><li>Disable blending for all the Render Targets.</li></ul>
</remarks>
Fields
AlphaToCoverageEnable
A value that determines whether or not to use alpha-to-coverage as a multi-sampling technique when writing a pixel to a Render Target.
public bool AlphaToCoverageEnable
Field Value
Remarks
Alpha-to-coverage is a technique that uses the alpha value of a pixel to determine how much coverage it should have in a multi-sampled anti-aliasing (MSAA) scenario. This can help achieve smoother edges in transparent textures by blending the coverage of the pixel based on its alpha value.
Default
A Blend State description with default values.
public static readonly BlendStateDescription Default
Field Value
Remarks
The default values are:
- Alpha-to-CoverageDisabled
- Independent BlendingDisabled. Only enable blend for the first Render Target
- Disable blending for all the Render Targets.
DefaultAlphaToCoverageEnable
Default value for AlphaToCoverageEnable.
public const bool DefaultAlphaToCoverageEnable = false
Field Value
DefaultIndependentBlendEnable
Default value for IndependentBlendEnable.
public const bool DefaultIndependentBlendEnable = false
Field Value
IndependentBlendEnable
A value indicating whether to enable independent blending in simultaneous Render Targets, meaning per-Render Target blending settings.
public bool IndependentBlendEnable
Field Value
Remarks
If set to true, each of the RenderTargets can have its own blend settings.
If set to false, only the first Render Target (RenderTarget0) is taken into account. The others (RenderTarget1 to RenderTarget7) are ignored.
RenderTargets
An array of Render Target blend descriptions (see BlendStateRenderTargetDescription); these correspond to the eight Render Targets that can be set to the output-merger stage at one time.
public BlendStateDescription.RenderTargetBlendStates RenderTargets
Field Value
Methods
Equals(BlendStateDescription)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(BlendStateDescription other)
Parameters
otherBlendStateDescriptionAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Operators
operator ==(BlendStateDescription, BlendStateDescription)
public static bool operator ==(BlendStateDescription left, BlendStateDescription right)
Parameters
leftBlendStateDescriptionrightBlendStateDescription
Returns
operator !=(BlendStateDescription, BlendStateDescription)
public static bool operator !=(BlendStateDescription left, BlendStateDescription right)
Parameters
leftBlendStateDescriptionrightBlendStateDescription