What the heck is displacement mapping?!

Here's my attempt at a beginner explanation:

If you know what bump mapping is, and it's limitations, then it is easy to understand displacement mapping conceptually. Bump mapping uses a texture to perturb/replace the per-pixel normal (usually interpolated from the normal specified at the edges) of a primitive. This is then used to calculate the lighting for that given pixel. However, since the underlying surface hasn't actually been modified, the "bumps" added to the surface are really a kind of optical illusion, and as you rotate the surface such that it becomes parallel to your eyes, it exposes its flat shap.

Displacement mapping is like bump mapping, except that instead of modifying the normal, it modifies the surface geometry itself. Now not only is the normal perturbed, but the shape of the surface truly is "bumpy" and if you look at the silhouette of the object, or rotate it to be parallel, it returns its bumpy shape.


A picture is worth a thousand words, and if someone showed you bump mapping and displacement mapping side by side, you'd instantly get it. Unfortunately, I am too lazy to track down a link to such an image. Maybe someone else can provide. :)
 
tire.jpg


If the image doesn't work, just view the page it's from (at the bottom): http://www17.tomshardware.com/graphic/02q3/020718/radeon9700-05.html
 
Informal explaination:
It's a map , a texture that contains height values.
You place this map over a regular texture and the results is that it's stretched to a new shape based on the height values of the displacement map.
 
JF_Aidan_Pryde said:
Informal explaination:
It's a map , a texture that contains height values.
You place this map over a regular texture and the results is that it's stretched to a new shape based on the height values of the displacement map.
Perhaps a better thing to say is that the map is placed over the model.
 
If developers *want* to do it, it's fairly straightfoward.
Westwood's Earth and Beyond is the only shipping title supporting the feature. But Parhelia, R300 and NV30 all supports Displacement mapping so I guess it should be quite a feasible modelling primitive in the future.
 
JF_Aidan_Pryde said:
If developers *want* to do it, it's fairly straightfoward.
Westwood's Earth and Beyond is the only shipping title supporting the feature. But Parhelia, R300 and NV30 all supports Displacement mapping so I guess it should be quite a feasible modelling primitive in the future.

doesn't R300 only do displacement mapping through it's trufom? or is it the fact that truform can do displacement mapping?

i wasn't clear if the r300 can just flat out do displacement mapping regardless if truform is enabled or not
 
Brent said:
doesn't R300 only do displacement mapping through it's trufom? or is it the fact that truform can do displacement mapping?

i wasn't clear if the r300 can just flat out do displacement mapping regardless if truform is enabled or not

First of all truform is just ATI's marketing name for N-Patch...

Displacement mapping (can) consist of the following steps:
1. Polygon tesselation
2. Texture (disp map) lookup
3. Actual displacing of the vertex using the value from the texture

Step 1 is optional, and can be any kind of tesselation that the card supports. (Like N-Patch).
Will ATI support Matrox's depth-adaptive tesselation? I don't know. It is certainly not a requirement of DM.

Step 2 is the actual new stuff.

Step 3 is actually part of the VS program that the developer writes. That value can be used for anything not just displacing the vertex.
 
Is it as easy to implement as n-patches were? Basically, will we see displacement mapping supported in video cards anytime soon?
 
elimc said:
Is it as easy to implement as n-patches were? Basically, will we see displacement mapping supported in video cards anytime soon?

Parhelia, Radeon 9700 and presumably nv30.
 
Displacements maps (done on the GPU) are tricky to get working with stencil shadows (usually done on the CPU).
 
elimc said:
Is it as easy to implement as n-patches were? Basically, will we see displacement mapping supported in video cards anytime soon?

In theory: yes.

It's just a texture map placed on the surface with usual mapping.
Turning on is just a matter of flipping a few render-states.

In practice: no.

DM (in Matrox implementation at least) does not calculate new vertex normals. Since the surface is distorted it needs new normals for proper lighting. The only way out is using normal-maps and per-pixel lighting.
That is a pretty big and complicated change!
The first game that will use per-pixel lighting is Doom3. (At least that I know of.)

Doom3 on the other hand has a problem with any geometry distortion computed on the video card. The engine uses shadow volumes, which have to be calculated from the final geometry. Since cards cannot return the computed geometry, it have to be calculated on the CPU to be usable for shadow volume calculation. This problem exist in skeletal animation, N-patches, DM, etc. This means the Doom3 skeletal animations will have to be computed by the CPU, regardless of the fact that VS can do it...

The situation will only change if some videocard will support hardware-shadow-volume-generation.

DM can still be used in games that doesn't use shadow volumes. Hardware shadow buffering or other simple texture based shadow algorithms can be used with geometry distorting techniques.

The other problem is the amount of work the artist has to put in to support DM. I won't go into detail just now, maybe someone can explain it better than me.
 
The amount of work of course depends on the issue at hand. To create a landscape or other less complicated objects like e.g. an asteroid through displacement mapping wouldn't be hard at all for an artist. I also see cool possibilities for animated displacement maps, or e.g. for dynamically/procedurally generated ones, what way we could e.g. have incredibly realistic rippling water that reacts realistically to any objects entering it. Loads of other gimmicks come to mind, but its mostly limited to simple scenarios or special effects. :)

Using Displacement maps to create characters (like in those Matrox demos) on the other hand is much more complicated. Being a character modeler myself, it'd mean totally changing the currently used aproach for character modeling for most artists out there, most importantly of all I don't see many obvious advantages in doing so. IMHO, unless we're getting into a level of tesselation where the actual displacement map is meant to replace what is currently done by bumpmaps, namely simulating wrinkles and veins amongst other very small detail on a character (and for that current hardware is nowhere near powerfull enough, even in software renderering we're usually still using bumpmaps for these minor details), I don't see it as beeing very usefull for character purposes. I'd prefer NURBS or other subdivision surfaces over displacement mapping any day when it gets to more complicated objects or characters.

Displacement maps are a good, neccessary and interesting feature, but nothing revolutionary that's dramatically going to change the way artists, or games work. Having had them at disposal in software rendering for years, I can only say that displacement mapping is occasionally being used for a variety of things, but is not one of the most commonly used features around by a long shot...
 
Back
Top