StereoGL Design Considerations

General

I plan to implement in C++ in order to use VL-1.2, a vector/matrix library that works well with OpenGL and is compatible with regular arrays, so it will be callable from plain C. I do not plan to do object oriented programming.

The prefix STGL_ will be used for definitions and macros, and the library will be called "libstgl". I was going to use just SGL, but someone else is already using it.
 

Stereo display methods

OpenGL-supported (hardware page-flipping)

Normally, this will use Quad-buffering, but should probably be able to handle dual-buffer stereo, where rendering is directly into the FRONT_LEFT and FRONT_RIGHT buffers. SGI also have some strange stereo modes that use extensions to standard OpenGL. Are there any other special cases we need to be aware of?

There are many systems that require specific video modes to be activated before hardware stereo will work, and it is not handled by OpenGL. This is a general requirement for mny methods below as well. This is really complex for IRIX because they have many very different graphics boards.

Software page-flipping

There are some stereo display systems that alternate left and right frames (page-flip) manually. This approach probably requires a vertical blank interrupt, which can be fed in externally through a parallel port for video cards that don't support a vblank interrupt.  This should be very similar to real OpenGL-supported stereo, once the driver is installed. ELSA revelators work this way, but use BIOS code for at least part of the page-flipping process. I don't see any special problems with this method other than getting the page-flipping driver built and knowing how to feed it left/right data, which may be difficult if we can't get good hardware documentation.

Interlaced

This approach uses the interesting side-effect that interlaced displays have naturally alternating frames of image data. It provides a fairly easy way to get stereo-in-a-window without trashing the desktop like above/below does. Interlaced displays can be generated pretty easily in OpenGL using a stencil buffer with every other row set.
 

Above/Below

This method works by inserting an extra vertical blank in the middle of the screen. The result is two display frames from each actual video frame, each stretched to just under half the original vertical resolution. This avoids the missing-data problem of interlaced stereo, but has problems of its own.

Some stereo viewing methods that don't use LCD shuttering

Anaglyph

This is the old-fashioned colored glasses. There is a big variety of color combinations. There are two basic types: "pure anaglyph" is derived from greyscale left and right frames. Color anaglyph allows the originals to be colored, but color saturation must be low to keep intensities similar for both eyes. This is a good one to implement as an alternative and cheap method. It is easy to implement in OpenGL using color masks. Problems are:

Side-by-Side

Left and right images are displayed side by side, and can either be left view on the left (straight-eyed or relaxed-eyed) or left on the right (cross-eyed).  Straight-eyed stereo works better for small images (<6cm seperation) or when viewing through mirrors that increase the effective separation between eyes.  Some people learned stereo viewing with mirrors and still prefer it to LCD glasses, so we should try to support this. Cross-eyed stereo allows for unassisted viewing of larger images than straight-eyed, but causes more strain because there is a larger disagreement between actual focal length and the focal length your eyes expect. I think that this can be overcome with practice, but I doubt that this is good for long-term eye health.
 

Mirror

This is an interesting method that uses side-by-side display with one image flipped left to right. First, place a mirror in front of your screen, vertical and perpendicular to the screen surface.  Next, position your eyes near the close edge of the mirror. If you look to one side of the screen such that one eye views a reflection, you will get a stereo image. This could be a useful item for stereo on flat LCD displays.
 

Pixel screening

This is a term I just made up for a group of stereo devices under development for flat LCD displays, which can't do shuttered stereo because the refresh rate is too slow and pixel persistence is too high. These techniques screen out individual pixels for left or right views, instead of screening frame by frame. I know of two methods: pixel-sized polarizing filters viewed through polarizing glasses, and lenticular lenses which are like those 3D/animated postcards and require no glasses at all (neat!) One advantage is that there should be no ghosting. This should be easy to implement with stencil buffer screens, once you know which pixels go with which view.

Same problems as with interlaced (pixel sized details can be lost) but could be harder to adjust for, depending on the pixel pattern.


User control

How should stereo display settings be controlled? It may be useful to have a separate controller application running in the background, like a MS-Windows tray item, or the Spaceball daemon in UNIX. This means installing an extra program. Settings should also be controllable from the main application. There could also be a standard GLUT menu for a quick and easy way to include stereo control.