Re: [osg-users] DataVariance questions
Hi Glenn, On Mon, Nov 16, 2009 at 3:42 PM, Glenn Waldron wrote: > Hi all, I have a questions about DataVariance in DrawThreadPerContext mode. > I understand conceptually how it is supposed to work, but I am unclear on a > detail: > > Does setting the data variance on a Node affect the drawables/statesets in > the render graph? No, Nodes have no effect on the render graph as only StateSet and Drawables make it into the rendering backend. > > When you call View::setSceneData(), it runs the StaticObjectDetectionVisitor > to automatically compute data variance on all the drawables and statesets. > Good. But what data that you load or page in at runtime? Do I need to run > that visitor on dynamically loaded data? Your data really should have the DataVariance set appropriately before passing it back to be merged, the StaticObjectDetectionVisitor is really just a fallback for when scenegraphs aren't set up explcitly. > From looking at the source, it would appear that unless you run that > Visitor, setting the data variance to DYNAMIC on a Node only affects the > Optimizer, and has no effect on the data variance of drawables in the render > graph. I'm going to fire up the debugger and try to test this out, but any > insights in the meantime would be appreciated. Thanks. This is correct, the Optimizer is the currently the only traverser that uses the DataVariance hint on nodes. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] DataVariance questions
Hi all, I have a questions about DataVariance in DrawThreadPerContext mode. I understand conceptually how it is supposed to work, but I am unclear on a detail: Does setting the data variance on a Node affect the drawables/statesets in the render graph? When you call View::setSceneData(), it runs the StaticObjectDetectionVisitor to automatically compute data variance on all the drawables and statesets. Good. But what data that you load or page in at runtime? Do I need to run that visitor on dynamically loaded data? >From looking at the source, it would appear that unless you run that Visitor, setting the data variance to DYNAMIC on a Node only affects the Optimizer, and has no effect on the data variance of drawables in the render graph. I'm going to fire up the debugger and try to test this out, but any insights in the meantime would be appreciated. Thanks. Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] DataVariance
Hi Paul, On Mon, Nov 24, 2008 at 3:57 PM, <[EMAIL PROTECTED]> wrote: > Using CullDrawThreadPerContext and it works.. > > If the problem is with stateset and Drawable not being set to DYNAMIC, why > wouldn't my SetDataVariance NodeVisitor (see below) convert everything to > DYNAMIC. I call this during my initialization of the scene graph. Your visitor shouldn't use getOrCreateStateSet as this will be creating a StateSet on all nodes and drawables. Use getStateSet and an if statement to protect. As to why it doesn't seem to fix the threading problem you have. We'll I can't help you here. You have to debug your app, as I don't have it in front of me, and I have plenty of work to do myself. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] DataVariance
Using CullDrawThreadPerContext and it works.. If the problem is with stateset and Drawable not being set to DYNAMIC, why wouldn't my SetDataVariance NodeVisitor (see below) convert everything to DYNAMIC. I call this during my initialization of the scene graph. Paul P. - Original Message From: Robert Osfield <[EMAIL PROTECTED]> To: OpenSceneGraph Users Sent: Monday, November 24, 2008 8:45:47 AM Subject: Re: [osg-users] DataVariance Hi Paul, Could you try the CullDrawThreadPerContext thread model to see if that works safely. If it does then the issue is almost certainly down to some StateSet or Drawable in your scene graph that you are modifying the contents that don't have the DataVariance set to DYNAMIC. Robert. On Mon, Nov 24, 2008 at 1:41 PM, <[EMAIL PROTECTED]> wrote: > I attempted to set all my nodes and state sets to DYNAMIC data variance by > doing the following and it still is locking up on me (i.e. with the same call > stack as below): > > SetDataVariance dataVariance; > root->accept(dataVariance); > > Where: > > class SetDataVariance : public osg::NodeVisitor > { > public: > SetDataVariance(): >osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) > {}; > virtual void apply(osg::Node& node); > virtual void apply(osg::Geode &node); > }; > void SetDataVariance::apply(osg::Node& node) > { > node.getOrCreateStateSet()->setDataVariance(osg::Object::DYNAMIC); > traverse(node); > } > void SetDataVariance::apply(osg::Geode& geode) > { > geode.getOrCreateStateSet()->setDataVariance(osg::Object::DYNAMIC); > geode.setDataVariance(osg::Object::DYNAMIC); > for(unsigned int i=0;i { > osg::Drawable* drawable = geode.getDrawable(i); > if (drawable) > { > >drawable->getOrCreateStateSet()->setDataVariance(osg::Object::DYNAMIC); > drawable->setDataVariance(osg::Object::DYNAMIC); > } > } > } > > Removing a portion of my scene graph and the problem goes away (or is > hidden).. In particular, if I remove the node->addDrawable(geometry), the > problem goes away. The problem exists even if node->addDrawable( new > osg::Geometry). In addition, turning off optimization doesn't seem to help. > As I said before, using single threaded viewer and it works fine. > > Any idea what is going on? > > Paul P. > > - Original Message > From: Robert Osfield <[EMAIL PROTECTED]> > To: OpenSceneGraph Users > Sent: Friday, November 21, 2008 4:10:20 AM > Subject: Re: [osg-users] DataVariance > > Hi Paul P. > > You will have to debug this on your own I'm afraid, this type of issue > is not something one can resolve without seeing it first hand. > > The best I can do is recommend that look into the using DataVariance > set to DYNAMIC on all StateSet and Drawable that you have in your > scene. This is the most likely cause of problems like this, but we've > already recommended this and you've made no comment whether you've > tried this. There have been lots written on this topic on osg-users > so please don't overlook the archives. > > Robert. > > On Thu, Nov 20, 2008 at 7:32 PM, <[EMAIL PROTECTED]> wrote: >> When I change to SingleThreaded, I do not see the problem. The standard OSG >> examples work fine. Other cases of my problem also work fine. >> >> Clearly, it's something in this app that is causing problems. In the >> problem case, I'm rendering to two different image buffers and then reading >> the images out on the CPU. My scene is a "normal" scene except I have two >> cameras with each rendering to these different textures (i.e. a top and >> bottom view of the scene). I also have another camera rendering an >> orthogonal projection on top of the scene. >> >> Paul P. >> >> >> - Original Message >> From: Robert Osfield <[EMAIL PROTECTED]> >> To: OpenSceneGraph Users >> Sent: Wednesday, September 17, 2008 11:03:33 AM >> Subject: Re: [osg-users] DataVariance >> >> Hi Paul, >> >> I can't say why your app might be hanging. Do the standard OSG >> example hang on your machine? >> >> Try running the view single threaded as something that might at least >> flesh out whether threading is an issue at all. >> >> Robert. >> >> On Wed, Sep 17, 2008 at 3:52 PM, <[EMAIL PROTECTED]> wrote: >>> Thanks for the quick response... >>> >>> Then, any idea why my application is hanging when I attempt to render my >>> first frame?? Below is the
Re: [osg-users] DataVariance
Hi Paul, Could you try the CullDrawThreadPerContext thread model to see if that works safely. If it does then the issue is almost certainly down to some StateSet or Drawable in your scene graph that you are modifying the contents that don't have the DataVariance set to DYNAMIC. Robert. On Mon, Nov 24, 2008 at 1:41 PM, <[EMAIL PROTECTED]> wrote: > I attempted to set all my nodes and state sets to DYNAMIC data variance by > doing the following and it still is locking up on me (i.e. with the same call > stack as below): > >SetDataVariance dataVariance; >root->accept(dataVariance); > > Where: > > class SetDataVariance : public osg::NodeVisitor > { > public: >SetDataVariance(): > osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) > {}; >virtual void apply(osg::Node& node); >virtual void apply(osg::Geode &node); > }; > void SetDataVariance::apply(osg::Node& node) > { >node.getOrCreateStateSet()->setDataVariance(osg::Object::DYNAMIC); >traverse(node); > } > void SetDataVariance::apply(osg::Geode& geode) > { > geode.getOrCreateStateSet()->setDataVariance(osg::Object::DYNAMIC); > geode.setDataVariance(osg::Object::DYNAMIC); > for(unsigned int i=0;i { > osg::Drawable* drawable = geode.getDrawable(i); > if (drawable) > { > > drawable->getOrCreateStateSet()->setDataVariance(osg::Object::DYNAMIC); >drawable->setDataVariance(osg::Object::DYNAMIC); > } > } > } > > Removing a portion of my scene graph and the problem goes away (or is > hidden).. In particular, if I remove the node->addDrawable(geometry), the > problem goes away. The problem exists even if node->addDrawable( new > osg::Geometry). In addition, turning off optimization doesn't seem to help. > As I said before, using single threaded viewer and it works fine. > > Any idea what is going on? > > Paul P. > > - Original Message > From: Robert Osfield <[EMAIL PROTECTED]> > To: OpenSceneGraph Users > Sent: Friday, November 21, 2008 4:10:20 AM > Subject: Re: [osg-users] DataVariance > > Hi Paul P. > > You will have to debug this on your own I'm afraid, this type of issue > is not something one can resolve without seeing it first hand. > > The best I can do is recommend that look into the using DataVariance > set to DYNAMIC on all StateSet and Drawable that you have in your > scene. This is the most likely cause of problems like this, but we've > already recommended this and you've made no comment whether you've > tried this. There have been lots written on this topic on osg-users > so please don't overlook the archives. > > Robert. > > On Thu, Nov 20, 2008 at 7:32 PM, <[EMAIL PROTECTED]> wrote: >> When I change to SingleThreaded, I do not see the problem. The standard OSG >> examples work fine. Other cases of my problem also work fine. >> >> Clearly, it's something in this app that is causing problems. In the >> problem case, I'm rendering to two different image buffers and then reading >> the images out on the CPU. My scene is a "normal" scene except I have two >> cameras with each rendering to these different textures (i.e. a top and >> bottom view of the scene). I also have another camera rendering an >> orthogonal projection on top of the scene. >> >> Paul P. >> >> >> - Original Message >> From: Robert Osfield <[EMAIL PROTECTED]> >> To: OpenSceneGraph Users >> Sent: Wednesday, September 17, 2008 11:03:33 AM >> Subject: Re: [osg-users] DataVariance >> >> Hi Paul, >> >> I can't say why your app might be hanging. Do the standard OSG >> example hang on your machine? >> >> Try running the view single threaded as something that might at least >> flesh out whether threading is an issue at all. >> >> Robert. >> >> On Wed, Sep 17, 2008 at 3:52 PM, <[EMAIL PROTECTED]> wrote: >>> Thanks for the quick response... >>> >>> Then, any idea why my application is hanging when I attempt to render my >>> first frame?? Below is the call stack of the two OSG threads. >>> >>> The problem seems to exist when I include two different parts of my scene >>> graph. My scene graph consists of two Camera's at the root. Each renders >>> to a different image array (using camera->attach(..., image);). >>> >>> Each camera then has shared subgraphs attached which also contain a Camera >>> node (for Ortho v
Re: [osg-users] DataVariance
I attempted to set all my nodes and state sets to DYNAMIC data variance by doing the following and it still is locking up on me (i.e. with the same call stack as below): SetDataVariance dataVariance; root->accept(dataVariance); Where: class SetDataVariance : public osg::NodeVisitor { public: SetDataVariance(): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}; virtual void apply(osg::Node& node); virtual void apply(osg::Geode &node); }; void SetDataVariance::apply(osg::Node& node) { node.getOrCreateStateSet()->setDataVariance(osg::Object::DYNAMIC); traverse(node); } void SetDataVariance::apply(osg::Geode& geode) { geode.getOrCreateStateSet()->setDataVariance(osg::Object::DYNAMIC); geode.setDataVariance(osg::Object::DYNAMIC); for(unsigned int i=0;igetOrCreateStateSet()->setDataVariance(osg::Object::DYNAMIC); drawable->setDataVariance(osg::Object::DYNAMIC); } } } Removing a portion of my scene graph and the problem goes away (or is hidden).. In particular, if I remove the node->addDrawable(geometry), the problem goes away. The problem exists even if node->addDrawable( new osg::Geometry). In addition, turning off optimization doesn't seem to help. As I said before, using single threaded viewer and it works fine. Any idea what is going on? Paul P. - Original Message From: Robert Osfield <[EMAIL PROTECTED]> To: OpenSceneGraph Users Sent: Friday, November 21, 2008 4:10:20 AM Subject: Re: [osg-users] DataVariance Hi Paul P. You will have to debug this on your own I'm afraid, this type of issue is not something one can resolve without seeing it first hand. The best I can do is recommend that look into the using DataVariance set to DYNAMIC on all StateSet and Drawable that you have in your scene. This is the most likely cause of problems like this, but we've already recommended this and you've made no comment whether you've tried this. There have been lots written on this topic on osg-users so please don't overlook the archives. Robert. On Thu, Nov 20, 2008 at 7:32 PM, <[EMAIL PROTECTED]> wrote: > When I change to SingleThreaded, I do not see the problem. The standard OSG > examples work fine. Other cases of my problem also work fine. > > Clearly, it's something in this app that is causing problems. In the problem > case, I'm rendering to two different image buffers and then reading the > images out on the CPU. My scene is a "normal" scene except I have two cameras > with each rendering to these different textures (i.e. a top and bottom view > of the scene). I also have another camera rendering an orthogonal projection > on top of the scene. > > Paul P. > > > - Original Message ---- > From: Robert Osfield <[EMAIL PROTECTED]> > To: OpenSceneGraph Users > Sent: Wednesday, September 17, 2008 11:03:33 AM > Subject: Re: [osg-users] DataVariance > > Hi Paul, > > I can't say why your app might be hanging. Do the standard OSG > example hang on your machine? > > Try running the view single threaded as something that might at least > flesh out whether threading is an issue at all. > > Robert. > > On Wed, Sep 17, 2008 at 3:52 PM, <[EMAIL PROTECTED]> wrote: >> Thanks for the quick response... >> >> Then, any idea why my application is hanging when I attempt to render my >> first frame?? Below is the call stack of the two OSG threads. >> >> The problem seems to exist when I include two different parts of my scene >> graph. My scene graph consists of two Camera's at the root. Each renders to >> a different image array (using camera->attach(..., image);). >> >> Each camera then has shared subgraphs attached which also contain a Camera >> node (for Ortho view for part of the scene) but with no attachments. >> >> The osgViewer's camera is unchanged (and I really don't need to "render" >> anything). >> >> Am I doing something wrong with these camera's? >> >> While I'm at it, one more questions: >> Is there a way to turn on the OSG statistics overlay without using the >> keyboard. I've added the StatsHandler event handler. With osgProducer, I >> used to be able to do viewerEventHandler->setFrameStatsMode(mode). >> >> Paul P. >> >> THREAD #1 >> #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () >> from /lib/tls/libpthread.so.0 >> #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 >> #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x8281f88, >> mutex=0x8281f80) >> at >>/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThread
Re: [osg-users] DataVariance
Hi, i have encountered some similiar problems with multithreading (and the datavariance stuff). One thing I have considered is changing the design of osg::Statesets and osg::StateAttribute to immutable classes. So once the stuff is created you can only change it by cloning it. At least for those objects you don't have to think about datavariance anymore. Attached you will find a 'setup' design pattern, which helps you spawning immutable objects. Richard PS.: Just an idea. TestClass.cpp Description: TestClass.cpp TestClass.h Description: TestClass.h Test.cpp Description: Test.cpp ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] DataVariance
Hi Paul P. You will have to debug this on your own I'm afraid, this type of issue is not something one can resolve without seeing it first hand. The best I can do is recommend that look into the using DataVariance set to DYNAMIC on all StateSet and Drawable that you have in your scene. This is the most likely cause of problems like this, but we've already recommended this and you've made no comment whether you've tried this. There have been lots written on this topic on osg-users so please don't overlook the archives. Robert. On Thu, Nov 20, 2008 at 7:32 PM, <[EMAIL PROTECTED]> wrote: > When I change to SingleThreaded, I do not see the problem. The standard OSG > examples work fine. Other cases of my problem also work fine. > > Clearly, it's something in this app that is causing problems. In the problem > case, I'm rendering to two different image buffers and then reading the > images out on the CPU. My scene is a "normal" scene except I have two cameras > with each rendering to these different textures (i.e. a top and bottom view > of the scene). I also have another camera rendering an orthogonal projection > on top of the scene. > > Paul P. > > > - Original Message > From: Robert Osfield <[EMAIL PROTECTED]> > To: OpenSceneGraph Users > Sent: Wednesday, September 17, 2008 11:03:33 AM > Subject: Re: [osg-users] DataVariance > > Hi Paul, > > I can't say why your app might be hanging. Do the standard OSG > example hang on your machine? > > Try running the view single threaded as something that might at least > flesh out whether threading is an issue at all. > > Robert. > > On Wed, Sep 17, 2008 at 3:52 PM, <[EMAIL PROTECTED]> wrote: >> Thanks for the quick response... >> >> Then, any idea why my application is hanging when I attempt to render my >> first frame?? Below is the call stack of the two OSG threads. >> >> The problem seems to exist when I include two different parts of my scene >> graph. My scene graph consists of two Camera's at the root. Each renders to >> a different image array (using camera->attach(..., image);). >> >> Each camera then has shared subgraphs attached which also contain a Camera >> node (for Ortho view for part of the scene) but with no attachments. >> >> The osgViewer's camera is unchanged (and I really don't need to "render" >> anything). >> >> Am I doing something wrong with these camera's? >> >> While I'm at it, one more questions: >> Is there a way to turn on the OSG statistics overlay without using the >> keyboard. I've added the StatsHandler event handler. With osgProducer, I >> used to be able to do viewerEventHandler->setFrameStatsMode(mode). >> >> Paul P. >> >> THREAD #1 >> #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () >>from /lib/tls/libpthread.so.0 >> #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 >> #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x8281f88, >>mutex=0x8281f80) >>at >> /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 >> #3 0x40ad9241 in OpenThreads::BlockCount::block (this=0x8281f80) at >> Block:133 >> #4 0x40ad7506 in osgViewer::ViewerBase::renderingTraversals (this=0x827ab58) >>at >> /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:733 >> #5 0x40ad6a88 in osgViewer::ViewerBase::frame (this=0x827ab58, >>simulationTime=0) >>at >> /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:592 >> #6 0x080858a7 in MyViewer::frame (this=0x827aad8, simTime=0) >>at MyViewer.hpp:131 >> >> THREAD #2 >> #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () >>from /lib/tls/libpthread.so.0 >> #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 >> #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x82786dc, >>mutex=0x82786d4) >>at >> /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 >> #3 0x400aedf5 in OpenThreads::Block::block (this=0x82786d4) at Block:42 >> #4 0x40a8cdc7 in osgViewer::Renderer::TheadSafeQueue::takeFront ( >>this=0x82786cc) >>at >> /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:136 >> #5 0x40a8ee38 in osgViewer::Renderer::draw (this=0x8278640) >>at >> /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:340 >> #6 0x40a9085e in osgViewer::Renderer::oper
Re: [osg-users] DataVariance
When I change to SingleThreaded, I do not see the problem. The standard OSG examples work fine. Other cases of my problem also work fine. Clearly, it's something in this app that is causing problems. In the problem case, I'm rendering to two different image buffers and then reading the images out on the CPU. My scene is a "normal" scene except I have two cameras with each rendering to these different textures (i.e. a top and bottom view of the scene). I also have another camera rendering an orthogonal projection on top of the scene. Paul P. - Original Message From: Robert Osfield <[EMAIL PROTECTED]> To: OpenSceneGraph Users Sent: Wednesday, September 17, 2008 11:03:33 AM Subject: Re: [osg-users] DataVariance Hi Paul, I can't say why your app might be hanging. Do the standard OSG example hang on your machine? Try running the view single threaded as something that might at least flesh out whether threading is an issue at all. Robert. On Wed, Sep 17, 2008 at 3:52 PM, <[EMAIL PROTECTED]> wrote: > Thanks for the quick response... > > Then, any idea why my application is hanging when I attempt to render my > first frame?? Below is the call stack of the two OSG threads. > > The problem seems to exist when I include two different parts of my scene > graph. My scene graph consists of two Camera's at the root. Each renders to > a different image array (using camera->attach(..., image);). > > Each camera then has shared subgraphs attached which also contain a Camera > node (for Ortho view for part of the scene) but with no attachments. > > The osgViewer's camera is unchanged (and I really don't need to "render" > anything). > > Am I doing something wrong with these camera's? > > While I'm at it, one more questions: > Is there a way to turn on the OSG statistics overlay without using the > keyboard. I've added the StatsHandler event handler. With osgProducer, I used > to be able to do viewerEventHandler->setFrameStatsMode(mode). > > Paul P. > > THREAD #1 > #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () > from /lib/tls/libpthread.so.0 > #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 > #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x8281f88, > mutex=0x8281f80) > at >/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 > #3 0x40ad9241 in OpenThreads::BlockCount::block (this=0x8281f80) at Block:133 > #4 0x40ad7506 in osgViewer::ViewerBase::renderingTraversals (this=0x827ab58) > at >/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:733 > #5 0x40ad6a88 in osgViewer::ViewerBase::frame (this=0x827ab58, > simulationTime=0) > at >/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:592 > #6 0x080858a7 in MyViewer::frame (this=0x827aad8, simTime=0) > at MyViewer.hpp:131 > > THREAD #2 > #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () > from /lib/tls/libpthread.so.0 > #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 > #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x82786dc, > mutex=0x82786d4) > at >/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 > #3 0x400aedf5 in OpenThreads::Block::block (this=0x82786d4) at Block:42 > #4 0x40a8cdc7 in osgViewer::Renderer::TheadSafeQueue::takeFront ( > this=0x82786cc) > at >/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:136 > #5 0x40a8ee38 in osgViewer::Renderer::draw (this=0x8278640) > at >/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:340 > #6 0x40a9085e in osgViewer::Renderer::operator() (this=0x8278640, > context=0x8272258) > at >/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:640 > #7 0x4086352d in osg::GraphicsContext::runOperations (this=0x8272258) > at >/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsContext.cpp:688 > #8 0x4086c3ee in osg::RunOperations::operator() (this=0x829ea70, > - context=0x8272258) > at >/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:134 > #9 0x4086bc7d in osg::GraphicsOperation::operator() (this=0x829ea70, > object=Internal: global symbol `Object' found in RissAnimationPath.cpp > psymtab but not in symtab. > Object may be an inlined function, or may be a template function > (if a template, try specifying an instantiation: Object). > ) > at >/src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:50 > #10 0x408af928 in osg::OperationThread::run (this=0x829e810) > at >/src/OpenSceneGr
Re: [osg-users] DataVariance
Hi Paul, I can't say why your app might be hanging. Do the standard OSG example hang on your machine? Try running the view single threaded as something that might at least flesh out whether threading is an issue at all. Robert. On Wed, Sep 17, 2008 at 3:52 PM, <[EMAIL PROTECTED]> wrote: > Thanks for the quick response... > > Then, any idea why my application is hanging when I attempt to render my > first frame?? Below is the call stack of the two OSG threads. > > The problem seems to exist when I include two different parts of my scene > graph. My scene graph consists of two Camera's at the root. Each renders to > a different image array (using camera->attach(..., image);). > > Each camera then has shared subgraphs attached which also contain a Camera > node (for Ortho view for part of the scene) but with no attachments. > > The osgViewer's camera is unchanged (and I really don't need to "render" > anything). > > Am I doing something wrong with these camera's? > > While I'm at it, one more questions: > Is there a way to turn on the OSG statistics overlay without using the > keyboard. I've added the StatsHandler event handler. With osgProducer, I used > to be able to do viewerEventHandler->setFrameStatsMode(mode). > > Paul P. > > THREAD #1 > #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () >from /lib/tls/libpthread.so.0 > #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 > #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x8281f88, > mutex=0x8281f80) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 > #3 0x40ad9241 in OpenThreads::BlockCount::block (this=0x8281f80) at Block:133 > #4 0x40ad7506 in osgViewer::ViewerBase::renderingTraversals (this=0x827ab58) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:733 > #5 0x40ad6a88 in osgViewer::ViewerBase::frame (this=0x827ab58, > simulationTime=0) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:592 > #6 0x080858a7 in MyViewer::frame (this=0x827aad8, simTime=0) > at MyViewer.hpp:131 > > THREAD #2 > #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () >from /lib/tls/libpthread.so.0 > #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 > #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x82786dc, > mutex=0x82786d4) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 > #3 0x400aedf5 in OpenThreads::Block::block (this=0x82786d4) at Block:42 > #4 0x40a8cdc7 in osgViewer::Renderer::TheadSafeQueue::takeFront ( > this=0x82786cc) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:136 > #5 0x40a8ee38 in osgViewer::Renderer::draw (this=0x8278640) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:340 > #6 0x40a9085e in osgViewer::Renderer::operator() (this=0x8278640, > context=0x8272258) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:640 > #7 0x4086352d in osg::GraphicsContext::runOperations (this=0x8272258) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsContext.cpp:688 > #8 0x4086c3ee in osg::RunOperations::operator() (this=0x829ea70, > -context=0x8272258) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:134 > #9 0x4086bc7d in osg::GraphicsOperation::operator() (this=0x829ea70, > object=Internal: global symbol `Object' found in RissAnimationPath.cpp > psymtab but not in symtab. > Object may be an inlined function, or may be a template function > (if a template, try specifying an instantiation: Object). > ) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:50 > #10 0x408af928 in osg::OperationThread::run (this=0x829e810) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/OperationThread.cpp:413 > #11 0x4086bbf9 in osg::GraphicsThread::run (this=0x829e810) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:38 > #12 0x40b1d672 in OpenThreads::ThreadPrivateActions::StartThread ( > data=0x829e820) > at > /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThread.c++:170 > #13 0x41463dec in start_thread () from /lib/tls/libpthread.so.0 > #14 0x41228a2a in clone () from /lib/tls/libc.so.6 > > > > > - Original Message > From: Robert Osfield <[EMAIL PROTECTED]> > To: OpenSceneGraph Users > Sent: Wednesday, September 17, 2008 8
Re: [osg-users] DataVariance
Thanks for the quick response... Then, any idea why my application is hanging when I attempt to render my first frame?? Below is the call stack of the two OSG threads. The problem seems to exist when I include two different parts of my scene graph. My scene graph consists of two Camera's at the root. Each renders to a different image array (using camera->attach(..., image);). Each camera then has shared subgraphs attached which also contain a Camera node (for Ortho view for part of the scene) but with no attachments. The osgViewer's camera is unchanged (and I really don't need to "render" anything). Am I doing something wrong with these camera's? While I'm at it, one more questions: Is there a way to turn on the OSG statistics overlay without using the keyboard. I've added the StatsHandler event handler. With osgProducer, I used to be able to do viewerEventHandler->setFrameStatsMode(mode). Paul P. THREAD #1 #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0 #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x8281f88, mutex=0x8281f80) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 #3 0x40ad9241 in OpenThreads::BlockCount::block (this=0x8281f80) at Block:133 #4 0x40ad7506 in osgViewer::ViewerBase::renderingTraversals (this=0x827ab58) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:733 #5 0x40ad6a88 in osgViewer::ViewerBase::frame (this=0x827ab58, simulationTime=0) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/ViewerBase.cpp:592 #6 0x080858a7 in MyViewer::frame (this=0x827aad8, simTime=0) at MyViewer.hpp:131 THREAD #2 #0 0x4146627d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0 #1 0x41235a66 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6 #2 0x40b1e364 in OpenThreads::Condition::wait (this=0x82786dc, mutex=0x82786d4) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThreadCondition.c++:137 #3 0x400aedf5 in OpenThreads::Block::block (this=0x82786d4) at Block:42 #4 0x40a8cdc7 in osgViewer::Renderer::TheadSafeQueue::takeFront ( this=0x82786cc) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:136 #5 0x40a8ee38 in osgViewer::Renderer::draw (this=0x8278640) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:340 #6 0x40a9085e in osgViewer::Renderer::operator() (this=0x8278640, context=0x8272258) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:640 #7 0x4086352d in osg::GraphicsContext::runOperations (this=0x8272258) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsContext.cpp:688 #8 0x4086c3ee in osg::RunOperations::operator() (this=0x829ea70, - context=0x8272258) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:134 #9 0x4086bc7d in osg::GraphicsOperation::operator() (this=0x829ea70, object=Internal: global symbol `Object' found in RissAnimationPath.cpp psymtab but not in symtab. Object may be an inlined function, or may be a template function (if a template, try specifying an instantiation: Object). ) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:50 #10 0x408af928 in osg::OperationThread::run (this=0x829e810) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/OperationThread.cpp:413 #11 0x4086bbf9 in osg::GraphicsThread::run (this=0x829e810) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:38 #12 0x40b1d672 in OpenThreads::ThreadPrivateActions::StartThread ( data=0x829e820) at /src/OpenSceneGraph_2.6/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThread.c++:170 #13 0x41463dec in start_thread () from /lib/tls/libpthread.so.0 #14 0x41228a2a in clone () from /lib/tls/libc.so.6 - Original Message From: Robert Osfield <[EMAIL PROTECTED]> To: OpenSceneGraph Users Sent: Wednesday, September 17, 2008 8:06:47 AM Subject: Re: [osg-users] DataVariance Hi Paul, In all the OSG 2.x series the DataVariance is used during the draw traversal to monitor when all DYNAMIC StateSet and Drawables have been dispatched, as once they have been the next frame can be started in a parallel with the remaining STATIC objects are rendered (in DrawThreadPerContex, CullThreadPerCameraDrawThreadPerContext threading models.) Robert. On Wed, Sep 17, 2008 at 12:54 PM, <[EMAIL PROTECTED]> wrote: > In OSG 2.6, is the DataVariance value only used by the Optimizer or is it > also used during the frame processing? > > I've had some problems in the past with the StaticObjectDetectionVisitor and > the Optimizer (assume "sharing" part of the Optimizer) doing
Re: [osg-users] DataVariance
The rule of thumb is that the Data Variance should be set to DYNAMIC on instances that change once that have been added to the Scenegraph. The short reason why is that this allows the Cull and draw threads to correctly handle and stage any changes that may be made in the app threads to the instances Gordon __ Gordon Tomlinson Product Manager 3D Email : gtomlinson @ overwatch.textron.com __ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 "Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival" - Master Tambo Tetsura -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 7:54 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] DataVariance In OSG 2.6, is the DataVariance value only used by the Optimizer or is it also used during the frame processing? I've had some problems in the past with the StaticObjectDetectionVisitor and the Optimizer (assume "sharing" part of the Optimizer) doing some things to my scene graph which cause it to render incorrectly when I don't specify my DataVariance as being DYNAMIC. Is there a reason why there is a StaticObjectDetectionVisitor being done when setSceneData() is performed independent of the Optimizer settings? Is the DataVariance value used by something other than the Optimizer? Paul P. ___ 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
Re: [osg-users] DataVariance
Hi Paul, In all the OSG 2.x series the DataVariance is used during the draw traversal to monitor when all DYNAMIC StateSet and Drawables have been dispatched, as once they have been the next frame can be started in a parallel with the remaining STATIC objects are rendered (in DrawThreadPerContex, CullThreadPerCameraDrawThreadPerContext threading models.) Robert. On Wed, Sep 17, 2008 at 12:54 PM, <[EMAIL PROTECTED]> wrote: > In OSG 2.6, is the DataVariance value only used by the Optimizer or is it > also used during the frame processing? > > I've had some problems in the past with the StaticObjectDetectionVisitor and > the Optimizer (assume "sharing" part of the Optimizer) doing some things to > my scene graph which cause it to render incorrectly when I don't specify my > DataVariance as being DYNAMIC. > > Is there a reason why there is a StaticObjectDetectionVisitor being done when > setSceneData() is performed independent of the Optimizer settings? Is the > DataVariance value used by something other than the Optimizer? > > Paul P. > > > > > ___ > 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
[osg-users] DataVariance
In OSG 2.6, is the DataVariance value only used by the Optimizer or is it also used during the frame processing? I've had some problems in the past with the StaticObjectDetectionVisitor and the Optimizer (assume "sharing" part of the Optimizer) doing some things to my scene graph which cause it to render incorrectly when I don't specify my DataVariance as being DYNAMIC. Is there a reason why there is a StaticObjectDetectionVisitor being done when setSceneData() is performed independent of the Optimizer settings? Is the DataVariance value used by something other than the Optimizer? Paul P. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org