Hi,

I see a threading issue when capturing current attributes in cull phase.

My code placed in my derived ShadowTechnique::cull():

void MyShadowVolume::cull( osgUtil::CullVisitor& cv )
{
   ref_ptr< StateSet > currentState = new StateSet;
   cv.getState()->captureCurrentState( *currentState );

   cv.pushStateSet( _ss1 );
   _shadowedScene->Group::traverse( cv );
   cv.popStateSet();

   cv.pushStateSet( _ss2 );
   _shadowedScene->Group::traverse( cv );
   cv.popStateSet();
}

StateSets are not changing. It crashes inside captureCurrentState while I have to wait few seconds. However, the time changes (race-condition?). It looks like threading issue and if I set viewer.setThreadingModel( SingleThreaded ), the problem seems to disappear.

Is the code above correct? Am I using captureCurrentState correctly? I need it to determine FrontFace attribute settings.
Thanks,
John






_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to