IlluminateComponents Class Reference

IlluminateComponents Class Reference

#include <object.h>

Class Description

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.

+ Inheritance diagram for IlluminateComponents:

Public Member Functions

 IlluminateComponents ()
 
CoreExport ~IlluminateComponents ()
 
int nUserIllumChannels ()
 
const MCHARGetUserIllumName (int n)
 Returns the name of the index in channels name array. More...
 
CoreExport int FindUserIllumName (const MCHAR *name)
 Returns the index associated with a name. More...
 
void SetUserIllumOutput (int n, Color &out)
 Set the output illumination color to indexed channel. More...
 
Color GetUserIllumOutput (int n)
 Get the output illumination color of indexed channel. More...
 
void Reset ()
 It sets to black all the output colors. More...
 
- Public Member Functions inherited from BaseInterfaceServer
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
virtual UtilExport int NumInterfaces () const
 
virtual UtilExport BaseInterfaceGetInterfaceAt (int i) const
 
virtual UtilExport ~BaseInterfaceServer ()
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 

Public Attributes

Point3 L
 Light Vector. More...
 
float NL
 N dot L, N and L are normalized. More...
 
float geometricAtten
 The contrast applied to N.L... More...
 
float shapeAtten
 attenuation fraction due to cone(s) or rect falloff More...
 
float distanceAtten
 Attenuation due to distance falloff. More...
 
float shadowAtten
 The composite attenuation due to all shadowing objects transparent objects may supply some shadowAtten as well as filterAtten. More...
 
float ambientAtten
 light control over ambitient shading components. More...
 
float diffuseAtten
 light control over diffuse shading components. More...
 
float specularAtten
 light control over specular shading components. More...
 
Color rawColor
 Raw light color or mixed with light map value, unattenuated by shape, distance, or shadow. More...
 
Color filteredColor
 Light color modulated by map value, then filtered by a transparent object, raw color * filterAtten, otherwise unattenuated. More...
 
Color shadowColor
 Shadow color, attenuated by shape, distance and shadow fraction. More...
 
Color lightAmbientColor
 Ambient color due to light, attenuated, without shadow color. More...
 
Color lightDiffuseColor
 Diffuse color due to light, attenuated, without shadow color. More...
 
Color lightSpecularColor
 Specular color due to light, attenuated, without shadow color. More...
 
Color finalColor
 Equivalent to 4.0 final illumination color, with and without shadows. More...
 
Color finalColorNS
 Equivalent to finalColor, but with no shadow attenuation applied and no shadow. More...
 
int nUserIllumOut
 The number of user illumination channels, returned by nUserIllumChannels() More...
 
const MCHAR ** userIllumNames
 Pointer to shared name array, never destroyed. More...
 
ColoruserIllumOut
 The user illumination color array, created and deleted with the class. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 
- Protected Attributes inherited from BaseInterfaceServer
Tab< BaseInterface * > interfaces
 

Constructor & Destructor Documentation

3182  geometricAtten(0.0f), distanceAtten(0.0f), shadowAtten(0.0f), shapeAtten(0.0f), specularAtten(0.0f),
3183  NL(0.0f), ambientAtten(0.0f) {}
float geometricAtten
The contrast applied to N.L...
Definition: object.h:3098
#define NULL
Definition: autoptr.h:18
float diffuseAtten
light control over diffuse shading components.
Definition: object.h:3119
int nUserIllumOut
The number of user illumination channels, returned by nUserIllumChannels()
Definition: object.h:3175
float shapeAtten
attenuation fraction due to cone(s) or rect falloff
Definition: object.h:3100
float distanceAtten
Attenuation due to distance falloff.
Definition: object.h:3102
float shadowAtten
The composite attenuation due to all shadowing objects transparent objects may supply some shadowAtte...
Definition: object.h:3110
float NL
N dot L, N and L are normalized.
Definition: object.h:3093
float specularAtten
light control over specular shading components.
Definition: object.h:3122
Color * userIllumOut
The user illumination color array, created and deleted with the class.
Definition: object.h:3179
const MCHAR ** userIllumNames
Pointer to shared name array, never destroyed.
Definition: object.h:3177
float ambientAtten
light control over ambitient shading components.
Definition: object.h:3116

Member Function Documentation

int nUserIllumChannels ( )
inline
Returns
Number of user illumination channels for material
3191 { return nUserIllumOut; }
int nUserIllumOut
The number of user illumination channels, returned by nUserIllumChannels()
Definition: object.h:3175
const MCHAR* GetUserIllumName ( int  n)
inline

Returns the name of the index in channels name array.

Parameters
nThe element in the userIllumNames array
Returns
The name of the user channel, NULL if no name specified
3197  {
3198  DbgAssert( n < nUserIllumOut );
3199  if( userIllumNames )
3200  return userIllumNames[n];
3201  return NULL;
3202  }
#define NULL
Definition: autoptr.h:18
int nUserIllumOut
The number of user illumination channels, returned by nUserIllumChannels()
Definition: object.h:3175
#define DbgAssert(expr)
Definition: assert1.h:72
const MCHAR ** userIllumNames
Pointer to shared name array, never destroyed.
Definition: object.h:3177
CoreExport int FindUserIllumName ( const MCHAR name)

Returns the index associated with a name.

Parameters
nameThe channel name in the userIllumNames array
Returns
The index of the user channel, -1 if name no found
void SetUserIllumOutput ( int  n,
Color out 
)
inline

Set the output illumination color to indexed channel.

Parameters
nThe channel index in the userIllumOut array
outThe illumination color to set
3216  {
3217  DbgAssert( n < nUserIllumOut );
3218  userIllumOut[n] = out;
3219  }
int nUserIllumOut
The number of user illumination channels, returned by nUserIllumChannels()
Definition: object.h:3175
#define DbgAssert(expr)
Definition: assert1.h:72
Color * userIllumOut
The user illumination color array, created and deleted with the class.
Definition: object.h:3179
Color GetUserIllumOutput ( int  n)
inline

Get the output illumination color of indexed channel.

Parameters
nThe channel index in the userIllumOut array
Returns
The illumination color to get
3225  {
3226  DbgAssert( n < nUserIllumOut );
3227  return userIllumOut[n];
3228  }
int nUserIllumOut
The number of user illumination channels, returned by nUserIllumChannels()
Definition: object.h:3175
#define DbgAssert(expr)
Definition: assert1.h:72
Color * userIllumOut
The user illumination color array, created and deleted with the class.
Definition: object.h:3179
void Reset ( )
inline

It sets to black all the output colors.

3231  {
3234  rawColor.Black();
3235  filteredColor.Black();
3239  shadowColor.Black();
3240  finalColor.Black();
3241  finalColorNS.Black();
3242  L = Point3( 0,0,0 );
3243  if(nUserIllumOut>0 && userIllumOut){
3244  for(int i=0; i<nUserIllumOut; ++i )
3245  userIllumOut[i].Black();
3246  }
3247  }
Color lightSpecularColor
Specular color due to light, attenuated, without shadow color.
Definition: object.h:3159
float geometricAtten
The contrast applied to N.L...
Definition: object.h:3098
Color lightDiffuseColor
Diffuse color due to light, attenuated, without shadow color.
Definition: object.h:3157
Color filteredColor
Light color modulated by map value, then filtered by a transparent object, raw color * filterAtten...
Definition: object.h:3139
void Black()
Definition: color.h:181
Color lightAmbientColor
Ambient color due to light, attenuated, without shadow color.
Definition: object.h:3155
float diffuseAtten
light control over diffuse shading components.
Definition: object.h:3119
int nUserIllumOut
The number of user illumination channels, returned by nUserIllumChannels()
Definition: object.h:3175
Definition: point3.h:55
Color finalColor
Equivalent to 4.0 final illumination color, with and without shadows.
Definition: object.h:3165
float shapeAtten
attenuation fraction due to cone(s) or rect falloff
Definition: object.h:3100
float distanceAtten
Attenuation due to distance falloff.
Definition: object.h:3102
float shadowAtten
The composite attenuation due to all shadowing objects transparent objects may supply some shadowAtte...
Definition: object.h:3110
Color finalColorNS
Equivalent to finalColor, but with no shadow attenuation applied and no shadow.
Definition: object.h:3171
Point3 L
Light Vector.
Definition: object.h:3091
float NL
N dot L, N and L are normalized.
Definition: object.h:3093
Color shadowColor
Shadow color, attenuated by shape, distance and shadow fraction.
Definition: object.h:3144
float specularAtten
light control over specular shading components.
Definition: object.h:3122
Color * userIllumOut
The user illumination color array, created and deleted with the class.
Definition: object.h:3179
float ambientAtten
light control over ambitient shading components.
Definition: object.h:3116
Color rawColor
Raw light color or mixed with light map value, unattenuated by shape, distance, or shadow...
Definition: object.h:3132

Member Data Documentation

Point3 L

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

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()

const MCHAR** userIllumNames

Pointer to shared name array, never destroyed.

Color* userIllumOut

The user illumination color array, created and deleted with the class.