I've been pondering this Database pager. It only caches the image files into 
memory to prevent loading during runtime doesn't it? Those are then used to 
build textures on the card memory.
 
Is there anything to deal with loading textures onto the graphics card, dishing 
out texture IDs rather than reloading the texture onto card memory?
 
Kim.

________________________________

From: [EMAIL PROTECTED] on behalf of Sukender
Sent: Wed 19/11/2008 15:53
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Management



Hi Kim,

You may just use the osgDB::Registry cache. That's automatic :)
For instance, set the cache by writing:
        osgDB::ReaderWriter::Options* rwoptions = new 
osgDB::ReaderWriter::Options;
        rwoptions->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
        osgDB::Registry::instance()->setOptions(rwoptions);

This will cache everything loaded with readNodeFile() or readImageFile().
For my use, I preload things in the cache by calling:
        osgDB::Registry::instance()->addEntryToObjectCache(path, 
osgDB::readNodeFile(path));

And I set the cache to never unload:
        osgDB::DatabasePager * pPager = viewer.getDatabasePager();
        assert(pPager);
        osgDB::Registry::instance()->setDatabasePager(pPager);
        pPager->setExpiryDelay(DBL_MAX);
        pPager->setExpiryFrames(INT_MAX);

Also, you could clear the cache by calling:
        osgDB::Registry::instance()->clearObjectCache();

Hope it will help.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


Le Wed, 19 Nov 2008 16:28:25 +0100, Kim C Bale <[EMAIL PROTECTED]> a écrit:

> I have a number of different models in OSG format that all use the same
> texture.
>
>
>
> What I want to avoid is having duplicate textures loaded onto the
> graphics card when I load these separate models. In previous programs I
> have achieved this using a Texture Manager that manages all texture
> loading i.e. loading the texture once when required and then dishing out
> the texture ID on subsequent requests. A fairly standard practice.
>
>
>
> Is there something similar already built into the OSG? The
> TextureAtlasBuilder in osgUtil sounds looks like it might do something
> similar but I'm not 100% sure, there is very little documentation on it.
>
>
>
> Thanks all.
>
>
> Kim.

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


<<winmail.dat>>

*****************************************************************************************
To view the terms under which this email is distributed, please go to 
http://www.hull.ac.uk/legal/email_disclaimer.html
*****************************************************************************************
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to