↑ Return to Exporting Your Model

Vector Displacement Maps

Share
Vector Displacement

Vector Displacement in action

In addition to traditional Displacement and Normal Map creation, ZBrush 4R3 introduces the option to create Vector Displacement maps.

This map type provides the best of both worlds and helps your other software’s rendering engine recreate all the fine details originally found in your sculpture.

About the Vector Displacement Maps

To understand Vector Displacement, it is important to have a solid grasp of how traditional Displacement maps work.

When creating a displacement maps, ZBrush compares your model’s currently selected subdivision level with the details of its highest level. It then calculates a map that represents the differences between the two levels, capturing the details of the high-level sculpt.

Displacement maps are generated as a grayscale image that uses the black-to-white intensity variations to push the rendered surface in or pull it out, effectively changing the silhouette of the model. It is important to note that this deformation is always along the point’s surface normal – perpendicular to the model’s surface.

Normal maps do not move rendered points. Instead, these maps alter the surface normal, using RGB color values to tell the rendering engine how to change the way light reacts to the surface. They create the illusion of fully 3D detail within the silhouette of the model but cannot actually deform the surface’s shape.

Normal maps render extremely quickly and work best with high resolution details. Displacement maps take longer to render, but are the only way to reproduce details that change the shape of the model. Many artists find it useful to create a normal map for the highest resolution details and a separate displacement map for medium resolution details. This combination combines the shape changes of a displacement map with the speed of a normal map.

Most of the time, displacement and/or normal maps are enough to reproduce your high resolution mesh with all its details. But there are a number of scenarios where traditional maps can’t accurately reproduce the ZBrush model’s surface. One of the best examples is a simple mushroom: If your base mesh is a 4 sided polygon and your finished sculpt is a nice mushroom, a displacement map will only accurately reproduce the mushroom’s cap. The stem would look like an extrusion from the cap’s outer edges.

In short, displacement maps are useless for any type of surface change that is not perpendicular to the base mesh’s polygons.

Vector displacement incorporates elements of a normal map by using RGB colors to add a directional value to each of the map’s pixels. Like other difference maps, it compares the model’s current subdivision level with its highest level, but because of the vector value it can move the rendered surface to perfectly match the high resolution sculpt.

Above is the sculpted mushroom, rendered with a vector displacement maps and a “traditional” displacement map

Above is the sculpted mushroom, rendered with a vector displacement maps and a “traditional” displacement map

Not all rendering engines support vector displacement maps. If your rendering engine is one that does, we recommend using them as they will produce the most accurate results.

As with displacement maps, you can create 16-bit maps (which need an additional factor value to render your sculpt accurately), or 32-bit maps (which effectively have the factor value baked in). Of course, if your rendering engine supports 32-bit maps it is best to work with that format.

 

Diagnostic File for the Perfect Export Settings

Bear in mind that vector displacement maps are not yet standardized within the industry. Each rendering engine approaches them in a different way, and can execute the various render steps in a different order. As a result, a map that works perfectly in one rendering engine will likely produce an inaccurate render in other engines. You will need to experiment to find the correct combination of color order and direction for your pipeline.

There are 48 possible combinations of export settings located in the Import Export Preferences, such as NormalMapFlipX or NormalMapFlipYZ

The Flip and Switch options, located in the Preferences >> Import-Export palette

The Flip and Switch options, located in the Preferences > Import-Export palette

To avoid you having to manually testing all these different combinations, ZBrush has an option to Creates diagnostic files based on your export settings in the Tool >> Vector Displacement Map sub-palette. These diagnostic files are comprised of an OBJ file, a diffuse map and the generated vector displacement map.

The Diagnostic file, rendered in modo from Luxology. Notice the 1st square with the perfect sphere, even if some UVs seams are visible

The Diagnostic file, rendered in modo from Luxology. Notice the 1st square with the perfect sphere, even if some UVs seams are visible

All you need to do is load all the OBJ file into your favorite 3D package and create a material in which you import the vector displacement map and the diffuse map. Now render the 3D model to see a grid with floating 3D shapes in front of a numerated checker. One of the shapes should be a perfect sphere while the others are degenerated models or non-spherical shapes.

Note: You only need to worry about how perfectly spherical each shape is. Your result may have UV seams visible or some polygon artifacts, but that doesn’t matter for the diagnostic test.

Beneath each shape is a number. Note the number found beneath the perfect sphere shape. Then you simply need to return to ZBrush and set Preferences >> Importexport >> FlipAndSwitch as well as Tangent FlipAndSwitch to this value. For example, if you are creating a World map for use in Maya 2012 you would see the sphere to be over the number 7 and that is what you would set ZBrush’s FlipAndSwitch slider to. Now save your settings by clicking Preferences >> Config >> Store Config. Alternatively, use the Ctrl+Shift+I (Cmd+Shift+I for Mac) keyboard shortcut.

Once your Importexport sliders have been set for your target application and saved, all of your vector displacement maps will export correctly for that particular renderer.

Here are the settings for a few external applications:

  • Maya 2012: 7 FlipandSwitch for a World map.
  • Modo 501 SP6: 1 TangentFlipandSwitch for a Tangent map.
  • 3DSMAX 2012: 7 FlipandSwitch for a World map.

UV Seams and Vector Displacement Maps

As with normal maps, vector displacements are really sensitive to UV seams. Depending on your settings and target application, these seams may be more or less visible. Unfortunately, this problem can’t be avoided. As powerful as vector displacement maps are, they do mix the negative aspects of displacement maps and normal maps.

The best practice is to carefully place your UV seams on areas which will be hidden (or at least less visible) in the final render.

16-bits and 32-bits Vector Maps

Just like with traditional displacement maps, ZBrush can produce 16-bit and 32-bit vector displacement maps. The main advantage of 32-bit maps is that you don’t need to enter a depth factor to producing an accurately displaced render. This means less effort for an even more accurate result.

The information provided by ZBrush when generating a 16-bit map with its factor value

The information provided by ZBrush when generating a 16-bit map with its factor value

Due to their increased accuracy and reduced effort, most rendering engines now support the 32-bit mode. If it is at all possible for you to do so, we recommend using this mode. ZBrush can export vector displacement maps in the RGB TIFF and OpenEXR file formats. OpenEXR is advised for most applications, including Luxology modo or Autodesk Maya and 3DSMax.

Vector Displacement Map Workflow

As with the generation of traditional displacement and normal maps, ZBrush must compare the low resolution and high resolution levels of a model to calculate the differences between them. ZBrush then creates a map of these differences, using the object’s UVs. Before generating your vector displacement maps, follow these steps:

1. Make sure that your model has more than one level of subdivision and UVs.

2. Go to the lowest level of subdivision.

3. Define your UV Map size in the Tool >> UV Map sub-palette.

4. Use the Tool >> Vector Displacement Map sub-palette to set the options of your choice for the map’s depth, mode and smoothing options.

5. Click the Create and Export Vector Displacement Map button to generate and export your map.

6. For 16-bit maps: Upon export, ZBrush will display the map’s depth factor in the progress bar near the top left of the interface. Please write this number down for use in your shader settings in the rendering application. (If you are creating a 32-bit map, this value will always be 1.)

7. Export your base mesh model as an OBJ file or use GoZ to export it to your application of choice. Either way, you can now set up your materials.

Note: GoZ doesn’t support vector displacement maps at this time. This means that you must manually add the map to your existing shader and adjust its corresponding options.

 

Vector Displacement Map Options

Vector Displacement maps have only few options which can impact the final result. These settings are quite important, however, and may dramatically improve the compatibility with your target rendering solution.

The Vector Displacement Map sub-palette, located in the Tool palette

The Vector Displacement Map sub-palette, located in the Tool palette

Vector Displacement Tangent / World

The vd Tangent option sets how the vector displacement map is computed – whether it’s based on the normal of the polygons or based on the world axis. With it turned on, ZBrush will create a Tangent map. Turned off will produce a World map.

Because animated objects are in motion relative to the world coordinate system, Tangent mode must be used any time your model will be animated. World mode is suitable for static (non-animated) renders.

Vector Displacement 32-Bits /16-Bits

The vd 32Bit mode defines the depth of the computed map and of course, its accuracy. With the vd 32Bit button activated, ZBrush will generate a 32-Bit map. With this button deactivated ZBrush will generate a 16-bit map. In this latter case it is important to note the alpha depth factor value which will be displayed at the top of the interface once the map has been created.

The benefit of 32-bit maps is that you don’t need to set a depth value in your render engine to produce accurate results.

Please refer to the 16-bit and 32-bit Vector Maps section above.

Vector Displacement Smooth UV

When turned on, the vd SUV option smooths the model’s UVs when producing the displacement map. This option should be enabled if your rendering engine uses smoothed UVs.

  • When SmoothUV is enabled for generating maps, all UV borders will remain frozen when smoothing.

Vector Displacement Surface Normals

The vd SNormals option smooths the low resolution model’s surface normals and results in a smoother map.

Create and Export Vector Displacement Map

The CreateAndExport VDMap button will take all other settings into account to compute your vector displacement map. It will open a system window asking you for your file name and the location where you wish to save it.

You will have the option to save the map as a TIFF file or Open EXR.

Create Diagnostic Files

This operation will generate a set of diagnostic files, useful to determine the correct Preferences settings for your vector displacement maps when rendered in your particular target application. These files will be created based upon the other settings in the Vector Displacement Map sub-palette.

Please refer to the Diagnostic File for the Perfect Export Settings section for more information.

Vector Displacement Flip Options

These options, located in the Preferences >> Importexport sub-palette have a huge impact on the result of your render. They define whether the axis vectors are flipped or not. Please refer to the Diagnostic File section above.