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::light variable, there is no need to create a new Light object.

Enumerated Types

SourceType Enumerated type for types of fragment lights.
LightLookUpTableUploadId Enumerated type for fragment light lookup tables. 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. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
SetColorDiffuse Sets the diffuse color of each light source. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
SetColorSpecular0 Sets Specular Color 0 for each light source. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
SetColorSpecular1 Sets Specular Color 1 for each light source. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
SetPosition This is an immediate function. It sets the light position. You must use SetLightType to set the light type to SOURCE_TYPE_POINT. This function is an immediate function. (Immediate functions directly generate commands and insert them 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. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
Note: This function sets the same registers as the Light::SetDirection function.
SetSpotDirection Sets the spotlight light direction. You must use SetLightType to set the light type to SOURCE_TYPE_POINT. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
SetLightType Configures the light type. (SOURCE_TYPE_DIRECTIONAL or SOURCE_TYPE_POINT.) This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
SetDistanceAttenuationScaleBias Sets the scale and bias for input values to the distance attenuation lookup table. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
EnableTwoSideDiffuse Sets whether lighting is for one face or both faces. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
EnableGeomFactor0 Sets whether lights will use Geometry Factor 0. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
EnableGeomFactor1 Sets whether lights will use Geometry Factor 1. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
EnableSpotLight Enables or disables spotlights. A lookup table is used if enabled. You must use SetLightType to set the light type to SOURCE_TYPE_POINT.
EnableDistanceAttenuation Enables or disables distance attenuation of lights. A lookup table is used if enabled.
EnableShadowed Sets the components 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. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)
UploadLookUpTableNative Sets the lighting lookup table. The data used by this function has already been converted from floating point to fixed point. This function is an immediate function. (Immediate functions directly generate commands and insert them into the command buffer.)

Revision History

2011/02/15
Initial version.

CONFIDENTIAL