Hi Berg,

The "ideal" way to insert a capture of main camera would be to insert
a custom osg::GraphicsOperation into set of rendering operations
attached to each GraphicsContext that you want to capture, you need to
insert this custom operation before after the cameras but before the
swap buffer.  Right now there isn't a convenient way of inserting this
operation in the right place, we need to add some more API to
GraphicsContext to do it, possible osgViewer::ViewerBase itself is
something to extend as well to provide a high level way of add such
operations.

Until these methods are added, you'll need to make do with a post draw
callback on the last camera to be drawn.

Robert.

On Nov 17, 2007 11:10 PM, Berg, Michael <[EMAIL PROTECTED]> wrote:
> Robert,
>
> Thanks for the tips.  After experimenting with the code in the osghud
> example, I was finally able to get a basic version of what I wanted
> working with the CompositeViewer.
>
> However, I now have another question.  I want to be able to take a
> screenshot of the entire screen.  I currently have a PostDrawCallback
> that successfully takes a screenshot, but since this callback is set on
> the main scene's camera, it only takes a screenshot of the main scene
> (and doesn't include the contents of the additional view/camera in the
> corner).  The setPostDrawCallback method is only available from osg::Camera
>
> Is there a way to remedy this?
>
> Or am I going to have to write code to individually screenshot every
> camera in the CompositeViewer and then stitch together and overlay each
> into a single screenshot?
>
> Thanks again,
> Michael
>
>
> Robert Osfield wrote:
> > Hi Michael,
> >
> > osgViewer::CompositeViewer is the appropriate tool for this type of
> > work, although you can use a slave camera in osgViewer::Viewer to as
> > well, but this isn't as logically clean.  The osghud examples provide
> > a range of examples of use of an iscene graph camera, a slave camera,
> > and a separate view - its for doing a HUD but the ideas are similar.
> >
> > As to why it isn't working for you, but best guess is that there is a
> > rendering order issue with the cameras - the full screen view
> > rendering after the insert view.  osg::Camera has support for
> > specifying the rendering order, so try something like
> >
> >    insert_camera->setRenderOrder(osg::Camera::POST_RENDER);
> >
> > You can also provide an int to setRenderOrder as a second parameter to
> > help differentiate between multiple post/pre draw cameras.
> >
> > Robert.
>
> _______________________________________________
> 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