Website powered by

Vector Displacement Converter (Nuke/Gizmo/Python)

Purpose

Vector Displacement is still unfamiliar to many in VFX Industry. How does it work? What is FlipAndSwitch number in ZBrush? Why exported maps are giving the wrong results? I had all these questions in my head, so I thought I should learn this in detail. after getting sufficient knowledge, I thought of creating a tool out of it.

Let's say we already have an asset done in Katana/Renderman, and we need to convert that to Maya/Arnold. Now, straight away, the existing Vector Displacement Map will not work for Maya/Arnold and need to be regenerated from ZBrush. The main purpose of this tool is to convert existing Vector Displacement Maps to other DCCs/Renderers. So artists don't have to worry about the technical part of it.

I wanted to explore tools creation in Nuke and how the thing works in the backend, as any Lookdev artist will always have access to the Nuke, and it's best for exporting images with the right Colorspace and desired file format.

Basic Information

A Vector Displacement contains XYZ 3D Space Coordinates which have positive as well as negative values. The Coordinate spaces have to match with the DCC/Renderer which is being used, as each DCCs/Renderers uses its own combination of 3D Coordinates. So there are 2 combinations that are used to get the right 3D Coordinate Space.

  • Flip - Channels flipping/Inverting. ( XYZ -> -XY-Z ) [Minus sign denotes negative channel]
  • Switch - Channels Switching/Shuffling. ( XYZ -> ZXY )

Hence, ZBrush used FlipAndSwitch Term. If we start having combinations out of these, we will get 48 combinations/ 48 Coordinate Spaces.

On top of that, there are 2 types of Vector Displacements, and both of them have their specific use cases.

  • World/Object Space - This Vector Displacement is used only on Non-Deforming/Static objects (Environments). World Space will not consider Object Transformations (Move/Rotate/Scale), which means, if you scale your object 5 times, you will see World Vector Displacement have 5 times less intensity. On the other hand, you will see the correct output in Object Space.
  • Tangent Space - This Vector Displacement is used only on Deforming objects (Creatures). Tangent Space will always take Object Transformations (Move/Rotate/Scale) into consideration.

How to use

You must have this information before doing the conversion.

  • Input DCC/Renderer.
  • Input Vector Displacement Type, whether It's World or Tangent.
  • You don't need to know the above 2 information if you already know the ZBrush FlipAndSwitch number. In that case, just click the ZBrush FlipAndSwitch option.

Once you have this information, you are all set to use this tool. Here are the basic steps.

  1. Load Vector Displacement Map in Nuke with correct Colorspace.
  2. Connect VectorDisplacementConverter Gizmo to the map.
  3. Select Vector Displacement Type, which will provide the required parameters.
  4. For World or Tangent, define Input DCC/Renderer as per the information you have. If you are going with ZBrush FlipAndSwitch, just type out the correct number.
  5. Define Output DCC/Renderer you want to convert to, or ZBrush FlipAndSwitch number.
  6. Add a Write node and save.

Parameters

Reset - Revert back everything to default values.

World/Object

  • Input - Input DCC/Renderer
  • Output - Output DCC/Renderer

Tangent

  • Input - Input DCC/Renderer
  • Output - Output DCC/Renderer

ZBrush FlipAndSwitch

  • Input - Input ZBrush FlipAndSwitch Number
  • Output - Output ZBrush FlipAndSwitch Number

No Need to Convert

It's all about FlipAndSwitch number. If Input and Output requires same Coordinate Spaces, then it will give a warning saying "NO NEED TO CONVERT !". This simply means you don't need the conversion and you can use your existing map directly.

Output

Current Limitation

  1. This tool can only convert a World Space map to World or Tangent Space map to Tangent.
  2. There are limited DCC/Renderer options in the tool as of now, the list will grow.