The base class for special effects.
Inheritance:
Public Classes
-
enum TechniqueSelection
Public Methods
-
Effect()
-
Effect(const Effect ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY)
-
virtual inline bool isSameKindAs(const osg::Object* obj) const
-
virtual inline const char* libraryName() const
-
virtual inline const char* className() const
-
virtual const char* effectName() const
- get the name of this effect
-
virtual const char* effectDescription() const
- get a brief description of this effect
-
virtual const char* effectAuthor() const
- get the effect author's name
-
inline virtual void setUpDemo()
- optional: set effect parameters to produce a visually significant result to be used in demo applications like osgfxbrowser.
-
virtual void traverse(osg::NodeVisitor &nv)
- custom traversal
-
inline bool getEnabled() const
- get whether the effect is enabled or not
-
inline void setEnabled(bool v)
- set whether the effect is enabled or not
-
inline int getNumTechniques() const
- get the number of techniques defined for this effect
-
inline Technique* getTechnique(int i)
- get the i-th technique
-
inline const Technique* getTechnique(int i) const
- get the i-th const technique
-
inline int getSelectedTechnique() const
- get the index of the currently selected technique
-
inline void selectTechnique(int i)
- select a technique or enable automatic detection
-
inline void addTechnique(Technique* tech)
- add a technique to the effect
-
inline void dirtyTechniques()
- force rebuilding of techniques on next traversal
-
inline void inherited_traverse(osg::NodeVisitor &nv)
- default traversal
Protected Methods
-
virtual ~Effect()
-
Effect& operator=(const Effect &)
-
virtual bool define_techniques()
- abstract method to be implemented in derived classes; its purpose if to create the techniques that can be used for obtaining the desired effect.
Documentation
The base class for special effects. An effect is basically a collection of
state attributes and an interface for configuring them in a predefined
fashion. The Effect class does more however, as it handles multipass
rendering transparently and it allows more than one "technique" to be
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
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
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
for obtaining the desired effect. In define_techniques() you will usually
create one or more instances of custom classes derived from Technique and
you will add them to the effect with addTechnique(). The order is important:
techniques added first will have higher priority and will be used first as
soon as all rendering contexts support it.
- Effect()
- Effect(const Effect ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY)
- virtual inline bool isSameKindAs(const osg::Object* obj) const
- virtual inline const char* libraryName() const
- virtual inline const char* className() const
- virtual const char* effectName() const
- get the name of this effect
- virtual const char* effectDescription() const
- get a brief description of this effect
- virtual const char* effectAuthor() const
- get the effect author's name
- inline virtual void setUpDemo()
-
optional: set effect parameters to produce a visually significant
result to be used in demo applications like osgfxbrowser. Default
is to do nothing.
- enum TechniqueSelection
- AUTO_DETECT
- virtual void traverse(osg::NodeVisitor &nv)
- custom traversal
- virtual ~Effect()
- Effect& operator=(const Effect &)
- virtual bool define_techniques()
-
abstract method to be implemented in derived classes; its purpose
if to create the techniques that can be used for obtaining the
desired effect. You will usually call addTechnique() inside
this method.
- inline bool getEnabled() const
- get whether the effect is enabled or not
- inline void setEnabled(bool v)
- set whether the effect is enabled or not
- inline int getNumTechniques() const
- get the number of techniques defined for this effect
- inline Technique* getTechnique(int i)
- get the i-th technique
- inline const Technique* getTechnique(int i) const
- get the i-th const technique
- inline int getSelectedTechnique() const
- get the index of the currently selected technique
- inline void selectTechnique(int i)
- select a technique or enable automatic detection
- inline void addTechnique(Technique* tech)
- add a technique to the effect
- inline void dirtyTechniques()
- force rebuilding of techniques on next traversal
- inline void inherited_traverse(osg::NodeVisitor &nv)
- default traversal
- Direct child classes:
- SpecularHighlights
Scribe
Cartoon
BumpMapping
AnisotropicLighting
- Friends:
- class Validator
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.