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

Syntax

class Source

Description

Class for making settings per light source.

Member Variables

id u8 The light source number. Type is u8. Set a value between 0 and -7.
isEnableTwoSideDiffuse bool Light can be made to strike both sides by setting this to true. Type is bool.
isEnableGeomFactor0 bool Sets whether to use geometric factor 0. Type is bool.
isEnableGeomFactor1 bool Sets whether to use geometric factor 1. Type is bool.
diffuseR u8 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 u8 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 u8 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 u8 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 u8 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 u8 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 u8 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 u8 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 u8 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 u8 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 u8 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 u8 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 bit32 Holds a light's X and Y coordinates converted into rendering command format. The type is bit32.
protected posZ bit32 Holds a light's Z coordinate converted into rendering command format. The type is bit32.
protected isInfinity u8 A flag that indicates whether to send a light's position to infinity. Type is u8.
protected distAttnBias bit32 Holds a light's distance attenuation bias converted into rendering command format. The type is bit32.
protected distAttnScale bit32 Holds a light's distance attenuation scale converted into rendering command format. The type is bit32.
protected spotDirectionXY bit32 Holds the X and Y components of a spotlight's direction, converted into rendering command format. The type is bit32.
protected spotDirectionZ bit32 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