Hi everybody. I need to figure out the PagedLOD technology...

I've tried the following example, everything worked fine...


 osg::ref_ptr<osg::PagedLOD> plod = new osg::PagedLOD();

plod->setName("plod for ");

plod->setRangeMode(osg::LOD::DISTANCE_FROM_EYE_POINT);

std::string Filename1 = "/home/maximum2000/LABS/PLOD/osg/1.osg";

std::string Filename2 = "/home/maximum2000/LABS/PLOD/osg/2.osg";

std::string Filename3 = "/home/maximum2000/LABS/PLOD/osg/3.osg";

std::string Filename4 = "/home/maximum2000/LABS/PLOD/osg/4.osg";

plod->setFileName (0, Filename1);

plod->setRange (0, 0.0f, 100.0f);

plod->setFileName (1, Filename2);

plod->setRange (1, 100.0f, 200.0f);

plod->setFileName (2, Filename3);

plod->setRange (2, 200.0f, 300.0f);

plod->setFileName (3, Filename4);

plod->setRange (3, 300.0f, 1000.0f);

plod->setNumChildrenThatCannotBeExpired(1);

root->addChild(plod);

osgDB::writeNodeFile(*root, "/home/maximum2000/LABS/PLOD/osg/saved.osg");




But memory doesn't get free. As result, there is all the data in
memory while watching all 4 LODs (from different distance).

If a get it right, I need to use osgDB::DatabasePager to unload all
"inactive" objects.

Is that true?


I've tried to do as follows:


1. Added the code:

....

viewer = new osgViewer::Viewer();

dbPager = osgDB::DatabasePager::create();

dbPager->setCompileGLObjectsForContextID (0, true);

dbPager->setDoPreCompile(true);

viewer->getScene()->setDatabasePager(dbPager);



2. And appended the folloing string into the code from beginning of this
message.

.......

root->addChild(plod);

dbPager->registerPagedLODs(plod) ;


3. Every frame is called by

......

viewer->getDatabasePager()->updateSceneGraph(*(viewer->getFrameStamp()));

.....


But memory still doesn't get free. There is all the data, not only visible.
Did I understand everythig right? Why doesn't memory get free?



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

Reply via email to