Hi John, On 9 May 2012 15:52, John Kelso <ke...@nist.gov> wrote: > Many thanks. This problem sure is beginning to smell like "driver and/or > card" to me. I'd love to hear from other Linux users too.
I think there is probably a few issues going on here. First up switching on/off subgraphs can cause problems on first enabling a new subgraph in that OpenGL objects required to render the subgraph may not have compiled and downloaded to the GPU so have to be created, compiled and downloaded on the first frame that they appear - this can cause a frame drop but it'll typically be just for the first frame. The way to avoid this issue is to make sure you precompile the whole subgraph prior to rendering. The OSG has a osgUtil::GLObjectsVisitor written for the purpose of precompiling this will be invoked in the realize of the graphics window - but will only compile your subgraph if you have already assigned it to the view. If you add you scene graph after realize you can invoke this automatically for the next frame by calling osgViewer::Renderer::setCompileOnNextDraw(true) for each viewer Camera via: osgViewer::Renderer* renderer = dynamic_cast<osgViewer::Renderer*>(camera->getRenderer()); renderer->setCompileOnNextDraw(true); If your NodeMask is set to 0x0 then the GLObjectVisitor won't traverse the subgraphs so perhaps this might be causing problems, if so you might need to use a draw callback to invoke your own GLObjectVistor traversal with NodeVisitor::setNodeMaskOverride(uint) set so that the compile traversal is able to ignore the 0x0 node masks during traversal. -- The odd frame rate cycling seen by Stephan is likely a whole different issue related to the way the driver/os/OpenGL FIFO and the draw dispatch are all interacting. Try disabling/enabling vsync to see if that changes behaviour. By co-incidence Today I'll be doing some work on using the new ARB_sync functionality to sync frame loop, this should enable us to control how many frames are dropped into the OpenGL FIFO and hold the frame loop to be sync'd with vysnc so we don't end up over filling the OpenGL FIFO and hopefully this will avoid the OpenGL FIFO blocking the application periodically. I'll ping the list once I've checked this functionality in. Robert. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org