Bump mapping
From Wikipedia, the free encyclopedia
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).
Contents |
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 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.
The Matrox G400 chip supports, in hardware, a texture-based surface detailing method called Environment Mapped Bump Mapping (EMBM). EMBM was actually created by BitBoys Oy and licensed to Matrox.
EMBM was not supported by several competitors such as NVIDIA's GeForce 256 through GeForce 2, which only supported the simpler Dot-3 BM, but was available on the ATI Radeon 7200. Due to this lack of industry-wide support, and its toll on the limited graphics hardware of the time, EMBM only saw limited use during G400's time. Only a few games supported the feature, such as Dungeon Keeper 2 and Millennium Soldier: Expendable.
EMBM requires either specialized hardware within the chip for its calculations or a more flexible and programmable graphics pipeline, such as later DirectX 8.0 accelerators like the GeForce 3 and Radeon 8500.
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.
Though not part of its initial design, it was eventually discovered that the Sony PlayStation 2 was capable of practical bump mapping. By using the Emotion Engine's unique vertex processing units in combination with multi-pass rendering, bump mapping could be accomplished [1]. This capability was not often used until nearly the end of the system's life cycle, with games such as Hitman: Blood Money.
Most other systems, including the Sony PlayStation 3, Microsoft Xbox, Microsoft Xbox 360, and most PC graphics cards do bump mapping using pixel shaders.
- Blinn, James F. "Simulation of Wrinkled Surfaces", Computer Graphics, Vol. 12 (3), pp. 286-292 SIGGRAPH-ACM (August 1978)
- Hojengaard, Rasmus, Interview in Play Magazine, as translated at http://www.hitmanforum.com/show.php?id=28819&catid=36
- http://www.blacksmith-studios.dk/projects/downloads/bumpmapping_using_cg.php Bump Mapping tutorial using CG and C++
- http://freespace.virgin.net/hugo.elias/graphics/x_polybm.htm (shows a simple creating vectors per pixel of a grayscale for a bump map to work and more)
