Rendering Stereoscopic 3D Images and Video

You probably know stereoscopic 3D videos from the cinema. The Bino video player can play them, and there are some example videos on the Bino website.

These videos were rendered with WurblPT, and this article explains how that is done.

In general you need to render two images instead of one: a left eye view and a right eye view. There are lots of possibilities to combine both views into a single image. WurblPT uses the top-bottom layout, where the left eye view is placed on top of the right eye view so that you get a combined image that is twice as high as a traditional 2D image:
Stereoscopic 3D image in top-bottom layout

The question now is how to determine the left and right eye camera configurations that are used instead of the single 2D camera. That is done as follows:

Note that this approach only works for traditional images. For 180°/360° surround images, the left and right camera centers differ for each pixel.

See camera.hpp for details, and have a look at wurblpt-sponza and wurblpt-rolling-marbles to see how these camera models are used to render the Bino example scenes.