Table of Contents

This page provides information about V-Ray's normal map equalizer tool.


Overview


Normal map equalizer is a command-line tool used to correct any biases in the normal map so that the map appears neutral on a large scale and can be rotated without affecting the material's appearance. The tool equalizes the map outside the DCC application. The equalized normal map is then fed into the DCC and can be rendered with any Chaos renderer. 

Normal maps have become a standard way to describe surface detail for many PBR workflows. However, compared to bump maps, normal maps have some distinct peculiarities regarding rotation:

  • Rotating normal maps is not as simple as just changing the UV coordinates where to sample the normal map - the values from the map need to be adjusted as well to take into account the rotation. The VRayNormalMap texture has a special parameter that can perform the rotation correctly; other textures, such as the VRayTriplanarTex and VRayUVWRandomizer, also have built-in code for correct handling of normal map rotation.
  • Many normal maps found on the internet have an inherent slope or bias that causes them to produce a distinctly different look when the map is rotated (even if the rotation is performed correctly as per the point above). This is unfortunate because rotating a texture gives an additional degree of freedom when randomizing a material to avoid repetitive tiling artifacts.

The normal map equalizer tool is specifically designed to deal with the second issue. It ensures that the look of the material is preserved when a normal map is rotated and/or used in a utility like the VRayTriplanarTex or VRayUVWRandomizer texture. 

Note that all materials in the Chaos Cosmos material library are expected to have their normal maps processed with this tool so that they can be safely used together with the VRayUVWRandomizer texture.

The normal map equalizer tool currently works only with Windows OS.



Download Normal Map Equalizer Tool


Command Line Usage


The normal map equalizer tool is a command-line tool. Running it without any parameters in the Command Prompt prints a short usage guide.

To process a map with the normal map equalizer tool, use the following command:

normal_map_equalizer inFile outFile [-area fff] [-showProgress] [-numThreads nnn]

For example:

normal_map_equalizer forest_ground_4k.png forest_ground_4k_equalized.png

or

normal_map_equalizer forest_ground_4k.png forest_ground_4k_equalized.png -area 0.25 -showProgress


The inFile is the map file that needs equalizing. Note that you should add the file format of the image, e.g. png, jpg, etc. You can either drag and drop the image file into the command prompt if the image is in a different location from the normal map equalizer tool's executable, or you can type the file name if the image file is stored in the same location as the tool's executable file. The supported inFile formats are .jpg, .png, .exr, and .tiff.

Note that the tool currently does not handle mip-mapped .tx files: neither as an inFile nor as an outFile. To output a mip-mapped .tx file, first produce an equalized result of it in a PNG, JPG, or EXR format; then convert it to a tiled mip-mapped .tx file through any tool such as the makeTX tool from OpenImageIO.

It is important to note that any conversion to mip-mapped files (.tx or .exr) must be done on the resulting equalized texture.

The outFile is the texture output that is stored locally after the tool completes equalization. Use a name different from the inFile name to avoid overwriting files. The supported outFile formats are .jpg, .png, .exr, and .tiff.


Arguments


-area – This parameter is important and it roughly controls the size of the feature in texture space that needs to be "equalized". The default value works fine for many maps but it might need adjustment in specific cases. Normal maps that represent noisy surfaces may need a larger value here, while normal maps that represent surfaces with regular features (tiles, bricks) may need a lower value to avoid distortions.

fff is a floating-point number between 0.0 and 1.0 and determines the texture area for which to normalize. The default is 0.321 and works well in most cases.

-showProgress – Specifies whether calculation progress should be printed to the standard output.

-numThreads – Sets the number of threads used by the tool. The default is 0 - automatic number of threads.


Examples


The following example shows a Chaos material for grass downloaded from the Chaos Cosmos Library. The renders show the normal map from the grass material, and a medium gray diffuse color in order to show the effect of the normal map more clearly.


Normal texture with stochastic tiling but no rotation randomization

Normal texture with stochastic tiling and rotation randomization - squares of different illumination are clearly visible

“Equalized” normal texture with stochastic tiling and rotation randomization - the square artifacts are significantly reduced.



If you allow the normal texture to be randomly rotated for each tile, this leads to patches of different illumination due to the normal map having a built-in slope or bias. Equalizing the texture removes the artifacts to a large extent.


Original normal map

Equalized normal map

Difference between the original and the equalized normal map.


Was this helpful?