Gorgon
Show / Hide Table of Contents

Class GorgonRasterStateBuilder

A builder for a GorgonRasterState object.

Inheritance
object
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>
GorgonStateBuilderAllocator<GorgonRasterStateBuilder, GorgonRasterState>
GorgonRasterStateBuilder
Implements
IGorgonFluentBuilderAllocator<GorgonRasterStateBuilder, GorgonRasterState, IGorgonAllocator<GorgonRasterState>>
IGorgonFluentBuilder<GorgonRasterStateBuilder, GorgonRasterState>
Inherited Members
GorgonStateBuilderAllocator<GorgonRasterStateBuilder, GorgonRasterState>.OnUpdate(GorgonRasterState)
GorgonStateBuilderAllocator<GorgonRasterStateBuilder, GorgonRasterState>.Build(IGorgonAllocator<GorgonRasterState>)
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>.WorkingState
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>.OnCreateState()
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>.OnResetTo(GorgonRasterState)
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>.OnClearState()
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>.Build()
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>.ResetTo(GorgonRasterState)
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>.Clear()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonRasterStateBuilder : GorgonStateBuilderAllocator<GorgonRasterStateBuilder, GorgonRasterState>, IGorgonFluentBuilderAllocator<GorgonRasterStateBuilder, GorgonRasterState, IGorgonAllocator<GorgonRasterState>>, IGorgonFluentBuilder<GorgonRasterStateBuilder, GorgonRasterState>
Remarks

Use this builder to create a new immutable GorgonRasterState to pass to a GorgonPipelineState. This object provides a fluent interface to help build up a raster state.

This will define how a triangle, line, point, etc... is rasterized by the GPU when rendering. Clipping, vertex ordering, culling, etc... are all affected by this state.

A raster state is an immutable object, and as such can only be created by using this object.

Constructors

| Edit this page View Source

GorgonRasterStateBuilder()

Initializes a new instance of the GorgonRasterStateBuilder class.

Declaration
public GorgonRasterStateBuilder()
See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState

Methods

| Edit this page View Source

Antialiasing(bool, bool?)

Function to set the antialiasing flags for MSAA and line anti aliasing.

Declaration
public GorgonRasterStateBuilder Antialiasing(bool msaa, bool? lineAntiAlias = null)
Parameters
Type Name Description
bool msaa

true to enable multisampling, false to disable.

bool? lineAntiAlias

[Optional] true to enable line antialiasing, false to disable.

Returns
Type Description
GorgonRasterStateBuilder

The fluent interface for this builder.

See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

CullMode(CullingMode, bool?)

Function to set the culling mode.

Declaration
public GorgonRasterStateBuilder CullMode(CullingMode cullMode, bool? isFrontCounterClockwise = null)
Parameters
Type Name Description
CullingMode cullMode

The current culling mode.

bool? isFrontCounterClockwise

[Optional] true if vertices that are ordered counter-clockwise are considered front facing, false if not.

Returns
Type Description
GorgonRasterStateBuilder

The fluent interface for this builder.

See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

DepthBias(int, float, float)

Function to set the depth bias parameters.

Declaration
public GorgonRasterStateBuilder DepthBias(int depthBias, float depthBiasClamp, float slopeScaledDepthBias)
Parameters
Type Name Description
int depthBias

The depth bias.

float depthBiasClamp

The depth bias clamping value.

float slopeScaledDepthBias

The slope scaled depth bias value.

Returns
Type Description
GorgonRasterStateBuilder

The fluent interface for this builder.

See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

DisableConservativeRasterization()

Function to turn off conservative rasterization.

Declaration
public GorgonRasterStateBuilder DisableConservativeRasterization()
Returns
Type Description
GorgonRasterStateBuilder

The fluent interface for this builder.

See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

DisableScissorRects()

Function to disable scissor cipping rectangles.

Declaration
public GorgonRasterStateBuilder DisableScissorRects()
Returns
Type Description
GorgonRasterStateBuilder

The fluent interface for this builder.

Remarks

This will disable scissor rectangle clipping entirely. Any rectangles assigned via the SetScissorRect(Rectangle), or SetScissorRects(ReadOnlySpan<Rectangle>) will remain assigned.

See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

EnableConservativeRasterization()

Function to turn on conservative rasterization.

Declaration
public GorgonRasterStateBuilder EnableConservativeRasterization()
Returns
Type Description
GorgonRasterStateBuilder

The fluent interface for this builder.

See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

EnableScissorRects()

Function to enable scissor cipping rectangles.

Declaration
public GorgonRasterStateBuilder EnableScissorRects()
Returns
Type Description
GorgonRasterStateBuilder

The fluent interface for this builder.

Remarks

This must be called if the SetScissorRect(Rectangle), or SetScissorRects(ReadOnlySpan<Rectangle>) methods are to be used.

warning

If no scissor rectangle is set on the GorgonGraphics interface, and this is set to true, nothing will be rendered.

See Also
GorgonGraphics
| Edit this page View Source

FillMode(FillMode)

Function to set the primitive fill mode.

Declaration
public GorgonRasterStateBuilder FillMode(FillMode fillMode)
Parameters
Type Name Description
FillMode fillMode

The current primitive fil mode.

Returns
Type Description
GorgonRasterStateBuilder

The fluent interface for this builder.

See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

ForcedReadWriteViewSampleCount(int)

Function to set the forced unordered access view count.

Declaration
public GorgonRasterStateBuilder ForcedReadWriteViewSampleCount(int sampleCount)
Parameters
Type Name Description
int sampleCount

The sample count to set.

Returns
Type Description
GorgonRasterStateBuilder

The fluent interface for this builder.

See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

OnClearState()

Function to clear the working state for the builder.

Declaration
protected override GorgonRasterStateBuilder OnClearState()
Returns
Type Description
GorgonRasterStateBuilder

The fluent builder interface.

Overrides
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>.OnClearState()
See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

OnCreateState()

Function to update the properties of the state from the working copy to the final copy.

Declaration
protected override GorgonRasterState OnCreateState()
Returns
Type Description
GorgonRasterState

The fluent builder interface.

Overrides
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>.OnCreateState()
See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

OnResetTo(GorgonRasterState)

Function to reset the builder to the specified state.

Declaration
protected override GorgonRasterStateBuilder OnResetTo(GorgonRasterState state)
Parameters
Type Name Description
GorgonRasterState state

The state to copy from.

Returns
Type Description
GorgonRasterStateBuilder

The fluent builder interface.

Overrides
GorgonStateBuilderCommon<GorgonRasterStateBuilder, GorgonRasterState>.OnResetTo(GorgonRasterState)
See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState
| Edit this page View Source

OnUpdate(GorgonRasterState)

Function to update the properties of the state, allocated from an allocator, from the working copy.

Declaration
protected override void OnUpdate(GorgonRasterState state)
Parameters
Type Name Description
GorgonRasterState state

The state to update.

Overrides
GorgonStateBuilderAllocator<GorgonRasterStateBuilder, GorgonRasterState>.OnUpdate(GorgonRasterState)
See Also
GorgonGraphics
GorgonPipelineState
GorgonRasterState

Implements

IGorgonFluentBuilderAllocator<TB, TBo, TBa>
IGorgonFluentBuilder<TB, TBo>

Extension Methods

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

See Also

GorgonGraphics
GorgonPipelineState
GorgonRasterState
  • 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