Detailed Description
- See also:
- Class RenderData, Class
LightRayTraversal, Class
ObjLightDesc, Class ShadeContext, Class Color, Class Point3.
- Description:
- This class has a method Illuminate()
used to determine the color and direction of the light striking the
point sc.P() and a method to get the position of the light.
It also has two public data members that determine if the diffuse
and specular colors of objects are affected.
- Data Members:
- BOOL affectDiffuse;
This data member is available in release 2.0 and later only.
If TRUE the light affects the diffuse color; otherwise it does
not.
BOOL affectSpecular;
This data member is available in release 2.0 and later only.
If TRUE the light affects the specular color; otherwise it does
not.
BOOL ambientOnly;
This data member is available in release 3.0 and later only.
If TRUE the light affects the ambient color only; otherwise it does
not.
DWORD extra;
This data member is available in release 3.0 and later only.
This is not currently used and is available for use in the
future.
#include <imtl.h>
List of all
members.
Constructor & Destructor Documentation
Member Function Documentation
virtual BOOL Illuminate |
( |
ShadeContext & |
sc, |
|
|
Point3 & |
normal, |
|
|
Color & |
color, |
|
|
Point3 & |
dir, |
|
|
float & |
dot_nl, |
|
|
float & |
diffuseCoef |
|
) |
|
[inline, virtual] |
- Parameters:
- ShadeContext& sc
Describes the properties of the point to shade. The point itself is
sc.P().
Point3&
normal
The normal to the surface in camera space.
Color&
color
The color that is returned. This is the brightness of light
striking the point (sc.P())
Point3
&dir
The direction that the light is coming from.
float &dot_nl
This provides a bit of optimization as most lights will have to
calculate this quantity. This is the dot product between the light
vector and the normal to the surface.
float &diffuseCoef
This parameter should be set by the Illuminate function. The
default value is the same as dot_nl. It will be used by shading
functions instead of dot_nl to compute the diffuse illumination of
the surface. The built-in lights use the new "Contrast" parameter
(which has a range of [0..100]) to compute the diffuseCoef from the
dot_nl by the Contrast function:
float a = contrast/200.0f + 0.5f;
kA = (2.0f-1.0f/a);
kB = 1.0f-kA;
float ContrastFunc(float nl)
{
return (contrast==0.0f)? nl : nl/(kA*nl+kB);
}
- Returns:
- Returns FALSE if the hitpoint is outside the effective range of
the light or if the normal of the surface faces away from the
light. This is a hint to the material that the light did not
calculate its illumination because it is assumed it wasn't going to
be used. If TRUE the point is being illuminated.
- Default Implementation:
- { return 0;}
virtual Point3 LightPosition |
( |
|
) |
[inline, virtual] |
- Default Implementation:
- { return Point3(0,0,0); }
Reimplemented in ObjLightDesc.
virtual CoreExport void DeleteThis |
( |
|
) |
[virtual] |
- Default Implementation:
- {delete this; }
Implements RenderData.
Member Data Documentation
LightDesc LightDesc LightDesc LightDesc
LightDesc LightDesc LightDesc LightDesc LightDesc LightDesc
LightDesc LightDesc LightDesc LightDesc
LightDesc LightDesc LightDesc LightDesc LightDesc LightDesc