Hi Baptiste, The osgdistortion example is probably the best place to learn how to do the type of RTT that you want. The key part is that your RTT Camera will be a slave Camera attached to the viewer, with the slave Camera using the default RELEATIE_RF RefnerceFrame to it inherts the view and projection matrix from the Viewer's master Camera that the camera manipulator controls. A second slave Camera renders to the GraphicsWindow but is set up with an ABSOLUTE_RF ReferenceFrame so that it ignores the master Camera view and projection matrix so you can do all the screen space post processing effects you want.
Robert. On 20 August 2013 18:38, Baptiste S. <baptiste.sansie...@noos.fr> wrote: > Hi, > > I'm trying to use mutlipass rendering with osg, I would like to render my 3d > scene in a texture and use this texture in some fragment shader for > post-processing (I'm working for GL ES2). > > That's my first time with OSG, there's a lot of obscure things for me, so be > clement please :) > > 1 - I've just created a RTT camera inspired from osgprerender (so RTT cam is > part of scene graph) I have now my 3d scene rendered on a plane ! Cool ! > My first problem is that I'm using a camera manipulator (trackball), and this > manipulator is attached to the main camera so I manipulate the plane with the > texture instead of my 3d scene ... :( I would like to attach the manipulator > to my RTT camera, and the main camera should just be a static ortho cam !! > I've seen this post : Attach camera manipulator to RTT camera instead of > viewer? (cannot paste the link cause it's my first post ... :? ) > which describe exactly the same problem, > I understand that I can only attach the manipulator to the main camera or to > it's slave (using setAllowEventFocus), not on cameras added to scene graph. > But I have no idea on how to use slave camera for rendering to texture ? > All provided exemples I have seen use the same method that I used .... > Could you enlighten me about this point ? > > 2 - Another thing I was wondering is how can I order my RTT cameras if I have > more than one ? > Using camera->setRenderOrder(osg::Camera::PRE_RENDER); doesn't allow me to > specify which RTT camera should be render in first place ? > > > Thank you! > > Cheers, > Baptiste > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=55909#55909 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org