#include <MDrawContext.h>
Class to allow access to pass context information.
MPassContext provides access to current pass context information. The term "pass context" is used to denote a logical breakdown of the render loop within a single frame to render.
A "pass" denotes the highest level elements of the breakdown. Each pass has a unique identifier and a list of semantics.
The identifier can either be an internally specified identifier or the name of a custom scene or user render operation (MSceneRender, MUserRenderOperation respectively).
The semantics provide a description of what is being rendered. The list of semantics is ordered, from first to last element, such that the first element provides the broadest description and additional elements refine (provides additional details) about the previous element.
The following is a list of semantics which may be returned as the first element of the semantic list. Possible refining semantics are also described.
As an example, the semantic list returned may contain these elements:
[ color pass, opaque surface drawing, material override ]
This indicates that the active pass is drawing to a color output. Also that the render items being draw are opaque, and that those render items are being drawing with a material override.
As a second example, the semantic list returned may contain these elements:
[ color pass, transparent surface drawing, back-face culling ]
This means that the active pass is drawing to a color output. Also that the render items being drawn are transparent, and that those render items are being drawing with back-face culling enabled.
Public Member Functions | |
const MString & | passIdentifier () const |
Return the identifier for the pass context. More... | |
const MStringArray & | passSemantics () const |
Return an array of semantics for the pass context. More... | |
bool | hasShaderOverride () const |
Return if there is a shader instance override set for the current pass. More... | |
MShaderInstance * | shaderOverrideInstance () const |
Return the shader instance override set for the current pass. More... | |
Static Public Attributes | |
static const MString | kColorPassSemantic |
Semantic for a color pass. | |
static const MString | kShadowPassSemantic |
Semantic for a shadow pass. | |
static const MString | kPointLightShadowPassSemantic |
Semantic for a point light shadow pass. | |
static const MString | kDepthPassSemantic |
Semantic for a depth pass, which pre-renders an intermediate normalized depth target and a linear depth texture that can be used for depth testing during later passes. | |
static const MString | kNormalDepthPassSemantic |
Semantic for a normal and depth pass, whose result will be used for SSAO. | |
static const MString | kOpaqueGeometrySemantic |
Semantic to indicate opaque surfaces are being drawn. | |
static const MString | kPreUIGeometrySemantic |
Semantic to indicate pre-scene UI is being drawn. E.g. The grid. | |
static const MString | kPostUIGeometrySemantic |
Semantic to indicate post-scene UI for surfaces is being drawn. e.g. the wireframe or components. | |
static const MString | kUIGeometrySemantic |
Semantic to indicate UI for surfaces is being drawn. e.g. the wireframe or components. | |
static const MString | kOpaqueUISemantic |
Semantic for opaque UI. | |
static const MString | kTransparentUISemantic |
Semantic for transparent UI. | |
static const MString | kXrayUISemantic |
Semantic for UI in xray mode. | |
static const MString | kTransparentGeometrySemantic |
Semantic to indicate transparent surfaces are being drawn. | |
static const MString | kCullBackSemantic |
Semantic to indicate that back-face culling is being applied. | |
static const MString | kCullFrontSemantic |
Semantic to indicate that front-face culling is being applied. | |
static const MString | kMaterialOverrideSemantic |
Semantic to indicate that a material override is being used. | |
static const MString | kTransparentPeelSemantic |
Semantic for a transparent peel pass. | |
static const MString | kTransparentPeelAndAvgSemantic |
Semantic for a transparent peel-and-average pass. | |
static const MString | kTransparentWeightedAvgSemantic |
Semantic for a transparent weighted-average pass. | |
static const MString | kUserPassSemantic |
Semantic to indicate a user defined pass (MUserRenderOperation) | |
static const MString | kBeginRenderSemantic |
Semantic to indicate the start of rendering. See MRenderer::addNotification() for usage. | |
static const MString | kBeginSceneRenderSemantic |
Semantic to indicate the beginning of scene draw pass. See MRenderer::addNotification() for usage. | |
static const MString | kEndSceneRenderSemantic |
Semantic to indicate the end of a scene draw pass. See MRenderer::addNotification() for usage. | |
static const MString | kEndRenderSemantic |
Semantic to indicate the end of rendering. See MRenderer::addNotification() for usage. | |
static const MString | kSelectionPassSemantic |
Semantic for a selection pass. | |
static const MString | kDOFPassSemantic |
Semantic for depth-of-field pass. | |
static const MString | kMotionVectorPassSemantic |
Semantic for motion vector pass, whose result will be used for motion blur. | |
static const MString | kPEPatternPassSemantic |
Semantic for post-effect pattern pass, which fills an intermediate depth target with depth values of surfaces included in post effects. The depth target will be used for depth test in non-post-effect pattern pass later. | |
static const MString | kNonPEPatternPassSemantic |
Semantic for non-post-effect pattern pass, which produces alpha mask for surfaces excluded from post effects in order to composite the beauty pass output without post effects over the one with post effects later. | |
const MString & passIdentifier | ( | ) | const |
Return the identifier for the pass context.
If a render override is active, then the name of the current operation will be returned.
const MStringArray & passSemantics | ( | ) | const |
Return an array of semantics for the pass context.
The array may contain the following semantics:
bool hasShaderOverride | ( | ) | const |
Return if there is a shader instance override set for the current pass.
MShaderInstance * shaderOverrideInstance | ( | ) | const |
Return the shader instance override set for the current pass.
When the returned new shader instance is no longer needed, MShaderManager::releaseShader() should be called to notify the shader manager that the caller is done with the shader.