Levi Swartzentruber wrote:
I am working on a VRJuggler project that uses OSG as its scenegraph. I need to use a PagedLOD for the terrain because of its size. I used Virtual Planet Builder to generate the PagedLOD and added that PagedLOD to the scenegraph as a node. The application shows only the lowest resolution model of the terrain.

I found a message in the osg-users and vpb archive titled "LOD Problem" from 26 May 2009 about the same problem. Simply, VRJuggler uses osgUtil::SceneView and not osgViewer so support for database paging is not present. Supposedly, if that support were added, it PagedLODs would operate properly.

I have tried to build support for osgDB::DatabasePager into my application as it is included in osgViewer but that has not solved my problem. The modifications to the generic OSG Juggler sample app code are at the end of this message. I would appreciate any advice on either what I have missed or what I have not done correctly in this code. I can send the entire Application.cpp file if needed.

Hi, Levi,

I had to do something similar for a different library (VESS). I haven't looked at VR Juggler in many years, but it seems like you're on the right track so far.

Some things you appear to be missing...

During configuration of the SceneView, you'll need these:

   * osgSceneView->getCullVisitor()->setDatabaseRequestHandler(osgDatabasePager)
   * 
osgDatabasePager->setCompileGLObjectsForContextID(osgSceneView->getState()->getContextID(),
     true)


Before a frame render (perhaps in the update method)

   * osgDatabasePager->updateSceneGraph(*osgFrameStamp)
   * osgDatabasePager->signalBeginFrame()


After a frame render,

   * osgDatabasePager->compileGLObjects(*(osgSceneView->getState()),
     availableTime)
   * osgSceneView->flushDeleteGLObjects(availableTime)
   * osgDatabasePager->signalEndFrame()


I think that's all of them. Hopefully you can deduce what goes where from the above :-)

This works for our library, at least in the case of one active DatabasePager and one active SceneView. I don't know that we've ever tested multiple pagers/views, although we did code for it (you need a separate DatabasePager for each distinct scene, but multiple SceneViews can share a DatabasePager if they also share the scene). Right now we're in the process of porting our stuff to use osgViewer, which does all of this and more for you. I'd recommend the same for you guys, if you can find the time :-)

--"J"

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to