<div dir="ltr"><div dir="ltr">On Wed, 11 Dec 2019 at 13:04, Greg D <<a href="mailto:g.danaha@networkharbor.com">g.danaha@networkharbor.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I don't understand exactly what the cache does.</div></blockquote><div><br></div><div>The clue is in the name, ObjectCache is cache of Objects so they can be reused.</div><div><br></div><div>The cache is useful for avoid objects being loaded multiple ties, especially important for textures as they consume a large amount of GPU memory so maintaining duplicates can cripple performance.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"> 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, </div></blockquote><div><br></div><div>The amount of time objects in cache are retained for is controlled by the osgDB::Registry::setExpiryDelay(double), it defaults to 10 seconds, you can set it programmatically or set the default via OSG_EXPIRY_DELAY env var.<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">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.<div><div><br></div><div>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.</div><div><br></div><div><div>osg::ref_ptr<osgDB::Options> dbOptions = new osgDB::Options();</div><div>dbOptions->setObjectCacheHint(osgDB::Options::CACHE_NONE);<br></div></div><div><br></div><div><span style="font-size:9.5pt;font-family:Consolas;color:black">osgDB::readNodeFile(</span><span style="font-size:9.5pt;font-family:Consolas;color:gray">fileName</span><span style="font-size:9.5pt;font-family:Consolas;color:black">, </span><span style="font-size:9.5pt;font-family:Consolas;color:gray">dbOptions</span><span style="font-size:9.5pt;font-family:Consolas;color:black">);</span><br></div><div><br></div><div>Is this not the correct way to disable caching?<br></div></div></div></blockquote><div><br></div><div>It's a ObjectCacheHint so plugns can be free to ignore the hint if they want to use the cache for their own requirements.</div><div><br></div><div>Robert.<br></div><div><br></div><div> </div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/CAFN7Y%2BXzTpV%2B5H-x-dU-HSWL%2B80PaDcxTuHB7J3B%3DJgJXsShcQ%40mail.gmail.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/CAFN7Y%2BXzTpV%2B5H-x-dU-HSWL%2B80PaDcxTuHB7J3B%3DJgJXsShcQ%40mail.gmail.com</a>.<br />