[osg-users] extracting the current image and depth information

J.P. Delport jpdelport at csir.co.za
Mon Nov 16 23:01:35 PST 2009


a few pointers...

For just a screenshot type app, look at osgscreenshot example.

To get depth information you would have to attach a texture to a Render 
to Texture (RTT) camera's depth buffer. An RTT camera can also give you 
a copy of the rendered view.

Search the archives for "RTT" "render to texture" "camera attachments" 
"FBO" "MRT".

Textures rendered to can be copied back to the CPU as osg::Image's.

There are some osg examples that use render to texture, start with 
osgprerender and then search for some of the functions it uses.

For depth related stuff you can probably start at all the shadow examples.


Eric Coppock wrote:
> Hi all,
> Here's my second question... where I make it painfully obvious just how extremely noob I am with OSG...
> I have OSGviewer incorporated into my own application, and responding nicely to viewpoint changes coming from a separate flight simulator.  I want to extract the current image ("image" may not be the right word here in OSG world ... "view" may be even worse?)  and the current depth information for the scene I'm looking at in the viewer window, so I can pass them to some downstream processing.
> All the examples I've looked at seem to be a fair bit more complex than I'm looking for, and I haven't found the magic button yet.  Yes I bought the reference manual and read the quick-start guide.  ;)
> Thank you!
> Eric Coppock
> Colorado, USA ;)
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=19714#19714
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.

More information about the osg-users mailing list