From 6622e36226cd9fe349fcf696fd1f77a909bf52d0 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sun, 9 Jun 2019 11:47:43 +0300 Subject: [PATCH] Only merge pure osg::Groups in the optimizer --- components/sceneutil/optimizer.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/sceneutil/optimizer.cpp b/components/sceneutil/optimizer.cpp index 7c568ff9d7..e8ebed8686 100644 --- a/components/sceneutil/optimizer.cpp +++ b/components/sceneutil/optimizer.cpp @@ -1802,12 +1802,11 @@ bool Optimizer::MergeGeometryVisitor::mergePrimitive(osg::DrawElementsUInt& lhs, bool Optimizer::MergeGroupsVisitor::isOperationPermissible(osg::Group& node) { - return !node.asSwitch() && - !node.asTransform() && - !node.getCullCallback() && + return !node.getCullCallback() && !node.getEventCallback() && !node.getUpdateCallback() && - isOperationPermissibleForObject(&node); + isOperationPermissibleForObject(&node) && + typeid(node)==typeid(osg::Group); } void Optimizer::MergeGroupsVisitor::apply(osg::LOD &lod)