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<geode.getNumDrawables();++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 <osg-users@lists.openscenegraph.org>
> 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 <osg-users@lists.openscenegraph.org>
>> 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<type>).
>>> )
>>>    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 <osg-users@lists.openscenegraph.org>
>>> 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 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 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 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 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