Provides the components of the Illuminate function to Shaders, Materials and Render Elements.
The interface to lights to return the illumination as a set of components. This interface separates the illumination into various components as well as the final result.
#include <object.h>
Public Member Functions |
|
IlluminateComponents () | |
CoreExport | ~IlluminateComponents () |
int | nUserIllumChannels () |
MCHAR * | GetUserIllumName (int n) |
Returns the name of the index in channels
name array. |
|
CoreExport int | FindUserIllumName (MCHAR *name) |
Returns the index associated with a name.
|
|
void | SetUserIllumOutput (int n, Color &out) |
Set the output illumination color to indexed
channel. |
|
Color | GetUserIllumOutput (int n) |
Get the output illumination color of indexed
channel. |
|
void | Reset () |
It sets to black all the output colors.
|
|
Public Attributes |
|
Point3 | L |
Light
Vector. |
|
float | NL |
N dot L, N and L are normalized. |
|
float | geometricAtten |
The contrast applied to N.L... |
|
float | shapeAtten |
attenuation fraction due to cone(s) or rect
falloff |
|
float | distanceAtten |
Attenuation due to distance falloff.
|
|
float | shadowAtten |
The composite attenuation due to all
shadowing objects transparent objects may supply some shadowAtten
as well as filterAtten. |
|
float | ambientAtten |
light control over ambitient shading
components. |
|
float | diffuseAtten |
light control over diffuse shading
components. |
|
float | specularAtten |
light control over specular shading
components. |
|
Color | rawColor |
Raw light color or mixed with light map
value, unattenuated by shape, distance, or shadow. |
|
Color | filteredColor |
Light
color modulated by map value, then filtered by a transparent
object, raw color * filterAtten, otherwise unattenuated. |
|
Color | shadowColor |
Shadow color, attenuated by shape, distance
and shadow fraction. |
|
Color | lightAmbientColor |
Ambient color due to light, attenuated,
without shadow color. |
|
Color | lightDiffuseColor |
Diffuse color due to light, attenuated,
without shadow color. |
|
Color | lightSpecularColor |
Specular color due to light, attenuated,
without shadow color. |
|
Color | finalColor |
Equivalent to 4.0 final illumination color,
with and without shadows. |
|
Color | finalColorNS |
Equivalent to finalColor, but with no shadow
attenuation applied and no shadow. |
|
int | nUserIllumOut |
The number of user illumination channels,
returned by
nUserIllumChannels() |
|
MCHAR ** | userIllumNames |
Pointer to shared name array, never
destroyed. |
|
Color * | userIllumOut |
The user illumination color array, created
and deleted with the class. |
IlluminateComponents | ( | ) | [inline] |
: nUserIllumOut(0),userIllumOut(NULL),userIllumNames(NULL) {}
CoreExport ~IlluminateComponents | ( | ) |
int nUserIllumChannels | ( | ) | [inline] |
{ return nUserIllumOut; }
MCHAR* GetUserIllumName | ( | int | n | ) | [inline] |
Returns the name of the index in channels name array.
n | The element in the userIllumNames array |
{ DbgAssert( n < nUserIllumOut ); if( userIllumNames ) return userIllumNames[n]; return NULL; }
CoreExport int FindUserIllumName | ( | MCHAR * | name | ) |
Returns the index associated with a name.
name | The channel name in the userIllumNames array |
void SetUserIllumOutput | ( | int | n, |
Color & | out | ||
) | [inline] |
Set the output illumination color to indexed channel.
n | The channel index in the userIllumOut array |
out | The illumination color to set |
{ DbgAssert( n < nUserIllumOut ); userIllumOut[n] = out; }
Color GetUserIllumOutput | ( | int | n | ) | [inline] |
Get the output illumination color of indexed channel.
n | The channel index in the userIllumOut array |
{ DbgAssert( n < nUserIllumOut ); return userIllumOut[n]; }
void Reset | ( | ) | [inline] |
It sets to black all the output colors.
{ NL = geometricAtten = shapeAtten = distanceAtten = shadowAtten = ambientAtten = diffuseAtten = specularAtten = 0.0f; rawColor.Black(); filteredColor.Black(); lightAmbientColor.Black(); lightDiffuseColor.Black(); lightSpecularColor.Black(); shadowColor.Black(); finalColor.Black(); finalColorNS.Black(); L = Point3( 0,0,0 ); if(nUserIllumOut>0 && userIllumOut){ for(int i=0; i<nUserIllumOut; ++i ) userIllumOut[i].Black(); } }
Light Vector.
float NL |
N dot L, N and L are normalized.
float geometricAtten |
The contrast applied to N.L...
this is equivalent to the diffCoef returned by standard illuminate
float shapeAtten |
attenuation fraction due to cone(s) or rect falloff
float distanceAtten |
Attenuation due to distance falloff.
float shadowAtten |
The composite attenuation due to all shadowing objects transparent objects may supply some shadowAtten as well as filterAtten.
0 for all shadow, 1 for all light. light control over basic shading components
float ambientAtten |
light control over ambitient shading components.
0 = no ambient, 1 = all ambient
float diffuseAtten |
light control over diffuse shading components.
0 = no diffuse, 1 = all diffuse
float specularAtten |
light control over specular shading components.
0 = no specular, 1 = all specular
Raw light color or mixed with light map value, unattenuated by shape, distance, or shadow.
Light color modulated by map value, then filtered by a transparent object, raw color * filterAtten, otherwise unattenuated.
Shadow color, attenuated by shape, distance and shadow fraction.
Ambient color due to light, attenuated, without shadow color.
Diffuse color due to light, attenuated, without shadow color.
Specular color due to light, attenuated, without shadow color.
Equivalent to 4.0 final illumination color, with and without shadows.
Equivalent to finalColor, but with no shadow attenuation applied and no shadow.
int nUserIllumOut |
The number of user illumination channels, returned by nUserIllumChannels()
MCHAR** userIllumNames |
Pointer to shared name array, never destroyed.
The user illumination color array, created and deleted with the class.