lit-specular

Description

This program does a demonstration of specular lighting. It also uses two light channels to show the overlay of diffuse and specular light colors. A specified light object for a specular light can also act as a pseudo parallel light if used in the diffuse light channel. This property is used in the demo; the same light object (GX_LIGHT0) is applied to both channels.

Coverage

Functions Parameters Description
GXInitLightPos Position coordinate (x, y, z) Appropriate value.
GXInitSpecularDir Light direction (nx, ny, nz) Appropriate value.
GXInitLightShininess Shininess parameter Values ranging from 4.0 through 256.0.
GXSetNumChans Number of color channels. 1, 2
GXSetChanCtrl Color channel ID GX_COLOR0, GX_COLOR1
Channel enable Always GX_ENABLE.
Ambient color source Always GX_SRC_REG.
Material color source Always GX_SRC_REG.
Light mask GX_LIGHT0 for both channels.
Diffusion function GX_DF_NONE, GX_DF_CLAMP
Attenuation function GX_AF_NONE, GX_AF_SPOT, GX_AF_SPEC
GXSetChanAmbColor Color channel ID GX_COLOR0, GX_COLOR1
Material color Only one color.
GXSetChanMatColor Color channel ID GX_COLOR0, GX_COLOR1
Material color Only one color.

Using the Demo

End the test with START.

The Control Stick moves the light.

The C Stick rotates the object.

The B Button changes the model.

The L and R Buttons adjust the shininess of specular light.

The Y button changes the display mode in the following order:
Specular only, diffuse only, specular/diffuse added, specular/diffuse blended

Snapshot

Specular light color only.

lit-specular-0.jpg (4563 bytes)

Uses two color channels. Diffuse light color is added to specular light color.

lit-specular-1.jpg (5116 bytes)

Required Data Files

None.

Revision History

2006/03/01 Initial version.


CONFIDENTIAL