Game Development Reference
In-Depth Information
noted, however, that if the focal length and aspect ratio are known for a particular
view frustum, then the formulas in Table 5.1 provide a significantly more effi-
cient way of calculating normalized frustum planes.
5.6 Reflections and Oblique Clipping
Many scenes contain a reflective surface such as a mirror or a body of water for
which a reflection image needs to be rendered. The typical way in which reflec-
tions are shown in a scene is to establish a separate image buffer called the re-
flection buffer to hold the result of rendering the objects in the scene that are vis-
ible in the reflection. The reflected scene is first rendered into the reflection buff-
er, and then the main scene is rendered into the main image buffer. When the ge-
ometry representing the reflective surface is rendered, colors from the corre-
sponding pixels in the reflection buffer are read and used to contribute to the final
image.
The reflected scene is rendered through a virtual camera that is the reflection
of the main camera through the plane of the reflection, as shown in Figure 5.19.
y
z
Reflection plane
z
Figure 5.19. The upper view frustum represents the actual camera rendering a scene that
contains a reflection plane. The virtual camera used to render the reflection is represented
by the lower view frustum, and it is itself a reflection of the upper view frustum. The x
axis points out of the page for both view frustums, and consequently, the camera-space
coordinate system for the camera rendering the reflection is left-handed.
y
Search Nedrilad ::




Custom Search