View Full Version : 3D Stereoscopic with OpenGL ES
02-15-2011, 02:05 AM
I'm looking since a long time, but i never find something good about it.
I know that the basic way (buffer left and right) is not implemented.
So, is it possible to do 3D Stereoscopic with OpenGL ES 2.0? And if the answer is "Yes", could you explain me how or give me a link of a tutorial.
I really need an answer to continue my project.
Thank for your helping.
02-21-2011, 10:32 AM
OpenGL ES doesn't support the traditional quad-buffer stereo modes, but it IS possible to do stereo 3D if you use one of the new 3D TV's for your display. These TV's accept left/right pairs packed into a single video frame. As a result, you do conventional double buffering but draw both the left and right views into the target buffer before doing the swapbuffer. The way you pack the left and right views into the single buffer depends on your TV.
The "3D Ready" DLP projection TV's pack the images in a 'checkboard' format -- if you imagine a checkerboard, the red squares correspond to the left view and the black squares correspond to the right view. Passive polarized TVs may interleave horizontal lines of left / right images. Autostereo TVs may may interleave vertical lines of left/right images (or even multiple images).
There are several ways of doing interleaved images -- using stencil buffers is an example -- where you draw from one viewpoint with one mask test and the second viewpoint with a different mask test. Any OpenGL ES implementation that supports stencil buffers will support this approach. There are several other ways of doing this as well.
The new LCD and Plasma 3D TVs support packed images (either side-by-side or top-bottom) of the left/right images pairs. Instead of drawing into a left or right buffer, you simply use the viewport command to set your drawing region (e.g., top/bottom or left/right) and then draw the appropriate view.
When you run your application you should see the double images on the TV. You would then manually enable 3D on your TV and place it into the proper mode for your display content.
The big difference between these approaches and conventional OpenGL quadbuffer stereo is that the stereo pairs are packed into a single frame and count on the display to interpolate from a half-resolution image into a full frame image. Quadbuffer is full resolution all the way through.
Some stereo TV's do support a full resolution mode where the image buffer is twice as high as usual (e.g., 1920 x 2160) and the stereo pairs are packed top/bottom. This format would then run at 24/48fps refresh rate instead of the 60/120fps that the other modes support. I've never tried running in this mode but I have run in all of the others (Checkerboard on DLP, horizontal interleaved on passive polaritzed, vertical interleaved on autostereo, plus top/bottom and left/right on LCD and Plasma) using OpenGL ES 1.1
Hope this helps
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.