An instance of this class is created for every light added into the Shadow Manager and id is appended to shadowLightsRoot. SoShadowLight contains a part of a final shadow rendering scene graph that renders shadows created by this light. If the light is turned off (i.e. casts no shadows) the scene graph below is not traversed.
Definition at line 94 of file SoShadowLight.h.
Public Member Functions | |
SoShadowLight (CShadowManager *sm, SoLight *l) | |
Constructor. | |
~SoShadowLight () | |
Destructor. | |
void | addVolume (SoSeparator *volume) |
Add a new shadow volume to the light. | |
SoSeparator * | getVolume (int i) |
Get shadow volume i. | |
int | getNumVolumes () |
Get number of shadow volumes under this light. | |
void | deleteVolumes () |
Deletes all shadow volumes under this light. | |
void | deleteVolume (int casterName) |
Deletes shadow volumes i under this light. | |
CShadowManager * | getManager () |
Returns pointer to the Shadow Manager. | |
SoLight * | getLight () |
Returns pointer to the light node. | |
void | setLightName (int lightIndex) |
Sets caster name index and the name of the node. | |
int | getLightName () |
Gets caster name index. | |
void | setSensor (SoNodeSensor *sensor) |
Sets light sensor. | |
SoNodeSensor * | getSensor () |
Gets light sensor. | |
void | createShadowVolumes () |
Creates all shadow volumes of all objects for this light. | |
void | createShadowVolumes (int caster) |
Creates all shadow volumes of all objects for this light. | |
Public Attributes | |
SbBool | status |
Saved light status. | |
SbBool * | pstatus |
Pointer to saved light status. | |
Private Member Functions | |
void | init () |
Shadow light object initialization. | |
Static Private Member Functions | |
static void | checkStencilExt () |
Checks if GL_EXT_stencil_wrap is present in run-time. | |
static GLboolean | CheckExtension (char *extName) |
Run-time check if an OpenGL extension is present at the renderer. | |
static void | incrementStencilCB (void *userdata, SoAction *action) |
Rendering ++ CB. | |
static void | decrementStencilCB (void *userdata, SoAction *action) |
Rendering -- CB. | |
static void | litStencilCB (void *userdata, SoAction *action) |
Rendering lit CB. | |
static void | finishStencilCB (void *userdata, SoAction *action) |
Rendering finish CB. | |
Private Attributes | |
CShadowManager * | manager |
Pointer to shadow manager. | |
SoLight * | light |
Light. | |
SoSeparator * | lightRenderRoot |
Light render root. | |
SoSeparator * | volumesRoot |
Shadow volumes root node (vol. | |
SoNodeSensor * | sensor |
Sensor of light movement or change. | |
int | nameIndex |
Object name index. | |
Static Private Attributes | |
static float | envIntensity = 0.0f |
Ambient light intensity saved value. | |
static GLenum | incValue = GL_INCR |
OpenGL enum for incrementing stencil buf. | |
static GLenum | decValue = GL_DECR |
OpenGL enum for decrementing stencil buf. |
|
Constructor.
Definition at line 115 of file SoShadowLight.cpp. References init(), lightRenderRoot, nameIndex, pstatus, status, and volumesRoot. |
|
Destructor.
Definition at line 141 of file SoShadowLight.cpp. References lightRenderRoot, sensor, and volumesRoot. |
|
Checks if GL_EXT_stencil_wrap is present in run-time.
Definition at line 80 of file SoShadowLight.cpp. References CheckExtension(), decValue, GL_DECR_WRAP_EXT, GL_INCR_WRAP_EXT, and incValue. Referenced by incrementStencilCB(). |
|
Run-time check if an OpenGL extension is present at the renderer.
Definition at line 45 of file SoShadowLight.cpp. Referenced by checkStencilExt(). |
|
Shadow light object initialization. Creates shadow rendering subgraph. Definition at line 158 of file SoShadowLight.cpp. References decrementStencilCB(), finishStencilCB(), CShadowManager::getEnvironmentNode(), TLightInfo::globEnv, incrementStencilCB(), light, TLightInfo::light, lightRenderRoot, litStencilCB(), manager, pstatus, and TLightInfo::status. Referenced by SoShadowLight(). |
|
Rendering ++ CB. Sets stencil test according to the chosen algorithm.
Definition at line 483 of file SoShadowLight.cpp. References checkStencilExt(), incValue, ONDEBUG, and zfailAlg. Referenced by init(). |
|
Rendering -- CB. Sets stencil test according to the chosen algorithm.
Definition at line 534 of file SoShadowLight.cpp. References decValue, ONDEBUG, and zfailAlg. Referenced by init(). |
|
Rendering lit CB. Turns off ambient light and draws the user scene beside shadowed regions with one active light turned on. Shadow volumes of this light are tested with stencil buffer.
Definition at line 570 of file SoShadowLight.cpp. References envIntensity, TLightInfo::globEnv, TLightInfo::light, ONDEBUG, and TLightInfo::status. Referenced by init(). |
|
Rendering finish CB. Turns on ambient light and turns off the active light.
Definition at line 624 of file SoShadowLight.cpp. References envIntensity, TLightInfo::globEnv, TLightInfo::light, and ONDEBUG. Referenced by init(). |
|
Add a new shadow volume to the light.
Definition at line 327 of file SoShadowLight.cpp. References ONDEBUG, and volumesRoot. Referenced by CShadowManager::addObject(). |
|
Get shadow volume i.
Definition at line 386 of file SoShadowLight.cpp. References volumesRoot. Referenced by CShadowManager::createCasterVolumes(). |
|
Get number of shadow volumes under this light.
Definition at line 373 of file SoShadowLight.cpp. References volumesRoot. Referenced by CShadowManager::createCasterVolumes(). |
|
Deletes all shadow volumes under this light.
Definition at line 337 of file SoShadowLight.cpp. References ONDEBUG, and volumesRoot. |
|
Deletes shadow volumes i under this light.
Definition at line 349 of file SoShadowLight.cpp. References ONDEBUG, and volumesRoot. Referenced by CShadowManager::removeObject(). |
|
Returns pointer to the Shadow Manager.
Definition at line 255 of file SoShadowLight.cpp. References manager. |
|
Returns pointer to the light node.
Definition at line 266 of file SoShadowLight.cpp. References light. Referenced by CShadowManager::checkLights(), CShadowManager::endCB(), CShadowManager::initCB(), CShadowManager::nslightsOffCB(), CShadowManager::nslightsOnCB(), CShadowManager::removeLight(), and SoShadowVolume::SoShadowVolume(). |
|
Sets caster name index and the name of the node.
Definition at line 277 of file SoShadowLight.cpp. |
|
Gets caster name index.
Definition at line 293 of file SoShadowLight.cpp. References nameIndex. Referenced by CShadowManager::addObject(). |
|
Sets light sensor.
Definition at line 304 of file SoShadowLight.cpp. |
|
Gets light sensor.
Definition at line 315 of file SoShadowLight.cpp. References sensor. |
|
Creates all shadow volumes of all objects for this light.
Definition at line 396 of file SoShadowLight.cpp. References ONDEBUG, and volumesRoot. Referenced by CShadowManager::lightMoveCallback(). |
|
Creates all shadow volumes of all objects for this light.
Definition at line 416 of file SoShadowLight.cpp. References ONDEBUG, and volumesRoot. |
|
Pointer to shadow manager.
Definition at line 98 of file SoShadowLight.h. Referenced by getManager(), and init(). |
|
Light.
Definition at line 100 of file SoShadowLight.h. Referenced by getLight(), and init(). |
|
Light render root.
Definition at line 102 of file SoShadowLight.h. Referenced by init(), SoShadowLight(), and ~SoShadowLight(). |
|
Shadow volumes root node (vol. created by this light). Definition at line 104 of file SoShadowLight.h. Referenced by addVolume(), createShadowVolumes(), deleteVolume(), deleteVolumes(), getNumVolumes(), getVolume(), SoShadowLight(), and ~SoShadowLight(). |
|
Sensor of light movement or change.
Definition at line 108 of file SoShadowLight.h. Referenced by getSensor(), and ~SoShadowLight(). |
|
Object name index.
Definition at line 110 of file SoShadowLight.h. Referenced by getLightName(), setLightName(), and SoShadowLight(). |
|
Ambient light intensity saved value.
Definition at line 112 of file SoShadowLight.h. Referenced by finishStencilCB(), and litStencilCB(). |
|
OpenGL enum for incrementing stencil buf. Depends on if EXT_stencil_wrap extension is present. Definition at line 114 of file SoShadowLight.h. Referenced by checkStencilExt(), and incrementStencilCB(). |
|
OpenGL enum for decrementing stencil buf. Depends on if EXT_stencil_wrap extension is present. Definition at line 116 of file SoShadowLight.h. Referenced by checkStencilExt(), and decrementStencilCB(). |
|
Saved light status.
Definition at line 132 of file SoShadowLight.h. Referenced by CShadowManager::endCB(), CShadowManager::initCB(), CShadowManager::nslightsOffCB(), CShadowManager::nslightsOnCB(), and SoShadowLight(). |
|
Pointer to saved light status.
Definition at line 134 of file SoShadowLight.h. Referenced by init(), and SoShadowLight(). |