Gorgon
Show / Hide Table of Contents

Class GorgonBlendState

Describes how rasterized data is blended with a GorgonRenderTargetView and how render targets blend with each other.

Inheritance
object
GorgonBlendState
Implements
IEquatable<GorgonBlendState>
Inherited Members
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
object.MemberwiseClone()
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 Source

Additive

Additive blending on render target 0.

Declaration
public static readonly GorgonBlendState Additive
Field Value
Type Description
GorgonBlendState
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

AdditiveAlphaOverwrite

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

Default

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

Inverted

Inverse color blending on render target 0.

Declaration
public static readonly GorgonBlendState Inverted
Field Value
Type Description
GorgonBlendState
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

ModulatedAlphaOverwrite

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

NoBlending

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

Premultiplied

Premultiplied alpha blending on render target 0

Declaration
public static readonly GorgonBlendState Premultiplied
Field Value
Type Description
GorgonBlendState
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

PremultipliedAlphaOverwrite

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

SoftAdditive

Soft additive blending on render target 0.

Declaration
public static readonly GorgonBlendState SoftAdditive
Field Value
Type Description
GorgonBlendState
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder

Properties

| Edit this page View Source

AlphaBlendOperation

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

ColorBlendOperation

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

DestinationAlphaBlend

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

DestinationColorBlend

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

IsBlendingEnabled

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

LogicOperation

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

SourceAlphaBlend

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

SourceColorBlend

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

WriteMask

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
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder

Methods

| Edit this page View Source

Equals(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 state parameter; otherwise, false.

See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

Equals(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 obj parameter; otherwise, false.

Overrides
object.Equals(object)
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
| Edit this page View Source

GetHashCode()

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.

Overrides
object.GetHashCode()
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder

Implements

IEquatable<T>

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)

See Also

GorgonGraphics
GorgonPipelineState
GorgonBlendStateBuilder
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author