21 May 2013 05:41
DatabasePager setTargetMaximumNumberOfPageLOD behavior
Hi,
I'm hoping to get some clarification on how the DatabasePager::setTargetMaximumNumberOfPageLOD is supposed to work. I am setting this value to 3 in my application. I then use the following function to create and add PagedLODs the the scene:
void AddPagedLOD()
{
osg::ref_ptr<osg::PagedLOD> lod = new osg::PagedLOD;
lod->addChild( new osg::Group, 10.0f, FLT_MAX );
lod->setFileName(1,"large.osgb");
lod->setRange(1,0.0f,10.0f);
root->addChild(lod);
}
When I add 3 PagedLODs to my scene and have them load the file, they are never released from memory once I leave the active range. This makes sense since the number PagedLODs is not above the target.
However, when I add 4 PagedLODs then leave the active range, all 4 files are released from memory. I was expecting only 1 of the files to be released.
Am I misunderstanding the behavior of this setting or should only 1 file be released in this case?
I had a quick glance at the DatabasePager source and was able to make two small changes to get the behavior I was expecting. However, I don't have much experience dealing with PagedLODs and wanted to verify that this should be the correct behavior before submitting a patch.
Cheers,
Farshid
<div><div dir="ltr">Hi,<div><br></div>
<div>I'm hoping to get some clarification on how the DatabasePager::setTargetMaximumNumberOfPageLOD is supposed to work. I am setting this value to 3 in my application. I then use the following function to create and add PagedLODs the the scene:</div>
<div><br></div>
<div>void AddPagedLOD()</div>
<div>{</div>
<div>
<div> osg::ref_ptr<osg::PagedLOD> lod = new osg::PagedLOD;</div>
<div> lod->addChild( new osg::Group, 10.0f, FLT_MAX );</div>
<div>
lod->setFileName(1,"large.osgb");</div>
<div> lod->setRange(1,0.0f,10.0f);</div>
<div> root->addChild(lod);</div>
<div>}</div>
<div><br></div>
<div>When I add 3 PagedLODs to my scene and have them load the file, they are never released from memory once I leave the active range. This makes sense since the number PagedLODs is not above the target.</div>
<div><br></div>
<div>However, when I add 4 PagedLODs then leave the active range, all 4 files are released from memory. I was expecting only 1 of the files to be released.</div>
<div><br></div>
<div>Am I misunderstanding the behavior of this setting or should only 1 file be released in this case?</div>
<div><br></div>
<div>I had a quick glance at the DatabasePager source and was able to make two small changes to get the behavior I was expecting. However, I don't have much experience dealing with PagedLODs and wanted to verify that this should be the correct behavior before submitting a patch.</div>
<div><br></div>
<div>Cheers,</div>
<div>Farshid</div>
<div><br></div>
</div>
</div></div>
------------------
Read this topic online here:
RSS Feed