Hi Ben,

Try placing the Text HUD Camera in the scene graph underneath the main
scene Camera and leave all the frame buffer/texture attachment settings
blank, this way it'll inherit the current frame buffer configuration from
it's parent.

Robert.

On 4 November 2014 20:58, Ben Strukus <[email protected]> wrote:

>  Hi Robert,
>
>
>
> The osgdistortion example is a great resource and I've used it quite a bit
> to set up the RTT and the distortion mesh, however when it comes to
> rendering a HUD (text, in my case) to that texture using slaves, I'm not
> seeing that being done in the example.
>
>
>
> Here's what I have:
>
> -          A slave camera that renders the main scene to a texture.
>
> -          A slave camera that renders a screen-space mesh with the above
> texture applied to it.
>
> -          A lone camera acting as a HUD that I would like to render to
> the texture, but can't seem to get this working.
>
>
>
> I've tried attaching the lone camera as a child of the RTT camera, and
> that doesn't seem to work.
>
> I can get it to work when the RTT camera isn't a slave, but as soon as I
> make it a slave it doesn't work.
>
> I can get the HUD to render directly to the screen  when I attach it as a
> child of the screen-space mesh camera, however it won't appear distorted.
>
>
>
> *From:* osg-users [mailto:[email protected]] *On
> Behalf Of *Robert Osfield
> *Sent:* Tuesday, November 04, 2014 12:14 PM
> *To:* OpenSceneGraph Users
> *Subject:* Re: [osg-users] Slaves, RTT, and HUD
>
>
>
> 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
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to