Class GorgonRasterStateBuilder
A builder for a GorgonRasterState object.
Inheritance
Implements
Inherited Members
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 SourceGorgonRasterStateBuilder()
Initializes a new instance of the GorgonRasterStateBuilder class.
Declaration
public GorgonRasterStateBuilder()
See Also
Methods
| Edit this page View SourceAntialiasing(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
| Edit this page View SourceCullMode(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
| Edit this page View SourceDepthBias(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
| Edit this page View SourceDisableConservativeRasterization()
Function to turn off conservative rasterization.
Declaration
public GorgonRasterStateBuilder DisableConservativeRasterization()
Returns
Type | Description |
---|---|
GorgonRasterStateBuilder | The fluent interface for this builder. |
See Also
| Edit this page View SourceDisableScissorRects()
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
| Edit this page View SourceEnableConservativeRasterization()
Function to turn on conservative rasterization.
Declaration
public GorgonRasterStateBuilder EnableConservativeRasterization()
Returns
Type | Description |
---|---|
GorgonRasterStateBuilder | The fluent interface for this builder. |
See Also
| Edit this page View SourceEnableScissorRects()
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
| Edit this page View SourceFillMode(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
| Edit this page View SourceForcedReadWriteViewSampleCount(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
| Edit this page View SourceOnClearState()
Function to clear the working state for the builder.
Declaration
protected override GorgonRasterStateBuilder OnClearState()
Returns
Type | Description |
---|---|
GorgonRasterStateBuilder | The fluent builder interface. |
Overrides
See Also
| Edit this page View SourceOnCreateState()
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
See Also
| Edit this page View SourceOnResetTo(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
See Also
| Edit this page View SourceOnUpdate(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. |