lit-cartoon

Description

This program tests texture coordinate generation with an unclamped diffuse function. The red component of lit color on each vertex is used to generate a coordinate for looking up a 1D texture map. The second texture coordinate can be generated by the green component; it is used to select a 1D texture line from a 2D texture map. This method can be used to express cel-shaded lighting (cartoon lighting).

Coverage

Functions Parameters Description
GXInitLightPos Position coordinate (x, y, z) Various values.
GXInitLightColor Light color Appropriate value.
GXSetChanCtrl Color channel ID Always GX_COLOR0A0.
Channel enable Always GX_ENABLE.
Ambient color source Always register source.
Material color source Always register source.
Light mask Always GX_LIGHT0.
Diffusion function Always GX_DF_SIGN.
Attenuation function Always GX_AF_NONE.
GXSetChanAmbColor Ambient color Appropriate value.
GXSetChanMatColor Material color Appropriate value.
GXSetTexCoordGen Texture coordinate to be generated Always GX_TEXCOORD0.
Texture coordinate generation feature Always GX_TG_SRTG.
Source Always GX_TG_COLOR0.
Matrix Always GX_IDENTITY.

Using the Demo

START exits the test.

The Control Stick moves the light.

The C Stick rotates the model.

The A button changes the model.

The B button selects the 1D texture to use.

The X and Y buttons select an item to control in the following order:
Ambient, Light, Material.

The L and R buttons change the brightness value of the selected item. This value is used only as the red value of the selected item.

Snapshot

lit-cartoon-0.jpg (9458 bytes)

lit-cartoon-1.jpg (8112 bytes)

lit-cartoon-2.jpg (8998 bytes)

lit-cartoon-3.jpg (11120 bytes)

Required Data Files

$REVOLUTION_SDK_ROOT/dvddata/gxTests/lit-06.tpl

Revision History

2006/03/01 Initial version.


CONFIDENTIAL