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:
scrawl
2017-02-24 01:08:44 +01:00
parent ef431eec29
commit 7e2436aba9

View File

@@ -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);