nn::gr::CTR::FragmentLight::Source Class

Syntax

class Source

Description

Class for making settings per light source.

Member Variables

id The light source number. Type is u8. Set a value between 0 and -7.
isEnableTwoSideDiffuse Light can be made to strike both sides by setting this to true. Type is bool.
isEnableGeomFactor0 Sets whether to use geometric factor 0. Type is bool.
isEnableGeomFactor1 Sets whether to use geometric factor 1. Type is bool.
diffuseR Red component setting for diffuse light.     Type is u8. The product of dmp_FragmentMaterial.diffuse and dmp_FragmentLightSource[i].diffuse is set after it has been mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
diffuseG Green component setting for diffuse light. Type is u8. The product of dmp_FragmentMaterial.diffuse and dmp_FragmentLightSource[i].diffuse is set after it has been mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
diffuseB Blue component setting for diffuse light.     Type is u8. The product of dmp_FragmentMaterial.diffuse and dmp_FragmentLightSource[i].diffuse is set after it has been mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
ambientR Red component setting for ambient light. Type is u8. The product of dmp_FragmentMaterial.ambient and dmp_FragmentLightSource[i].ambient is set after it has been mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
ambientG Green component setting for ambient light. Type is u8. The product of dmp_FragmentMaterial.ambient and dmp_FragmentLightSource[i].ambient is set after it has been mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
ambientB Blue component setting for ambient light. Type is u8. The product of dmp_FragmentMaterial.ambient and dmp_FragmentLightSource[i].ambient is set after it has been mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
specular0R Red component setting for specular light. Type is u8. The product of dmp_FragmentMaterial.specular0 and dmp_FragmentLightSource[i].specular0 is set after it has been mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
specular0G Green component setting for specular light. Type is u8. The product of dmp_FragmentMaterial.specular0 and dmp_FragmentLightSource[i].specular0 is set after it has been mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
specular0B Blue component setting for specular light. Type is u8. The product of dmp_FragmentMaterial.specular0 and dmp_FragmentLightSource[i].specular0 is set after it has been mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
specular1R Red component setting for specular 1. Type is u8. Either dmp_FragmentLightSource[i].specular1 is set or the product of dmp_FragmentMaterial.specular1 and dmp_FragmentLightSource[i].specular1 is set depending on whether true or false, respectively, is specified to Light::isEnableLutRefl. Each setting is first mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
specular1G Green component setting for specular 1. Type is u8. Either dmp_FragmentLightSource[i].specular1 is set or the product of dmp_FragmentMaterial.specular1 and dmp_FragmentLightSource[i].specular1 is set depending on whether true or false, respectively, is specified to Light::isEnableLutRefl. Each setting is first mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
specular1B Blue component setting for specular 1. Type is u8. Either dmp_FragmentLightSource[i].specular1 is set or the product of dmp_FragmentMaterial.specular1 and dmp_FragmentLightSource[i].specular1 is set depending on whether true or false, respectively, is specified to Light::isEnableLutRefl. Each setting is first mapped from a value between 0.0f and 1.0f to a value between 0 and 255.
protected posXY Holds a light's X and Y coordinates converted into rendering command format. The type is bit32.
protected posZ Holds a light's Z coordinate converted into rendering command format. The type is bit32.
protected isInfinity A flag that indicates whether to send a light's position to infinity. Type is u8.
protected distAttnBias Holds a light's distance attenuation bias converted into rendering command format. The type is bit32.
protected distAttnScale Holds a light's distance attenuation scale converted into rendering command format. The type is bit32.
protected spotDirectionXY Holds the X and Y components of a spotlight's direction, converted into rendering command format. The type is bit32.
protected spotDirectionZ Holds the Z component of a spotlight's direction, converted into rendering command format. The type is bit32.

Member Functions

SetPosition Configures the light position. Converts the set value to a 16-bit floating point number used to set the rendering command and stores it.
SetSpotDirection Sets the spotlight light direction. Converts the set value to a 13-bit fixed point number used to set the rendering command and stores it.
SetDistAttnScaleBias Sets the scale and bias for distance attenuation. Converts the set value to a 20-bit floating point number used to set the rendering command and stores it.
SetDistAttnStartEnd Sets scale and bias for distance attenuation by specifying an attenuation start distance and attenuation end distance. Converts the set values to scale and bias values, and then converts them to 20-bit floating point numbers used to set the render command and stores them.
MakeAllCommand Generates all light source commands based on configured data.
MakeCommand Generates all light source commands based on configured data. The MakeAllCommand function is called internally. This has been left to maintain compatibility.
MakeColorCommand Generates color information commands for light sources based on configured data.
MakeGeometryCommand Generates geometric information commands for light sources based on configured data.
Source The constructor initializes member variables.

Revision History

2010/09/15
Initial version.

CONFIDENTIAL