Changeset 13041 for OpenSceneGraph/trunk/include/osgFX/Cartoon
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osgFX/Cartoon (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgFX/Cartoon
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 */ … … 26 26 27 27 /** 28 This effect implements a technique called 'Cel-Shading' to produce a 29 cartoon-style (non photorealistic) rendering. Two passes are required: 30 the first one draws solid surfaces, the second one draws the outlines. 31 A vertex program is used to setup texture coordinates for a sharp lighting 28 This effect implements a technique called 'Cel-Shading' to produce a 29 cartoon-style (non photorealistic) rendering. Two passes are required: 30 the first one draws solid surfaces, the second one draws the outlines. 31 A vertex program is used to setup texture coordinates for a sharp lighting 32 32 texture on unit 0 which is generated on-the-fly. 33 33 This effect requires the ARB_vertex_program extension. … … 40 40 // effect class informations 41 41 META_Effect( 42 osgFX, 43 Cartoon, 44 45 "Cartoon", 46 42 osgFX, 43 Cartoon, 44 45 "Cartoon", 46 47 47 "This effect implements a technique called 'Cel-Shading' to produce a " 48 48 "cartoon-style (non photorealistic) rendering. Two passes are required: " … … 52 52 "This effect requires the ARB_vertex_program extension " 53 53 "or OpenGL Shading Language.", 54 54 55 55 "Marco Jez; OGLSL port by Mike Weiblen"); 56 56 57 57 /** get the outline color */ 58 58 inline const osg::Vec4& getOutlineColor() const; 59 59 60 60 /** set the outline color */ 61 61 inline void setOutlineColor(const osg::Vec4& color); 62 62 63 63 /** get the outline line width */ 64 64 inline float getOutlineLineWidth() const; 65 65 66 66 /** set the outline line width */ 67 67 inline void setOutlineLineWidth(float w); 68 68 69 69 /** get the OpenGL light number */ 70 70 inline int getLightNumber() const; 71 71 72 72 /** set the OpenGL light number that will be used in lighting computations */ 73 73 inline void setLightNumber(int n); … … 96 96 _wf_mat->setEmission(osg::Material::FRONT_AND_BACK, color); 97 97 } 98 98 99 99 inline float Cartoon::getOutlineLineWidth() const 100 100 { 101 101 return _wf_lw->getWidth(); 102 102 } 103 103 104 104 inline void Cartoon::setOutlineLineWidth(float w) 105 105 { 106 106 _wf_lw->setWidth(w); 107 107 } 108 108 109 109 inline int Cartoon::getLightNumber() const 110 110 { 111 111 return _lightnum; 112 112 } 113 113 114 114 inline void Cartoon::setLightNumber(int n) 115 115 {
