COMBATSIM.COM: The Ultimate Combat Simulation and Strategy Gamers' Resource.
 

 
Environmental Bump Mapping
by Matrox Graphics
 

Figure5
Alpha Approach
Embossing Rendered using Multi-pass Alpha Texturing. Notice the artifacts. Environment Mapped
True Environment Mapped Bump Mapping

Figure 5 shows a comparison between embossing using the limited multi-pass alpha approach (top) and embossing using Environment Mapped Bump Mapping (bottom). Notice how the Environment Mapped Bump is much more realistic than the multi-pass alpha; it is easy to spot that the image on the top is simply a shifted replica of the original map.

Matrox G400

Although multi-pass alpha can be convincing at times, it has several critical limitations with its implementation and results, as detailed in table 1. Some of these include:

Limited Lighting Angle

The illusion rapidly breaks down and looks wrong when the light is past a certain angle of incidence (it cannot shift indefinitely). At that point, it becomes obvious that the shadowed and lit areas are simply shifted versions of the actual texture, as shown in figure 6.

Lighting Limits

Limited Range of Bumps

Multi-pass alpha is limited in the range of bumps supported. This technique cannot accommodate varying degrees of height as the shift must be uniform over each polygon.

Complex Implementation

The proper amount of shifting, or shadow, has to be calculated by the application. This can be tricky to get right, and just means more work for the programmer and the host CPU. The calculation of the amount of shift becomes even more complicated if multiple light sources are present.

Click to continue

 

It is easy to see that with all of its limitations and disadvantages, this technique lacks ease of use for developers. In fact, it cannot even really be considered a hardware technique because most of the work is done by the application, which means that it uses precious CPU cycles.

Most importantly, multi-pass alpha cannot be used to simulate any of the special effects and animations that Envi- ronment Mapped Bump Mapping supports.

Environment Mapped Bump Mapping

Given the limitations of multi-pass alpha, DirectX 6 uses a more versatile and flexible method of implementing bump mapping in hardware. This method is Environment Mapped Bump Mapping.

In typical environment mapped texture mapping (without bump mapping), the environment map contains a value for each texel of the conventional texture map. This value is applied to the texture map when it is mapped onto the 3D surface.

When adding bumps, the process becomes more complex. Environment Mapped Bump Mapping requires three maps: a conventional texture map, a bump map and an environment map. A bump map is essentially a differential value map derived from a height map.

The bump map contains a value for each texel coordinate of the conventional texture map. This value specifies a value from a different location within the environment map that should be applied to the texture map.

Image

The bump map is combined with the environment map and the resulting "perturbed" environment map is applied to the original texture. In other words, for each texel coordinate of a texture map, there exists a corresponding environment map coordinate, the value of which is applied to the texel in order to create the lighting effect.

As explained earlier, a bump is simulated by changing the lighting on the areas where the bump introduces a slope on the surface. Therefore a different environment map coordinate is used for the same texel coordinate.

This new environment map coordinate is defined by the bump map and is dependent on the slope of the bump at that particular coordinate. Notice how for the same coordinate, the bumped texture chooses a darker or lighter shade from the environment map, giving the impression that the slope at that point is not flat relative to the direction of the light.

For more information see the Matrox site.

Join a discussion forum on this article by clicking   HERE.

 

Copyright © 1997 - 2000 COMBATSIM.COM, INC. All Rights Reserved.

Last Updated May 26th, 1999

© 2014 COMBATSIM.COM - All Rights Reserved