Sphere mapping
Encyclopedia
In computer graphics
Computer graphics
Computer graphics are graphics created using computers and, more generally, the representation and manipulation of image data by a computer with help from specialized software and hardware....

, sphere mapping (or spherical environment mapping) is a type of reflection mapping
Reflection mapping
In computer graphics, environment mapping, or reflection mapping, is an efficient Image-based lighting technique for approximating the appearance of a reflective surface by means of a precomputed texture image. The texture is used to store the image of the distant environment surrounding the...

 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
Orthographic projection
Orthographic projection is a means of representing a three-dimensional object in two dimensions. It is a form of parallel projection, where all the projection lines are orthogonal to the projection plane, resulting in every plane of the scene appearing in affine transformation on the viewing surface...

 (as opposed to one with perspective
Perspective (graphical)
Perspective in the graphic arts, such as drawing, is an approximate representation, on a flat surface , of an image as it is seen by the eye...

). 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
Surface normal
A surface normal, or simply normal, to a flat surface is a vector that is perpendicular to that surface. A normal to a non-flat surface at a point P on the surface is a vector perpendicular to the tangent plane to that surface at P. The word "normal" is also used as an adjective: a line normal to a...

 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:
  • The map has been created as above, looking at the sphere along the z-axis.
  • The texture coordinate of the center of the map is (0,0), and the sphere's image has radius 1.
  • We are rendering an image in the same exact situation as the sphere, but the sphere has been replaced with a reflective object.
  • The image being created is orthographic, or the viewer is infinitely far away, so that the view direction does not change as one moves across the image.

At texture coordinate , note that the depicted location on the sphere is (where z is ), and the normal at that location is also . 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 is .

See also

  • Cube mapping
    Cube mapping
    In computer graphics, cube mapping is a method of environment mapping that uses a six-sided cube as the map shape. The environment is projected onto the six faces of a cube and stored as six square textures, or unfolded into six regions of a single texture...

  • Skybox (video games)
    Skybox (video games)
    A skybox is a method of creating backgrounds to make a computer and video games level look bigger than it really is. When a skybox is used, the level is enclosed in a cuboid; and the sky, distant mountains, distant buildings, and other unreachable objects are projected onto the cube's faces , thus...

  • Reflection mapping
    Reflection mapping
    In computer graphics, environment mapping, or reflection mapping, is an efficient Image-based lighting technique for approximating the appearance of a reflective surface by means of a precomputed texture image. The texture is used to store the image of the distant environment surrounding the...

  • HEALPix
    HEALPix
    HEALPix , an acronym for Hierarchical Equal Area isoLatitude Pixelisation of a 2-sphere, can refer to either an algorithm for pixelisation of the 2-sphere, an associated software package, or an associated class of map projections.The HEALPix projection is a general class of spherical projections,...

    , mapping with little distortion, arbitrary precision, and equal-sized fragments
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK