Stereo renders

The theory behind stereo rendering

Stereo rendered images works because it consist of 2 different images which are then viewed from the two different eyes of the viewer. Since the two eyes are located at two different positions in space, they view a scene from two slightly different point of views and thus the two viewed images have two different perspectives in the scene.

Types of stereo images

There are basically two different ways to view a stereo image. One uses a mechanical apparatus generally composed of lenses designed to focus each eye on one single image of the stereo pair. In this apparatus, the two images are completely separated. This type of stereo image is the one that produces the best 3D experience because the two images can not produce crosstalk, that is the left-eye image appearing showing to the right-eye and vice-versa, since they are completely separated. Also in this category are the stereo helmets which displays the two images on two separate miniature LCD screens. The main advantage of these devices is that they allow for the reproduction of full color stereo scenes.

The other way uses a filter or an electronic shutter to separate the two images which are merged into a single image when rendered. The cheapest separating device is the colored filter glasses and the stereo images they use are called anaglyphs. Glasses designed for the printed medium uses filters designed to work with printed color inks and they usually don't work as well with stereo images displayed on a computer screen. For best viewing result from a computer screen, use colored glasses designed to filter the colors of the red, green and blue frequencies of the screen. 

The main disadvantage of using colored filters is that it becomes impossible to reproduce accurately a colored image. The stereo effect relies on the reproduction of the same monochrome scene viewed from two different point of view and encoded in two different channels of an RGB bitmap. Another disadvantage is that the filters are incapable of separating perfectly the two images and this produces crosstalk which looks like ghost images into the scene. The main advantage is that they are cheap to produce and it is even possible to construct one at home using filters designed specifically for this purpose manufactured by Kodak that can be purchased from a well supplied professional photography shop. For anaglyphs viewing on the screen, use the Kodak red #26 and green #58 filters. I don't recommend using blue filters because they are too dark and produce too much a difference in luminosity between the left and right image.

Another device that enters into the second category are the LCD shutter glasses designed for computer games. Unless they becomes cheap enough or you already own one for playing games, I would not recommend buying one simply for the pleasure of viewing stereo images. Yet another device in this category is the Polaroid filtered glasses. The filters are positioned vertically for one eye and horizontally for the other eye. They, also, are fairly cheap to produce but they only work in front of a cinema projection screen because there need to be two projectors and each one of them also needs to be polarized accordingly.

How does stereo anaglyphs works

In order to give the proper visual effect, the stereo renderer must project onto the viewing surface (which, in the context of 3D rendering, is mostly the computer screen), the two images viewed from the two different eyes.

The eye will decode the depth of each object from the angle they have to adopt in order to view the object and the adaptation of texture shifting from the surface of the objects (note that some people have difficulties viewing 3d stereo images. This is due to the fact that the visual system does not rely exclusively on the angle between the eyes to decode the depth but also on the focusing distance and other more subtle cues). In order to force the eye to adopt the proper angle that will induce the proper depth perception, the two images of a given object must be positioned differently within the frame of the image.

For instance, an object that would be located nearly at infinity like a star would force the angle between the eyes to be parallel. To produce this effect in a stereo image, the two images would have to be shifted from one another the equivalent of the distance between the two eyes. The right image shifted toward the right, half the distance between the eyes and the left image shifted toward the left, half the distance between the eyes. 

Conversely, an object that would be located 10cm in front of the viewer would force the eyes to cross at 25° angle. To produce this effect, the right image would now need to be shifted toward the left, a distance sufficient to force the eye to cross 12.5° and the left image shifted toward the right, the same distance.

Note that an object that would be located at the same distance as the viewing plane would produce two images that would be exactly superposed one over the other. Thus the eye would adop an angle that is proper to view the distance of the screen.

By shifting right or left those two stereo images, it is possible to fool the visual system into believing that the object depicted are located at different positions in the virtual world. The math for this is quite simple and it is possible, using any paint programs to produce anaglyphs by manually shifting sprites on different layers but it is much more easier to let the computer do it. Moreover, the computer can compute much more subtle texture shift that will give the models the appearance of solids in space instead of cardboard cutouts positions in space.