March 1, 2021
Hot Topics:

Environment Mapping Techniques

  • By Addison Wesley
  • Send Email »
  • More Articles »

7.5 Exercises

  1. Answer this: What are the key assumptions behind environment mapping? For what situations does it break down?

  2. Try this yourself: How would Figure 7-10 look if the value for the etaRatio index of refraction vector in C7E5v_dispersion were (1, 1, 1)?

  3. Try this yourself: Try reimplementing the C7E1v_reflection vertex program to perform the reflection vector computation in object space and then transforming the resulting object-space reflection vector into world space.

  4. Answer this: What is the Fresnel effect?

  5. Try this yourself: When mipmapping is enabled, both OpenGL and Direct3D support a texture mapping feature known as texture level-of-detail (LOD) bias. Texture LOD bias can be useful to avoid unnaturally crisp reflections. Modify one of this chapter's examples to provide a positive bias for the cube map texture used as the environment map. This creates blurry reflections.

  6. Answer this: Prior to hardware support for cube map textures, a technique known as sphere mapping was used to project 3D vectors onto a 2D texture. Research this technique and explain why everyone uses cube map textures now.

7.6 Further Reading

Jim Blinn and Martin Newell introduced environment mapping in a 1976 paper titled "Texture and Reflection in Computer Generated Images," which appeared in the Communications of the ACM.

Ned Greene published an important paper titled "Environment Mapping and Other Applications of World Projections," which appeared in a 1986 issue of IEEE Computer Graphics and Applications. Greene proposed the idea of storing environment maps as cube maps.

RenderMan uses cube map textures for its environment mapping support. See The RenderMan Companion: A Programmer's Guide to Realistic Computer Graphics (Addison-Wesley, 1989), by Steve Upstill, for more details.

Doug Voorhies and Jim Foran published a SIGGRAPH paper titled "Reflection Vector Shading Hardware" (ACM Press) in 1994. The paper proposed a dedicated hardware approach for computing per-fragment reflection vectors that were used to sample an environment map stored in a cube map texture.

OpenGL 1.3 and DirectX 7 introduced hardware support for cube map textures. The OpenGL 1.3 or later specification provides the mathematics for how texture co-ordinates map to particular cube faces.

Matthias Wloka's 2002 paper "Fresnel Reflection" (available on NVIDIA's Developer Web site, developer.nvidia.com) discusses the Fresnel effect in further detail. The paper explains various implementations and trade-offs between them.

About the Authors

Randima (Randy) Fernando is Manager of Developer Education at NVIDIA.

Mark J. Kilgard is a Senior Software Engineer at NVIDIA.

Source of this material

This is Chapter 7: Environment Mapping Techniques from the book The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics (ISBN:0-321-19496-9) written by Randima Fernando and Mark J. Kilgard, published by Addison Wesley Professional.

To access the full Table of Contents for the book

Page 5 of 5

This article was originally published on March 24, 2003

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date