Hi Robert, Understood... I appreciate the feedback. I'll probably end up implementing my own visitor to do what I need ;)
Regards, -----Original Message----- From: osg-users [mailto:[email protected]] On Behalf Of Robert Osfield Sent: April-28-17 2:06 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Optimizer::RemoveLoadedProxyNodesVisitor + NO_AUTOMATIC_LOADING Hi Guy, The visitor in question is meant to just remove loading ProxyNode's it's not meant to remove nodes that haven't yet been loaded, doing so would potentially break applications where nodes disappear that are still needed. What you describe is a special case - there are problems loading external nodes and you still want to get rid of them. This is an application specific decision you are prepared to make but isn't a general solution. My recommendation would be to just write a visitor that you run on the loaded subgraphs and cleans up items like ProxuNode's that have failed. There may be other platform specific scene graph optimizations you can do that the OSG can do because it can't assume that it's safe. Robert. On 28 April 2017 at 18:10, Guy Volckaert <[email protected]> wrote: > Hi, > > I was wondering if someone could explain why the > Optimizer::RemoveLoadedProxyNodesVisitor is not removing ProxyNodes with > NO_AUTOMATIC_LOADING set? > > Here is the motivation behind my question... We often need to load relatively > large openflight terrains that contains a significant number external > references. In fact, on some terrains, each single tree is an external > reference - so you can image how many external references that makes!!! > Unfortunately, many of these terrains are provided to us AS IS and we don't > have the necessary rights to modify them. > > What we discovered is that, sometimes, many of those external reference files > are missing, thus leading to poor performance. For example, if we simply > delete all the external references for a terrains, I would expect better > performance (since I don't need to render all those trees), but that's not > the case. > > To resolve this poor performance problem, I modified the following optimizer > function to consider the NO_AUTOMATIC_LOADING. Can you tell me if what I did > makes sense? If so, then I could propose this as a change in the > osg-submission. > > > Code: > void Optimizer::RemoveLoadedProxyNodesVisitor::apply(osg::ProxyNode& > proxyNode) { > if (proxyNode.getNumParents()>0 > && ( proxyNode.getNumFileNames()==proxyNode.getNumChildren() > //MTSI_BEGIN > || ( proxyNode.getLoadingExternalReferenceMode() == > osg::ProxyNode::NO_AUTOMATIC_LOADING && proxyNode.getNumChildren() == 0 ) ) ) > //MTSI_END > { > if (isOperationPermissibleForObject(&proxyNode)) > { > _redundantNodeList.insert(&proxyNode); > } > } > traverse(proxyNode); > } > > > > Thank you! > > Cheers, > Guy > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=70857#70857 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph. > org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ________________________________ This e-mail may contain proprietary information and/or copyright material. This e-mail is intended for the use of the addressee only. Any unauthorized use may be unlawful. If you receive this e-mail by mistake, please advise the sender immediately by using the reply facility in your e-mail software. Information contained in and/or attached to this document may be subject to export control regulations of the European Community, USA, or other countries. Each recipient of this document is responsible to ensure that usage and/or transfer of any information contained in this document complies with all relevant export control regulations. If you are in any doubt about the export control restrictions that apply to this information, please contact the sender immediately. Be aware that Meggitt may monitor incoming and outgoing e-mails to ensure compliance with the Meggitt IT Use policy. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

