3ds Max C++ API Reference
IlluminateComponents Class Reference

Provides the components of the Illuminate function to Shaders, Materials and Render Elements. More...

#include <object.h>

+ 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...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

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
 

Detailed 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.

Constructor & Destructor Documentation

◆ IlluminateComponents()

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

◆ ~IlluminateComponents()

Member Function Documentation

◆ nUserIllumChannels()

int nUserIllumChannels ( )
inline
Returns
Number of user illumination channels for material
3251 { return nUserIllumOut; }

◆ GetUserIllumName()

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
3257  {
3258  DbgAssert( n < nUserIllumOut );
3259  if( userIllumNames )
3260  return userIllumNames[n];
3261  return NULL;
3262  }
#define DbgAssert(expr)
Definition: assert1.h:82

◆ FindUserIllumName()

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

◆ SetUserIllumOutput()

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
3276  {
3277  DbgAssert( n < nUserIllumOut );
3278  userIllumOut[n] = out;
3279  }

◆ GetUserIllumOutput()

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
3285  {
3286  DbgAssert( n < nUserIllumOut );
3287  return userIllumOut[n];
3288  }

◆ Reset()

void Reset ( )
inline

It sets to black all the output colors.

3291  {
3294  rawColor.Black();
3295  filteredColor.Black();
3299  shadowColor.Black();
3300  finalColor.Black();
3301  finalColorNS.Black();
3302  L = Point3( 0,0,0 );
3303  if(nUserIllumOut>0 && userIllumOut){
3304  for(int i=0; i<nUserIllumOut; ++i )
3305  userIllumOut[i].Black();
3306  }
3307  }
void Black()
Definition: color.h:232
Color shadowColor
Shadow color, attenuated by shape, distance and shadow fraction.
Definition: object.h:3204
Color finalColorNS
Equivalent to finalColor, but with no shadow attenuation applied and no shadow.
Definition: object.h:3231
Color lightSpecularColor
Specular color due to light, attenuated, without shadow color.
Definition: object.h:3219
Color lightDiffuseColor
Diffuse color due to light, attenuated, without shadow color.
Definition: object.h:3217
Color rawColor
Raw light color or mixed with light map value, unattenuated by shape, distance, or shadow.
Definition: object.h:3192
Color filteredColor
Light color modulated by map value, then filtered by a transparent object, raw color * filterAtten,...
Definition: object.h:3199
Color lightAmbientColor
Ambient color due to light, attenuated, without shadow color.
Definition: object.h:3215
Color finalColor
Equivalent to 4.0 final illumination color, with and without shadows.
Definition: object.h:3225
Point3 L
Light Vector.
Definition: object.h:3151
Definition: point3.h:56

Member Data Documentation

◆ L

Point3 L

Light Vector.

◆ NL

float NL

N dot L, N and L are normalized.

◆ geometricAtten

float geometricAtten

The contrast applied to N.L...

this is equivalent to the diffCoef returned by standard illuminate

◆ shapeAtten

float shapeAtten

attenuation fraction due to cone(s) or rect falloff

◆ distanceAtten

float distanceAtten

Attenuation due to distance falloff.

◆ shadowAtten

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

◆ ambientAtten

float ambientAtten

light control over ambitient shading components.

0 = no ambient, 1 = all ambient

◆ diffuseAtten

float diffuseAtten

light control over diffuse shading components.

0 = no diffuse, 1 = all diffuse

◆ specularAtten

float specularAtten

light control over specular shading components.

0 = no specular, 1 = all specular

◆ rawColor

Color rawColor

Raw light color or mixed with light map value, unattenuated by shape, distance, or shadow.

◆ filteredColor

Color filteredColor

Light color modulated by map value, then filtered by a transparent object, raw color * filterAtten, otherwise unattenuated.

◆ shadowColor

Color shadowColor

Shadow color, attenuated by shape, distance and shadow fraction.

◆ lightAmbientColor

Color lightAmbientColor

Ambient color due to light, attenuated, without shadow color.

◆ lightDiffuseColor

Color lightDiffuseColor

Diffuse color due to light, attenuated, without shadow color.

◆ lightSpecularColor

Color lightSpecularColor

Specular color due to light, attenuated, without shadow color.

◆ finalColor

Color finalColor

Equivalent to 4.0 final illumination color, with and without shadows.

◆ finalColorNS

Color finalColorNS

Equivalent to finalColor, but with no shadow attenuation applied and no shadow.

◆ nUserIllumOut

int nUserIllumOut

The number of user illumination channels, returned by nUserIllumChannels()

◆ userIllumNames

const MCHAR** userIllumNames

Pointer to shared name array, never destroyed.

◆ userIllumOut

Color* userIllumOut

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