Hi John,

When using osgViewer you should never need to assign the DatabasePager
yourself, as the viewer will automatically do it in the correct way
for you.  In your case it's likely that your assignment of separate
pagers for each view is the problem - a single DatabasePager should
only work on a single scene graph, you can't have multiple
DatabasePager's working on a single scene graph.   osgViewer itself
manages this automatically via the osgViewer::Scene.

Try removing your DatabasePager code completely.

Robert.

On Sun, Jul 5, 2009 at 7:11 PM,
phishja...@yahoo.com<phishja...@yahoo.com> wrote:
> I am running a program with a composite viewer which contains one viewer for
> pure openGL rendering and multiple other views for scene rendering.  The
> scene consists of any number of loaded 3d models and a TerraPage database.
>  The code is set up as follows (I have copy/pasted and inserted pseudo code
> as the program is not compact enough to fully include.  If any omitted parts
> are important, let me know and I'll post them!):
> this->_view = new osgViewer::Viewer;
> this->_view->setName("_view");
> this->_view->setSceneData(this->_sceneGroup.get());
> this->_compositeViewer = new osgViewer::CompositeViewer;
> this->_compositeViewer->setName("_compositeViewer");
> this->_compositeViewer->addView(this->_view);
> // Set up Traits ...
>
> // Set up Graphics Context...
>
> // Set up Display Settings
>
> this->_view->setThreadingModel(osgViewer::Viewer::SingleThreaded);
> this->_view->setUpThreading();
> this->_view->startThreading();
> this->_compositeViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
> this->_compositeViewer->realize();
> this->_view->getCamera()->setInitialDrawCallback(new
> CameraInitialDrawCallback(this));
> this->_view->getCamera()->setFinalDrawCallback(new
> CameraFinalDrawCallback(this));
> this->_compositeViewer->setUpThreading();
> this->_compositeViewer->startThreading();
> while(...)
> {
> this->_compositeViewer->frame();
> }
>
> Other views are added via:
> void ...addViewer(osgViewer::Viewer* x)
> {
> const unsigned int viewSize = this->_compositeViewer->getNumViews();
> for(unsigned int i = 0; i < viewSize; i++)
> {
> if(this->_compositeViewer->getView(i) == x)
> {
> return;
> }
> }
> x->setThreadingModel(osgViewer::Viewer::SingleThreaded);
> x->addEventHandler(this->_eventHandler);
> x->setKeyEventSetsDone(24);
> x->setUpThreading();
> x->startThreading();
> this->_compositeViewer->addView(x);
> }
> These other views have a database pager attached to them:
> this->_scene = this->_viewer->getScene();
> if(this->_scene->getDatabasePager() == NULL)
> {
> this->_scene->setDatabasePager(new osgDB::DatabasePager);
> this->_scene->getDatabasePager()->setTargetFrameRate(60.0f);
> this->_scene->getDatabasePager()->registerPagedLODs(this->getSceneManager()->getTerrainDatabase());
> }
> Just a few frames into the applicaiton, it can crash.  It appears as though
> all threads continue to run except for the database pager.  I get the
> following stack trace with the current version on SVN:
>> osg60-osg.dll!osg::BoundingBoxImpl<osg::Vec3f>::expandBy(const osg::Vec3f
>> & v={...})  Line 152 C++
>   osg60-osg.dll!ComputeBound::drawArrays(unsigned int __formal=5, int
> first=354, int count=1197852551)  Line 706 + 0x2f bytes C++
>   osg60-osg.dll!osg::DrawArrayLengths::accept(osg::PrimitiveFunctor &
> functor={...})  Line 92 C++
>   osg60-osg.dll!osg::Geometry::accept(osg::PrimitiveFunctor & functor={...})
>  Line 2241 + 0x29 bytes C++
>   osg60-osg.dll!osg::Drawable::computeBound()  Line 781 C++
>   osg60-osg.dll!osg::Drawable::getBound()  Line 203 + 0xe bytes C++
>   osg60-osg.dll!osg::Geode::computeBound()  Line 192 + 0x1e bytes C++
>   osg60-osg.dll!osg::Node::getBound()  Line 334 + 0xe bytes C++
>   osg60-osg.dll!osg::Group::computeBound()  Line 357 + 0x16 bytes C++
>   osg60-osg.dll!osg::Node::getBound()  Line 334 + 0xe bytes C++
>   osg60-osg.dll!osg::Group::computeBound()  Line 357 + 0x16 bytes C++
>   osg60-osg.dll!osg::Node::getBound()  Line 334 + 0xe bytes C++
>   osg60-osg.dll!osg::Group::computeBound()  Line 357 + 0x16 bytes C++
>   osgdb_txp.dll!txp::TXPPagedLOD::computeBound()  Line 121 C++
>   osg60-osg.dll!osg::Node::getBound()  Line 334 + 0xe bytes C++
>   osg60-osg.dll!osg::Group::computeBound()  Line 357 + 0x16 bytes C++
>   osg60-osg.dll!osg::Node::getBound()  Line 334 + 0xe bytes C++
>   osg60-osgDB.dll!osgDB::DatabasePager::DatabaseThread::run()  Line 607 C++
>   ot11-OpenThreads.dll!OpenThreads::ThreadPrivateActions::StartThread(void *
> data=0x037c9d5c)  Line 65535 C++
>   msvcr90.dll!_callthreadstartex()  Line 348 + 0x6 bytes C
>   msvcr90.dll!_threadstartex(void * ptd=0x06aae2e8)  Line 326 + 0x5 bytes C
>   kernel32.dll!7c80b729()
>   [Frames below may be incorrect and/or missing, no symbols loaded for
> kernel32.dll]
> I am not an OSG expert by any means, but have been trying to fix this for
> over a week and just don't have any insight into what might cause this.  Any
> help would be appreciated!
> - John
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to