next up previous contents
Next: 11.2.1 Sphere Mapping Up: 11.2 Environment Mapping Previous: 11.2 Environment Mapping

11.2.0.1 The Inherent Limitations of Environment Mapping

It is important to keep in mind the limitations of this approach. The environment map is accessed solely based on a 3D orientation. This would imply that different positions within the environment receive exactly identical incoming irradiance from the environment. Obviously, that's not at all true in general. The incident illumination for a point above a table is almost certainly going to be different than the incident illumination for a point underneath the table. Still the assumption is reasonable if the two positions are relatively near each other. What ``near'' means depends on the environment. In the case of the table, ``near'' certainly implies that the two points are close to each other but also that both should be on the same side of the table. However if the environment is the void of interstellar space, ``near'' could mean hundreds of miles away.

When using an environment map to render an object, we assume that the environment map is relatively position independent with respect to the object being rendering. This simply means, for example, that when we use a single environment map to render a shiny metallic teapot, we are assuming that the ``environments'' of all the points making up the teapot are all approximately the same. For convex objects such as a sphere that is relatively distant from the other objects making up the sphere's environment, this is a very reasonable assumption. For a non-convex object such as a shiny torus, the assumption is not very good because the torus, being non-convex, can reflect itself. Such inter-reflections are position dependent and therefore can not be captured by an environment map.

Even in a case such as a torus that has the opportunity for inter-reflections, we often still use environment mapping. The object's shiny surface simply will not reflect itself. Most observers will not even notice the lack of inter-reflections, particularly in the context of an animated scene. Environment mapping is often convincing even when applied in situations that, technically, are not well suited to the technique. The simple fact is that human observers are typically easily impressed by shiny rendered objects (they are a lot like raccoons in this respect) and are very trusting in the authenticity of reflections, particularly on complex curved surfaces.

Keep in mind that the environment of an object is a complete 360 degree panorama. This leads a problem when you try to encode the environment as a 2D texture. The implicit topology of OpenGL's 2D texturing functionality is that of an infinite plane with texture coordinates simply interpolated between vertices using (ideally) barycentric coordinates. Anyone versed in planar and spherical geometry understands the sort of problems this mismatch of topology creates.

Before we can use OpenGL texturing for environment mapping, we must first decide on a parameterization of the environment that works given the way OpenGL interpolates texture coordinates. Multiple parameterizations are possible. Blinn and Newell originally described a cylindrical parameterization indexed by polar coordinates. Unfortunately, 2D texture coordinates parameterized as an abscissa and polar angle are not interpolated correctly by conventional texturing hardware as supported by OpenGL. Figure 65 demonstrates this point.

 

% latex2html id marker 12568
\fbox{\begin{tabular}{c}
\vrule width 0pt height 0....
... not cross the line as expected when 2D textured with OpenGL.}\\
\end{tabular}}

Three common environment map parameterizations are sphere mapping, dual paraboloid mapping, and cube mapping. Each will be described in turn. Each parameterization has different advantages and disadvantages.

You can use environment maps to represent any effect that depends only upon a 3D orientation. These effects include specular and directional diffuse reflection, refraction, and Phong lighting. Several of these effects are discussed in the context of OpenGL's sphere mapping capability, but they are applicable to other parameterizations as well.


next up previous contents
Next: 11.2.1 Sphere Mapping Up: 11.2 Environment Mapping Previous: 11.2 Environment Mapping
David Blythe
1999-08-06