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 FLATTEN_STATIC_TRANSFORMS not all transforms are flattened


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Sergey Lukashev
Guest





PostPosted: Wed Apr 24, 2019 8:17 pm    Post subject:
Optimizer FLATTEN_STATIC_TRANSFORMS not all transforms are flattened
Reply with quote

Hello, osg folks!

I've used FLATTEN_STATIC_TRANSFORMS and it works quite good. However, now I need to rotate the scene, so I added a MatrixTransform on top of the root node. But it does not get flattened for SOME models. I properly set DataVariance of every Transform to STATIC before running the Optimizer. Can somebody point out where issue could come from and how to debug or solve it?





--------------------------------------
Regards, Sergey.


------------------
Post generated by Mail2Forum
Back to top
Voerman, L.
Guest





PostPosted: Thu Apr 25, 2019 7:35 am    Post subject:
Optimizer FLATTEN_STATIC_TRANSFORMS not all transforms are flattened
Reply with quote

Hi Sergey,without example I can only guess what might go wrong, 
maybe you need
FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS

or some of the nodes have a name, nodemask or userdata or stateset.
all of those could prevent the optimizer from removing the transform.
I also had some trouble getting the optimizer to remove the top node of a graph, so adding a simple Group on top might also help.
Regards, Laurens.



On Wed, Apr 24, 2019 at 10:16 PM Sergey Lukashev < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hello, osg folks!

I've used FLATTEN_STATIC_TRANSFORMS and it works quite good. However, now I need to rotate the scene, so I added a MatrixTransform on top of the root node. But it does not get flattened for SOME models. I properly set DataVariance of every Transform to STATIC before running the Optimizer. Can somebody point out where issue could come from and how to debug or solve it?





--------------------------------------
Regards, Sergey.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12324

PostPosted: Thu Apr 25, 2019 8:27 am    Post subject:
Optimizer FLATTEN_STATIC_TRANSFORMS not all transforms are flattened
Reply with quote

Hi Sergey,

The FLATTEN_STATIC_TRANSFORMS operation is not able to remove the
topmost node so can't flatten this MatrixTransform you've added. This
limitation is due to the optimization being called with external code
holding a pointer/reference to that topmost node. To be able to
optimize this topmost node away we'd need to come up with a new API
that requires users to replace the pointer references they have.

Without any API changes the way to get round this limitation is to
have a Group node as the topmost node, then have the new
MatrixTransform as a child of this group, then the original scene
graph below the MatrixTransform.

Robert.

On Wed, 24 Apr 2019 at 21:16, Sergey Lukashev <> wrote:
Quote:

Hello, osg folks!

I've used FLATTEN_STATIC_TRANSFORMS and it works quite good. However, now I need to rotate the scene, so I added a MatrixTransform on top of the root node. But it does not get flattened for SOME models. I properly set DataVariance of every Transform to STATIC before running the Optimizer. Can somebody point out where issue could come from and how to debug or solve it?





--------------------------------------
Regards, Sergey.



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


Joined: 24 Apr 2019
Posts: 1

PostPosted: Thu Apr 25, 2019 12:44 pm    Post subject:
Optimizer FLATTEN_STATIC_TRANSFORMS not all transforms are flattened
Reply with quote

Thank you for responses!

Turns out my scene contained hanging leaf transforms and it was the issue. I removed them and now it works just fine.

Regarding the root node issue you have mentioned. I've noticed the variable name "nodeWeCannotRemove" and already tried adding a dummy Group above it but without it Optimizer will just apply the transform and set its matrix to identity. So it should work anyway.

Regards, Sergey.

25.04.2019, 11:26, "Robert Osfield" <>:
Quote:
Hi Sergey,

The FLATTEN_STATIC_TRANSFORMS operation is not able to remove the
topmost node so can't flatten this MatrixTransform you've added. This
limitation is due to the optimization being called with external code
holding a pointer/reference to that topmost node. To be able to
optimize this topmost node away we'd need to come up with a new API
that requires users to replace the pointer references they have.

Without any API changes the way to get round this limitation is to
have a Group node as the topmost node, then have the new
MatrixTransform as a child of this group, then the original scene
graph below the MatrixTransform.

Robert.

On Wed, 24 Apr 2019 at 21:16, Sergey Lukashev <> wrote:
Quote:
 Hello, osg folks!

 I've used FLATTEN_STATIC_TRANSFORMS and it works quite good. However, now I need to rotate the scene, so I added a MatrixTransform on top of the root node. But it does not get flattened for SOME models. I properly set DataVariance of every Transform to STATIC before running the Optimizer. Can somebody point out where issue could come from and how to debug or solve it?

 --------------------------------------
 Regards, Sergey.
 




------------------
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 Optimizer::RemoveLoadedProxyNodesVisi... guyv General 2 Fri Apr 28, 2017 5:09 pm View latest post
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 Synchronizing transforms between view... vignos General 1 Wed Dec 02, 2015 10:15 pm View latest post
No new posts FLATTEN_STATIC_TRANSFORMS Not Always ... Markus Hein General 1 Tue Feb 03, 2015 1:02 pm View latest post
No new posts FLATTEN_STATIC_TRANSFORMS Not Always ... Cary, Karl A. General 6 Thu Jan 22, 2015 11:45 am 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