Class GorgonBlendState
Describes how rasterized data is blended with a GorgonRenderTargetView and how render targets blend with each other.
Implements
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonBlendState : IEquatable<GorgonBlendState>
Remarks
This will define how rasterized data is blended with the current render target(s). The ability to disable blending, define how blending operations are performed, etc... are all done through this state. This state also defines how blending is performed between adjacent render target(s) in the RenderTargets. This is controlled by the IsIndependentBlendingEnabled flag on the GorgonPipelineState object.
The blend state contains 5 common blend states used by applications: Default (blending enabled for the first render target, using modulated blending), NoBlending (no blending at all), Additive (blending enabled on the first render target, using additive ops for source and dest), PremultipliedAlphaOverwrite (blending enabled on the first render target, with premultiplied blending ops for source and dest), and Inverted (blending enabled on the first render target, with inverted ops for source and dest).
A blend state is an immutable object, and as such can only be created by using a GorgonBlendStateBuilder.
Fields
| Edit this page View SourceAdditive
Additive blending on render target 0.
Declaration
public static readonly GorgonBlendState Additive
Field Value
Type | Description |
---|---|
GorgonBlendState |
See Also
| Edit this page View SourceAdditiveAlphaOverwrite
Additive blending on render target 0 with source alpha overwriting the destination alpha.
Declaration
public static readonly GorgonBlendState AdditiveAlphaOverwrite
Field Value
Type | Description |
---|---|
GorgonBlendState |
See Also
| Edit this page View SourceDefault
The default blending state.
Declaration
public static readonly GorgonBlendState Default
Field Value
Type | Description |
---|---|
GorgonBlendState |
Remarks
This is a modulated blend between the color and alpha channels.
See Also
| Edit this page View SourceInverted
Inverse color blending on render target 0.
Declaration
public static readonly GorgonBlendState Inverted
Field Value
Type | Description |
---|---|
GorgonBlendState |
See Also
| Edit this page View SourceModulatedAlphaOverwrite
Modulated blending on render target 0 with source alpha overwriting the destination alpha.
Declaration
public static readonly GorgonBlendState ModulatedAlphaOverwrite
Field Value
Type | Description |
---|---|
GorgonBlendState |
See Also
| Edit this page View SourceNoBlending
Render target 0 blending enabled, blending operations don't allow for blending.
Declaration
public static readonly GorgonBlendState NoBlending
Field Value
Type | Description |
---|---|
GorgonBlendState |
See Also
| Edit this page View SourcePremultiplied
Premultiplied alpha blending on render target 0
Declaration
public static readonly GorgonBlendState Premultiplied
Field Value
Type | Description |
---|---|
GorgonBlendState |
See Also
| Edit this page View SourcePremultipliedAlphaOverwrite
Premultiplied alpha blending on render target 0 with source alpha overwriting the destination alpha.
Declaration
public static readonly GorgonBlendState PremultipliedAlphaOverwrite
Field Value
Type | Description |
---|---|
GorgonBlendState |
See Also
| Edit this page View SourceSoftAdditive
Soft additive blending on render target 0.
Declaration
public static readonly GorgonBlendState SoftAdditive
Field Value
Type | Description |
---|---|
GorgonBlendState |
See Also
Properties
| Edit this page View SourceAlphaBlendOperation
Property to return the blending operation to perform.
Declaration
public BlendOperation AlphaBlendOperation { get; }
Property Value
Type | Description |
---|---|
BlendOperation |
Remarks
This value specifies the type how to combine the SourceAlphaBlend and DestinationAlphaBlend operation results.
The default value is Add.
See Also
| Edit this page View SourceColorBlendOperation
Property to return the blending operation to perform.
Declaration
public BlendOperation ColorBlendOperation { get; }
Property Value
Type | Description |
---|---|
BlendOperation |
Remarks
This value specifies the type how to combine the SourceColorBlend and DestinationColorBlend operation results.
The default value is Add.
See Also
| Edit this page View SourceDestinationAlphaBlend
Property to return the destination blending operation.
Declaration
public Blend DestinationAlphaBlend { get; }
Property Value
Type | Description |
---|---|
Blend |
Remarks
This defines the type of operation to apply to the alpha component of a pixel being blended with the destination pixel data.
The default value is Zero.
See Also
| Edit this page View SourceDestinationColorBlend
Property to return the destination blending operation.
Declaration
public Blend DestinationColorBlend { get; }
Property Value
Type | Description |
---|---|
Blend |
Remarks
This defines the type of operation to apply to the color (RGB) components of a pixel being blended with the destination pixel data.
The default value is Zero.
See Also
| Edit this page View SourceIsBlendingEnabled
Property to return whether blending should be enabled for this render target.
Declaration
public bool IsBlendingEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
The default value is false.
See Also
| Edit this page View SourceLogicOperation
Property to return the logical operation to apply when blending.
Declaration
public LogicOperation LogicOperation { get; }
Property Value
Type | Description |
---|---|
LogicOperation |
Remarks
This provides extra functionality used when performing a blending operation. See this link for more details.
The default value is Noop.
See Also
| Edit this page View SourceSourceAlphaBlend
Property to return the source blending operation.
Declaration
public Blend SourceAlphaBlend { get; }
Property Value
Type | Description |
---|---|
Blend |
Remarks
This defines the type of operation to apply to the alpha component of a pixel being blended from the source pixel data.
The default value is One.
See Also
| Edit this page View SourceSourceColorBlend
Property to return the source blending operation.
Declaration
public Blend SourceColorBlend { get; }
Property Value
Type | Description |
---|---|
Blend |
Remarks
This defines the type of operation to apply to the color (RGB) components of a pixel being blended from the source pixel data.
The default value is One.
See Also
| Edit this page View SourceWriteMask
Property to return the flags used to mask which pixel component to write into.
Declaration
public WriteMask WriteMask { get; }
Property Value
Type | Description |
---|---|
WriteMask |
Remarks
This provides the ability to allow writes to only the specified component(s) defined in the mask. To define multiple components, combine the flags with the OR operator.
The default value is All.
See Also
Methods
| Edit this page View SourceEquals(GorgonBlendState)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(GorgonBlendState state)
Parameters
Type | Name | Description |
---|---|---|
GorgonBlendState | state | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
See Also
| Edit this page View SourceEquals(object)
Indicates whether the current object is equal to another object of the same type.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Overrides
See Also
| Edit this page View SourceGetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |