This program shows an example usage of Z texture. Every object in the scene (except water surface) is drawn as 2D sprites by using static textures. However, these sprites also contain depth offset information (Z texture), so a type of 3D effect can be produced (for example, intersections of terrain and water surface). In this demo, Z textures are also prepared as static data.
| Functions | Parameters | Description |
GXInitTexObj |
Pointer to image data. | Appropriate value. |
| Width and height | Appropriate value. | |
| Texture Format | GX_TF_Z8 / GX_TF_Z16 |
|
| Clamp (S, T) | GX_CLAMP (N/A) |
|
| Mipmap | GX_DISABLE |
|
|
min_filter | GX_NEAR |
| max_filter | GX_NEAR |
|
| min_lod, max_lod, lod_bias | 0.0f, 0.0f, 0.0f (don't care) | |
| bias_clamp, do_edge_lod | GX_DISABLE (don't care) |
|
max_aniso |
GX_ANISO_1 |
|
GXSetZTexture |
Operations | GX_ZT_DISABLE, GX_ZT_REPLACE, GX_ZT_ADD |
| format | GX_TF_Z8 / GX_TF_Z16 |
|
| bias | some constant values | |
|
before texture process | GX_FALSE. |
|
comp0 | GX_GREATER |
| ref0 | Appropriate tolerance value. | |
| op | GX_AOP_AND |
|
| comp1 | GX_ALWAYS |
|
| ref1 | N/A |
The Menu button exits the demo.
The L and R Buttons change the water level.
The Control Stick moves selected tree sprite. X/Y Buttons select a tree.
B Button cycles the Z texture setting in the following order.
[Bias-On], [Bias-Off], [Replace], [Z texture off]

$REVOLUTION_SDK_ROOT/dvddata/gxTests/tev-04.tpl
2006/03/01 Initial version.
CONFIDENTIAL