Hi Ben, Have a look at the osgdistortion example as it does exactly what you describe you want to do.
Robert. On 4 November 2014 19:53, Ben Strukus <[email protected]> wrote: > Hello, > > > > I'm looking to get the following scenario working: > > A scene with a HUD rendering on a distortion mesh using > slave cameras. > > > > What I've tried so far is... > > 1. A normal Viewer class with two Cameras in the scene graph, one > on a pre-render pass that renders the main scene to a texture and one on a > post-render pass that renders a screen space mesh with the other Camera's > texture applied to it. > > 2. A Viewer class with two Cameras attached as slaves, with the > same pre- and post-render setup as above. The RTT (pre-render) Camera has > the main scene as the child and the mesh (post-render) Camera has just the > screen space mesh as a child. > > > > For these, I can get a HUD displaying on the following Cameras when I > attach it as a child to the respective Camera: > > - 1's pre-render Camera, attached to the texture and set up as a > FBO > > - 1's post-render Camera > > - 2's post-render Camera > > > > For my HUD, I'm simply creating a Camera with an Absolute reference frame, > orthogonal 2D projection, and on the post-render pass. See osghud.cpp, as > I've pretty much copied that with the modification of an optional Texture > parameter. > > > > The part I'm having trouble getting to work is getting that HUD rendering > to a texture when that RTT Camera is a slave of a View. The thing that > baffles me is I can get it working on a non-slave RTT Camera in the same > way, and I can get it working on a non-RTT slave Camera, but not the > intersection of both. > > > > I've tried searching for a similar solution, but I haven't found anything > for this specific scenario. Any help or direction would be appreciated. J > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

