Ran script to remove trailing spaces and tabs
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgFX - Copyright (C) 2003 Marco Jez
|
||||
@@ -25,16 +25,16 @@ namespace osgFX
|
||||
{
|
||||
|
||||
/**
|
||||
This single-pass effect implements a sort of anisotropic
|
||||
This single-pass effect implements a sort of anisotropic
|
||||
lighting that replaces the standard OpenGL lighting model.
|
||||
The final color of vertices is not computed directly, it is
|
||||
the result of a texture lookup on a user-supplied lighting
|
||||
image map. A vertex program is used to compute the s and t
|
||||
texture coordinates as follows: s = (N dot H) ; t = (N dot L)
|
||||
where N is the vertex normal, L is the light-to-vertex vector,
|
||||
H is the half-way vector. This is a good example of how you
|
||||
can use the State::getInitialViewMatrix() method to retrieve
|
||||
the view matrix and perform view-dependant effects without
|
||||
The final color of vertices is not computed directly, it is
|
||||
the result of a texture lookup on a user-supplied lighting
|
||||
image map. A vertex program is used to compute the s and t
|
||||
texture coordinates as follows: s = (N dot H) ; t = (N dot L)
|
||||
where N is the vertex normal, L is the light-to-vertex vector,
|
||||
H is the half-way vector. This is a good example of how you
|
||||
can use the State::getInitialViewMatrix() method to retrieve
|
||||
the view matrix and perform view-dependant effects without
|
||||
fakes of any kind.
|
||||
This effect requires the ARB_vertex_program extension.
|
||||
*/
|
||||
@@ -43,10 +43,10 @@ namespace osgFX
|
||||
AnisotropicLighting();
|
||||
AnisotropicLighting(const AnisotropicLighting& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Effect(osgFX, AnisotropicLighting,
|
||||
|
||||
"Anisotropic Lighting",
|
||||
|
||||
META_Effect(osgFX, AnisotropicLighting,
|
||||
|
||||
"Anisotropic Lighting",
|
||||
|
||||
"This single-pass effect implements a sort of anisotropic "
|
||||
"lighting that replaces the standard OpenGL lighting model.\n"
|
||||
"The final color of vertices is not computed directly, it is "
|
||||
@@ -58,23 +58,23 @@ namespace osgFX
|
||||
"can use the State::getInitialViewMatrix() method to retrieve "
|
||||
"the view matrix and perform view-dependant effects without "
|
||||
"fakes of any kind.\n"
|
||||
"This effect requires the ARB_vertex_program extension.",
|
||||
|
||||
"This effect requires the ARB_vertex_program extension.",
|
||||
|
||||
"Marco Jez");
|
||||
|
||||
|
||||
|
||||
|
||||
/** get the lighting map */
|
||||
inline osg::Image* getLightingMap();
|
||||
|
||||
|
||||
/** get the const lighting map */
|
||||
inline const osg::Image* getLightingMap() const;
|
||||
|
||||
|
||||
/** set the lighting map */
|
||||
inline void setLightingMap(osg::Image* image);
|
||||
|
||||
/** get the OpenGL light number */
|
||||
inline int getLightNumber() const;
|
||||
|
||||
|
||||
/** set the OpenGL light number that will be used in lighting computations */
|
||||
inline void setLightNumber(int n);
|
||||
|
||||
@@ -90,27 +90,27 @@ namespace osgFX
|
||||
};
|
||||
|
||||
// INLINE METHODS
|
||||
|
||||
|
||||
inline osg::Image* AnisotropicLighting::getLightingMap()
|
||||
{
|
||||
return _texture->getImage();
|
||||
}
|
||||
|
||||
|
||||
inline const osg::Image* AnisotropicLighting::getLightingMap() const
|
||||
{
|
||||
return _texture->getImage();
|
||||
}
|
||||
|
||||
|
||||
inline void AnisotropicLighting::setLightingMap(osg::Image* image)
|
||||
{
|
||||
_texture->setImage(image);
|
||||
}
|
||||
|
||||
|
||||
inline int AnisotropicLighting::getLightNumber() const
|
||||
{
|
||||
return _lightnum;
|
||||
}
|
||||
|
||||
|
||||
inline void AnisotropicLighting::setLightNumber(int n)
|
||||
{
|
||||
_lightnum = n;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgFX - Copyright (C) 2003 Marco Jez
|
||||
@@ -25,16 +25,16 @@ namespace osgFX
|
||||
{
|
||||
|
||||
/**
|
||||
This effect makes surfaces appear bumpy. Children nodes must use two textures,
|
||||
one for diffuse color and one for the normal map (which can be created
|
||||
from a height map with tools like nVIDIA's normal map generator). Furthermore,
|
||||
tangent-space basis vectors must be created and assigned to each Geometry; this
|
||||
can be done quickly by calling BumpMapping::prepareChildren(). Note that both
|
||||
diffuse and normal map textures must have corresponding UV maps defined in
|
||||
This effect makes surfaces appear bumpy. Children nodes must use two textures,
|
||||
one for diffuse color and one for the normal map (which can be created
|
||||
from a height map with tools like nVIDIA's normal map generator). Furthermore,
|
||||
tangent-space basis vectors must be created and assigned to each Geometry; this
|
||||
can be done quickly by calling BumpMapping::prepareChildren(). Note that both
|
||||
diffuse and normal map textures must have corresponding UV maps defined in
|
||||
Geometry objects.
|
||||
This effect defines a preferred technique which uses ARB vertex & fragment
|
||||
programs, and a fallback technique which doesn't use fragment programs. The
|
||||
latter is more limited though since it can't handle ambient and specular
|
||||
This effect defines a preferred technique which uses ARB vertex & fragment
|
||||
programs, and a fallback technique which doesn't use fragment programs. The
|
||||
latter is more limited though since it can't handle ambient and specular
|
||||
components.
|
||||
*/
|
||||
class OSGFX_EXPORT BumpMapping: public Effect {
|
||||
@@ -42,10 +42,10 @@ namespace osgFX
|
||||
BumpMapping();
|
||||
BumpMapping(const BumpMapping& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Effect(osgFX, BumpMapping,
|
||||
|
||||
"Bump Mapping",
|
||||
|
||||
META_Effect(osgFX, BumpMapping,
|
||||
|
||||
"Bump Mapping",
|
||||
|
||||
"This effect makes surfaces appear bumpy. Children nodes must use two textures, "
|
||||
"one for diffuse color and one for the normal map (which can be created "
|
||||
"from a height map with tools like nVIDIA's normal map generator). Furthermore, "
|
||||
@@ -57,58 +57,58 @@ namespace osgFX
|
||||
"programs, and a fallback technique which doesn't use fragment programs. The "
|
||||
"latter is more limited though since it can't handle ambient and specular "
|
||||
"components.",
|
||||
|
||||
|
||||
"Marco Jez");
|
||||
|
||||
|
||||
|
||||
|
||||
/** get the OpenGL light number */
|
||||
inline int getLightNumber() const;
|
||||
|
||||
|
||||
/** set the OpenGL light number that will be used in lighting computations */
|
||||
inline void setLightNumber(int n);
|
||||
|
||||
|
||||
/** get the texture unit that contains diffuse color texture. Default is 1 */
|
||||
inline int getDiffuseTextureUnit() const;
|
||||
|
||||
|
||||
/** set the texture unit that contains diffuse color texture. Default is 1 */
|
||||
inline void setDiffuseTextureUnit(int n);
|
||||
|
||||
/** get the texture unit that contains normal map texture. Default is 0 */
|
||||
inline int getNormalMapTextureUnit() const;
|
||||
|
||||
|
||||
/** set the texture unit that contains normal map texture. Default is 0 */
|
||||
inline void setNormalMapTextureUnit(int n);
|
||||
|
||||
|
||||
/** get the diffuse color texture that overrides children's texture */
|
||||
inline osg::Texture2D* getOverrideDiffuseTexture();
|
||||
|
||||
|
||||
/** get the const diffuse color texture that overrides children's texture */
|
||||
inline const osg::Texture2D* getOverrideDiffuseTexture() const;
|
||||
|
||||
|
||||
/** set the diffuse color texture that overrides children's texture */
|
||||
inline void setOverrideDiffuseTexture(osg::Texture2D* texture);
|
||||
|
||||
|
||||
/** get the normal map texture that overrides children's texture */
|
||||
inline osg::Texture2D* getOverrideNormalMapTexture();
|
||||
|
||||
|
||||
/** get the const normal map texture that overrides children's texture */
|
||||
inline const osg::Texture2D* getOverrideNormalMapTexture() const;
|
||||
|
||||
/** set the normal map texture that overrides children's texture */
|
||||
inline void setOverrideNormalMapTexture(osg::Texture2D* texture);
|
||||
|
||||
|
||||
/**
|
||||
prepare a Geometry for bump lighting. Tangent-space basis vectors are
|
||||
generated and attached to the geometry as vertex attribute arrays.
|
||||
*/
|
||||
void prepareGeometry(osg::Geometry* geo);
|
||||
|
||||
|
||||
/** prepare a Node for bump lighting, calling prepareGeometry() for each Geometry */
|
||||
void prepareNode(osg::Node* node);
|
||||
|
||||
|
||||
/** prepare children for bump lighting. Actually calls prepareNode() for each child */
|
||||
void prepareChildren();
|
||||
|
||||
|
||||
/** set up a demo environment with predefined diffuse and normal maps, as well as texture coordinates */
|
||||
void setUpDemo();
|
||||
|
||||
@@ -126,41 +126,41 @@ namespace osgFX
|
||||
osg::ref_ptr<osg::Texture2D> _normal_tex;
|
||||
};
|
||||
|
||||
// INLINE METHODS
|
||||
|
||||
// INLINE METHODS
|
||||
|
||||
inline int BumpMapping::getLightNumber() const
|
||||
{
|
||||
return _lightnum;
|
||||
}
|
||||
|
||||
|
||||
inline void BumpMapping::setLightNumber(int n)
|
||||
{
|
||||
_lightnum = n;
|
||||
dirtyTechniques();
|
||||
}
|
||||
|
||||
|
||||
inline int BumpMapping::getDiffuseTextureUnit() const
|
||||
{
|
||||
return _diffuse_unit;
|
||||
}
|
||||
|
||||
|
||||
inline void BumpMapping::setDiffuseTextureUnit(int n)
|
||||
{
|
||||
_diffuse_unit = n;
|
||||
dirtyTechniques();
|
||||
}
|
||||
|
||||
|
||||
inline int BumpMapping::getNormalMapTextureUnit() const
|
||||
{
|
||||
return _normal_unit;
|
||||
}
|
||||
|
||||
|
||||
inline void BumpMapping::setNormalMapTextureUnit(int n)
|
||||
{
|
||||
_normal_unit = n;
|
||||
dirtyTechniques();
|
||||
}
|
||||
|
||||
|
||||
inline osg::Texture2D* BumpMapping::getOverrideDiffuseTexture()
|
||||
{
|
||||
return _diffuse_tex.get();
|
||||
@@ -170,7 +170,7 @@ namespace osgFX
|
||||
{
|
||||
return _diffuse_tex.get();
|
||||
}
|
||||
|
||||
|
||||
inline void BumpMapping::setOverrideDiffuseTexture(osg::Texture2D* texture)
|
||||
{
|
||||
_diffuse_tex = texture;
|
||||
@@ -186,7 +186,7 @@ namespace osgFX
|
||||
{
|
||||
return _normal_tex.get();
|
||||
}
|
||||
|
||||
|
||||
inline void BumpMapping::setOverrideNormalMapTexture(osg::Texture2D* texture)
|
||||
{
|
||||
_normal_tex = texture;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgFX - Copyright (C) 2003 Marco Jez
|
||||
@@ -25,10 +25,10 @@ namespace osgFX
|
||||
{
|
||||
|
||||
/**
|
||||
This effect implements a technique called 'Cel-Shading' to produce a
|
||||
cartoon-style (non photorealistic) rendering. Two passes are required:
|
||||
the first one draws solid surfaces, the second one draws the outlines.
|
||||
A vertex program is used to setup texture coordinates for a sharp lighting
|
||||
This effect implements a technique called 'Cel-Shading' to produce a
|
||||
cartoon-style (non photorealistic) rendering. Two passes are required:
|
||||
the first one draws solid surfaces, the second one draws the outlines.
|
||||
A vertex program is used to setup texture coordinates for a sharp lighting
|
||||
texture on unit 0 which is generated on-the-fly.
|
||||
This effect requires the ARB_vertex_program extension.
|
||||
*/
|
||||
@@ -39,11 +39,11 @@ namespace osgFX
|
||||
|
||||
// effect class informations
|
||||
META_Effect(
|
||||
osgFX,
|
||||
Cartoon,
|
||||
|
||||
"Cartoon",
|
||||
|
||||
osgFX,
|
||||
Cartoon,
|
||||
|
||||
"Cartoon",
|
||||
|
||||
"This effect implements a technique called 'Cel-Shading' to produce a "
|
||||
"cartoon-style (non photorealistic) rendering. Two passes are required: "
|
||||
"the first one draws solid surfaces, the second one draws the outlines. "
|
||||
@@ -51,24 +51,24 @@ namespace osgFX
|
||||
"texture on unit 0 which is generated on-the-fly.\n"
|
||||
"This effect requires the ARB_vertex_program extension "
|
||||
"or OpenGL Shading Language.",
|
||||
|
||||
|
||||
"Marco Jez; OGLSL port by Mike Weiblen");
|
||||
|
||||
/** get the outline color */
|
||||
inline const osg::Vec4& getOutlineColor() const;
|
||||
|
||||
|
||||
/** set the outline color */
|
||||
inline void setOutlineColor(const osg::Vec4& color);
|
||||
|
||||
|
||||
/** get the outline line width */
|
||||
inline float getOutlineLineWidth() const;
|
||||
|
||||
|
||||
/** set the outline line width */
|
||||
inline void setOutlineLineWidth(float w);
|
||||
|
||||
|
||||
/** get the OpenGL light number */
|
||||
inline int getLightNumber() const;
|
||||
|
||||
|
||||
/** set the OpenGL light number that will be used in lighting computations */
|
||||
inline void setLightNumber(int n);
|
||||
|
||||
@@ -95,22 +95,22 @@ namespace osgFX
|
||||
{
|
||||
_wf_mat->setEmission(osg::Material::FRONT_AND_BACK, color);
|
||||
}
|
||||
|
||||
|
||||
inline float Cartoon::getOutlineLineWidth() const
|
||||
{
|
||||
return _wf_lw->getWidth();
|
||||
}
|
||||
|
||||
|
||||
inline void Cartoon::setOutlineLineWidth(float w)
|
||||
{
|
||||
_wf_lw->setWidth(w);
|
||||
}
|
||||
|
||||
|
||||
inline int Cartoon::getLightNumber() const
|
||||
{
|
||||
return _lightnum;
|
||||
}
|
||||
|
||||
|
||||
inline void Cartoon::setLightNumber(int n)
|
||||
{
|
||||
_lightnum = n;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgFX - Copyright (C) 2003 Marco Jez
|
||||
@@ -50,10 +50,10 @@ namespace osgFX
|
||||
defined. Each technique tries to implement the effect in a different way,
|
||||
often using different OpenGL extensions. The active technique can be
|
||||
selected either manually, with selectTechnique(), or automatically, in which
|
||||
case the first technique that is supported by all active rendering contexts
|
||||
case the first technique that is supported by all active rendering contexts
|
||||
is chosen.
|
||||
If you are an Effect user, then simply use it as a node group. Create an
|
||||
instance of your desired effect, add it to your scene graph and call its
|
||||
If you are an Effect user, then simply use it as a node group. Create an
|
||||
instance of your desired effect, add it to your scene graph and call its
|
||||
addChild() method to add a child node as you would do with a Group.
|
||||
If you are an Effect developer, you will have to implement the method
|
||||
define_techniques() to define the different techniques that can be used
|
||||
@@ -74,7 +74,7 @@ namespace osgFX
|
||||
|
||||
/** get the name of this Effect */
|
||||
virtual const char *effectName() const = 0;
|
||||
|
||||
|
||||
/** get a brief description of this Effect*/
|
||||
virtual const char *effectDescription() const = 0;
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace osgFX
|
||||
|
||||
/** set whether the effect is enabled or not */
|
||||
inline void setEnabled(bool v);
|
||||
|
||||
|
||||
/**
|
||||
optional: set effect parameters to produce a visually significant
|
||||
result to be used in demo applications like osgfxbrowser. Default
|
||||
@@ -96,7 +96,7 @@ namespace osgFX
|
||||
|
||||
/** get the number of techniques defined for this Effect */
|
||||
inline int getNumTechniques() const;
|
||||
|
||||
|
||||
/** get the i-th Technique */
|
||||
inline Technique* getTechnique(int i);
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace osgFX
|
||||
inline void selectTechnique(int i = AUTO_DETECT);
|
||||
|
||||
/** custom traversal */
|
||||
virtual void traverse(osg::NodeVisitor& nv);
|
||||
virtual void traverse(osg::NodeVisitor& nv);
|
||||
|
||||
/** default traversal */
|
||||
inline void inherited_traverse(osg::NodeVisitor& nv);
|
||||
@@ -122,7 +122,7 @@ namespace osgFX
|
||||
protected:
|
||||
virtual ~Effect();
|
||||
Effect &operator=(const Effect &) { return *this; }
|
||||
|
||||
|
||||
/** force rebuilding of techniques on next traversal */
|
||||
inline void dirtyTechniques();
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace osgFX
|
||||
this method.
|
||||
*/
|
||||
virtual bool define_techniques() = 0;
|
||||
|
||||
|
||||
private:
|
||||
friend class Validator;
|
||||
|
||||
@@ -149,13 +149,13 @@ namespace osgFX
|
||||
|
||||
// use int instead of bool to avoid errors
|
||||
mutable osg::buffered_value<int> _tech_selected;
|
||||
|
||||
|
||||
int _global_sel_tech;
|
||||
|
||||
bool _techs_defined;
|
||||
|
||||
osg::ref_ptr<osg::Geode> _dummy_for_validation;
|
||||
|
||||
|
||||
void build_dummy_node();
|
||||
};
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace osgFX
|
||||
{
|
||||
_enabled = v;
|
||||
}
|
||||
|
||||
|
||||
inline int Effect::getNumTechniques() const
|
||||
{
|
||||
return static_cast<int>(_techs.size());
|
||||
@@ -200,12 +200,12 @@ namespace osgFX
|
||||
{
|
||||
_techs.push_back(tech);
|
||||
}
|
||||
|
||||
|
||||
inline void Effect::dirtyTechniques()
|
||||
{
|
||||
_techs_defined = false;
|
||||
}
|
||||
|
||||
|
||||
inline void Effect::inherited_traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
typedef osg::Group inherited;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgFX - Copyright (C) 2003 Marco Jez
|
||||
@@ -31,10 +31,10 @@
|
||||
|
||||
\namespace osgFX
|
||||
|
||||
The osgFX library is a NodeKit that extends the core scene graph to provide a special effects framework.
|
||||
The osgFX library is a NodeKit that extends the core scene graph to provide a special effects framework.
|
||||
osgFX's framework allows multiple rendering techniques to be provide for each effect, thereby provide the use
|
||||
appropriate rendering techniques for each different class of graphics hardware, i.e. support for both modern
|
||||
programmable graphics hardware and still have standard OpenGL 1.1 support as a fallback.
|
||||
programmable graphics hardware and still have standard OpenGL 1.1 support as a fallback.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -31,19 +31,19 @@ namespace osgFX
|
||||
MultiTextureControl(const MultiTextureControl& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Node(osgFX, MultiTextureControl);
|
||||
|
||||
|
||||
void setTextureWeight(unsigned int unit, float weight);
|
||||
|
||||
float getTextureWeight(unsigned int unit) const { return (unit<_textureWeightList.size()) ? _textureWeightList[unit] : 0.0f; }
|
||||
|
||||
|
||||
unsigned int getNumTextureWeights() const { return _textureWeightList.size(); }
|
||||
|
||||
|
||||
protected:
|
||||
virtual ~MultiTextureControl() {}
|
||||
MultiTextureControl& operator = (const MultiTextureControl&) { return *this; }
|
||||
|
||||
|
||||
void updateStateSet();
|
||||
|
||||
|
||||
typedef std::vector<float> TextureWeightList;
|
||||
TextureWeightList _textureWeightList;
|
||||
};
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgFX - Copyright (C) 2003 Marco Jez
|
||||
@@ -57,7 +57,7 @@ namespace osgFX
|
||||
|
||||
// INLINE METHODS
|
||||
|
||||
|
||||
|
||||
|
||||
inline const Registry::EffectMap& Registry::getEffectMap() const
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgFX - Copyright (C) 2003 Marco Jez
|
||||
@@ -25,10 +25,10 @@ namespace osgFX
|
||||
{
|
||||
|
||||
/**
|
||||
This is a two-passes effect; the first pass renders the subgraph as usual
|
||||
while the second pass switches to wireframe mode, sets up lighting and
|
||||
This is a two-passes effect; the first pass renders the subgraph as usual
|
||||
while the second pass switches to wireframe mode, sets up lighting and
|
||||
material to obtain a fixed (user-defined) color and then renders the subgraph.
|
||||
This effect uses the PolygonOffset attribute to avoid Z-fighting, so it
|
||||
This effect uses the PolygonOffset attribute to avoid Z-fighting, so it
|
||||
requires at least OpenGL version 1.1.
|
||||
*/
|
||||
class OSGFX_EXPORT Scribe: public Effect {
|
||||
@@ -38,28 +38,28 @@ namespace osgFX
|
||||
|
||||
// effect class informations
|
||||
META_Effect(
|
||||
osgFX,
|
||||
Scribe,
|
||||
|
||||
"Scribe",
|
||||
|
||||
osgFX,
|
||||
Scribe,
|
||||
|
||||
"Scribe",
|
||||
|
||||
"This is a two-passes effect; the first pass renders the subgraph as usual "
|
||||
"while the second pass switches to wireframe mode, sets up lighting and "
|
||||
"material to obtain a fixed (user-defined) color and then renders the subgraph.\n"
|
||||
"This effect uses the PolygonOffset attribute to avoid Z-fighting, so it "
|
||||
"requires at least OpenGL version 1.1.",
|
||||
|
||||
|
||||
"Marco Jez");
|
||||
|
||||
/** get the wireframe color */
|
||||
inline const osg::Vec4& getWireframeColor() const;
|
||||
|
||||
|
||||
/** set the wireframe color */
|
||||
inline void setWireframeColor(const osg::Vec4& color);
|
||||
|
||||
|
||||
/** get the wireframe line width */
|
||||
inline float getWireframeLineWidth() const;
|
||||
|
||||
|
||||
/** set the wireframe line width */
|
||||
inline void setWireframeLineWidth(float w);
|
||||
|
||||
@@ -85,12 +85,12 @@ namespace osgFX
|
||||
{
|
||||
_wf_mat->setEmission(osg::Material::FRONT_AND_BACK, color);
|
||||
}
|
||||
|
||||
|
||||
inline float Scribe::getWireframeLineWidth() const
|
||||
{
|
||||
return _wf_lw->getWidth();
|
||||
}
|
||||
|
||||
|
||||
inline void Scribe::setWireframeLineWidth(float w)
|
||||
{
|
||||
_wf_lw->setWidth(w);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgFX - Copyright (C) 2003 Marco Jez
|
||||
@@ -22,12 +22,12 @@ namespace osgFX
|
||||
{
|
||||
|
||||
/**
|
||||
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.
|
||||
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
|
||||
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).
|
||||
*/
|
||||
class OSGFX_EXPORT SpecularHighlights: public Effect {
|
||||
@@ -35,42 +35,42 @@ namespace osgFX
|
||||
SpecularHighlights();
|
||||
SpecularHighlights(const SpecularHighlights& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Effect(osgFX, SpecularHighlights,
|
||||
|
||||
"Specular Highlights",
|
||||
|
||||
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).",
|
||||
|
||||
"extensions (GL_EXT_texture_cube_map, GL_ARB_texture_cube_map or OpenGL v1.3).",
|
||||
|
||||
"Marco Jez");
|
||||
|
||||
|
||||
|
||||
|
||||
/** get the OpenGL light number */
|
||||
inline int getLightNumber() const;
|
||||
|
||||
|
||||
/** set the OpenGL light number that will be used in lighting computations */
|
||||
inline void setLightNumber(int n);
|
||||
|
||||
|
||||
/** get the texture unit number */
|
||||
inline int getTextureUnit() const;
|
||||
|
||||
|
||||
/** set the texture unit that will be used to apply the cube map */
|
||||
inline void setTextureUnit(int n);
|
||||
|
||||
|
||||
/** get the specular color */
|
||||
inline const osg::Vec4& getSpecularColor() const;
|
||||
|
||||
|
||||
/** set the specular color */
|
||||
inline void setSpecularColor(const osg::Vec4& color);
|
||||
|
||||
|
||||
/** get the specular exponent */
|
||||
inline float getSpecularExponent() const;
|
||||
|
||||
|
||||
/** set the specular exponent */
|
||||
inline void setSpecularExponent(float e);
|
||||
|
||||
@@ -88,23 +88,23 @@ namespace osgFX
|
||||
};
|
||||
|
||||
// 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;
|
||||
@@ -115,7 +115,7 @@ namespace osgFX
|
||||
{
|
||||
return _color;
|
||||
}
|
||||
|
||||
|
||||
inline void SpecularHighlights::setSpecularColor(const osg::Vec4& color)
|
||||
{
|
||||
_color = color;
|
||||
@@ -126,7 +126,7 @@ namespace osgFX
|
||||
{
|
||||
return _sexp;
|
||||
}
|
||||
|
||||
|
||||
inline void SpecularHighlights::setSpecularExponent(float e)
|
||||
{
|
||||
_sexp = e;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgFX - Copyright (C) 2003 Marco Jez
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
An helper macro that defines the methods techniqueName() and
|
||||
An helper macro that defines the methods techniqueName() and
|
||||
techniqueDescription() making them return the strings passed as parameters.
|
||||
*/
|
||||
#define META_Technique(name, description) \
|
||||
@@ -87,14 +87,14 @@ namespace osgFX
|
||||
/** get the const StateSet object associated to the i-th pass */
|
||||
inline const osg::StateSet* getPassStateSet(int i) const;
|
||||
|
||||
/**
|
||||
/**
|
||||
traverse children with multipass if necessary. By default this method
|
||||
simply calls the protected method traverse_implementation(); you can
|
||||
override it to change the default behavior.
|
||||
Don't call this method directly as it is called by osgFX::Effect
|
||||
*/
|
||||
inline virtual void traverse(osg::NodeVisitor& nv, Effect* fx);
|
||||
|
||||
|
||||
protected:
|
||||
Technique(const Technique &): osg::Referenced() {} // copying is nonsense ;)
|
||||
virtual ~Technique() {}
|
||||
@@ -105,7 +105,7 @@ namespace osgFX
|
||||
|
||||
/** create a new pass node, add it to the technique and associate a StateSet */
|
||||
void addPass(osg::StateSet* ss = 0);
|
||||
|
||||
|
||||
/** optional: return a node that overrides the child node on a specified pass */
|
||||
inline virtual osg::Node* getOverrideChild(int) { return 0; }
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace osgFX
|
||||
implement this method in derived classes to add the required passes.
|
||||
*/
|
||||
virtual void define_passes() = 0;
|
||||
|
||||
|
||||
/**
|
||||
traverse children with multipass if necessary. Don't call this method
|
||||
directly unless you are in a customized version of traverse().
|
||||
@@ -142,12 +142,12 @@ namespace osgFX
|
||||
{
|
||||
return _passes[i].get();
|
||||
}
|
||||
|
||||
|
||||
inline void Technique::dirtyPasses()
|
||||
{
|
||||
_passes.clear();
|
||||
}
|
||||
|
||||
|
||||
inline void Technique::traverse(osg::NodeVisitor& nv, Effect* fx)
|
||||
{
|
||||
traverse_implementation(nv, fx);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgFX - Copyright (C) 2003 Marco Jez
|
||||
@@ -34,7 +34,7 @@ namespace osgFX
|
||||
*/
|
||||
class OSGFX_EXPORT Validator: public osg::StateAttribute {
|
||||
public:
|
||||
|
||||
|
||||
Validator();
|
||||
Validator(Effect* effect);
|
||||
Validator(const Validator& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
||||
@@ -45,7 +45,7 @@ namespace osgFX
|
||||
void compileGLObjects(osg::State& state) const;
|
||||
|
||||
inline int compare(const osg::StateAttribute& sa) const;
|
||||
|
||||
|
||||
inline void disable() { _effect = 0; }
|
||||
|
||||
protected:
|
||||
@@ -63,7 +63,7 @@ namespace osgFX
|
||||
// check the types are equal and then create the rhs variable
|
||||
//used by the COMPARE_StateAttribute_Parameter macros below.
|
||||
COMPARE_StateAttribute_Types(Validator,sa)
|
||||
|
||||
|
||||
// compare parameters
|
||||
COMPARE_StateAttribute_Parameter(_effect)
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user