Jump to content

Bump mapping

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Sdornan (talk | contribs) at 01:27, 26 June 2007 (Requirements). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A sphere without bump mapping.
The bump map that is applied to the image below.
This sphere is geometrically the same as the first, but has a bump map applied. This changes how it reacts to shading, giving it the appearance of a bumpy texture resembling that of an orange.

Bump mapping is a computer graphics technique where at each pixel, a perturbation to the surface normal of the object being rendered is looked up in a heightmap and applied before the illumination calculation is done (see, for instance, Phong shading). The result is a richer, more detailed surface representation that more closely resembles the details inherent in the natural world. Normal mapping is the most commonly used bump mapping technique, but there are other alternatives, such as parallax mapping.

The difference between displacement mapping and bump mapping is evident in the example images; in bump mapping, the normal alone is perturbed, not the geometry itself. This leads to artifacts in the silhouette of the object (the sphere still has a circular silhouette).

Fake bump mapping

Programmers of 3D graphics sometimes use computationally cheaper fake bump mapping techniques in order to simulate bump mapping. One such method uses texel index alteration instead of altering surface normals, often used for '2D' bump mapping. As of GeForce 2 class card this technique is implemented in graphics accelerator hardware.

Full-screen 2D fake bump mapping, which could be easily implemented with a very simple and fast rendering loop, was a very common visual effect in the demos of the 1990s.

Real bump mapping

Real bump mapping makes use of calculating vectors for each pixel determining the height map. This can be as little as two lines of code for calculating the X and Y gradient at every pixel or it can be more complex; the final result is that of calculating the slope, so code complexity may not matter. Next a code is made to have these vector point calculations aligned with the U and V axis of the bump map it came from on the normal for the normal to be adjusted correctly. Then the typical lighting transforms the normal’s U and V texture pixel shade by comparing the vector direction point in the map with the light’s normal X, Y and Z point calculation in its segments or pixels like a graph. If the point is more at the light, then it’s brighter, the points facing further away from the light actually get darker more quickly.

If low resolution lights are used like a low pixel non-filtered specular from an earlier shader model, you can see how it works up close, looking like a sweep of animation.

On a normal map instead of vectors calculated per-pixel through small coding it's stored as a certain color in the map. Then the same happens on the light's point and X and Y span.

In some cases real bump mapping can cost less than emboss bump mapping because of the number of passes and amount of texture layers required to produce it; emboss bump mapping uses 2 to 3 extra passes, while real bump mapping can be done in one extra pass or texture layer. Also, it costs less than normal mapping, as normal mapping usually needs more than one pass due to its multi-channel structure.

Requirements

Stable real bump mapping requires either a built in shader programming unit on the GPU (vertex shader) or a dedicated vector processing unit connected to the GPU. The GPU must also have multi-pass rendering capabilities or bump mapping will be the only type of texture effect available due to a two texture layer limit.

The Emotion Engine on the Sony PlayStation 2 is an example of handling bump mapping through a vector processing unit. Sony included 2 vector processors rather than a GPU shader that could be used for bump mapping operations. The system could calculate height maps independently while the per-pixel calculations were carried out in one of the vector processing units. Unfortunately this capability was not used much until nearly the end of the system's life cycle with games such as Hitman: Blood Money[1].

Most other systems, including the Sony PlayStation 3, Microsof [[Xbox], Microsoft]] [[Xbox 360, and most PC graphics cards do bump mapping using pixel shaders.

References

See also