Using Bump Mapping Effects
The fun begins when we start looking at how we can use bump-mapping techniques to achieve different special effects. Many of the values defined above can be animated, which can create some awesome effects. Some effects that bump maps can create include:
Figure 2. DirectX 6 bump mapping illustration.
|Figure 2A. Scene rendered to texture,
which is then used as the water surface.
|Figure 2B. Scene rendered to texture,
which is then used as environment map
and distorted with DirectX 6 bump mapping
and a procedural bump map texture.
|Figure 2C. Same scene as 2B,
rendered in wireframe.
Now that we’ve looked at how to implement DirectX 6 bump mapping, let’s look at a few ideas for effects that could be possible (I say "could" because I haven't tried them all yet) with the above techniques. I have included two demonstration applications that you can download and try: one that shows the embossing technique <emboss.zip>, and another that demonstrates uses bump mapping to create a reflection on shimmering water surface <waterdemo.zip>.
Embossing. Using the embossing example presented earlier in this article, you could create the effect of a spotlight on an object, using a spotlight light map texture. However, unlike the embossing technique that used multiple textures, colored lights could be used instead. If you used this technique in conjunction with vertex lighting, you would likely need to play with the scale and fall-off of the lightmap to get it to match your global lighting model.
Water reflection. An animated, procedural sinusoidal bump map can create very realistic water without a lot of geometry (see Figure 1).
Water distortion. An effect similar to that used in the software-rendered version of Quake (where the entire frame buffer was animated in a sinusoidal pattern) could be implemented. First, you would render the 3D scene to a texture surface. Then using that texture as the environment map, render a couple of triangles to fill the frame buffer and use a sinusoidal patterned bump map to distort the view of the rendered scene, thus bending the entire scene according to the wave pattern.
Circus mirror and lens effects. Using a texture surface as the rendering target, render a scene (or a subset thereof) from the point of view of a mirror in your scene. Then use this rendered scene as the mirror's texture, and use bump mapping to perturb the reflection/refraction according to the values in your bump map. This way the mirror could be bent and warped, like a funhouse mirror, to distort the view of the scene.
Super Mario 64-style portals. An animated texture for the bump map could mimic the effect used in Mario 64 in which the portals that Mario jumped through rippled after he passed them. Nintendo create the effect in Mario 64 using additional geometry.
Better level-of-detail (LOD) transitions. Low LOD models can use bump mapping to hide their low polygon count. For example, if a building has a door handle and window sills that normally stick out from building itself, then when the viewer is far away from the building, the lower LOD version could simply be a cube. This low-detail version of the model could use bump mapping to make the door handle and window sills appear lighted or shadowed as lights moved about in the scene. As the player approaches, you could swap the low-detail geometry for the higher LOD, and turn off bump mapping.
Bullet holes, with Terminator 2-style melting effects. Bullet holes could be created in a surface by compositing in a pre-computed "bullet-hole bump map" onto the objects. Then, just like the silvery-surfaced bad guy in the movie Terminator 2, the bullet holes could melt away by animating the BUMPENVMATXX values toward 0.
Heat distortion rising off the ground. This effect could be done in a similar fashion to the water distortion effect earlier described, but applied to just a subsection of the scene. This may be an instance in which you would want to use a DuDvL format, where luminance in the bump map would taper off toward the top, making the rippling effect fade.
Rippling cloth/clothing/flags. By either procedurally rendering a bump map with an animation, or simply by animating the UV coordinates of a bump map, a character’s shirt could appear to ripple in the wind.
Flight simulator detail textures. This is a similar idea to detail texturing, in which blending a highly tiled texture onto a base texture adds detail -- grossly oversampled textures become more clearly defined as the viewer gets close to them. For example, imagine farm fields viewed from an altitude of 1,000 feet in a flight simulator. At that height, the fields look like a quilt. However, at a height of ten feet (say, when you’re about to crash into the field) the detail adds blades of wheat. Likewise, you could use bump mapping to show 20-foot waves on water from 1,000 feet up, and when the plane swoops down to ten feet in altitude (I never could keep that darned plane in the air), you can make out small ripples or rain drops.