<div dir="ltr"><div><br></div><div>I found a reasonably good generic solution to flatten any part of my scene graph.<br></div><div>- Use a visitor pattern to collect all my osg::Geometry into a set of geometries starting at the osg::Group in question<br></div><div>- do a clone of the geometries into a new set with (osg::CopyOp::DEEP_COPY_PRIMITIVES | osg::CopyOp::DEEP_COPY_ARRAYS) , then add them into a new osg::Group for the optimizer to work with.<br></div><div>- Use a osgUtil::MergeGeometryVisitor to collect all the primitive sets</div><div>- Then an osgUtil::IndexMeshVisitor to merge the primitive sets<br></div><div><br></div><br>On Sunday, March 1, 2020 at 9:07:42 AM UTC-8, AndrewC wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr"><div>Hi,<br></div><div>I was wondering what the best practices are for dealing with a complex scene graph where a single osg::Group might have , say, 5000 children where each child is fairly simple osg::Geom geometry. Clearly, this is inefficient and draws slowly.<br></div><div>So obviously, compiling/collecting the geometry into one drawable would be much more efficient. osgUtil::Optimizer does not seem to do this for me, or am I missing something?</div><div><br></div><div>Andrew<br></div></div></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/81eebbe0-f14b-4aa4-9c09-8bed0152647b%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/81eebbe0-f14b-4aa4-9c09-8bed0152647b%40googlegroups.com</a>.<br />