gDPSetPrimColor [Macro]

Function

gDPSetPrimColor

Sets the primitive color

Syntax

#include <ultra64.h>        /* gbi.h */
gDPSetPrimColor(Gfx *gdl, u32 m, u32 l, u32 r, u32 g, u32 b, u32 a)
gsDSetPrimColor(          u32 m, u32 l, u32 r, u32 g, u32 b, u32 a)

Arguments

gdl
Display list pointer.
m
The minimum value when LOD is less than 1.0 (.8, 0~255 texel/pixel ratio)
l
LOD factor for interpolation of third axis (.8, 0~255)
r
Red component of RGBA color (8-bit precision, 0~255).
g
Green component of RGBA color (8-bit precision, 0~255).
b
Blue component of RGBA color (8-bit precision, 0~255).
a
Alpha component of RGBA color (8-bit precision, 0~255).

Description

Sets the RDP's primitive color, which is used as an input source by the color combiner (CC). The primitive color register set by this macro becomes a general-purpose color register of the CC, expressing the constant flat-shaded surface color applied by the primitive. It is also used for rendering specular highlights. The contents of the primitive color register determines the highlight color. In 2-cycle mode, it indicates the color of the first specular highlight (Hilite1). Furthermore, m and l are used for trilinear interpolation in the MIP-mapping process.

For details, please see Section 12.6.2 "CC Internal Color Registers" in the N64 Programming Manual. For information about LOD, see 13.7.3 "LOD Enable" and 14.4.4 "Sprite Compression."

Comment

Normally you need to insert gDPPipeSync immediately after the RDP registers are changed in order to gain synchronization (to wait for the completion of the previous primitive process). However, this macro does not require such synchronization.

See Also

gDPFillRectangle, gDPSetAlphaCompare, gDPSetCombineMode, gDPSetCycleType, and gDPSetRenderMode

Revision History

02/01/99   Completely rewritten