[osg-users] Stereoscopic Screenshot

24 views
Skip to first unread message

Nathan Schofield

unread,
Jan 28, 2010, 3:39:39 AM1/28/10
to osg-...@lists.openscenegraph.org
Hi,

I'm working on an application that's based on the osgstereoimage example, what I'm having trouble with is saving out the scene to an image using writeImageFile. The image is created fine using readPixels inside a custom DrawCallback attached to the cameras FinalDrawCallback, however only one image of the stereo pair is "captured", the stereo effect is not written out to the image. I'm guessing this is because the stereo effect takes place after the cameras FinalDrawCallback, does anyone have any idea how you would go about capturing the stereo effect into a image file.
...

Thank you!

Cheers,
Nathan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=23318#23318

_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Nathan Schofield

unread,
Jan 28, 2010, 8:49:09 AM1/28/10
to osg-...@lists.openscenegraph.org
Does any body have a clue? Would the use of FBO, get the information required or RTT camera, or both?

...

Thank you!

Cheers,
Nathan

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=23354#23354

Robert Osfield

unread,
Jan 28, 2010, 9:45:18 AM1/28/10
to osg-...@lists.openscenegraph.org
On Thu, Jan 28, 2010 at 1:49 PM, Nathan Schofield
<John.Smit...@googlemail.com> wrote:
> Does any body have a clue? Would the use of FBO, get the information required or RTT camera, or both?

I don't have a clue why it doesn't work, but then there is too my
unknowns about what exactly you are doing to have a guess.

What type of stereo are you using? Have you been able to recreate the
problem with the standard OSG viewer?

I've just tried osgviewer cow.osg --stereo, and then pressed 'c' to
capture a screen shot and the resulting image looks correct - the
anaglyphic stereo is all in place as one would expect.

Robert.

Nathan Schofield

unread,
Jan 28, 2010, 11:26:17 AM1/28/10
to osg-...@lists.openscenegraph.org
Hi Robert,

Thanks for your time I appreciate the help, I'm using Quad Buffered stereo.
I have used the osgViewer program, and i am able to produce a stereo screenshot when in anaglyphic mode, but not when using quad buffer - i simply get a flat image of one of the eye views.

Is there something specific that quad buffered stereo uses in hardware that is applied at the hardware stage of the pipeline that cannot be seen by the view?

I'm willing to try anything you suggest!

...

Thank you!

Cheers,
Nathan

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=23377#23377

Robert Osfield

unread,
Jan 28, 2010, 11:48:13 AM1/28/10
to osg-...@lists.openscenegraph.org
Hi Nathan,

Quad buffer stereo uses two back buffers and two front buffers, one
pair for each eye. You screenshot capture code is probably just
capturing one of these buffers so will just be the left or right eye
image.

As to what you actually want in the case of quad buffer stereo screen
capture I can't say. What are you expecting? Two side by side
images? Two images? How do you plan to view them afterwards?

Robert.

Nathan Schofield

unread,
Jan 29, 2010, 3:28:24 AM1/29/10
to osg-...@lists.openscenegraph.org
The idea was that I would screen capture the stereo image on screen to produce a single image with the stereo effect in it, you would then be able to view this image on its own (with the appropriate monitor and glasses) without the need for the two separate images and a piece of software.
How would one go about taking the contents of both the BACK_LEFT and BACK_RIGHT buffers to produce a single image.
Once again thanks for the help

Nathan

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=23393#23393

Robert Osfield

unread,
Jan 29, 2010, 4:48:31 AM1/29/10
to osg-...@lists.openscenegraph.org
Hi Nathan,

On Fri, Jan 29, 2010 at 8:28 AM, Nathan Schofield
<John.Smit...@googlemail.com> wrote:
> The idea was that I would screen capture the stereo image on screen to produce a single image with the stereo effect in it, you would then be able to view this image on its own (with the appropriate monitor and glasses) without the need for the two separate images and a piece of software.

?? I don't know where to start... quad buffer stereo requires
software to drive it, end of story, you simply can't output a "quad
buffer stereo image" and magically get it to work.

> How would one go about taking the contents of both the BACK_LEFT and BACK_RIGHT buffers to produce a single image.
> Once again thanks for the help

You need to go read an OpenGL book, and think about strereo and how
you want to rendering it.

Robert.

Nathan Schofield

unread,
Jan 29, 2010, 4:57:46 AM1/29/10
to osg-...@lists.openscenegraph.org
I thought that if the image looked the same as that on screen i.e. with the offset and two images merged together, displaying this on a 3D monitor with shutter glasses would produce the same effect as displaying it via software, maybe I was wrong.

As for capturing the image I tried setting glReadBuffer to GL_BACK_LEFT then capturing one image, changing glReadBuffer to GL_BACK_RIGHT capturing the second image, and using copySubImage to combine the two. However the second image from GL_BACK_RIGHT is always black.

Cheers,
Nathan

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=23403#23403

Nishant Singh

unread,
Jan 30, 2010, 10:30:03 AM1/30/10
to osg-...@lists.openscenegraph.org
Hi Nathan,
For active stereo with shutter glasses, if you use the merged image then it will not work. Active stereo works on the principle that scene is rendered at min 120 Hz and each alternate frame is for the left eye and right eye. the shutter glasses are in sync in the 3D moniter so that each frame is either seen by the left eye of right eye. if you see without the shutter glasses then you will see the merged images. but if you merge the right and left frames before and then display the scene then you will still see the merged images with the shutter glasses but not the 3D effect as both eyes will see the same image.

-Nishant   

Nathan Schofield

unread,
Feb 1, 2010, 3:33:00 AM2/1/10
to osg-...@lists.openscenegraph.org
Sorry I don't know why I said shutter glasses, we are using a horizontal interlaced monitor with passive polarized glasses, although I guess I still wont be able to capture the effect anyway. If anyone knows of a way of doing what I need I would be very thankful.

Cheers,
Nathan

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=23464#23464

David Fries

unread,
Feb 1, 2010, 11:42:04 AM2/1/10
to osg-...@lists.openscenegraph.org
On Mon, Feb 01, 2010 at 08:33:00AM +0000, Nathan Schofield wrote:
> Sorry I don't know why I said shutter glasses, we are using a
> horizontal interlaced monitor with passive polarized glasses,
> although I guess I still wont be able to capture the effect anyway.
> If anyone knows of a way of doing what I need I would be very
> thankful.

If it's just the old style CRT interlaced format, as in left eye sees
even lines and right eye sees odd lines, then you would only need a
static image. If that's the case, capture left and right images, then
use a program to take even lines from one and odd from the other. The
gimp has a program to blank every other line, if you do that do you
get black on one eye and the image in the other?

If it's the entire frame buffer being displayed to the left eye in
one frame, and the next goes to the right, you have to have a program
capable of switching out left and right images with the quad buffering
anyway, so why don't you just draw it real time with your program in
the first place? The other option is to capture left and right images
to disk, then have an option in your program to load them back off
disk and display them again.

--
David Fries <da...@fries.net>
http://fries.net/~david/ (PGP encryption key available)

Nathan Schofield

unread,
Feb 2, 2010, 3:36:38 AM2/2/10
to osg-...@lists.openscenegraph.org
Hi David

I am using a JVC 3D monitor model :- http://pro.jvc.com/prof/attributes/features.jsp?model_id=MDL101867

I am rendering it out in realtime, the idea was to "convert 2d images to 3d", so after conversion you wouldn't need the software again to view the image just the hardware and glasses. I have managed to get hold of each of the BACK_LEFT and BACK_RIGHT buffer contents by sampling them over two frames, I would like the conversion to take place within the osg application, am just not sure how to go about combining the images to produce the the same stereo effect. I will take what you said and see if I can get any further.

Cheers,
Nathan

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=23522#23522

J.P. Delport

unread,
Feb 2, 2010, 3:53:17 AM2/2/10
to osg-...@lists.openscenegraph.org
Hi,

Nathan Schofield wrote:
> Hi David
>
> I am using a JVC 3D monitor model :- http://pro.jvc.com/prof/attributes/features.jsp?model_id=MDL101867
>
> I am rendering it out in realtime, the idea was to "convert 2d images to 3d", so after conversion you wouldn't need the software again to view the image just the hardware and glasses. I have managed to get hold of each of the BACK_LEFT and BACK_RIGHT buffer contents by sampling them over two frames, I would like the conversion to take place within the osg application, am just not sure how to go about combining the images to produce the the same stereo effect. I will take what you said and see if I can get any further.
>

you can make a simple fragment shader with two images as input that
makes a single image as output.

jp

> Cheers,
> Nathan
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=23522#23522
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-...@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.

Reply all
Reply to author
Forward
0 new messages