SoShadowSpotLight(3)

NAME
SoShadowSpotLight - The SoShadowSpotLight class is a node for setting up a spot light which casts shadows.

SYNOPSIS

#include <Inventor/annex/FXViz/nodes/SoShadowSpotLight.h>

Inherits SoSpotLight.

  Public Member Functions
virtual SoType getTypeId (void) const
SoShadowSpotLight (void)
virtual void GLRender (SoGLRenderAction *action)

  Static Public Member Functions
static SoType getClassTypeId (void)
static void initClass (void)

  Public Attributes
SoSFNode shadowMapScene
SoSFFloat nearDistance
SoSFFloat farDistance

  Protected Member Functions
virtual const SoFieldData * getFieldData (void) const
virtual ~SoShadowSpotLight ()

  Static Protected Member Functions
static const SoFieldData ** getFieldDataPtr (void)

  Additional Inherited Members

Detailed Description

The SoShadowSpotLight class is a node for setting up a spot light which casts shadows. This node can be used instead of a normal spot light if you need to improve the performance by supplying a simplified scene graph to be used when rendering the shadow map(s). For instance, the shadow map scene graph doesn't need any textures or materials, and any non-casters can also be excluded from this scene graph. It's more optimal to use this node than to use the SoShadowStyle node to control this, at the cost of some extra application complexity.

It's especially useful if you have a scene with few shadow caster nodes and lots of shadow receiver nodes.

Currently, this node must be placed somewhere in the SoShadowGroup subgraph to cast shadows.

FILE FORMAT/DEFAULTS:

ShadowSpotLight {
  shadowMapScene NULL
  nearDistance -1
  farDistance -1
}

Here is the example from SoShadowGroup, modified to use SoShadowSpotLight instead of a normal SoSpotLight. Notice that only the sphere casts shadows.

DirectionalLight { direction 0 0 -1 intensity 0.2 }
ShadowGroup {
  quality 1 # to get per pixel lighting
  ShadowSpotLight {
    location -8 -8 8.0
    direction 1 1 -1
    cutOffAngle 0.35
    dropOffRate 0.7
    shadowMapScene
    DEF sphere Separator {
        Complexity { value 1.0 }
        Material { diffuseColor 1 1 0 specularColor 1 1 1 shininess 0.9 }
        Shuttle { translation0 -3 1 0 translation1 3 -5 0 speed 0.25 on TRUE }
        Translation { translation -5 0 2 }
        Sphere { radius 2.0 }
      }
  }
  # need to insert the sphere in the regular scene graph as well
  USE sphere
  Separator {
    Material { diffuseColor 1 0 0 specularColor 1 1 1 shininess 0.9 }
    Shuttle { translation0 0 -5 0 translation1 0 5 0 speed 0.15 on TRUE }
    Translation { translation 0 0 -3 }
    Cube { depth 1.8 }
  }
  Separator {
    Material { diffuseColor 0 1 0 specularColor 1 1 1 shininess 0.9 }
    Shuttle { translation0 -5 0 0 translation1 5 0 0 speed 0.3 on TRUE }
    Translation { translation 0 0 -3 }
    Cube { }
  }
  Coordinate3 { point [ -10 -10 -3, 10 -10 -3, 10 10 -3, -10 10 -3 ] }
  Material { specularColor 1 1 1 shininess 0.9 }
  Complexity { textureQuality 0.1 }
  Texture2 { image 2 2 3 0xffffff 0x225588 0x225588 0xffffff }
  Texture2Transform { scaleFactor 4 4 }
  FaceSet { numVertices 4 }
}

Since
    Coin 3.0

Constructor & Destructor Documentation

  SoShadowSpotLight::SoShadowSpotLight (void)
Constructor.

  SoShadowSpotLight::~SoShadowSpotLight () [protected], [virtual]
Destructor.

Member Function Documentation

  SoType SoShadowSpotLight::getClassTypeId (void) [static]
This static method returns the SoType object associated with objects of this class.

  SoType SoShadowSpotLight::getTypeId (void) const [virtual]
Returns the type identification of an object derived from a class inheriting SoBase. This is used for runtime type checking and 'downward' casting.

Reimplemented from SoSpotLight.

  const SoFieldData ** SoShadowSpotLight::getFieldDataPtr (void) [static], [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
 Returns the SoFieldData class which holds information about fields in this node.

  const SoFieldData * SoShadowSpotLight::getFieldData (void) const [protected], [virtual]
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.

Reimplemented from SoSpotLight.

  void SoShadowSpotLight::initClass (void) [static]

  void SoShadowSpotLight::GLRender (SoGLRenderAction * action) [virtual]
Action method for the SoGLRenderAction.

This is called during rendering traversals. Nodes influencing the rendering state in any way or want to throw geometry primitives at OpenGL override this method.

Reimplemented from SoSpotLight.

Member Data Documentation

  SoSFNode SoShadowSpotLight::shadowMapScene
The shadow map scene graph. If this is NULL (the default), the node will behave as a normal SoSpotLight node.

  SoSFFloat SoShadowSpotLight::nearDistance
Can be used to set a fixed near distance for this spot light. The value in this field will be used if it is set to > 0.0. Default value is -1.0.

  SoSFFloat SoShadowSpotLight::farDistance
Can be used to set a fixed far distance for this spot light. The value in this field will be used if it is set to > 0.0. Default value is -1.0.

Author

Generated automatically by Doxygen for Coin from the source code.