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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Public Attributes

# MRenderShadowData Class Reference

# OpenMayaRender - API module for rendering

Search for all occurrences

## Detailed Description

Access Rendering Shadow Map Data.

The shadow map can be changed by instanciating a MRenderCallback and overriding shadowCastCallback(). When this is invoked, a MRenderShadowData is passed as an argument; the depthMaps and midDistMaps members can then be changed by this API. Methods and data are provided to assist in transforming back and forth from world space to z buffer space. Paint Effects and Fur are two examples which use this mechanism to change the shadow map.

To prevent self shadowing, Maya uses a mid distance map to resolve the ambiguity. Details of this technique can be obtained from Graphics Gems III, "The Shadow Depth Map Revisited".

Examples:

  renderAccessNode.cpp.

`#include <MRenderShadowData.h>`

List of all members.

## Public Types
enum | LightType { kInvalid, kPoint, kDirectional, kSpot }
| Light Types. More...
## Public Member Functions
| MRenderShadowData ()
| Default Constructor.
void | worldToZbuffer (const MFloatPoint &worldPoint, MFloatPoint &screenPoint) const
| Converts world space point to shadow map.
void | zbufferToWorld (const MFloatPoint &screenPoint, MFloatPoint &worldPoint) const
| Converts shadow map point to world space.
## Public Attributes
bool | perspective
| set if the light has a perspective projection Search for all occurrences
bool | useMidDistMap
| set if the light generates a depth and midDist map Search for all occurrences
LightType | lightType
| the type of light the shadow map is generated for Search for all occurrences
unsigned short | shadowResX
| the x resolution of shadow map Search for all occurrences
unsigned short | shadowResY
| the y resolution of the shadow map Search for all occurrences
MFloatPoint | lightPosition
| position of the light in world space Search for all occurrences
MFloatMatrix | projectionMatrix
| projection matrix for the light Search for all occurrences
MFloatMatrix | perspectiveMatrix
| perspective matrix for the light Search for all occurrences
float * | depthMaps
| the output depth map Search for all occurrences
float * | midDistMaps
| the output mid distance map Search for all occurrences

## Member Enumeration Documentation

enum LightType

Search for all occurrences

Light Types.

Enumerator:

  kInvalid | Search for all occurrences
  kPoint | Search for all occurrences
  kDirectional | Search for all occurrences
  kSpot | Search for all occurrences

## Member Function Documentation

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

Search for all occurrences

Converts world space point to shadow map.

Shadow depth is stored in inPoint.z

Parameters:

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

Examples:
  renderAccessNode.cpp.

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

Search for all occurrences

Converts shadow map point to world space.

Shadow depth is stored in inPoint.z.

Parameters:

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

Examples:
  renderAccessNode.cpp.

MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData
MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData MRenderShadowData