al - Audio Library Functions gDP - DP GBI Macros gdSP - General GBI Macros gSP - SP GBI Macros gt - Turbo Microcode RDP gu - Graphics Utilities Math - Math Functions nuSys - NuSystem os - N64 Operating System sp - Sprite Library Functions uh - Host to Target IO 64DD - N64 Disk Drive
|
gdSPDefLightsFormat#include "gbi.h" typedef struct { Ambienta; Lightl[M]; } LightsM; LightsM gdSPDefLightsM( unsigned char ar, unsigned char ag, unsigned char ab, unsigned char d1r, unsigned char d1g, unsigned char d1b, unsigned char n1x, unsigned char n1y, unsigned char n1z, ... unsigned char dMr, unsigned char dMg, unsigned char dMb, unsigned char nMx, unsigned char nMy, unsigned char nMz)Arguments
It loads parameters defining the lights into light structures. The diffuse light direction coordinates specify the direction from the origin to the diffuse light. The macro name is actually gdSPDefLightsM where the letter M represents the number of diffuse lights in the scene. In the macro and in the structure (LightsM), M must be an actual integer in the range of 0 to 7. For example, with three diffuse lights, the command is gdSPDefLights3, and the corresponding structure is Lights3. In this case, arguments for colors of the ambient light and both colors and directions of 3 diffuse lights must be supplied. When M is 0, only the arguments for colors of the ambient light need be supplied. Example The following code defines an ambient and a diffuse light in a variable named "lite." The ambient color is a very dark gray, while the diffuse color is a bright red. As this example shows, the diffuse light direction vector does not need to be normalized. If the scale of the model view matrix is S and the magnitude of the light direction is L then try to keep 1 < L*S < 23040. Lights1 lite = gdSPDefLights1( 0x05, 0x05, 0x05, /* amb col */ 0xc0, 0x00, 0x00, /* col 1 */ 13, 25, 30); /* dir 1 */The variable (lite in this example) may be used in the gSPSetLights macro or the gSPLight macro to set the lighting state of the RSP. See Also gSPSetLights
|