Displacement Maps

 
 
 

Displacement maps, though similar to bump maps, actually modify objects' rendered geometry according to an image map. This creates bumps, ridges, and other surface variations that cast shadows that correctly follow the displacement.

A displacement map is a scalar map that displaces a surface at each point in the direction of the object's normal: the geometry is distorted according to the map during the rendering process. Unlike regular bump mapping that "fakes" the look of real texture, the edges are visibly raised and can cast shadows that follow the displacement effect. Displacement affects the geometry of the object during the rendering process.

Displacement map (A) and bump map (B).

To create a displacement map

  1. Select the object whose surface you want to displace.

  2. Open a render tree (press 7) and expand the object's Material node to reveal the Displacement port.

    The Material node's displacement input port (A).

  3. From the render tree's Nodes menu, select a Texture to use as a displacement map. Connect an image and select a texture projection as necessary — for more information see Applying a Texture.

  4. Connect the output of the texture node to the input of the Displacement parameter of the Material node.

    Even though the texture node's color output and the Displacement input's scalar input are not directly compatible, the render tree automatically inserts a Color2Scalar node to connect them.

  5. Apply or edit a Geometry Approximation property as described in Applying and Editing Geometry Approximation [Scene Elements], and set options as desired on the Displacement tab.

    In particular, set the Max Displ. setting to specify the maximum amount of displacement allowed on your object. A value of 0 disables the displacement while higher values limit the amount of displacement. It is critical that you set this parameter correctly because wherever an object's displacement exceeds this value, it will be clipped to this value (without creating a hole in the geometry). Make sure to set it high enough to accommodate the desired level of displacement.

    For a complete description of all options, see Geometry Approximation Property Editor [Properties Reference].

    NoteIf you import a scene created in older versions of Softimage where the Max Displacement setting did not exist or was set to 0, it will be automatically set to 2. Clipping may still occur if an object's render tree creates more extreme displacement than that.
  6. Now that the displacement has been applied, you probably want to adjust its intensity. You can do this by choosing the Nodes Image Processing Intensity shader.

  7. Connect the Intensity shader between the texture shader that is creating the displacement and the Color2Scalar node.

  8. Double-click the Intensity shader to open its property editor and adjust the Factor parameter to control the displacement on the object.

    ImportantThe amount of displacement on an object cannot exceed the limit specified by the Max Displacement value. If the level of displacement does exceed that value, it will be clipped to whatever the specified Max Displacement value is.

    A

    Texture used.

    B

    Positive displacement factor

    C

    Negative displacement factor

    A displacement map on an object affects the rendered geometry (not the wireframe) of an object. Hence, creating a jagged displacement map (like the one shown previously) would cause jagged shadows of the texture. Displacement is controlled via the Intensity shader placed between the material node and the texture used to create displacement.

  9. For moving objects with displacement, you can optimize the displacement approximation depending on how fast the object is moving by setting the Shutter Settings option on the Render Type tab of the mental ray Render Options Property Editor [Properties Reference]. The automatic reduction of displacement detail on moving objects has a significant impact on rendering performance and memory consumption by cutting down on the typically huge amount of tessellation data that gets generated.

    The displaced geometry should have a geometry approximation property applied to it and motion blur must be enabled for the render region and/or the render pass. See Defining and Rendering Motion Blur [Cameras and Motion Blur].

Creating Displacement: Render Tree Examples

This section provides some examples of shader networks that you can build, in the render tree, to create displacement.

Example 1: Creating a Displacement Map with an Alpha Channel

This example lets you use an image's alpha channel to create a displacement map on an object. You don't have to use the same texture to drive the diffuse or specular values of the object. In addition, the Alpha can be independently controlled with the Factor slider.

Although this example creates displacement, it is just as easy to create a bump map or use the alpha to define a texture.

Node

Function

A

Material node: Acts like a placeholder for any shader that can affect an object's look.

B

Phong: The Phong surface shader, which defines the surface of the object.

C

The Color2Scalar shader converts the Color2alpha shader's color output into a scalar value needed to drive the displacement.

D

Color2Alpha: This color channel tool shader extracts the Alpha channel from an image.

It can be independently controlled using the Factor slider in its property editor.

E

The Image shader defines which image you wish to use as a texture and how to project it.

In this example, the word "Alpha" was applied to a texture, but is only visible in the Alpha channel.

Example 2: Creating Displacement with Fractals

The material node's displacement input is the key to creating realistic displacement maps and animating them, too. This example uses a simple NURBS grid with a moderately high number of subdivisions.

This chocolate-like surface was created using a simple Fractal procedural shader. Once the desired fractal values were obtained, an Intensity shader is used to control the overall displacement.

Node

Function

A

Material node: Acts like a placeholder for any shader that can affect an object's look.

When shaders are connected to the Displacement parameter, they directly influence the surface displacement of an object.

B

Phong: The Phong surface shader, which defines the surface of the object.

In this example, it was given a silky, chocolate color.

C

The Color2Scalar shader converts the Intensity shader's color output into a scalar value needed to drive the displacement.

D

The Intensity shader controls the overall strength of the Fractal node. This is a good shader to have connected to the Displacement parameter at all times.

Shader D is connected to this shader's Input parameter.

E

The Fractal shader defines a fractal pattern which can then be animated.

Edit the Fractal parameters to achieve different looks. Start with a Threshold value above 0.5. This shader should have an XZ planar projection defined.

Tip

To further smooth the displacement effect, edit the Geometry Approximation's displacement value.

You can access this by selecting the object and choosing Selection Geometry Approximation from the Select panel. On the Displacement tab, edit the Steps parameter.