[osg-users] Texture Caching Problem with 3.6.3/4

Greg D g.danaha at networkharbor.com
Wed Dec 11 05:04:14 PST 2019


Thanks Robert.  I moved the line to clear the cache into my calling code 
and out of OSG.  

I don't understand exactly what the cache does.  If it has an expiration 
time and objects are removed after a minute or so (which seems to happen) 
it would appear it is a short-term cache, perhaps to increase efficiency 
when the model is loading, before it is rendered, such as re-using already 
loaded texture images and so forth.  If it is for long-term caching 
(keeping models in memory even after another model is loaded) that would be 
counter productive in our application, since the user might load several 
different large model files in a minute in some situations, and keeping all 
those models in memory would be problematic.  My preference would be to 
disable caching altogether, unless it is a short-term cache to make loading 
more efficient, in which case clearing the cache after the first render 
solves my problem.

I have set the osgDB::Options to CACHE_NONE but it does not appear to have 
any effect on caching.  The OpenFlight model and its textures are always 
loaded from the cache if the cache contains objects.

osg::ref_ptr<osgDB::Options> dbOptions = new osgDB::Options();
dbOptions->setObjectCacheHint(osgDB::Options::CACHE_NONE);

osgDB::readNodeFile(fileName, dbOptions);

Is this not the correct way to disable caching?

Thanks.


-- 
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/de89e01e-20e4-461c-9b51-dc9dddecd09b%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191211/7a7fb84a/attachment.html>


More information about the osg-users mailing list