Re: [osg-users] texture sharing between different osg objects?

2014-12-01 Thread Sebastian Messerschmidt
Hi Christian thanks Sebastian. Does this piece of code have to be placed in the beginning of the program during the initialization phase? I haven"t come across these classes so far... seems to be advanced stuff that is not even covered in the OSG books... You can place them anywhere, but to

Re: [osg-users] texture sharing between different osg objects?

2014-12-01 Thread Christian Buchner
thanks Sebastian. Does this piece of code have to be placed in the beginning of the program during the initialization phase? I haven"t come across these classes so far... seems to be advanced stuff that is not even covered in the OSG books... Christian 2014-12-01 18:10 GMT+01:00 Sebastian Messe

Re: [osg-users] texture sharing between different osg objects?

2014-12-01 Thread Sebastian Messerschmidt
Hi Christian, Also you could try to activate caching and sharing of nodes/textures: Here is some snippet from my code: { osgDB::SharedStateManager::ShareMode mode = osgDB::SharedStateManager::SHARE_NONE;// = osgDB::SharedStateManager::SHARE_ALL; mode = mConfig.mGlobalS

Re: [osg-users] texture sharing between different osg objects?

2014-12-01 Thread Robert Osfield
HI Christian, osgUtil::Optimizer has a visitor called StateVisitor that looks for duplicate state a removes it, by default it's called when you call Optimizer::optimize(..); The Optimizer will however only work on the scene graph you give it, so you have to give it the root node and is typicall

[osg-users] texture sharing between different osg objects?

2014-12-01 Thread Christian Buchner
Hi, when I use osgDB::readNodeFile on several objects, and those objects all reference the same texture file on disk - is it possible to make OSG use the same texture on all loaded subgraphs? Currently it seems like I have the same texture loaded over and over, consuming precious texture memory (a