Displacement Maps

by Kenneth Styrberg

Relevant to Blender v2.35

Displacement mapping is a powerful technique that allows a texture input, either procedural or an image, to manipulate the position of rendered faces. The displacement is controlled like a NOR map, a brighter texture will have a higher displacement. Unlike Normal or Bump mapping, where the normals are skewed to give an illusion of a bump, this creates real bumps. They cast shadows, occlude other objects, and do everything real geometry does.

Displacement mapping is set up to behave as a texture channel, with one very important difference. In order to manipulate the positions of renderfaces smoothly, the faces have to be very small and this eats memory and CPU time.

For distant/non-critical items, NOR mapping should still be used. NOR maps, compared to Displacement maps, impose very little additional CPU cost per renderface, and you can NOR map independently of renderface count. Use of Displacement maps quickly leads to millions of faces in a scene.

Here we see the difference using NOR maps versus Displacement Maps in Figure 11.30, “Difference between NOR and Displacement Maps.”. The left object has 240 faces and the right has 60717 faces at rendertime!

Figure 11.30. Difference between NOR and Displacement Maps.

Difference between NOR and Displacement Maps.

Note

Use Displacement Maps when you need your geometry to be more accurate.

Displacement Maps on Objects

Here is a list, from best to worst, that shows how different object types work with Displacement Maps.

  • Subsurf Meshes (Catmull-Clark) size is controlled with the render subsurf level. Displacement will work great!

  • Simple Subsurf Meshes Control renderfaces with render subsurf level. Displacement will work, but there is a pitfall at sharp edges if the texture there is not neutral gray.

  • Manually subdivided meshes Control renderfaces with number of subdivides. This can slow editing down because you cannot turn down the subdivide level when editing dense meshes.

  • Metaballs Control renderfaces with render wiresize. A small wiresize gives more faces.

The use of Displacement Maps on the following object types is possible, but they can give normal errors and visible seams when rendered.

The face count is directly connected to the U/V resolution of the surfaces. Higher resolution gives more renderfaces.

  • Open Nurbs surfaces

  • Closed Nurbs surfaces

  • Curves and Text

Note

It is recommended that you convert curve and surface object types to meshes before applying displacement.

Interface

The interface to Displacement Maps is two buttons and two value sliders in Materials context (F5), Map To panel. (Figure 11.31, “Map To panel.”).

Figure 11.31. Map To panel.

Map To panel.

The intensity displacement is controlled with the Disp slider and the normal displacement is controlled by the Nor slider.

Displacement Map usage

There are two modes in which displacement works:

  • Displace rendered vertices by intensity, vertices move along vertex normals.

  • Displace rendered vertices by texture normal, vertices move according to texture's NOR input.

The two modes are not exclusive. The amount of each type can be mixed using the sliders in the Materials context (F5), Map To panel, Figure 11.31, “Map To panel.”.

Not all textures provide both types of input though. Stucci, for example, only provides Normal, while Magic only provides Intensity. Cloud, Wood and Marble provide both Normal and Intensity. Image provides both Intensity and a derived Normal.

Note

Texture OSA is not currently working correctly for images mapped to displacement.

Intensity displacement gives a smoother, more continuous surface, since the vertices are only displaced outwards. Normal displacement, gives a more aggregated surface, since the vertices are displaced in multiple directions.

Here is an example of the right-hand object in Figure 11.30, “Difference between NOR and Displacement Maps.”, but with a Nor slider setting of about 2.0. Note that the Nor button is still unselected! You can clearly see the more aggregated displacement when a Nor setting is used together with Disp.

Figure 11.32. Disp and Nor settings.

Disp and Nor settings.

The depth of the displacement is scaled with an object's scale, but not with the relative size of the data. This means if you double the size of an object in Object mode, the depth of the displacement is also doubled, so the relative displacement appears the same.

If you scale in Editmode, the displacement depth is not changed, and thus the relative depth appears smaller or bigger.

The texture's intensity defines the displacement. Neutral gray, RGB = 128,128,128, means no displacement. For positive displacement, Figure 11.33, “Positive Displacement selected.”, white is a peak, black is a trough.

Figure 11.33. Positive Displacement selected.

Positive Displacement selected.

For negative displacement, Figure 11.34, “Negative Displacement selected.”, it is reversed.

Figure 11.34. Negative Displacement selected.

Negative Displacement selected.

Example

Here is an example showing the effect the subdivision level has on the end result of displacement maps. This is a Catmull-Clark subdivision type and the texture is a simple Cloud texture added to an Icosphere. See the section called “Catmull-Clark Subdivision Surfaces ” for more on subdivision surfaces.

The subdivision levels range from 0 - (none) to 6 - (maximum) subdivision.

Figure 11.35. Subsurf levels 0, 1, 2, (top) 3, 4, 5 (middle) and 6 (bottom).

Subsurf levels 0, 1, 2, (top) 3, 4, 5 (middle) and 6 (bottom).