Hi,
In my application, I just add this code on the init part :
Code:
osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D;
texture->setTextureSize(width, height);
texture->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR);
texture->setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR);
texture->setInternalFormat(GL_RGBA);
m_camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
m_camera->setRenderTargetImplementation(osg::Camera::PIXEL_BUFFER_RTT);
m_camera->attach(osg::Camera::COLOR_BUFFER, texture);
osg::ref_ptr<osgPPU::Processor> postProcessor = new osgPPU::Processor();
postProcessor->setCamera(m_camera);
postProcessor->setName("Processor");
postProcessor->dirtyUnitSubgraph();
m_root->addChild(postProcessor.get());
osgPPU::UnitBypass* bypass = new osgPPU::UnitBypass();
bypass->setName("Bypass");
postProcessor->addChild(bypass);
osgPPU::UnitInResampleOut* resample = new osgPPU::UnitInResampleOut();
resample->setName("Resample");
resample->setInputTextureIndexForViewportReference(-1);
resample->setFactorX(0.1);
resample->setFactorY(0.1);
bypass->addChild(resample);
osgPPU::UnitOut* ppuout = new osgPPU::UnitOut();
ppuout->setName("PipelineResult");
ppuout->setInputTextureIndexForViewportReference(-1);
resample->addChild(ppuout);
the camera is the only one camera that I have, it is the view's camera.
the root is the scene data
I just want to do a post render to texture into resampled texture, but I just
see the scene as there was no ppu (my image is not resampled)
Do I miss something ?
Cheers,
Sebastien
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=21150#21150
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org