163
11
Making3DStereoscopicGames
Sébastien Schertenleib
Sony Computer Entertainment Europe
11.1Introduction
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.2HowStereoscopic3DWorks
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.3HowtoSetUptheVirtual3DCameras
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.3HowtoSetUptheVirtual3DCameras 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)
166 11.Making3DStereoscopicGames
Figure 11.3. The view volume for an asymmetric frustum. The left and right values rep-
resent the minimum and maximum x values of the view volume, and the bottom and top
values represent the minimum and maximum y values of the view volume, respectively.
Having the ability to alter the camera properties every frame provides a much
larger degree of freedom for controlling the 3D scene. For instance, we can ad-
just the convergence of the cameras to control the depth and size of the objects
within the environment. The convergence corresponds to areas of the left and
right projected images that superimpose perfectly and therefore have zero paral-
lax, appearing in the plane of the screen. We can also adjust the interaxial dis-
tance, which is the separation between both cameras, in order to push back
foreground objects. This is very important because it allows us to offer a much
more comfortable experience.
11.4SafeArea
When creating a stereoscopic scene, we need to take into account where objects
are located within the 3D space. To make it more comfortable to watch, it is im-
portant that we take into account the zone of comfort, shown in Figure 11.4.
The screen acts as a window, and most of the content usually resides inside
the screen space, which is the volume of space behind the screen. Content that
comes out of the screen is usually small and fast. This also affects the heads-up
display (HUD), which can be moved slightly inside the screen space since, oth-
erwise, it might be difficult to focus on the main scene. To reduce eye strain, it is
also important to avoid any window violation that occurs when an object touches
the edges of the stereo window, resulting in an object being cut off more in one
eye than the other. A trivial solution is to alter the frustum culling so that the ob-
jects visible to a single eye are properly culled, as illustrated in Figure 11.5. Here,
the frustum origin is moved closer to the screen by the distance
Δ
z
given by

Δ
2tan 2
s
d
z
s
dfov
,
bottom
righ
t
top
left
11.4SafeArea 167
Figure 11.4. Objects very close to and far from the image plane are difficult to focus on
and are uncomfortable. Ideally, most of the scene should reside in the safe and comforta-
ble area.
Figure 11.5. Frustum culling for stereoscopic 3D. Instead of combining the view frustum
of both cameras, we want to cull any object that would be visible only to one camera,
reducing window violations.
LR
Screen
space
Audience
space
Image plane
Uncomfortable
stereo
Comfortable
stereo
LR
Screen
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset