tev-ztex

Description

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.

Coverage

Function Parameters Description
GXInitTexObj Pointer to image data. Appropriate value.
Width and height Appropriate value.
Texture Format GX_TF_Z8 / GX_TF_Z16
clamp_s, clamp_t GX_CLAMP (N/A)
Mipmap GX_DISABLE
GXInitTexObjLOD 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 operation GX_ZT_DISABLEGX_ZT_REPLACE, GX_ZT_ADD
Format GX_TF_Z8 / GX_TF_Z16
bias some constant values
GXSetZCompLoc before texture process GX_FALSE
GXSetAlphaCompare comp0 GX_GREATER
ref0 Appropriate tolerance value.
op GX_AOP_AND
comp1 GX_ALWAYS
ref1 N/A

Operation Method

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]

Snapshot

tev-ztex-0.jpg (86439 bytes)

Required Data Files

$REVOLUTION_SDK_ROOT/dvddata/gxTests/tev-04.tpl

Revision History

03/01/2006 Initial version.