Game Development Reference
Figure 1.1. Cubemap with a box volume (white) and reflection plane (red) matching a
rectangular room environment.
is unique in that we don't use the scene's geometry since we cannot access the
pixel's world position when we render into the 2D reflection texture. Moreover,
we limit ourselves to planar reflections.
We developed tools for our artists to allow placing cubemaps in levels and
associating them with a geometry proxy: a convex volume approximating the
reflection environment. For example, in a rectangular room an artist can place
a cubemap in the center of the room and define a box volume to approximate
the room boundaries. The center of the box volume doesn't need to match the
position of the cubemap. As we target planar reflections, we also require having
a reflection plane for the cubemap (Figure 1.1). The reflection plane could be
specified as a distance from the cubemap position and oriented by the cubemap's
up axis or extracted from a game's entity.
ure 1.2 ):
Consider a scene with a ground surface (hashed line), a reflection environment
(yellow) approximated by a proxy geometry (box volume in green) and a camera.
The camera looks at a position on the ground. The reflected view vector R is
used to get the intersection P with the proxy geometry. P is then used with
the cubemap that was captured at center C to recover the cubemap's sample
direction D . If we reflect the camera about the reflection plane, the new view
vector V of the reflected camera matches the previous R vector and intersects the
same point P . From this observation, we deduce that in order to fix the parallax
issue we could simply project the cubemap onto its geometry proxy, and then
render the geometry from the point of view of the reflected camera.