The following page describes how to use the Displacement Mapping feature first appearing in Blender 2.32.
What it is and When to use it. |
|
|
Displacement mapping is a powerful technique that allows a texture input, either proceedural, or image, to manipulate the position of rendered faces. 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 can do. The shaders/shadowbuffers/raytracer can't tell that you didn't model it that way. |
|
|
Displacement mapping is set up to behave as a texture chanel. With one
very important difference.
In order to manipulate the positions of renderfaces smoothly, they have
to be very small. For distant/non-critical items, NOR mapping should still be used. Compared to NOR maps, displacement imposes very little additional CPU cost per renderface, but you can NOR map independantly of renderface count. Use of displacement quickly leads to million face scenes. Use displacement when you need your scene to use more accurate geometry (note shadows on rightmost "cube"). [1] I am working on an adaptive subdivide that will only divide the faces that really need it. ie; if far from camera, or texture changing slowly, the renderfaces would remain large to speed up rendering. |
|
|
Currently there are at most 2 renderfaces per mesh face (or equivilent on other object).
If a quad face is not flat, it renders as two triangles.
To help get high renderface counts without bogging the machine down during editing, you can subsurf a mesh. The faces of the implicit surface (gray) are the faces that become renderfaces. Setting an object's material to WIRE, and selecting ALL EDGES (in editmode) is a good way to visualize the displaced renderfaces. |
|
|
To allow you to subdivide at rendertime without rounding off your edges,
a new type of subsurf has been created - "Simple subsurf".
By selecting "Simple Subdiv." as the subdivide type,
the mesh will be subdivided at rendertime to the level shown in the render
numbox, without changing it's overall shape.
To speed editing, it is best to keep the 3D view subdivide level low, and the render subdivide level high. But use caution. The amount of memory used for subsurf goes up tremendously at high values. It's not uncommon to lock up a computer for many many minutes this way. |
|
Where to use DisplacementDisplacement textures work for all 3D object types. However, because of need for fine renderfaces, not all objects are equally well suited for displacement mapping. |
|
From best to worst, displacement works the following object types using the
method listed to control the renderface size.
|
|
How to use Displacement | |
|
Simply put, divide the surface into small renderfaces with the above methods, then
use Displace like you would any texture.
There are currently two modes in which displacement works in:
The two modes are not exclusive. The amount of each type can be mixed using the sliders in the Material->MapTo panel. Not all textures provide both types of input though. Stucci, for example, only provides Normal, while Magic only provides intensity (derived from color). Cloud, Wood, and Marble provide both. Image provides both intensity and a derived Normal. The intensity displacement is controled with the new Disp slider. The Normal displacement is controlled by the Nor slider. Intensity displacement, gives a smoother, more continuous surfce, since the vertexes are displaced only outward. Normal displace, gives a more agregated surface, since the verts are displaced in multiple directions. |
|
|
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 inside editmode, the displacement depth is not changed, and thus the relative depth appears smaller. |
|
|
Neutral gray means 0 displacement.
For positive displacement, white is a peak, black is a valley. For negative displacement it is reversed. |
|
|
When making custom displace maps, start with a flood of 50% gray. Note how the edges of the cubes to the right remain sharp. If the background was not 50% gray, there would be a bevel or a lip there. Some adjustment can be done using the Texture->color panel's Brightness and Contrast sliders, but it is best to start off right. Sharp lines in disp maps, can cause normal problems, since a renderface can be requested to move only one of it's verts a great distance relative to the other 2-3. You tend to get better results if a small gaussian blur is run on the image first. |
|