OpenSceneGraph  3.0.1
Public Member Functions | Protected Member Functions
osgFX::SpecularHighlights Class Reference

This effect applies additive specular highlights at fragment level (instead of OpenGL's vertex-level lighting) by using a cube map and reflective texgen. More...

Inheritance diagram for osgFX::SpecularHighlights:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 SpecularHighlights ()
 SpecularHighlights (const SpecularHighlights &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 META_Effect (osgFX, SpecularHighlights,"Specular Highlights","This effect applies additive specular highlights at fragment level (instead ""of OpenGL's vertex-level lighting) by using a cube map and reflective texgen. ""A texture matrix is computed to rotate the cube map automatically; this makes ""the specular effect consistent with respect to view direction and light position. ""The user can choose which light should be used to compute the texture matrix.\n""This effect requires the GL_ARB_texture_env_add extension and one of the cube map ""extensions (GL_EXT_texture_cube_map, GL_ARB_texture_cube_map or OpenGL v1.3).","Marco Jez")
int getLightNumber () const
 get the OpenGL light number
void setLightNumber (int n)
 set the OpenGL light number that will be used in lighting computations
int getTextureUnit () const
 get the texture unit number
void setTextureUnit (int n)
 set the texture unit that will be used to apply the cube map
const osg::Vec4getSpecularColor () const
 get the specular color
void setSpecularColor (const osg::Vec4 &color)
 set the specular color
float getSpecularExponent () const
 get the specular exponent
void setSpecularExponent (float e)
 set the specular exponent

Protected Member Functions

virtual ~SpecularHighlights ()
SpecularHighlightsoperator= (const SpecularHighlights &)
bool define_techniques ()
 abstract method to be implemented in derived classes; its purpose if to create the techniques that can be used for obtaining the desired effect.

Detailed Description

This effect applies additive specular highlights at fragment level (instead of OpenGL's vertex-level lighting) by using a cube map and reflective texgen.

A texture matrix is computed to rotate the cube map automatically; this makes the specular effect consistent with respect to view direction and light position. The user can choose which light should be used to compute the texture matrix. This effect requires the GL_ARB_texture_env_add extension and one of the cube map extensions (GL_EXT_texture_cube_map, GL_ARB_texture_cube_map or OpenGL v1.3).


Constructor & Destructor Documentation

osgFX::SpecularHighlights::SpecularHighlights ( )
osgFX::SpecularHighlights::SpecularHighlights ( const SpecularHighlights copy,
const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY 
)
virtual osgFX::SpecularHighlights::~SpecularHighlights ( ) [inline, protected, virtual]

Member Function Documentation

bool osgFX::SpecularHighlights::define_techniques ( ) [protected, virtual]

abstract method to be implemented in derived classes; its purpose if to create the techniques that can be used for obtaining the desired effect.

You will usually call addTechnique() inside this method.

Implements osgFX::Effect.

int osgFX::SpecularHighlights::getLightNumber ( ) const [inline]

get the OpenGL light number

const osg::Vec4 & osgFX::SpecularHighlights::getSpecularColor ( ) const [inline]

get the specular color

float osgFX::SpecularHighlights::getSpecularExponent ( ) const [inline]

get the specular exponent

int osgFX::SpecularHighlights::getTextureUnit ( ) const [inline]

get the texture unit number

osgFX::SpecularHighlights::META_Effect ( osgFX  ,
SpecularHighlights  ,
"Specular Highlights"  ,
"This effect applies additive specular highlights at fragment level (instead ""of OpenGL's vertex-level lighting) by using a cube map and reflective texgen. ""A texture matrix is computed to rotate the cube map automatically; this makes ""the specular effect consistent with respect to view direction and light position. ""The user can choose which light should be used to compute the texture matrix.\n""This effect requires the GL_ARB_texture_env_add extension and one of the cube map ""extensions (GL_EXT_texture_cube_map, GL_ARB_texture_cube_map or OpenGL v1.3)."  ,
"Marco Jez"   
)
SpecularHighlights& osgFX::SpecularHighlights::operator= ( const SpecularHighlights ) [inline, protected]
void osgFX::SpecularHighlights::setLightNumber ( int  n) [inline]

set the OpenGL light number that will be used in lighting computations

References osgFX::Effect::dirtyTechniques().

void osgFX::SpecularHighlights::setSpecularColor ( const osg::Vec4 color) [inline]

set the specular color

References osgFX::Effect::dirtyTechniques().

void osgFX::SpecularHighlights::setSpecularExponent ( float  e) [inline]

set the specular exponent

References osgFX::Effect::dirtyTechniques().

void osgFX::SpecularHighlights::setTextureUnit ( int  n) [inline]

set the texture unit that will be used to apply the cube map

References osgFX::Effect::dirtyTechniques().


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

osg logo
Generated at Mon Oct 3 2011 12:39:47 for the OpenSceneGraph by doxygen 1.7.5.