Hi,
I try to make a multi pass rendering in order to apply post effect after
each pass.
I try to have this pass order:
camera1->RTT1->Quad->camera2->RTT2->Quad->camera3.
Group* subgraph;
Node* model;
Geode quad1, quad2;
each camera is use like :
cameraX->setClearColor(clearColour);
cameraX->setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
cameraX->setReferenceFrame(osg::Transform::RELATIVE_RF);
cameraX->setProjectionMatrix(osg::Matrixd::identity());
cameraX->setViewMatrix(osg::Matrixd::identity());
cameraX->setViewport(0,0,tex_width,tex_height);
cameraX->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
cameraX->attach(osg::Camera::COLOR_BUFFER, textureX);
and I try to set camera render order:
camera1->setRenderOrder(osg::Camera::PRE_RENDER,0);
camera2->setRenderOrder(osg::Camera::PRE_RENDER,1);
camera3->setRenderOrder(osg::Camera::PRE_RENDER,2);
camera1->addChild(model);
camera2->addChild(quad1);
camera3->addChild(quad2);
but it doesn't seems to be the good way, I have some OpenGL error with FBO.
does somebody can explain me the way to use more of 2 pass render, i need to
apply 3 or 4 filter ( as blur, noise, negative...) on a model?
I looked at the examples (osgprerender, osgprerendercubemap, osgHUD ...),
but I don't see how to solve my problem.
thanks.
Ben
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org