#include <revolution/gx.h>
#define GXInitLightShininess(lobj, shininess) \
GXInitLightAttn(lobj, 0.0F, 0.0F, 1.0F, \
(shininess)/2.0F, 0.0F, \
1.0F-(shininess)/2.0F )
lobj |
Pointer to a light object. |
shininess |
shininess parameter |
None.
This function sets the shininess of a per-vertex specular light. In reality, shininess is a property of the material being lit, not the light. However, in the graphics processor, the specular calculation is implemented by reusing the diffuse angle/distance attenuation function, so shininess is determined by the light attenuation parameters ((see GXInitLightAttn). The arithmetic formula approximates the function (N*H)^shininess "(Normal vector (1/2 the line-of-sight and the light direction))^brightness" Since the attenuation formula is only a fraction of second degree equations, it cannot be used as an accurate exponential function. To enable specular calculations, the lighting channel attenuation parameter must be set to GX_AF_SPEC using GXSetChanCtrl function.
The graph below represents the attenuation curve for various shininess levels (shininess).

As you can see from the graph, a larger value of shininess creates a narrower specular highlight.
And the following image shows result samples.
![]() |
![]() |
![]() |
![]() |
| shininess = 4.0 | shininess = 16.0 | shininess = 64.0 | shininess = 256.0 |
GXLightObj Initialization Flow
03/01/2006 Initial version.