163
11
Making3DStereoscopicGames
Sébastien Schertenleib
Sony Computer Entertainment Europe
11.1Introduction
With the large variety of 3D content being made available (sports events, movies,
TV, photos, games, etc.), stereoscopic 3D is gaining momentum. With the sup-
port for 3D content on the PC and game consoles such as the PlayStation 3 and
Nintendo 3DS, it is likely that it will become even more widespread. In this chap-
ter, we present some topics that need to be considered when creating or convert-
ing a game to stereoscopic 3D. We also present some optimization techniques
that are targeted to improving both the run-time performance and visual fidelity.
11.2HowStereoscopic3DWorks
Stereoscopic 3D is produced by creating two separate images (one for each eye)
that are then displayed on a 3D screen, as shown in Figure 11.1. Depending on
the technology in place, those two images are then separated for the correct eyes
through some means. The three major approaches are the following:
■ Active shutter glasses. The screen alternately displays the left and right im-
ages and sends a signal to the LCD screen in the lens for each eye, blocking
or transmitting the view as necessary.
■ Passive polarized glasses. The screen is paired with adjacent right and left
images using orthogonal polarizations. The filter on each eye blocks the or-
thogonally polarized light, allowing each eye to see only the intended image.
■ Parallax barrier. The screen features a layer of material with some slits
placed in front of it, allowing each eye to see a different set of pixels without
glasses, but with restricted view angles.
164 11.Making3DStereoscopicGames
Figure 11.1. Creating a stereoscopic 3D scene.
11.3HowtoSetUptheVirtual3DCameras
Contrary to other media, video games have the luxury of being able to control the
camera properties directly. As we mentioned earlier, stereoscopic 3D requires
that we set up two distinct cameras. One possible solution is illustrated in Figure
11.2(a), where we use a simple offset to move the left and right cameras. This
approach results in a large portion of each image being visible to only one eye, as
shown by the arrows. This tends to generate strong eye strain. Therefore, an al-
ternative approach that is sometimes used with a stereoscopic camcorder is to toe
in both cameras by rotating them inward, as shown in Figure 11.2(b). However,
the convergence is no longer parallel to the screen, producing a vertical parallax
deviation when the camera rotates upward or downward. This is unnatural and
uncomfortable for the user. To circumvent these shortcomings, the scheme de-
picted in Figure 11.2(c) consists of using parallel cameras with an asymmetric
projection that minimizes the zone covered by a single image while avoiding ver-
tical parallax. This provides a much more comfortable experience.
Glasses
11.3HowtoSetUptheVirtual3DCameras 165
Figure 11.2. (a) A simple offset is applied to the left and right cameras. (b) Both cameras
are rotated inward. (c) The cameras have parallel view directions by use asymmetric pro-
jections. Configurations (a) and (b) lead to issues that deteriorate the stereoscopic 3D
experience. Configuration (c) avoids those shortcomings by using asymmetric projection
matrices.
With this model, the usual projection matrix
p
roj
M
given by
proj
2
00
2
00
2
00
00 1 0
nrl
rl rl
ntb
tb tb
M
nf nf
nf nf
changes because it is no longer the case that
0rl
and 0
t
b
. The off-center
view frustum that we must use is shown in Figure 11.3.
LR
LR
LR
(a) (b)
(c)
Get Game Engine Gems 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.