This page is currently available only in English


Displacement

 

Table Of Contents


Overview

Displacement mapping is a texture-based technique used to physically displace tessellated geometry. It can be controlled by either a vector texture or height map texture, which is used to perturb the surface geometry. Unlike its cheaper 'sister' shader (Bump Map), displacement mapping affects shadows, since the geometry is actually perturbed.

To chain displacement-maps together we supply a Displacement Blender shader node which has been optimized to efficiently blend resultant displacement vectors together.

The output of this shader is a displacement vector, which when attached to the material displacement input will result in a perturbed surface position and normal.


Prerequisites

To make displacement mapping work, you'll need to enable tessellation and displacement on your object.

Please see the Tessellation and Displacement page for instructions and information on how to do that.

 

Examples

Simple Displacement

Here is an example of how displacement mapping can enhance the detail of simple geometry.

The scene consists of a simple plane that has been tessellated with the default mesh tessellation/displacement parameters and a displacement shader driven by a vector displacement map has been connected to the displacement input.

 

In the image below, see how an otherwise flat surface has geometric detail? The displacement vector map contains a different test in each quadrant. Top-left demonstrates fine perturbation high frequency detail coming out of the plane. Top-right demonstrates large perturbation low frequency detail coming out of the plane. Bottom-left demonstrates large detail, but as an indentation, going into the plane and bottom-right demonstrates fine detail going into the plane. More importantly, note how the top-right tower appears distorted and the lighting looks wrong - this is because the 'Max Displacement' of the mesh is default to 1.0 and so the displacement is being capped to that.

 

To compensate for the stumpy tower we increase the "Max Displacement" setting in the mesh properties to 4 as seen below.

 

 

Now the tower stands in all its glory, including the indented tower as can be seen in the bottom-right.

 

Finally, if we disable "Auto Bump Mapping," below we can see how the low frequency detail towers don't look any different but the fine details now look blurry. Auto-bump mapping allows us to achieve a similar level of visual quality without needing to tessellate the mesh to a ridiculous level which is not recommended as it can have severe performance costs.

 

ZBrush Vector Displacement

To use a vector displacement map (VDM) from ZBrush it is important to properly setup your ZBrush export preferences.

There are two types of vector displacement, object space or tangent space. Object and World space should only be used for static objects while Tangent space should be used for moving and deforming objects and can also be used for static objects.

ZBrush can be configured to export vector displacement maps in many different ways but Redshift requires the following specific values:

These can be configured by going to the "Import/Export" section of the ZBrush "Preferences" menu as pictured below.

Configuration for Object / World Space Configuration for Tangent Space

 

Vector displacement export is controlled by the settings found in the "Vector Displacement Map" section of the "Tools" panel as pictured below.

Vector Displacement Map settings

 

To control which type of vector displacement map is exported use the following settings:

Once appropriately configured the "CreateAndExport VDMap" button or Multi Map Exporter can be used to save the vector displacement file to disk.

When using the VDM in Redshift remember to interpret the file as raw (not color managed) and set the Map Encoding parameter to "Vector" and the Space Type parameter to match Object or Tangent respectively.

Object /World Space settings Tangent Space settings

 


Parameters

 

Texture

TexMap

Connect a texture sampling shader node here to set the displacement map input.


Scale

This scales the displacement value that is read from the texture. A value of 0.0 effectively disables the technique, yielding the original surface. Greater values increase the displacement effect. Negative values invert the direction of the displacement. The default is 1.0.


Map Encoding

This determines the type of displacement to do, given the texture input type:


Space Type

When computing vector displacement, it can be done in the following geometry space:


Only applicable to Vector type Map Encoding.


UV Set

Specify a UV Set other than the default here.


Change Range

Old Range Min / Max

The range of values that are read from the displacement/bump texture.


New Range Min / Max

The new range the values will be mapped to.