frb-zcopy

Description

frb-zcopy is an example of texture copying from the depth buffer. Z texturing is a powerful feature that attaches depth information to billboards or 2D sprites in order to generate 3D-like effects. If using texture copying from both the frame buffer and the depth buffer, generating images and Z textures at runtime is possible. This program uses a two-pass rendering scheme. On the first pass, it creates both image and depth textures by drawing 3D objects. Therefore, the scene resulting from the second pass becomes more 3D-like, although everything is drawn using a billboard.

Coverage

Function Parameters Description
GXSetTexCopySrc top / left / width / height Fixed.
GXSetTexCopyDst Width and height Fixed.
Format GX_TF_RGBA8 / GX_TF_Z24X8.
Mipmap filter GX_FALSE
GXCopyTex Image pointer Appropriate value.
Clear operation GX_TRUE
GXSetCopyClear Color Only one color.
Z value Always 0xFFFFFF.
GXInitTexObj Image pointer Appropriate value.
Width and height Fixed.
Format GX_TF_RGBA8 / GX_TF_Z24X8.
Wrap mode (s, t). GX_REPEAT
Mipmap Always GX_FALSE.
GXLoadTexObj Destination texture name. GX_TEXMAP0 / GX_TEXMAP1.
GXInvalidateTexAll None.
GXSetZTexture operation Always GX_ZT_ADD.
Format GX_TF_Z24X8
bias Fixed.
GXSetDrawSync token number Counts up in every frame.
GXReadDrawSync None.

Operation Method

START exits the test.

The Control stick moves camera position.

Snapshot

frb-zcopy.jpg (10907 bytes)

Required Data Files

None.

Revision History

03/01/2006 Initial version.