openscenegraph
SpecularHighlights
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13//osgFX - Copyright (C) 2003 Marco Jez
14
15#ifndef OSGFX_SPECULARHIGHLIGHTS_
16#define OSGFX_SPECULARHIGHLIGHTS_
17
18#include <osgFX/Export>
19#include <osgFX/Effect>
20
21namespace osgFX
22{
23
34 public:
37
39
40 "Specular Highlights",
41
42 "This effect applies additive specular highlights at fragment level (instead "
43 "of OpenGL's vertex-level lighting) by using a cube map and reflective texgen. "
44 "A texture matrix is computed to rotate the cube map automatically; this makes "
45 "the specular effect consistent with respect to view direction and light position. "
46 "The user can choose which light should be used to compute the texture matrix.\n"
47 "This effect requires the GL_ARB_texture_env_add extension and one of the cube map "
48 "extensions (GL_EXT_texture_cube_map, GL_ARB_texture_cube_map or OpenGL v1.3).",
49
50 "Marco Jez");
51
52
54 inline int getLightNumber() const;
55
57 inline void setLightNumber(int n);
58
60 inline int getTextureUnit() const;
61
63 inline void setTextureUnit(int n);
64
66 inline const osg::Vec4& getSpecularColor() const;
67
69 inline void setSpecularColor(const osg::Vec4& color);
70
72 inline float getSpecularExponent() const;
73
75 inline void setSpecularExponent(float e);
76
77 protected:
80
82
83 private:
84 int _lightnum;
85 int _unit;
86 osg::Vec4 _color;
87 float _sexp;
88 };
89
90 // INLINE METHODS
91
93 {
94 return _lightnum;
95 }
96
98 {
99 _lightnum = n;
101 }
102
104 {
105 return _unit;
106 }
107
109 {
110 _unit = n;
112 }
113
115 {
116 return _color;
117 }
118
120 {
121 _color = color;
123 }
124
126 {
127 return _sexp;
128 }
129
131 {
132 _sexp = e;
134 }
135
136}
137
138#endif
Definition Effect:66
void dirtyTechniques()
Definition Effect:207
Definition SpecularHighlights:33
void setTextureUnit(int n)
Definition SpecularHighlights:108
int getLightNumber() const
Definition SpecularHighlights:92
const osg::Vec4 & getSpecularColor() const
Definition SpecularHighlights:114
void setSpecularExponent(float e)
Definition SpecularHighlights:130
void setLightNumber(int n)
Definition SpecularHighlights:97
void setSpecularColor(const osg::Vec4 &color)
Definition SpecularHighlights:119
float getSpecularExponent() const
Definition SpecularHighlights:125
SpecularHighlights & operator=(const SpecularHighlights &)
Definition SpecularHighlights:79
int getTextureUnit() const
Definition SpecularHighlights:103
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")
virtual ~SpecularHighlights()
Definition SpecularHighlights:78
SpecularHighlights(const SpecularHighlights &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Definition Vec4f:28
Definition AnisotropicLighting:25
#define OSGFX_EXPORT
Definition osgFX/Export:27