MRenderOperation Class Reference

This reference page is linked to from the following overview topics: Extension for Autodesk Maya 2013, Rendering Overrides, Transition Guide, Devkit Samples, 3.6 Render Loop Overrides.



Detailed Description

Class which defines a rendering operation.

#include <MViewport2Renderer.h>

Inheritance diagram for MRenderOperation:

List of all members.

Public Types

enum  MRenderOperationType {
  kClear, kSceneRender, kQuadRender, kUserDefined,
  kHUDRender, kPresentTarget
}
 

Supported render operation types.

More...

Public Member Functions

virtual MRenderTarget ** targetOverrideList (unsigned int &listSize)
 Return a list of pointers to render target which will be used as the target overrides for the operation.
virtual bool enableSRGBWrite ()
 Return whether to enable GPU based gamma correction during pixel writes.
virtual const MFloatPointviewportRectangleOverride ()
 Query for a viewport rectangle override.
virtual const MStringname () const
 Query the name of a render operator.
MRenderOperationType operationType () const
 Query the type (MRenderOperationType) of a render operator.

Member Enumeration Documentation

Supported render operation types.

Enumerator:
kClear 

Clear background operation.

kSceneRender 

Render a 3d scene.

kQuadRender 

Render a 2d quad.

kUserDefined 

User defined operation.

kHUDRender 

2D HUD draw operation

kPresentTarget 

Present target for viewing.


Member Function Documentation

MRenderTarget ** targetOverrideList ( unsigned int &  listSize) [virtual]

Return a list of pointers to render target which will be used as the target overrides for the operation.

Parameters:
[out]listSizeNumber of targets returned. By default a value of 0 is returned.
Returns:
Pointer to an array of render targets. By default NULL is returned.
bool enableSRGBWrite ( ) [virtual]

Return whether to enable GPU based gamma correction during pixel writes.

Hardware support assumes a gamma value of 2.2 which is equivalent to converting to sRGB space. This method thus indicates whether to enable the ability of a render target to perform an "sRGB write".

All render targets returned from the MRenderOperation::targetOverrideList() method which support this capability will have the appropriate gamma correction performed.

Gamma correction is never performed for the MPresentTarget render operation.

The method MRenderTargetManager::formatSupportsSRGBWrite() can be used to query whether a a given format for a render target can support this capability.

The default implementation of this method will return false.

Returns:
Whether to enable "sRGB write" for the targets on an operation.
const MFloatPoint * viewportRectangleOverride ( ) [virtual]

Query for a viewport rectangle override.

An override is specified using 4 float values. All values are are represented as relative percentages of the output target dimensions.

  • The two values are the x and y values of the origin of the rectangle with respect to the origin of the render target. The origin of the render target is the lower left corner.
  • The next two values represent the width and height respectively.

Examples :

  • 0,0,1,1 would be mean 0 percentage from the origin and 100 percent of the target size.
  • 0.2, 0.3, 0.35, 0.4 would mean 20 percent to the left and 30 % up from the target origin, with a size which is 35 percent of the width and 40 percent of the height of the target.
Returns:
Reference to the viewport rectangle. NULL if there is no override.
const MString & name ( ) const [virtual]

Query the name of a render operator.

Returns:
Name of render operator

Reimplemented in MHUDRender.

MRenderOperation::MRenderOperationType operationType ( ) const

Query the type (MRenderOperationType) of a render operator.

Returns:
The type

MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation
MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation MRenderOperation