Displacement

Like the DisplaceGeo node, the Displacement shader node also performs displacement mapping, and at first glance the nodes seem very similar. However, the approach they have on performing displacement mapping is different.

Displacement mapping is a technique for adding geometric detail to object surfaces as you render them. Unlike the DisplaceGeo node, the Displacement node does this on the fly, only displacing those parts of the geometry that are visible at any given moment. Displacement considers the point of view of camera to determine which parts of the displacement need rendering, thus saving render time. It’s also possible to optimize the level of tessellation to be the level that you need for an object at a certain distance.

Inputs and Controls

Connection Type

Connection Name

Function

Input

normal

An optional map for calculating the normals (an RGB image where each pixel corresponds to the X, Y, and Z coordinates of a surface normal).

displacement

The image to create the displacement from.

unnamed

Either:

The 2D image you’re using for the surface texture, or

Another shader node, such as Diffuse, Specular, or Emission. Adding several shader nodes one after the other allows you to produce more complex effects.

Control (UI)

Knob (Scripting)

Default Value

Function

Displacement Tab

displacement channel

displacement_channel

luminance

Choose the channel from the displacement input that you want to use as the displacement map:

red - use the red channel.

green - use the green channel.

blue - use the blue channel.

alpha - use the alpha channel.

luminance - use the luminance.

average - use the average of the red, green, and blue channels.

normal expansion

normal_expansion

none

If you’re using the normals input, uncheck the build normals box and choose how you want the normals to be calculated:

none - to use the normals as they are (XYZ).

XY - to multiply the normals in the x and y dimensions (2*XY-1).

XYZ - to multiply the normals in the x, y, and z dimensions
(2*XYZ-1).

scale

scale

0.1

An overall multiplier that scales the displacement at each vertex.

filter size

filter_size

5

The size of the filter to use when sampling the input image.

filter

filter

Cubic

Select the filtering algorithm to use when remapping pixels from their original positions to new positions. This allows you to avoid problems with image quality, particularly in high contrast areas of the frame (where highly aliased, or jaggy, edges may appear if pixels are not filtered and retain their original values).

Impulse - remapped pixels carry their original values.

Cubic - remapped pixels receive some smoothing.

Keys - remapped pixels receive some smoothing, plus minor sharpening (as shown by the negative -y portions of the curve).

Simon - remapped pixels receive some smoothing, plus medium sharpening (as shown by the negative -y portions of the curve).

Rifman - remapped pixels receive some smoothing, plus significant sharpening (as shown by the negative -y portions of the curve).

Mitchell - remapped pixels receive some smoothing, plus blurring to hide pixelation.

Parzen - remapped pixels receive the greatest smoothing of all filters.

Notch - remapped pixels receive flat smoothing (which tends to hide moire patterns).

Lanczos4, Lanczos6, and Sinc4 - remapped pixels receive sharpening which can be useful for scaling down. Lanczos4 provides the least sharpening and Sinc4 the most.

build normals

build_normals

enabled

Check this to automatically calculate the normals after the displacement.

Uncheck this to have the normals calculated from the normals input according to the normals expansion control.

Tessellation Tab

max subdivision

displacement_max_tessellation

4

Sets the number of times that the polygon subdivision is applied.

mode

displacement_mode

screen

Select the polygon subdivision mode:

uniform - uniform polygon tessellation.

screen - evaluates dependent tessellation and ensures that no new triangles are generated once a certain screen size is reached.

adaptive - tessellate according to the displaced geometry complexity.

pixel edge length

displacement__edge_length

20

Sets the length, in pixels, of the subdivision polygon edges.

No polygons are generated beyond this threshold.

edge threshold

displacement_edge_threshold

0.01

Sets the edge threshold controlling subdivision. Edges larger than this get subdivided automatically, edges smaller than this get subdivided based on the normal threshold and the displace threshold. The smaller the threshold, the higher the amount of tessellation.

Note:  The displacement mode must be set to adaptive to enable this control.

normal threshold

displacement_normal_threshold

0.9

Sets the normal threshold when detecting changes in the normal orientation of the displaced samples. A value of 0.0 indicates normals with the same orientation. A value of 90.0 indicates orthogonal normals. The smaller threshold, the higher the amount of tessellation.

Note:  The displacement mode must be set to adaptive to enable this control.

displace threshold

displacement_displace_threshold

0.01

Sets the displace threshold when detecting changes in the height of the displaced samples. The smaller the threshold, the higher the amount of tessellation.

Note:  The displacement mode must be set to adaptive to enable this control.

Step-by-Step Guides

Modifying Objects Using an Image - Method 2