tg-shadow2

Description

This program shows an example of complicated full-scene shadow generation. This method uses object IDs to determine which parts should become shadow. (For details, see the Algorithm Details section.))

Coverage

This list doesn't contain settings for drawing other than full-scene shadows.

Functions Parameters Description
GXLoadTexMtxImm Matrices Appropriate projection matrix.
Matrix destination. GX_TEXMTX0
Types GX_MTX3x4
GXSetNumTexGens number of texgens 1
GXSetTexCoordGen Destination coordinates. GX_TEXCOORD0.
Generation type. GX_TG_MTX3x4
Generation source. GX_TG_POS
Matrix source. GX_TEXMTX0
GXInitTexObj Pointer to image data. Appropriate value.
Width and height Some constant values
Format GX_TF_RGBA8
Wrap mode (s, t). GX_CLAMP
Mipmap Always GX_FALSE.
GXLoadTexObj Destination texture name. GX_TEXMAP0
GXInvalidateTexAll (No parameter)
GXSetTexCopySrc top / left / width / height some constant values
GXSetTexCopyDst Width and height Some constant values
Format GX_TF_RGBA8
Mipmap filter GX_FALSE.
GXCopyTex Pointer to image data. Appropriate value.
Clear operation GX_TRUE.
GXSetNumTevStages Number of TEV Stages 2
GXSetTevOrder Each argument see algorithm details
GXSetTevColorIn Each argument See algorithm details
GXSetTevColorOp Each argument See algorithm details
clamp mode GX_TC_EQ(stage0), GX_TC_LINEAR(stage1)
See algorithm details
GXSetTevColor TEV Color Register GX_TEVREG0
Color value Appropriate value.
GXPixModeSync (No parameter)

Using the Demo

End the test with START.

The main stick moves camera position.
The sub stick moves light position.

The A Button changes display modes.
The B Button switches the shadow projection type (perspective/orthographic).
The X Button toggles the model size adjustment ON/OFF.
The Y Button changes the size of shadow map.

Snapshot

tg-shadow2-00.jpg (29082 bytes)

Required Data Files

None.

Algorithm Details

See Section "7.2 ID-Based Full-Scene Shadow Mapping" in "Graphics Library [Application Edition]."

Revision History

2006/03/01 Initial version.


CONFIDENTIAL