Change the order of optimizations to allow for the possibility of merging Geometries that have just become siblings after the removal of redundant nodes
This commit is contained in:
@@ -274,6 +274,20 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
}
|
||||
|
||||
if (options & REMOVE_REDUNDANT_NODES)
|
||||
{
|
||||
OSG_INFO<<"Optimizer::optimize() doing REMOVE_REDUNDANT_NODES"<<std::endl;
|
||||
|
||||
RemoveEmptyNodesVisitor renv(this);
|
||||
node->accept(renv);
|
||||
renv.removeEmptyNodes();
|
||||
|
||||
RemoveRedundantNodesVisitor rrnv(this);
|
||||
node->accept(rrnv);
|
||||
rrnv.removeRedundantNodes();
|
||||
|
||||
}
|
||||
|
||||
if (options & MERGE_GEODES)
|
||||
{
|
||||
OSG_INFO<<"Optimizer::optimize() doing MERGE_GEODES"<<std::endl;
|
||||
@@ -320,20 +334,6 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
tsv.stripify();
|
||||
}
|
||||
|
||||
if (options & REMOVE_REDUNDANT_NODES)
|
||||
{
|
||||
OSG_INFO<<"Optimizer::optimize() doing REMOVE_REDUNDANT_NODES"<<std::endl;
|
||||
|
||||
RemoveEmptyNodesVisitor renv(this);
|
||||
node->accept(renv);
|
||||
renv.removeEmptyNodes();
|
||||
|
||||
RemoveRedundantNodesVisitor rrnv(this);
|
||||
node->accept(rrnv);
|
||||
rrnv.removeRedundantNodes();
|
||||
|
||||
}
|
||||
|
||||
if (options & FLATTEN_BILLBOARDS)
|
||||
{
|
||||
FlattenBillboardVisitor fbv(this);
|
||||
|
||||
Reference in New Issue
Block a user