OpenSceneGraph 2.8.4
Public Member Functions | Protected Member Functions
osgUtil::HighlightMapGenerator Class Reference

This cube map generator produces a specular highlight map. More...

Inheritance diagram for osgUtil::HighlightMapGenerator:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 HighlightMapGenerator (const osg::Vec3 &light_direction, const osg::Vec4 &light_color, float specular_exponent, int texture_size=64)
 HighlightMapGenerator (const HighlightMapGenerator &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)

Protected Member Functions

virtual ~HighlightMapGenerator ()
HighlightMapGeneratoroperator= (const HighlightMapGenerator &)
virtual osg::Vec4 compute_color (const osg::Vec3 &R) const
 Override this method to define how colors are computed.

Detailed Description

This cube map generator produces a specular highlight map.

The vector-color association is: C = (R dot (-L)) ^ n, where C is the resulting color, R is the reflection vector, L is the light direction and n is the specular exponent.


Constructor & Destructor Documentation

osgUtil::HighlightMapGenerator::HighlightMapGenerator ( const osg::Vec3 light_direction,
const osg::Vec4 light_color,
float  specular_exponent,
int  texture_size = 64 
)
osgUtil::HighlightMapGenerator::HighlightMapGenerator ( const HighlightMapGenerator copy,
const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY 
)
virtual osgUtil::HighlightMapGenerator::~HighlightMapGenerator ( ) [inline, protected, virtual]

Member Function Documentation

osg::Vec4 osgUtil::HighlightMapGenerator::compute_color ( const osg::Vec3 R) const [inline, protected, virtual]

Override this method to define how colors are computed.

The parameter R is the reflection vector, pointing from the center of the cube. The return value should be the RGBA color associated with that reflection ray.

Implements osgUtil::CubeMapGenerator.

References osg::Vec3f::length(), and osg::Vec4f::w().

HighlightMapGenerator& osgUtil::HighlightMapGenerator::operator= ( const HighlightMapGenerator ) [inline, protected]

The documentation for this class was generated from the following file:

osg logo
Generated at Sun Jan 8 2012 13:16:57 for the OpenSceneGraph by doxygen 1.7.4.