Game Development Reference
In-Depth Information
the stereo effect. If you do not provide a way for the user to tune the experience, a vocal
minority will claim your game gives them a splitting headache. However, as stated be‐
fore, if you are a curious amateur, the process of moving the camera and rendering
stereoscopic images gives you a lot of insight into how the process works.
As discussed previously, we must take into account the intraocular distance of the viewer.
This is the amount of parallax we want to give objects at infinity. This distance usually
ranges between 3 cm and 6.5 cm. The large differences can arise when considering that
you must consider both adults and children when creating your 3D scene. Now it is
useful to develop a normalized measure of intraocular distance. Nvidia calls this real
eye separation and gives the following formula for the value:
Real eye separation = intraocular distance / real screen width
Note that this value will change depending on the width of the user's screen. This value
is important because it is used as a reference for the maximum camera separation when
rendering your stereoscopic images. Separations higher than this value will cause dis‐
comfort in the viewer. In fact, for computer screens where the user is relatively close to
the screen, most people don't feel comfortable when the camera separation is more than
half the real eye separation. This is why it is a good practice to allow the user to change
the separation as a parameter of the program. It is also important to remember that the
separation of the cameras is also the parallax value at an infinite distance. When two
images display parallax equal to separation, it is as if your eyes are perfectly parallel.
This is something that happens only when you are looking at something very far away,
like a mountaintop. If you increase parallax beyond separation, you would essentially
be asking your viewer to diverge her eyes beyond parallel. This is sort of the opposite
of crossing your eyes, and obviously is going to cause some discomfort.
As we now have an upper bound to our parallax, we can begin to create a parallax
budget . Recall that the distance at which the two frustums intersect is called convergence.
Well, at 100 times this distance, the value of parallax is 99% of separation. That means
that for objects in the scene being rendered at that depth value, they will appear flat and
all similarly far away. This is analogous to not being able to tell which peak of a faraway
mountain range is the closest.
Objects between 10 and 100 times the convergence distance have parallax that varies by
about 10%. This results in a subtle but perceptible depth differentiation. As you ap‐
proach convergence, the parallax exponentially decreases. At the convergence distance,
the parallax is equal to 0. At a distance closer to the viewer than the screen, the parallax
is negative. A distance out of the screen half that of the convergence distance creates a
negative parallax that is equal to the separation. If the object is any closer to the viewer,
her eyes verge on crossing and eyestrain becomes a problem. Now we can draw what
our budget looks like (see Figure 24-11 ).