Bump mapping
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
- 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
See also
External links
- 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)