Class GorgonDepthStencilState
Describes how rasterized primitive data is clipped against a depth/stencil buffer.
Implements
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonDepthStencilState : IEquatable<GorgonDepthStencilState>
Remarks
This will define how rasterized primitive data is clipped against a depth/stencil buffer. Depth reading, writing, and stencil operations are affected by this state.
The depth/stencil state contains 6 common depth/stencil states used by applications: Default (disabled depth/stencil), DepthStencilEnabled (both depth and stencil enabled, full write enabled), DepthStencilEnabledNoWrite (both depth and stencil enabled, no writing allowed), DepthEnabledNoWrite (depth enabled, no writing allowed), DepthEnabled (depth enabled, stencil disabled), and StencilEnabled (stencil enabled, depth disabled).
A depth/stencil state is an immutable object, and as such can only be created by using a GorgonDepthStencilStateBuilder.
Fields
| Edit this page View SourceDefault
The default depth/stencil state.
Declaration
public static readonly GorgonDepthStencilState Default
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
See Also
| Edit this page View SourceDepthEnabled
Depth only enabled.
Declaration
public static readonly GorgonDepthStencilState DepthEnabled
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
See Also
| Edit this page View SourceDepthEnabledNoWrite
Depth only enabled, depth write disabled.
Declaration
public static readonly GorgonDepthStencilState DepthEnabledNoWrite
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
See Also
| Edit this page View SourceDepthLessEqualEnabled
Depth only enabled. With a comparison of less than or equal for the depth buffer.
Declaration
public static readonly GorgonDepthStencilState DepthLessEqualEnabled
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
Remarks
This value is suitable for 2D operations because sprites don't have any depth, and not having an equals operator will cause overlapping sprites to overwrite instead of merge together.
See Also
| Edit this page View SourceDepthLessEqualEnabledNoWrite
Depth only enabled, depth write disabled. With a comparison of less than or equal for the depth buffer.
Declaration
public static readonly GorgonDepthStencilState DepthLessEqualEnabledNoWrite
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
Remarks
This value is suitable for 2D operations because sprites don't have any depth, and not having an equals operator will cause overlapping sprites to overwrite instead of merge together.
See Also
| Edit this page View SourceDepthLessEqualStencilEnabled
Depth/stencil enabled. With a comparison of less than or equal for the depth buffer.
Declaration
public static readonly GorgonDepthStencilState DepthLessEqualStencilEnabled
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
Remarks
This value is suitable for 2D operations because sprites don't have any depth, and not having an equals operator will cause overlapping sprites to overwrite instead of merge together.
See Also
| Edit this page View SourceDepthLessEqualStencilEnabledNoWrite
Depth/stencil enabled, depth write disbled. With a comparison of less than or equal for the depth buffer.
Declaration
public static readonly GorgonDepthStencilState DepthLessEqualStencilEnabledNoWrite
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
Remarks
This value is suitable for 2D operations because sprites don't have any depth, and not having an equals operator will cause overlapping sprites to overwrite instead of merge together.
See Also
| Edit this page View SourceDepthStencilEnabled
Depth/stencil enabled.
Declaration
public static readonly GorgonDepthStencilState DepthStencilEnabled
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
See Also
| Edit this page View SourceDepthStencilEnabledGreaterEqual
Depth/stencil enabled, with a greater than or equal comparer.
Declaration
public static readonly GorgonDepthStencilState DepthStencilEnabledGreaterEqual
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
Remarks
This value is useful for reversing a depth distribution across the depth buffer to provide better accuracy. See https://developer.nvidia.com/content/depth-precision-visualized for more information.
See Also
| Edit this page View SourceDepthStencilEnabledNoWrite
Depth/stencil enabled, depth write disbled.
Declaration
public static readonly GorgonDepthStencilState DepthStencilEnabledNoWrite
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
See Also
| Edit this page View SourceStencilEnabled
Stencil only enabled.
Declaration
public static readonly GorgonDepthStencilState StencilEnabled
Field Value
Type | Description |
---|---|
GorgonDepthStencilState |
See Also
Properties
| Edit this page View SourceBackFaceStencilOp
Property to return the setup information for stencil operations on back facing polygons.
Declaration
public GorgonStencilOperation BackFaceStencilOp { get; }
Property Value
Type | Description |
---|---|
GorgonStencilOperation |
See Also
| Edit this page View SourceDepthComparison
Property to set or return the depth comparison function.
Declaration
public Comparison DepthComparison { get; }
Property Value
Type | Description |
---|---|
Comparison |
Remarks
Use this property to determine whether a depth value will be written into the buffer if the function specified evaluates to true using the data being written and existing data.
The default value is Less.
See Also
| Edit this page View SourceFrontFaceStencilOp
Property to return the setup information for stencil operations on front facing polygons.
Declaration
public GorgonStencilOperation FrontFaceStencilOp { get; }
Property Value
Type | Description |
---|---|
GorgonStencilOperation |
See Also
| Edit this page View SourceIsDepthEnabled
Property to set or return whether the depth buffer is enabled or not.
Declaration
public bool IsDepthEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
The default value is false.
See Also
| Edit this page View SourceIsDepthWriteEnabled
Property to set or return whether to enable writing to the depth buffer or not.
Declaration
public bool IsDepthWriteEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
The default value is true
.
See Also
| Edit this page View SourceIsStencilEnabled
Property to set or return whether the stencil buffer is enabled or not.
Declaration
public bool IsStencilEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
The default value is false.
See Also
| Edit this page View SourceStencilReadMask
Property to set or return the read mask for stencil operations.
Declaration
public byte StencilReadMask { get; }
Property Value
Type | Description |
---|---|
byte |
Remarks
Use this to filter out specific values from the stencil buffer during a read operation.
The default value is 0xff
.
See Also
| Edit this page View SourceStencilWriteMask
Property to set or return the write mask for stencil operations.
Declaration
public byte StencilWriteMask { get; }
Property Value
Type | Description |
---|---|
byte |
Remarks
Use this to filter out specific values from the stencil buffer during a write operation.
The default value is 0xff
.
See Also
Methods
| Edit this page View SourceEquals(GorgonDepthStencilState)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(GorgonDepthStencilState info)
Parameters
Type | Name | Description |
---|---|---|
GorgonDepthStencilState | info | 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. |