Sphere mapping

In computer graphics, sphere mapping (or spherical environment mapping) is a type of reflection mapping that approximates reflective surfaces by considering the environment to be an infinitely far-away spherical wall. This environment is stored as a texture depicting what a mirrored sphere would look like if it were placed into the environment, using an orthographic projection (as opposed to one with perspective). This texture contains reflective data for the entire environment, except for the spot directly behind the sphere. (For one example of such an object, see Escher's drawing Hand with Reflecting Sphere.)

To use this data, the surface normal of the object, view direction from the object to the camera, and/or reflected direction from the object to the environment is used to calculate a texture coordinate to look up in the aforementioned texture map. The result appears like the environment is reflected in the surface of the object that is being rendered.

Usage example

In the simplest case for generating texture coordinates, suppose:

At texture coordinate (x,y), note that the depicted location on the sphere is (x,y,z) (where z is \sqrt{1 - x^2 - y^2}), and the normal at that location is also <x,y,z>. However, we are given the reverse task (a normal for which we need to produce a texture map coordinate). So the texture coordinate corresponding to normal <x,y,z> is (x,y).

See also

This article is issued from Wikipedia - version of the Thursday, September 03, 2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.