<div dir="ltr">Hi Art and Robert,<br><br>First of all I dont use my own viewer class, I use osgViewer. I initialize the viewer camera like this to support osgPPU :<br><br>    // Set single thread model<br>    viewer_.setThreadingModel(osgViewer::Viewer::SingleThreaded);<br>
<br>    // Set the main window position and size<br>    osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;<br>    traits->x                = windowProperties_.winXPos_;<br>    traits->y                = windowProperties_.winYPos_;<br>
    traits->width            = windowProperties_.winWidth_;<br>    traits->height           = windowProperties_.winHeight_;<br>    traits->windowDecoration = false;<br>    traits->doubleBuffer     = true;<br>    traits->sharedContext    = 0;<br>
      <br>    // Set the graphics context for the camera<br>    osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());<br>    gc->setClearColor( osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f) );<br>
    gc->setClearMask( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );<br>    gc->clear( );<br>    viewer_.getCamera()->setGraphicsContext(gc.get());<br><br>    // Set the viewport<br>    viewer_.getCamera()->setViewport( viewportProperties_.viewportXPos_,<br>
                                      viewportProperties_.viewportYPos_,<br>                                      viewportProperties_.viewportWidth_,<br>                                      viewportProperties_.viewportHeight_ );<br>
<br><br>    // Set the projection matrix as perspective<br>    double aspectRatio;<br>    if( viewportProperties_.viewportWidth_/viewportProperties_.viewportHeight_ >= 1.0 )<br>        aspectRatio = viewportProperties_.viewportWidth_/viewportProperties_.viewportHeight_;<br>
    else<br>        aspectRatio = viewportProperties_.viewportHeight_/viewportProperties_.viewportWidth_;<br>    <br>    viewer_.getCamera()->setProjectionMatrixAsPerspective( cameraProperties_.cameraFovy_,<br>                                                           aspectRatio,<br>
                                                           cameraProperties_.cameraZNear_, cameraProperties_.cameraZFar_ );<br><br>    // Positioning the camera<br>    osg::Matrix camTrans;<br>    camTrans.makeTranslate( cameraProperties_.cameraPos_.x(), cameraProperties_.cameraPos_.y(), -cameraProperties_.cameraPos_.z() );<br>
    viewer_.getCamera()->setViewMatrix( camTrans );<br><br>    // tell the camera to use OpenGL frame buffer object where supported.<br>    viewer_.getCamera()->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);<br>
<br>    // create texture to render to<br>    osg::Texture* texture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, false );<br>    osg::Texture* depthTexture = createRenderTexture( viewportProperties_.viewportWidth_, viewportProperties_.viewportHeight_, true);<br>
<br>    // attach the texture and use it as the color and depth buffer.<br>    viewer_.getCamera()->attach(osg::Camera::COLOR_BUFFER, texture);<br>    viewer_.getCamera()->attach(osg::Camera::DEPTH_BUFFER, depthTexture);<br>
<br>Ok then I build my particle scene using osgParticle. I use a ModularEmitter for the placer, shooter and counter.<br><br>Finally I set the osgPPU::Processor and attach all the unit I need for the shader rendering. Then I set the viewer scene data and start the main loop which look like this :<br>
<br>    osg::Group * rootGroupNode = new osg::Group();<br>    rootGroupNode->addChild( myParticleScene );<br>    rootGroupNode->addChild( myOsgPpuProcessor );<br>    viewer_.setSceneData( rootGroupNode_.get() );<br>
<br>    while (!viewer_.done())<br>    {<br>        if( checkForNewMedias() )<br>            updateSceneWithMedia();<br><br>        updateScene();<br><br>        // Draw the next frame.<br>        rendering_ = true;<br>        viewer_.frame();<br>
        rendering_ = false;<br><br>        Sleep(1);<br>    }<br><br>And the application crash with the error message I provide you. If I comment these lines in my viewer application :<br><br>    // Set single thread model<br>

    //viewer_.setThreadingModel(osgViewer::Viewer::SingleThreaded);<br><br>    // tell the camera to use OpenGL frame buffer object where supported.<br>
    //viewer_.getCamera()->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);<br>
<br>
    // create texture to render to<br>
    //osg::Texture* texture = createRenderTexture(
viewportProperties_.viewportWidth_,
viewportProperties_.viewportHeight_, false );<br>
    //osg::Texture* depthTexture = createRenderTexture(
viewportProperties_.viewportWidth_,
viewportProperties_.viewportHeight_, true);<br>
<br>
    // attach the texture and use it as the color and depth buffer.<br>
    //viewer_.getCamera()->attach(osg::Camera::COLOR_BUFFER, texture);<br>
    //viewer_.getCamera()->attach(osg::Camera::DEPTH_BUFFER, depthTexture);<br><br>And don't attach the osgPPU::Processor to my rootGroupNode, everything works well.<br><br>Hope I gave you enough informations, if you need more I'll provide you.<br>
<br>Thanks<br><br>Alex<br><br><br><br></div>