Hi,

I am adding an osgCompute::Computation node during runtime inside the 
updateTraversal of our viewer.

This works fine when added in the first updateTraversal frame, but fails in all 
later frames. What am I misunderstanding oder missing? Any hints?

Below the code:


Code:
void osgDAC::DACViewer::updateTraversal() {

..................... some stuff ....................

        framecnt_++;
        if (framecnt_ == 2) { // this fails, but works for framecnt_ == 1
                // osgCompute
                setThreadingModel(osgViewer::CompositeViewer::SingleThreaded);
                setReleaseContextAtEndOfFrameHint(false);

                osg::ref_ptr<osgCompute::Computation> computation = 
dacGPU::setupComputation();

                osg::ref_ptr<osgCompute::Module> module = 
computation->getModule( "osgcuda_warp" );
                if( !module )
                {
                        osg::notify(osg::FATAL) << "Cannot find module 
identified by osgcuda_warp." << std::endl;
                        return;
                }
                module->setUserData( getFrameStamp() );
                //osg::notify(osg::NOTICE)<<module->isEnabled()<<std::endl;
                
                // Add computation to scene
                getManager()->getGeometryRoot()->addChild(computation);
        }


} // UpdateTraversal Done




Thank you!

Cheers,
Johannes[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41555#41555





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

Reply via email to