MPassContext Class Reference

#include <MDrawContext.h>

Class Description

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.

  • A "color pass" semantic implies rendering for color output. Rendering for a color pass can be further broken down into the follow logical categorizations:
    • Color drawing of opaque surfaces. For this, an additional semantic can describe if a material override is being used.
    • Color drawing of transparent surfaces. For this, a breakdown of whether the drawing is occurring with back or front-face culling may be specified.
    • Color drawing of the UI for surfaces.
  • A "shadow pass" semantic implies rendering to create a shadow map.
  • A "depth" pass semantic implies rendering for depth output only and not color.
  • A "depth and normal" semantic implies rendering of depth and object normals as output.
  • A "user pass" semantic implies that a user operation (MUserRenderOperation) is the current operation being executed for the active render override (MRenderOverride)

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.

+ Examples:

Public Member Functions

const MStringpassIdentifier () const
 Return the identifier for the pass context. More...
 
const MStringArraypassSemantics () 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...
 
MShaderInstanceshaderOverrideInstance () 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.
 

Member Function Documentation

const MString & passIdentifier ( ) const
bool hasShaderOverride ( ) const
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.

Returns
The shader override.
+ Examples:

The documentation for this class was generated from the following files:
  • MDrawContext.h
  • MDrawContext.cpp