Home -> IRenderPassNode

Declaration

class IRenderPassNode;

Description

The IRenderPassNode interface represents the lowest level node in the rendering tree. This node is responsible for providing all the content and state involved in a single logical render pass during the rendering process, however most of this content and state information comes from child nodes. The only direct responsibility the IRenderPassNode object has is to specify the IFrameBuffer object which will be used when performing draw operations and various settings associated with it, and to define the list of child IProgramNode objects to draw, with an optional IDefaultState object associated with each IProgramNode.

In addition to specifying the framebuffer to use, the IRenderPassNode also defines whether content in the framebuffer should be cleared when this render pass is bound during rendering, through the SetAttachmentClearData method. It is also possible to configure whether existing content in the framebuffer must be preserved when the render pass begins, or whether the written content must be preserved after it completes using the SetAttachmentLoadStoreBehavior method. The render pass node is also used when multisample anti-aliasing (MSAA) is in use, with multisample framebuffer attachments being able to be resolved to single-sample textures when the render pass completes, through the EnableAttachmentMultiSamplingResolution method.

ImportantImportant

The IRenderPassNode node is unique on the render tree, in that it contains child nodes which are allowed to be added to the render tree more than once. This can allow simple duplication of large areas of the scene, such as when drawing to multiple windows, without the need to create separate scene nodes for each version. This is done by providing an associated IDefaultState object for a IProgramNode child node, which provides default bindings and state values which are used for all content under the IProgramNode. By varying these defaults for each use, it is possible to reuse content with different view and projection matrices for example, or potentially a wide variety of state settings which affect the way the content is drawn.

Where different shader programs are required, perhaps for techniques such as shadow generation, it would still generally be necessary to create separate scene nodes for these cases, however IRenderableNode objects are free to share the underlying IIndexBuffer and IVertexBuffer objects which contain the scene data, so redefining the scene nodes themselves will not lead to a significant increase in system or graphics memory usage.

WarningWarning

An IFrameBuffer object must be bound to an IRenderPassNode in order for the node to be ready for use in the rendering tree. It is an error to attach an IRenderPassNode to the render tree where no IFrameBuffer has been bound, however it is permitted to change the bound IFrameBuffer while the node is attached to the tree.

Enumerations

Name Description
Public Enum AttachmentLoadBehavior
Specifies whether previous attachment contents must be preserved when the render pass begins.
Public Enum AttachmentStoreBehavior
Specifies whether final attachment contents must be preserved when the render pass completes.

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 IProgramNode as a child of this node, with an optional associated IDefaultState object.
Public member AddChildNodes
Adds the specified set of IProgramNode objects as children of this node, with optional associated IDefaultState objects for each one.
Public member RemoveChildNode
Removes the specified IProgramNode as a child of this node
Public member RemoveChildNodes
Removes the specified set of IProgramNode objects as children of this node
Public member RemoveAllChildNodes
Removes all current IProgramNode child nodes
Public member SetChildNodes
Sets the specified set of IProgramNode objects as children of this node, removing any existing child nodes which may have been previously added.

Framebuffer methods

Name Description
Public member BindFrameBuffer
Binds the specified IFrameBuffer to this node
Public member SetAttachmentLoadStoreBehavior
Allows the application to relax requirements around whether framebuffer contents must be retained before or after this render pass is drawn
Public member SetAttachmentClearData
Instructs the renderer to clear the specified framebuffer target with the supplied data when this pass begins rendering
Public member RemoveAttachmentClearData
Removes a previously added instruction to clear a framebuffer target when this pass begins rendering
Public member EnableAttachmentMultiSamplingResolution
Instructs the renderer to resolve a multisampled framebuffer attachment down to the specified single-sampled target texture when this render pass completes rendering
Public member DisableAttachmentMultiSamplingResolution
Removes a multisampled framebuffer attachment resolution operation previously set by the EnableAttachmentMultiSamplingResolution method.

Enabled state methods

Name Description
Public member SetIsEnabled
Sets the enabled state of this node to the specified value. If this node is disabled, it will be ignored during rendering. No child nodes will be evaluated, and no defined framebuffer operations will occur.

Debug methods

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

See also