Hi Matt,

 

SharedStateManager is what you want.  I didn't have luck improving
performance with it, but you can check it out.  I believe the DatabasePager
shares the states when data is paged in if the SharedStateManager exists.
(I don't think it is initialized by default).  You have to call:

osgDB::Registry::instance()->getOrCreateSharedStateManager();

to create it, and then it should run from then on.

Look inside the osgDB::DatabasePager code for sharedState.

Also, osgDB::SharedStateManager.cpp

 

I think it is pretty time consuming, though, so it may not work for you.  I
think you'll get a decrease in memory usage, but also a decrease in
performance.  Its easy enough to try though.  (Just add the one line above
before you load any models).

 

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Matt
Franklin
Sent: Sunday, September 16, 2007 4:25 AM
To: [email protected]
Subject: [osg-users] Sharing statesets across files

 

Is there a way of including a proxy stateset node or referencing a stateset
stored in another file? I am trying to split up a single model into smaller
pagable chunks. However, my original model makes significant use of shared
statesets to maximise reuse of textures. When I break up my model each leaf
node includes its own copy of the shared stateset. The total disk space used
by the resulting fragments is a factor of ten larger than the original file.
This in itself is not a problem but the resulting texture memory usage is
also a factor of ten larger as a result of the lack of reuse.

Thanks in advance,

Matt 

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to