MRenderShadowData Class Reference
[OpenMayaRender - API module for rendering]

#include <MRenderShadowData.h>
Collaboration diagram for MRenderShadowData:
Collaboration graph

List of all members.

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".



Public Types

enum   LightType { kInvalid, kPoint, kDirectional, kSpot }
  Light Types. More...

Public Member Functions

  MRenderShadowData ()
void  worldToZbuffer (const MFloatPoint &worldPoint, MFloatPoint &screenPoint) const
void  zbufferToWorld (const MFloatPoint &screenPoint, MFloatPoint &worldPoint) const

Public Attributes

bool  perspective
  set if the light has a perspective projection
bool  useMidDistMap
  set if the light generates a depth and midDist map
LightType  lightType
  the type of light the shadow map is generated for
unsigned short  shadowResX
  the x resolution of shadow map
unsigned short  shadowResY
  the y resolution of the shadow map
MFloatPoint  lightPosition
  position of the light in world space
MFloatMatrix  projectionMatrix
  projection matrix for the light
MFloatMatrix  perspectiveMatrix
  perspective matrix for the light
float *  depthMaps
  the output depth map
float *  midDistMaps
  the output mid distance map

Member Enumeration Documentation

Light Types.


Constructor & Destructor Documentation

MRenderShadowData::MRenderShadowData (  ) 

Default Constructor

Member Function Documentation

void MRenderShadowData::worldToZbuffer ( const MFloatPoint inPoint,
MFloatPoint outPoint  
) const

Converts world space point to shadow map. Shadow depth is stored in inPoint.z

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

void MRenderShadowData::zbufferToWorld ( const MFloatPoint inPoint,
MFloatPoint outPoint  
) const

Converts shadow map point to world space. Shadow depth is stored in inPoint.z.

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

Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6