Changeset 13041 for OpenSceneGraph/trunk/include/osgFX/SpecularHighlights
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgFX/SpecularHighlights
r5328 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 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 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 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 23 23 24 24 /** 25 This effect applies additive specular highlights at fragment level (instead 26 of OpenGL's vertex-level lighting) by using a cube map and reflective texgen. 27 A texture matrix is computed to rotate the cube map automatically; this makes 28 the specular effect consistent with respect to view direction and light position. 25 This effect applies additive specular highlights at fragment level (instead 26 of OpenGL's vertex-level lighting) by using a cube map and reflective texgen. 27 A texture matrix is computed to rotate the cube map automatically; this makes 28 the specular effect consistent with respect to view direction and light position. 29 29 The user can choose which light should be used to compute the texture matrix. 30 This effect requires the GL_ARB_texture_env_add extension and one of the cube map 30 This effect requires the GL_ARB_texture_env_add extension and one of the cube map 31 31 extensions (GL_EXT_texture_cube_map, GL_ARB_texture_cube_map or OpenGL v1.3). 32 32 */ … … 36 36 SpecularHighlights(const SpecularHighlights& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); 37 37 38 META_Effect(osgFX, SpecularHighlights, 39 40 "Specular Highlights", 41 38 META_Effect(osgFX, SpecularHighlights, 39 40 "Specular Highlights", 41 42 42 "This effect applies additive specular highlights at fragment level (instead " 43 43 "of OpenGL's vertex-level lighting) by using a cube map and reflective texgen. " … … 46 46 "The user can choose which light should be used to compute the texture matrix.\n" 47 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 48 "extensions (GL_EXT_texture_cube_map, GL_ARB_texture_cube_map or OpenGL v1.3).", 49 50 50 "Marco Jez"); 51 52 51 52 53 53 /** get the OpenGL light number */ 54 54 inline int getLightNumber() const; 55 55 56 56 /** set the OpenGL light number that will be used in lighting computations */ 57 57 inline void setLightNumber(int n); 58 58 59 59 /** get the texture unit number */ 60 60 inline int getTextureUnit() const; 61 61 62 62 /** set the texture unit that will be used to apply the cube map */ 63 63 inline void setTextureUnit(int n); 64 64 65 65 /** get the specular color */ 66 66 inline const osg::Vec4& getSpecularColor() const; 67 67 68 68 /** set the specular color */ 69 69 inline void setSpecularColor(const osg::Vec4& color); 70 70 71 71 /** get the specular exponent */ 72 72 inline float getSpecularExponent() const; 73 73 74 74 /** set the specular exponent */ 75 75 inline void setSpecularExponent(float e); … … 89 89 90 90 // INLINE METHODS 91 91 92 92 inline int SpecularHighlights::getLightNumber() const 93 93 { 94 94 return _lightnum; 95 95 } 96 96 97 97 inline void SpecularHighlights::setLightNumber(int n) 98 98 { … … 100 100 dirtyTechniques(); 101 101 } 102 102 103 103 inline int SpecularHighlights::getTextureUnit() const 104 104 { 105 105 return _unit; 106 106 } 107 107 108 108 inline void SpecularHighlights::setTextureUnit(int n) 109 109 { … … 116 116 return _color; 117 117 } 118 118 119 119 inline void SpecularHighlights::setSpecularColor(const osg::Vec4& color) 120 120 { … … 127 127 return _sexp; 128 128 } 129 129 130 130 inline void SpecularHighlights::setSpecularExponent(float e) 131 131 {
