Displacement component

Courtesy of Meindbender

 

Displacement is a powerful texture-driven tool that can help users to create real geometric detail on objects. Contrary to bump/normal maps, the displacement feature simulates real geometry at render time as if it were actually modeled. This feature is very useful for adding fine detail to a mesh which would otherwise be difficult or impossible to model. Displacement uses a texture to define the geometric detail. Maxwell supports both 1D vertical displacement (also known as a Height Map) and 3D displacement (also known as Vector Displacement). 

Displacement Types - On the fly, Pretesselated and Vector

 

1D displacement map (middle) applied to a simple plane. Height Maps contain displacement information only in the vertical direction


3D Vector displacement map (middle) applied to the same plane. Vector displacement can specify direction in all three axis
 

 

Maxwell Render has three methods of displacement:

On the Fly

Maxwell Render's unique displacement technology that allows you to create virtually unlimited detail while using very little extra memory. This is a 1D height map displacement, so the mesh is subdivided and the local Y coordinate of each point is vertically displaced according to the values in a greyscale map. The object mesh is subdivided and displaced at render time, so the consumption of RAM is kept at almost the same levels as if no displacement was applied - although it will take longer to render, especially with bigger displacements.

This method is recommended for very fine, smaller/medium displacements, and when you need to prioritize the RAM consumption of your system.

Pretesselated

This is also a 1D height map displacement so the mesh is subdivided and the local Y coordinate of each point is vertically displaced according to the values on a greyscale map. In this case, the object mesh is subdivided and displaced before the voxelization, as a pre-process, so the pre-process and voxelization may take a bit longer, but as soon as the whole geometry is loaded into memory, the render is then much faster than On the Fly displacement. The only limit on the detail is how much RAM your system has, as all the geometry needs to be in memory at render time. 

This method is recommended for general purposes when the RAM in your system is not a limitation, as it renders much faster. 

Vector

In this type the displacement map is an RGB color map holding displacement information for both the X, Y and Z local coordinates of each point. As points can be displaced in the three axis, this type provides a surface with richer detail than simple 1D displacement height maps.  

 

Icon

Vector displacement maps can be created in 3D sculpting applications such as ZBrush, Mudbox or 3DCoat.

Adding displacement to a material

Only one displacement component can be added to the material, by right-clicking in the Layers list area of the Material editor, or from the Edit menu of the Material Editor.

To use displacement, you need an object with UVs and a displacement texture. The texture is similar to a usual grayscale bump map, with different shades of gray to describe elevation levels. Lighter grays will raise the geometry and darker grays will create cavities. Vector displacement maps are in color and 32bits, where red, green and blue describe both elevation and direction.

Example of very fine displacement using On the Fly displacement method

Displacement parameters

Map

Loads a displacement texture to access the displacement parameters. Maxwell Render can use 8, 16 or 32-bit grayscale displacement maps. It is recommended to use at least a 16-bit displacement image to create a smooth displacement, because 8-bit images may not contain enough gray levels (they contain only 256 height levels), so you may end seeing a stair-stepping effect if using 8-bit maps. 8-bit maps may be enough for displacements that do not require smooth transitions between grey levels, and additionally Maxwell Render’s texture interpolation helps to render even 8-bit images smoothly.

Icon

Vector displacement always requires 32bit maps

Subdivision

Before the surface is displaced, it is recursively subdivided, and this parameter is the measure of that subdivision level of the mesh: the higher the Subdivision value, the more accurate the result. With the on-the-fly displacement method, the more the mesh is subdivided during render time, the more it will influence the render time (in addition to Height which has the most negative impact on render time). Subdivision has no negative effect on render time when using the Pretesselated or Vector methods. These will instead require more RAM when rendering, depending on the level of subdivision you choose.

Subdivision and texture resolution are strongly related:

  • When specifying a low Subdivision value and using a high resolution texture with lots of detail, the final image will not show more detail than what is allowed by the Subdivision value.
  • When specifying a high Subdivision value but using a low resolution texture, the subdivision will reach the limit of the pixel detail of the texture and will not show a more detailed displacement. This is important to understand because you can optimize the displacement by starting with a high resolution texture and lower subdivision value, and keep raising the Subdivision value until the detail in the displacement is satisfactory.

An example of how surface detail is affected by increasing the Subdivision for the same texture can be seen below (this example uses the "Flat" subdivision method):

Different Subdivision values to control the subdivision of the mesh

 

The example above shows that going beyond a subdivision of 32 (in this particular case) would not add more detail while it would only increase the render time, or use more RAM. So it is important to avoid unnecessarily excessive Subdivision values. This depends of course on the resolution of your displacement map. A higher resolution displacement map will allow for more detail to be "extracted" from it.

Icon

Because the On the Fly and Pretesselated methods have a completely different approach to subdividing the geometry, the final subdivision in the render could be slightly different, but for most displacements, in general terms: On the Fly subdivision = Pretesselated + 1 subdivision

Adaptive

The Adaptive option locks the subdivision value to the given texture detail (at half pixel accuracy), which has the advantage of always creating the most detailed displacement that a given texture can provide. The user does not have to guess what the maximum subdivision value should be for that texture, or worry about exceeding it (which would increase render times but would not necessarily increase image detail - see example above). The adaptive mode should be used with care, because using a very large-resolution texture to represent some simple detail will result in unnecessarily long render times.

The larger your texture, the longer the render times with Adaptive mode on because it will always render the maximum amount of detail for that particular texture. 

Icon

Adaptive mode can add substantially to the render time, especially with large displacement textures. This mode should be used mainly to “test” your displacement textures first to see how much detail can be extracted from a given texture size. Then you can switch Adaptive off and manually raise the Subdivision value until a level of detail close to Adaptive mode is reached.

Subdivision Method

Define the method used to subdivide the mesh between Flat and Catmull/Loop. The Flat method subdivides the mesh, maintaining the original shape (a subdivided cube still looks like a sharp cube), while the Catmull/Loop method smooths the mesh while it it subdivides it, exactly in the same way as the Pixar OpenSubdiv feature. This subdivision method can be useful if you want to accurately subdivide a mesh using a displacement map extracted from a sculpting application such as Mudbox/Zbrush/3DCoat. For such maps it is generally a good idea to use Catmull/Loop, as this will much better mimic how those applications subdivide the mesh for sculpting.

Offset

This parameter allows you to specify which gray level in the texture should represent zero displacement. It is important that you set this parameter correctly, based on the way the displacement map was created. For example, some displacement maps may use 50% gray as zero displacement (darker shades than 50% in the texture will create cavities, lighter than 50% will raise the geometry). In this case, you should set the Offset parameter to 0.5 to get a proper displacement. If your displacement map uses black to represent zero displacement, set Offset to 0.

Icon

This parameter is not relevant when using Vector displacement.

Smoothing

Similar to the object’s normal smoothing angle setting, this parameter controls whether the displaced surface should render smoothly (continuous shading) or in a faceted way. It is generally suggested you leave this setting to “on”, unless you aim to render very sharp, detailed displacements such as sharp corners. Please note that the object's smoothing angle will still override the smoothing used for the object’s base mesh faces, so if the object’s smoothing angle is set to Flat (faceted rendering of the object), and the smoothing parameter is set to “on” in the displacement parameters, a smooth displacement surface will be rendered over a faceted base mesh surface.

UV Interpolation 

Allows you to choose the interpolation of the UV coordinates for the new geometry, choosing from: 

  • None: No boundary interpolation behavior occurs. 
  • Edges: All the boundary edges are sharp creases; boundary vertices are not affected. 
  • Edges and Corners: All the boundary edges are sharp creases and boundary vertices with exactly two incident edges are sharp corners. 
  • Sharp: Smooths only near vertices that are not at a discontinuous boundary. All vertices on a discontinuous boundary are subdivided with a sharp rule (interpolated through). 

Height Map Properties (for 1D displacement only) 

Height

This parameter sets the maximum distance displaced. This value needs to be greater or less than zero for displacement to appear. The white areas of your texture will be raised to the height value you set. Displacement height can be set in percentages or in absolute units:

  • Percentage (%): Sets the desired height as a percentage of the longest edge of the associated object’s bounding box. For example, if you have a car of 300 x 150 x 110 cm and you set height as 1, this means the peak displacement will be 1% of 300 (the longest edge of the bounding box) which is 3 cm to be observed as real length in render output. Using relative height is useful when you wish to preserve the same displacement height when scaling the object.
  • Centimeters (cm): Sets the height in centimeters to always displace to this given value regardless of object dimensions.

Vector 3D Properties (for 3D displacement only) 

Preset 

The different modeling and sculpting applications used to create vector displacement maps offer many different combinations of transforms and RGB mapping to compile the displacement information into the vector map. Given the huge amount of export map possibilities, Maxwell offers a collection of presets adjusted to the export methods of some popular sculpting tools that automatically set the fields with the corresponding options: 

  • Custom: Custom control over the Transform, RGB Mapping and Scale. 
  • ZBrush Tangent  
  • ZBrush World 
  • Mudbox Absolute Tangent 
  • Mudbox Object 
  • Mudbox World 
  • RealFlow 
  • Modo

Transform

Indicates if the displacement information coded in the vector file corresponds to displacement in Object, Tangent or World space at each point.

RGB Mapping

Indicates how the axis (X,Y,Z) are mapped to the R,G,B channels of the vector map. It's derived from the axis system with which the vector displacement map was created.

Scale

This parameter is used to control the overall size of the displacement (in X,Y,Z). Replaces the Height parameter (used in 1D displacement) because here the height values are derived from the map pixel values. It usually takes values lower than 1.0 on vector displacement maps saved in absolute tangent mode. 

Tips for using displacement

 

Icon

Tips to reduce the impact on render times:

Render times can vary greatly. These three factors play an important role in render times:

  • The base mesh vs. subdivision value (see below for details).
  • The height of displacement (for the On the Fly method, higher displacements will increase render times).
  • For the On the Fly displacement method: how many displaced surfaces and objects the rendered image contains. For example, a common usage of displacement may be for a brick wall seen from far away, taking up 30-40% of the rendered image. In this case, low height and subdivision values can be used, and the impact on render times will be minimal. On the other hand, a close-up render of a displacement object taking up the whole image, using high subdivision values, will need more time to render cleanly.

 

Base Mesh vs. Subdivision

The more polygons you have in your base mesh, the fewer subdivisions you will need to render the same amount of displacement detail. Displacements with fewer subdivisions will always render faster. For example, if you are planning to render displacement over a plane, model your initial plane using more than 2 triangles. The render time will not increase if your base mesh has many polygons.

Appropriate base mesh geometry

Objects made of evenly distributed polygons are preferable because they provide better quality. You should avoid base geometry with disproportionate triangles that converge to the same point. In areas with many small, converging triangles you may get artifacts when using displacement. This geometry is usually found in polygonal objects tesselated from NURBS geometry used in CAD applications. It is recommended that you introduce more iso-lines in the initial NURBS geometry in these areas to create more evenly-sized polygons. Some CAD applications allow good control over the tesselation, offering the creation of quads instead of triangles, or a limit to how long a triangle can be in the conversion.

Rendering sharp details

To render sharp details, consider turning off texture filtering. It will help you render sharper high-contrast areas in your texture. If you are using a moderate subdivision value, displacement will slightly smooth the rendered detail. In this case you should turn off Smoothing under the displacement options to render the details sharper. Keep in mind that turning off texture interpolation might reveal a stair-stepping effect if using 8-bit maps with smooth gradients.

Object Smoothing Angle

To avoid any possible artifacts or gaps in the displacement on objects which contain polygons connected at sharp angles, make sure you set an object Smoothing angle that exceeds the maximum polygon angle of the object (i.e. for a cube, it should be 90 or greater).

 

Related content: