DtSplitBackfacePolyVisitor identifies two-sided polygons and duplicates the geometry as a set of two single-sided polygons, reversing one set of normals in the process.
More...
Detailed Description
DtSplitBackfacePolyVisitor identifies two-sided polygons and duplicates the geometry as a set of two single-sided polygons, reversing one set of normals in the process.
This is intended to correct some unintended lighting and transparency artifacts that can occur. This visitor splits both transparent and opaque faces unless told to only split transparent, leaving opaque polygons double sided.
Constructor & Destructor Documentation
| makVrv::DtSplitBackfacePolyVisitor::DtSplitBackfacePolyVisitor |
( |
bool |
transparentOnly = false | ) |
|
Default CTOR.
- Parameters
-
| [in] | transparentOnly | is a flag to only split transparent faces. |
| virtual makVrv::DtSplitBackfacePolyVisitor::~DtSplitBackfacePolyVisitor |
( |
| ) |
|
|
virtual |
Member Function Documentation
| virtual void makVrv::DtSplitBackfacePolyVisitor::apply |
( |
osg::Node & |
node | ) |
|
|
virtual |
The Visitor apply method used to traverse the scene-graph.
- Parameters
-
| [in] | node | is the osg::Node being visited. |
- Note
- Called during scene-graph traversal, do not directly call this function.
| virtual void makVrv::DtSplitBackfacePolyVisitor::apply |
( |
osg::Geode & |
geode | ) |
|
|
virtual |
The Visitor apply method used to traverse the scene-graph.
- Parameters
-
| [in] | geode | is the osg::Geode being visited. |
- Note
- Called during scene-graph traversal, do not directly call this function.
| void makVrv::DtSplitBackfacePolyVisitor::processGeometry |
( |
| ) |
|
Split the geometry cached within this visitor.
- Note
- Must be called after traversing the tree.
| void makVrv::DtSplitBackfacePolyVisitor::setTransparentOnly |
( |
bool |
enable | ) |
|
Set the visitor to only split transparent polygons, leaving opaque polygons as double sided.
- Parameters
-
| [in] | enable | is a flag to only split transparent faces, default is false. |
| bool makVrv::DtSplitBackfacePolyVisitor::transparentOnly |
( |
| ) |
const |
Get whether the visitor is only splitting transparent polygons.
- Return values
-
| true | visitor only splits transparent double-sided polygons. |
| false | visitor splits all double-sided polygons. |
| void makVrv::DtSplitBackfacePolyVisitor::splitGeometry |
( |
osg::Geode & |
geode | ) |
const |
|
protected |
Split the double-sided geometry into two single-sided geometries.
- Parameters
-
| [in,out] | geode | is the geode who's geometry will be modified. |
| bool makVrv::DtSplitBackfacePolyVisitor::isDoubleSided |
( |
const osg::Node & |
node | ) |
const |
|
protected |
Check the geode for double-sided polygons.
- Parameters
-
| [in] | node | is the node to check. |
- Return values
-
| true | if geometry has double-sided polygons. |
| false | otherwise. |
| bool makVrv::DtSplitBackfacePolyVisitor::isTransparentMaterial |
( |
const osg::StateSet & |
ss | ) |
const |
|
protected |
Check if the material is transparent.
- Parameters
-
| [in] | ss | is the state-set to check for transparency. |
- Return values
-
| true | if there is transparency. |
| false | otherwise. |
| bool makVrv::DtSplitBackfacePolyVisitor::isTransparentTextures |
( |
const osg::StateSet & |
ss | ) |
const |
|
protected |
Check if any texture is transparent.
- Parameters
-
| [in] | ss | is the state-set to check for transparency. |
- Return values
-
| true | if there is transparency. |
| false | otherwise. |
| osg::CullFace* makVrv::DtSplitBackfacePolyVisitor::getOrCreateCullFaceAttribute |
( |
| ) |
|
|
protected |
Get or create a CullFace attribute.
- Returns
- a CullFace attribute, creating a new one if necessary.
Member Data Documentation
| osg::ref_ptr<osg::CullFace> makVrv::DtSplitBackfacePolyVisitor::myCullFace |
|
protected |
| osg::NodeList makVrv::DtSplitBackfacePolyVisitor::myGeodes |
|
protected |
| bool makVrv::DtSplitBackfacePolyVisitor::myTransparentOnly |
|
protected |
The documentation for this class was generated from the following file: