class OSGFX_EXPORT osgFX::Effect

The base class for special effects.

Inheritance:


Public Methods

[more] Effect()
[more] Effect(const Effect &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY)
[more]virtual inline bool isSameKindAs(const osg::Object* obj) const
[more]virtual inline const char* libraryName() const
[more]virtual inline const char* className() const
[more]virtual const char* effectName() const = 0
get the name of this effect
[more]virtual const char* effectDescription() const = 0
get a brief description of this effect
[more]virtual const char* effectAuthor() const = 0
get the effect author's name
[more]inline virtual void setUpDemo()
optional: set effect parameters to produce a visually significant result to be used in demo applications like osgfxbrowser.
[more]virtual void traverse(osg::NodeVisitor &nv)
custom traversal
[more]inline bool getEnabled() const
get whether the effect is enabled or not
[more]inline void setEnabled(bool v)
set whether the effect is enabled or not
[more]inline int getNumTechniques() const
get the number of techniques defined for this effect
[more]inline Technique* getTechnique(int i)
get the i-th technique
[more]inline const Technique* getTechnique(int i) const
get the i-th const technique
[more]inline int getSelectedTechnique() const
get the index of the currently selected technique
[more]inline void selectTechnique(int i)
select a technique or enable automatic detection
[more]inline void addTechnique(Technique* tech)
add a technique to the effect
[more]inline void dirtyTechniques()
force rebuilding of techniques on next traversal
[more]inline void inherited_traverse(osg::NodeVisitor &nv)
default traversal

Public Members

[more]enum TechniqueSelection

Protected Methods

[more]virtual ~Effect()
[more]Effect& operator=(const Effect &)
[more]virtual bool define_techniques() = 0
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.
o Effect()

o Effect(const Effect &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY)

ovirtual inline bool isSameKindAs(const osg::Object* obj) const

ovirtual inline const char* libraryName() const

ovirtual inline const char* className() const

ovirtual const char* effectName() const = 0
get the name of this effect

ovirtual const char* effectDescription() const = 0
get a brief description of this effect

ovirtual const char* effectAuthor() const = 0
get the effect author's name

oinline 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.

oenum TechniqueSelection

o AUTO_DETECT

ovirtual void traverse(osg::NodeVisitor &nv)
custom traversal

ovirtual ~Effect()

oEffect& operator=(const Effect &)

ovirtual bool define_techniques() = 0
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.

oinline bool getEnabled() const
get whether the effect is enabled or not

oinline void setEnabled(bool v)
set whether the effect is enabled or not

oinline int getNumTechniques() const
get the number of techniques defined for this effect

oinline Technique* getTechnique(int i)
get the i-th technique

oinline const Technique* getTechnique(int i) const
get the i-th const technique

oinline int getSelectedTechnique() const
get the index of the currently selected technique

oinline void selectTechnique(int i)
select a technique or enable automatic detection

oinline void addTechnique(Technique* tech)
add a technique to the effect

oinline void dirtyTechniques()
force rebuilding of techniques on next traversal

oinline 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++.