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 typically used at start up on the main scene graph.
For scene graphs that incremental add new subgraphs there is the osgDB::SharedStateManager that you can osgDB::Registry and have it do the merge for you. Robert. On 1 December 2014 at 14:32, Christian Buchner <[email protected]> wrote: > 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 > (and also rescaling the texture to powers of 2 multiple times...) > > Can osgUtil::Optimizer somehow recognize identical texture file names and > make the entire scene graph use the same texture handles? > > Christian > > > _______________________________________________ > 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

