OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Optimizer::RemoveLoadedProxyNodesVisitor + NO_AUTOMATIC_LOADING


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
guyv
User


Joined: 13 Feb 2009
Posts: 84

PostPosted: Fri Apr 28, 2017 5:09 pm    Post subject:
Optimizer::RemoveLoadedProxyNodesVisitor + NO_AUTOMATIC_LOADING
Reply with quote

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
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10892

PostPosted: Fri Apr 28, 2017 6:09 pm    Post subject:
Optimizer::RemoveLoadedProxyNodesVisitor + NO_AUTOMATIC_LOADING
Reply with quote

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 <> wrote:
Quote:
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








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
guyv
User


Joined: 13 Feb 2009
Posts: 84

PostPosted: Fri Apr 28, 2017 8:49 pm    Post subject:
Optimizer::RemoveLoadedProxyNodesVisitor + NO_AUTOMATIC_LOADING
Reply with quote

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:] On Behalf Of Robert Osfield
Sent: April-28-17 2:06 PM
To: OpenSceneGraph Users
Subject: Re: 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 <> wrote:
Quote:
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






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.



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts About osgUtil::Optimizer MAKE FAST GE... mp3butcher Submission 1 Sat Jul 09, 2016 10:59 pm View latest post
No new posts Optimizer run automatically by Databa... Chris Hanson General 0 Wed Aug 14, 2013 4:27 pm View latest post
No new posts osgUtil::Optimizer improvements robertosfield Submission 3 Tue Jul 23, 2013 10:13 am View latest post
No new posts osgUtil::Optimizer improvements PCJohn Submission 0 Tue Jul 23, 2013 9:05 am View latest post
No new posts [PATCH] osgUtil/Optimizer: documentat... robertosfield Submission 0 Wed Jun 19, 2013 12:27 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP