From 7e2436aba99555927a8932ca9461c65e9fe38287 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 24 Feb 2017 01:08:44 +0100 Subject: [PATCH] Change the order of optimizations to allow for the possibility of merging Geometries that have just become siblings after the removal of redundant nodes --- src/osgUtil/Optimizer.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index f4ea29fde..f93f6ae5f 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -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"<accept(renv); + renv.removeEmptyNodes(); + + RemoveRedundantNodesVisitor rrnv(this); + node->accept(rrnv); + rrnv.removeRedundantNodes(); + + } + if (options & MERGE_GEODES) { OSG_INFO<<"Optimizer::optimize() doing MERGE_GEODES"<accept(renv); - renv.removeEmptyNodes(); - - RemoveRedundantNodesVisitor rrnv(this); - node->accept(rrnv); - rrnv.removeRedundantNodes(); - - } - if (options & FLATTEN_BILLBOARDS) { FlattenBillboardVisitor fbv(this);