frb-zcopy is an example of the process of copying texture 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 genuine 3D objects. Therefore, the scene (resulting from the second pass) becomes more 3D-like, although everything is drawn using a billboard.
| Functions | 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. |
|
|
Destination texture name. | GX_TEXMAP0 / GX_TEXMAP1. |
GXInvalidateTexAll |
None. | |
GXSetZTexture |
Operations | Always GX_ZT_ADD. |
| Format | GX_TF_Z24X8 |
|
| bias | Fixed. | |
GXSetDrawSync |
token number | Counts up in every frame. |
GXReadDrawSync |
None. |
PAUSE exits the test.
The Control stick moves camera position.

None.
2006/03/01 Initial version.
CONFIDENTIAL