SpecularHighlights
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
//osgFX - Copyright (C) 2003 Marco Jez
#ifndef OSGFX_SPECULARHIGHLIGHTS_
#define OSGFX_SPECULARHIGHLIGHTS_
#include <osgFX/Export>
#include <osgFX/Effect>
namespace osgFX
{
class OSGFX_EXPORT SpecularHighlights: public Effect {
public:
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");
inline int getLightNumber() const;
inline void setLightNumber(int n);
inline int getTextureUnit() const;
inline void setTextureUnit(int n);
inline const osg::Vec4& getSpecularColor() const;
inline void setSpecularColor(const osg::Vec4& color);
inline float getSpecularExponent() const;
inline void setSpecularExponent(float e);
protected:
virtual ~SpecularHighlights() {}
SpecularHighlights& operator=(const SpecularHighlights&) { return *this; }
bool define_techniques();
private:
int _lightnum;
int _unit;
osg::Vec4 _color;
float _sexp;
};
// INLINE METHODS
inline int SpecularHighlights::getLightNumber() const
{
return _lightnum;
}
inline void SpecularHighlights::setLightNumber(int n)
{
_lightnum = n;
dirtyTechniques();
}
inline int SpecularHighlights::getTextureUnit() const
{
return _unit;
}
inline void SpecularHighlights::setTextureUnit(int n)
{
_unit = n;
dirtyTechniques();
}
inline const osg::Vec4& SpecularHighlights::getSpecularColor() const
{
return _color;
}
inline void SpecularHighlights::setSpecularColor(const osg::Vec4& color)
{
_color = color;
dirtyTechniques();
}
inline float SpecularHighlights::getSpecularExponent() const
{
return _sexp;
}
inline void SpecularHighlights::setSpecularExponent(float e)
{
_sexp = e;
dirtyTechniques();
}
}
#endif
Effect
osgFX::Effect::Effect
Effect()
osgFX::Effect::dirtyTechniques
void dirtyTechniques()
Definition Effect:207
osgFX::SpecularHighlights::setTextureUnit
void setTextureUnit(int n)
Definition SpecularHighlights:108
osgFX::SpecularHighlights::define_techniques
bool define_techniques()
osgFX::SpecularHighlights::getLightNumber
int getLightNumber() const
Definition SpecularHighlights:92
osgFX::SpecularHighlights::getSpecularColor
const osg::Vec4 & getSpecularColor() const
Definition SpecularHighlights:114
osgFX::SpecularHighlights::setSpecularExponent
void setSpecularExponent(float e)
Definition SpecularHighlights:130
osgFX::SpecularHighlights::setLightNumber
void setLightNumber(int n)
Definition SpecularHighlights:97
osgFX::SpecularHighlights::SpecularHighlights
SpecularHighlights()
osgFX::SpecularHighlights::setSpecularColor
void setSpecularColor(const osg::Vec4 &color)
Definition SpecularHighlights:119
osgFX::SpecularHighlights::getSpecularExponent
float getSpecularExponent() const
Definition SpecularHighlights:125
osgFX::SpecularHighlights::operator=
SpecularHighlights & operator=(const SpecularHighlights &)
Definition SpecularHighlights:79
osgFX::SpecularHighlights::getTextureUnit
int getTextureUnit() const
Definition SpecularHighlights:103
osgFX::SpecularHighlights::META_Effect
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")
osgFX::SpecularHighlights::~SpecularHighlights
virtual ~SpecularHighlights()
Definition SpecularHighlights:78
osgFX::SpecularHighlights::SpecularHighlights
SpecularHighlights(const SpecularHighlights &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osgFX
Definition AnisotropicLighting:25
osg::Vec4
Vec4f Vec4
Definition Vec4:21
Export
OSGFX_EXPORT
#define OSGFX_EXPORT
Definition osgFX/Export:27