Your Ad Here

Creating a Displacement Map

In addition to bump maps, you can also use displacement maps which, unlike bump maps, perturb the geometry of an object to create ripples, ridges, or just plain bumps.

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.

 

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.

 

3. From the render tree’s Nodes menu, select a Texture to use as a displacement map. Once selected, it appears in the render tree work area.

4. Connect the output of the texture node (click on the red dot and drag the connector) 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.

Set the Max Displacement

5. With the object still selected, choose Get > Property > Geometry Approximation from the Render toolbar.

This creates a local copy of the shared Geometry Approximation property for the displaced object and opens the Geometry Approximation property editor.

6. On the Displacement tab, 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.

 

If you import a scene created in older versions of XSI 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.

Control the amount of displacement

7. 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.

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

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

 

The 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.

For more information about setting the Max displacement value, see Edit the displacement’s geometry approximation.

 

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.

Edit the displacements geometry approximation

To edit the displacement quality in the render region and in the final render, you can set the object’s geometric approximation.

10. With the displaced object still selected, choose Get > Property > Geometry Approximation from the Render toolbar. This creates a local copy of the shared Geometry Approximation property for the displaced object and opens the Geometry Approximation property editor.

11. From the Displacement tab, select a displacement approximation method:

- Parametric approximation—Useful if you have a largely flat-based surface, as well as some displacement.

- Length approximation—Especially useful when combined with view dependency because it lets you control the approximate number of triangles per pixel. It can be used along with Distance and Angle approximation.

- Distance approximation—Useful on objects that have a gentle curve, since they don’t usually have two neighboring triangles with a large normal distance. It can be used along with Length and Angle approximation.

- Angle approximation—Useful on objects that have localized areas with high curvature, such as a cube with rounded edges. It can be used along with Length and Distance approximation.

- Fine—Useful when you need extremely detailed approximation. this is a particularly good setting for rendering displacement because it requires far less memory than other methods, but can create very detailed results.

12. Adjust the approximation’s refinement settings.

Each method has its own refinement settings, all of which are described in Geometry Approximation in the Rendering guide.

Painting a Displacement Map

Using the Color at Vertices feature, you can paint a displacement map onto any polygon mesh object. This method is much quicker than applying an image as a displacement map. Depending on the density of the mesh, you can achieve accurate results using the Color at Vertices feature.

For information on how to use the Color at Vertices feature, see Vertex Colors.

To paint displacement onto a polygon mesh object

1. Select the polygon mesh object in any 3D view.

2. From the Render toolbar, choose Get > Property > Color at Vertices Map. This applies a vertex coloring support so you can paint directly on the object’s surface.

3. Press Ctrl+w to open the Brush Properties property editor.

4. On the Vertex Color Painting tab, select Luminance from the Color Paint Mode menu, and select to paint a grayscale value onto the object. The Opacity slider defines the gray with which you will paint the displacement.

5. Press Shift+w to activate the Paint Vertex Color tool. The 3D view you paint in automatically changes to Constant display mode.

Click or drag the brush tool over the areas that you want to paint.

 

If you wish to see how the Color at Vertices property affects the displacement in the rendered image, use the same camera view in a second 3D view and draw a render region in it. Keep in mind, though, that this slows performance.

Note: For the paint effect to be visible in the render region, you must first apply the Vertex_RGBA shader to the object. To do this in the render tree, choose Nodes > Map Lookup > Vertex RGBA and connect this node’s output to the material node’s Displacement input. Then open the Vertex RGBA node’s property editor and select the Color at Vertices property that you applied to the object (from the Vertex Property menu).

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.

 

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.

 

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.

 

 

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.



SOFTIMAGE|XSI v.6.01     

Return to Softimage XSI Index


Your Ad Here