- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# MRenderOperation Class Reference
OpenMayaRender - API module for rendering

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

Search for all occurrences

## Detailed Description

Class which defines a rendering operation.

`#include <MViewport2Renderer.h>`

Inheritance diagram for MRenderOperation:
[legend]

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 MFloatPoint * | viewportRectangleOverride ()
| Query for a viewport rectangle override.
virtual const MString & | name () const
| Query the name of a render operator.
MRenderOperationType | operationType () const
| Query the type (MRenderOperationType) of a render operator.

## Member Enumeration Documentation

enum MRenderOperationType

Search for all occurrences

Supported render operation types.

Enumerator:

  kClear | Clear background operation. Search for all occurrences
  kSceneRender | Render a 3d scene. Search for all occurrences
  kQuadRender | Render a 2d quad. Search for all occurrences
  kUserDefined | User defined operation. Search for all occurrences
  kHUDRender | 2D HUD draw operation Search for all occurrences
  kPresentTarget | Present target for viewing. Search for all occurrences

## Member Function Documentation

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

Search for all occurrences

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

Parameters:

  [out] | listSize | Number 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]`

Search for all occurrences

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]`

Search for all occurrences

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]`

Search for all occurrences

Query the name of a render operator.

Returns:
  Name of render operator

Reimplemented in MHUDRender.

MRenderOperation::MRenderOperationType operationType | ( |  | ) | const

Search for all occurrences

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