Hi Alexandre,

Have a try of the osgDB::SharedStateManager. Just call:

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

once to wake it up.

But sometimes it may not work as you wish. I have done a similar work before
with a derived DatabasePager class. I just rewrote the updateSceneGraph()
function, checked the _dataToMergeList and combined textures with duplicate
filenames. It's a little different from SharedStateManager but useful to my
project. :)

Hope these will help.

Wang Rui

2009/9/22 Alexandre Amalric <[email protected]>

> Hi osg-users,
>
> I want to know if there is a way to share duplicate texture in a paged
> database.
>
> Let's take an exemple, I have a database.ive file calling a lot of external
> files model01.ive, model02.ive, model03.ive etc...
>
> In each modelXX.ive I have a geometry with a texture associated, this
> texture is a generic one and is the same for each modelXX.ive file.
> When loading database.ive I call the osgUtil optimizer with all
> optimisation on this file, but I don't know if it will optimize the external
> reference ?
>
> If not is there a way to tell the database pager to optimise the loaded
> subgraph on the run ??
>
> My goal is to get a unique instance of this generic texture when all the
> database is loaded in memory instead of loading it several times (each time
> there is a new modelXX.ive loaded).
>
> Kind regards,
>
> --
> Alexandre AMALRIC                   Ingénieur R&D
> ===================================
> PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
> http://www.pixxim.fr
>
> _______________________________________________
> 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

Reply via email to