Home -> IStateGroupNode

Declaration

class IStateGroupNode :public IStateContainer;

Description

The IStateGroupNode interface represents a node under an IProgramNode node in the render scene tree. This node is the primary node that is responsible for defining state settings during the rendering process. State settings applied on this node will be inherited and used by the contained IRenderableNode child nodes. Some settings such as blend state can only be defined on this node. Other state values, such as shader resource bindings and shader state settings, can also be set on child IRenderableNode objects. In this case, the child node values override the inherited values from a parent IStateGroupNode node for that object. Setting state on IStateGroupNode objects allows state values to be set once and shared by a set of individual objects, which is easier to manage, and slightly more efficient during rendering.

ImportantImportant

Note that as IStateGroupNode objects cannot be nested within themselves, only one level of grouping is allowed for sharing state settings.

WarningWarning

Unlike other nodes in the render tree, the IStateGroupNode does not guarantee all child IRenderableNode entries will be drawn in the order they are added. In order to minimize expensive pipeline state changes, renderer plugins will group child nodes into sets that can be drawn with the same pipeline state object. If you need to perform strictly ordered rendering tasks where each child IRenderableNode node is drawn in a particular order, such as if you have depth testing disabled, or are performing order-dependent transparency using blending operations, you must ensure all child IRenderableNode nodes use the same primitive mode, including whether primitive restart is enabled, as set by the SetPrimitiveMode method. Additionally, you must not enable instance rendering for any children using the the SetInstanceMode method. If you adhere to these requirements, strict ordering will be maintained, otherwise the order of rendering is undefined.

Enumerations

Name Description
Public Enum PolygonFillMode
Specifies the available options for configuring the polygon fill mode, as set by the SetPolygonFillMode method.
Public Enum PolygonCullMode
Specifies the available options for configuring the polygon cull mode, as set by the SetPolygonCullMode method.
Public Enum PolygonWindingOrder
Specifies the available options for configuring the polygon winding order, as set by the SetPolygonWindingOrder method.
Public Enum DepthComparisonFunction
Specifies the available depth comparison functions, as set by the SetDepthComparisonFunction method.
Public Enum StencilTargetFace
Specifies the available target faces for stencil operations, as used by the SetStencilOperation method.
Public Enum StencilComparisonFunction
Specifies the available stencil comparison functions, as set by the SetStencilOperation method.
Public Enum StencilOperation
Specifies the available stencil operations, as set by the SetStencilOperation method.
Public Enum BlendOperation
Specifies the available blend operations, as set by the SetBlendMode method.
Public Enum BlendFactor
Specifies the available blend factors, as set by the SetBlendMode method.

Members

Initialization methods

Name Description
Public member Delete
Schedules the object for deletion. After calling this method, the object will be destroyed after the current frame completes drawing.

Child node methods

Name Description
Public member AddChildNode
Adds the specified IRenderableNode as a child of this node
Public member AddChildNodes
Adds the specified set of IRenderableNode objects as children of this node
Public member RemoveChildNode
Removes the specified IRenderableNode as a child of this node
Public member RemoveChildNodes
Removes the specified set of IRenderableNode objects as children of this node
Public member RemoveAllChildNodes
Removes all current IRenderableNode child nodes
Public member SetChildNodes
Sets the specified set of IRenderableNode objects as children of this node, removing any existing child nodes which may have been previously added.

Compute methods

Name Description
Public member SetComputeTask
Defines a compute task to execute for this node. No child nodes or rendering state settings are valid when a compute task is defined, and the parent IShaderProgram node must define a compute shader.
Public member RemoveComputeTask
Removes the previously set compute task for this node

Depth state methods

Name Description
Public member SetDepthTestEnabled
Specifies whether fragments from rendered objects will be tested against the depth buffer
Public member SetDepthWriteEnabled
Specifies whether rendered objects will update the depth buffer based on the generated fragment depth values
Public member SetDepthComparisonFunction
Changes the comparison function used to perform depth testing
Public member SetDepthBias
Configures depth bias to offset generated depth values
Public member ClearDepthBias
Removes previously configured depth bias settings

Stencil state methods

Name Description
Public member SetStencilTestEnabled
Specifies whether stencil testing will be active, and configures some settings related to stencil testing.
Public member SetStencilOperation
Configures how stencil testing will be performed, and the actions which will be taken in response.
Public member SetStencilReferenceValue
Sets the reference value which will be used when performing stencil testing

Rasterization state methods

Name Description
Public member SetPolygonFillMode
Configures the fill mode for polygons, IE, whether they are drawn as lines or filled triangles.
Public member SetPolygonCullMode
Configures polygon culling, such as whether backface culling is enabled.
Public member SetPolygonWindingOrder
Specifies the vertex winding order, in order to determine the front and back of polygons.

Blend state methods

Name Description
Public member SetBlendEnabled
Specifies whether blending is enabled for rendered objects
Public member SetBlendMode
Configures the blend mode settings to use if blending is enabled

Resource binding methods (Inherited from IStateContainer)

Name Description
Public member BindTextureWithCombinedSampler
Creates a texture resource binding with a combined image sampler for the current shader program
Public member BindTexture
Creates a texture resource binding for the current shader program
Public member UnbindTexture
Removes a previously established texture resource binding, with or without a combined image sampler.
Public member BindSampler
Creates a sampler resource binding for the current shader program
Public member UnbindSampler
Removes a previously established sampler binding for the current shader program
Public member BindStateBuffer
Creates a state buffer resource binding for the current shader program
Public member UnbindStateBuffer
Removes a previously established state buffer binding for the current shader program
Public member BindResourceArray
Creates a resource array binding for the current shader program
Public member UnbindResourceArray
Removes a previously established resource array binding for the current shader program

State value methods (Inherited from IStateContainer)

Name Description
Public member SetStateValue
Sets the current target shader state variable to the specified value for this node and any child nodes
Public member ResetStateValue
Restores the target shader state variable to its default or inherited value

Debug methods

Name Description
Public member SetDebugName
Sets a debug name for this state group node, where supported by the renderer and native graphics API.

See also