class SG_EXPORT osg::Impostor

Impostor - is a form of Level Of Detail group node which allows both switching between children depending on distance from eye point and image caching.

Inheritance:


Public Methods

[more] Impostor()
[more] Impostor(const Impostor& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
[more] META_Node(osg, Impostor)
[more]inline void setImpostorThreshold(float distance)
Set the Impostor threshold distance.
[more]inline void setImpostorThresholdToBound(float ratio=1.0f)
Set the Impostor threshold distance relative to the node's bounding sphere's radius
[more]inline const float getImpostorThreshold() const
[more]inline const float getImpostorThreshold2() const
[more]ImpostorSprite* findBestImpostorSprite(const osg::Vec3& currLocalEyePoint)
Find the ImposterSprite which fits the current eye point best
[more]void addImpostorSprite(ImpostorSprite* is)
Add an ImpostorSprite to the Impostor
[more]inline ImpostorSpriteList& getImpostorSpriteList()
Get the list of ImpostorSprites attached to this Impostor
[more]inline const ImpostorSpriteList& getImpostorSpriteList() const
Get a const list of ImpostorSprites attached to this const Impostor

Protected Fields

[more]ImpostorSpriteList _impostorSpriteList
[more]float _impostorThreshold

Protected Methods

[more]virtual ~Impostor()
[more]virtual const bool computeBound() const


Inherited from LOD:

Public Methods

ovirtual void traverse(NodeVisitor& nv)
ovoid setRange(const unsigned int index, const float range)
oinline const float getRange(const unsigned int index) const
oinline const unsigned int getNumRanges() const
oinline void setCenter(const Vec3 &center)
oinline const Vec3& getCenter() const
ovoid setEvaluateLODCallback(EvaluateLODCallback* cbc)
oEvaluateLODCallback* getEvaluateLODCallback()
oconst EvaluateLODCallback* getEvaluateLODCallback() const
oinline const int evaluate(const Vec3& eye_local, const float bias=1.0f) const
ovirtual const int evaluateLODChild(const Vec3& eye_local, const float bias) const

Public Members

ostruct EvaluateLODCallback: public osg::Referenced

Protected Fields

oRangeList _rangeList2
oref_ptr<EvaluateLODCallback> _evaluateLODCallback
oVec3 _center

Protected Members

otypedef std::vector<float> RangeList RangeList _rangeList


Inherited from Group:

Public Methods

ovirtual bool addChild( Node* child )
ovirtual bool removeChild( Node* child )
ovirtual bool replaceChild( Node* origChild, Node* newChild )
oinline const unsigned int getNumChildren() const
oinline Node* getChild( const unsigned int i )
oinline const Node* getChild( const unsigned int i ) const
oinline bool containsNode( const Node* node ) const
oinline ChildList::iterator findNode( const Node* node )
oinline ChildList::const_iterator findNode( const Node* node ) const

Protected Fields

oChildList _children


Documentation

Impostor - is a form of Level Of Detail group node which allows both switching between children depending on distance from eye point and image caching.

The principle behind Imposters is that they cache an image of real geometry and then the image is drawn in subsequent frames instead of the real geometry. Its a bit like a Billboard *but* is updated at runtime and w.r.t view point. By drawing just the texture mapped quad you can cut down scene complexity and improve performance.

For more details have a look at:

http://grail.cs.washington.edu/projects/hic/

The OSG doesn't implement exactly the same technique as above, but its should be a good starting place. The OSG's impostors are much less intrusive since you don't need to restructure your whole scene to use them.

All you need to do to use Impostors is to set up the visible range values for each LOD child of the Impostor, as per osg::LOD, and set an Impostor threshold to tell the renderer at what distance the Impostor's image caching should cut in. The osg::CullVisitor automatically handles all the setting of pre-rendering stages to calculate the required ImpostorSprites (which encapsulates the image cache and quad), and updates them as the view point changes. If you use osg::SceneView/CullVisitor all the complexity of supporting Impostor will be nicely hidden away.

TODO: Various improvements are planned for the Impostor- 1) Estimation of how many frames an ImpostorSprite will be reused, if it won't be used more often than a minimum threshold then do not create ImpostorSprite - use the real geometry. 2) Sharing of texture memory between ImpostorSprites. 3) Simple 3D geometry for ImpostorSprite's rather than Billboarding. 4) Shrinking of the ImpostorSprite size to more closely fit the underlying geometry.

o Impostor()

o Impostor(const Impostor& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY)

o META_Node(osg, Impostor)

oinline void setImpostorThreshold(float distance)
Set the Impostor threshold distance. For eye points further than this threshold the Imposter is used if appropriate, otherwise the LOD children as chosen as per a standard LOD node.

oinline void setImpostorThresholdToBound(float ratio=1.0f)
Set the Impostor threshold distance relative to the node's bounding sphere's radius

oinline const float getImpostorThreshold() const

oinline const float getImpostorThreshold2() const

oImpostorSprite* findBestImpostorSprite(const osg::Vec3& currLocalEyePoint)
Find the ImposterSprite which fits the current eye point best

ovoid addImpostorSprite(ImpostorSprite* is)
Add an ImpostorSprite to the Impostor

oinline ImpostorSpriteList& getImpostorSpriteList()
Get the list of ImpostorSprites attached to this Impostor

oinline const ImpostorSpriteList& getImpostorSpriteList() const
Get a const list of ImpostorSprites attached to this const Impostor

ovirtual ~Impostor()

ovirtual const bool computeBound() const

oImpostorSpriteList _impostorSpriteList

ofloat _impostorThreshold


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.