Public Types | Public Member Functions | Public Attributes

MRenderShadowData Class Reference

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

enum LightType

Member Function Documentation

void worldToZbuffer ( const MFloatPoint inPoint,
MFloatPoint outPoint 
) const

Converts world space point to shadow map.

Shadow depth is stored in inPoint.z

Parameters:
[in]inPointThe original point in world space
[out]outPointThe converted point in shadow map
Examples:
renderAccessNode.cpp.
void zbufferToWorld ( const MFloatPoint inPoint,
MFloatPoint outPoint 
) const

Converts shadow map point to world space.

Shadow depth is stored in inPoint.z.

Parameters:
[in]inPointThe original point in shadow map
[out]outPointThe 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