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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes

# MRenderData Class Reference
OpenMayaRender - API module for rendering

This reference page is linked to from the following overview topics: Example C++ plug-in descriptions.

Search for all occurrences

## Detailed Description

Access Rendering Data.

The rendered image and depth map can be changed following the software render by instanciating a MRenderCallback and overriding renderCallback() or postProcessCallback(). When these methods are invoked, a MRenderData is passed as an argument; the rgbaArr and depthArr can then be changed by this API. Methods and data are provided to assist in transforming back and forth from world space to image space. Paint Effects and Fur are two examples which use this mechanism to change the rendered image.

Examples:

  renderAccessNode.cpp.

`#include <MRenderData.h>`

List of all members.

## Public Member Functions
| MRenderData ()
| Default class Constructor.
void | worldToScreen (const MFloatPoint &worldPoint, MFloatPoint &screenPoint) const
| Converts world space point to screen space.
void | screenToWorld (const MFloatPoint &screenPoint, MFloatPoint &worldPoint) const
| Converts screen space point to world space.
## Public Attributes
bool | perspective
| set if the camera has a perspective projection Search for all occurrences
unsigned short | resX
| the x resolution of the rendered image Search for all occurrences
unsigned short | resY
| the y resolution of the rendered image Search for all occurrences
unsigned short | left
| the left (low) render region dimension Search for all occurrences
unsigned short | bottom
| the bottom (low) render region dimension Search for all occurrences
unsigned short | right
| the right (high) render region dimension Search for all occurrences
unsigned short | top
| the top (high) render region dimension Search for all occurrences
unsigned short | bytesPerChannel
| number of bytes per channel of the rgbaArr Search for all occurrences
unsigned short | xsize
| the actual x resolution of rgbaArr and depthArr Search for all occurrences
unsigned short | ysize
| the actual y resolution of rgbaArr and depthArr Search for all occurrences
float | fieldOfView
| camera horizontal field of view in radians Search for all occurrences
float | aspectRatio
| camera pixel aspect ratio Search for all occurrences
MFloatVector | viewDirection
| view direction of the camera (object space) Search for all occurrences
MFloatPoint | eyePoint
| position of the camera (object space) Search for all occurrences
MFloatMatrix | worldToEyeMatrix
| camera matrix to transform to eye space
unsigned char * | rgbaArr
| this is a 1d array representing the output image buffer.
float * | depthArr
| this is a 1d array representing the output depth buffer. Search for all occurrences

## Member Function Documentation

void worldToScreen | ( | const MFloatPoint & | inPoint,
|  | MFloatPoint & | outPoint
| ) |  | const

Search for all occurrences

Converts world space point to screen space.

Screen depth is stored in outPoint.z.

Parameters:

  [in] | inPoint | The original point in world space
  [out] | outPoint | The converted point in screen space

Examples:
  renderAccessNode.cpp.

void screenToWorld | ( | const MFloatPoint & | inPoint,
|  | MFloatPoint & | outPoint
| ) |  | const

Search for all occurrences

Converts screen space point to world space.

Screen depth is stored in inPoint.z.

Parameters:

  [in] | inPoint | The original point in screen space
  [out] | outPoint | The converted point in world space

Examples:
  renderAccessNode.cpp.

## Member Data Documentation

unsigned char* rgbaArr

Search for all occurrences

this is a 1d array representing the output image buffer.

It is of size: resX * resY * 4 * bytesPerChannel. The array is indexed as [(resX * x + y) * 4 * bytesPerChannel], where (x,y) is the current pixel coordinates. The "4" multiplier is used for storing RGBA information, in the order of a,b,g,r (on OSX) or b,g,r,a (on Windows and Linux).

Examples:
  renderAccessNode.cpp.

float* depthArr

Search for all occurrences

this is a 1d array representing the output depth buffer.

It is of size: resX * resY, where each depth value is a single precision floating point vlue. It is indexed as [resX * x + y], where (x,y) is the current pixel coordinates.

Examples:
  renderAccessNode.cpp.

MRenderData MRenderData MRenderData MRenderData MRenderData MRenderData MRenderData MRenderData MRenderData MRenderData
MRenderData MRenderData MRenderData MRenderData MRenderData MRenderData MRenderData MRenderData MRenderData MRenderData