nn::gd::CTR::Light Class

Syntax

class Light

Description

This class manages settings for each of eight light sources.

Because each of the eight lights using the lighting stage can be accessed using the LightingStage::ligh variable, there is no need to create a new Light object.

Enumerated Types

SourceType This is a fragment light type enum value.
LightLookUpTableUploadId This is a fragment light lookup table enum value. It can be independently set for each separate light.

Member Functions

EnableLight Enables or disables each light source.
SetColorAmbient Sets the ambient color of each light source.
SetColorDiffuse Sets the diffuse color of each light source.
SetColorSpecular0 Sets Specular Color 0 for each light source.
SetColorSpecular1 Sets Specular Color 1 for each light source.
SetPosition This is an immediate function. It sets the light direction. SOURCE_TYPE_PUNCTUAL must be specified for a light type set using SetLightType. (The resulting command from the immediate function is inserted into the command buffer.)
Note: This function sets the same registers as the Light::SetDirection function.
SetDirection This is an immediate function. Sets the light direction. SOURCE_TYPE_DIRECTIONAL must be specified for the light type to be set using SetLightType. (The resulting command from the immediate function is inserted into the command buffer.)
Note: This function sets the same registers as the Light::SetDirection function.
SetSpotDirection Sets the spotlight light direction. SOURCE_TYPE_PUNCTUAL must be specified for the light type to be set using SetLightType.
SetLightType Configures the light type. (Specify SOURCE_TYPE_DIRECTIONAL or SOURCE_TYPE_PUNCTUAL.)
SetDistanceAttenuationScaleBias Sets the scale and bias for input values to the distance attenuation lookup table.
EnableTwoSideDiffuse Sets single-side or double-side lighting.
EnableGeomFactor0 Sets whether lights will use Geometric Factor 0.
EnableGeomFactor1 Sets whether lights will use Geometric Factor 1.
EnableSpotLight Enables or disables spotlights. A lookup table is used if enabled. SOURCE_TYPE_PUNCTUAL must be specified for a light type set using SetLightType.
EnableDistanceAttenuation Enables or disables distance attenuation of lights. A lookup table is used if enabled.
EnableShadowed Sets the element for which shadow is to be adjusted.
UploadLookUpTableFloat Sets the lighting lookup table. The floating point value you specify is converted into fixed point data by this function and then sent to the GPU.
UploadLookUpTableNative Sets the lighting lookup table. The data used by this function has already been converted from floating point to fixed point.

Revision History

2011/02/15
Initial version.

CONFIDENTIAL