Normal Maps

This information is here because while normal maps are widely used they are not always understood. This is provided as assistance to emerging CG artists.

What is a Normal Map?

A normal map is a file that controls how surface normals appear on a model at render time. It works by manipulating the standard surface normal thereby "fooling" the renderer into behaving as if there is lots of detail. Surface Normals

The geometry surface normal (typically stored with every face of a model) is a mathematical construct used at render time to determine the orientation of a surface. The geometry normals are oriented perpendicular to each face (triangle) and vertex of the model. This is important for determining fundamental rendering properties such as shading and visibility. By manipulating this surface normal, the illusion of high detail can be created on a low detail model.

A normal map is stored as an image file but instead of RGB data the file stores XYZ data.

  • The red channel is left to right (X) calculated as -1 to +1, stored as 0 to 255.
  • The green channel is down to up (Y) calculated as -1 to +1 stored as 0 to 255.
  • The blue channel is height off the surface (Z) which cannot be negative, calculated as 0 to 1, stored as 0 to 255.
  • A normal pointing straight away from a surface has the values (128, 128, 256) for (x, y, z).
  • When viewed as an image, normal maps often appear pastel coloured with a bluish cast. This is because while there are large variations in the values of X (red) and Y (green), the Z (blue) value is always pointing directly away from the surface and doesn't vary much.
  • Most normal maps used in 3D rendering are stored as tangent space values, which means that the normals are always pointing away from the surface (perpendicular to the local tangent), no matter which way the surface is facing. This type of normal map is also referred to as being in object space.

    Creating Normal Maps

    Although you can view a normal map as an image, it is very difficult to paint them by hand. There are many ways to create normal maps including within most modelling programs and specialized software.

    Combining Normal Maps

    It is often desirable to combine two normal maps to get a richer result. For example: To create a "dragon skin" look you might want to add a leather-like normal map to skin folds you've created using Z-brush or Mudbox.

    The method for properly combining normal maps to create more complex looks is not obvious and is often done wrong. Simply blending the two normal map images together gives a result that might appear OK at first glance, but used in a render will produce incorrect results. The fact is that the normals are mathematical vectors (not the colours you see) and to be combined correctly they be added together or subtracted from each other to get a correct result.

    To properly combine maps, we need to add the positive values (> 128) together and subtract the negative values (< 128). Fortunately this can be done inside Photoshop using the channel mixer to properly combine each vector.

    The following steps in Photoshop will properly combine two normal maps.

    Follow these steps carefully.

    1. Open either of the two normal map images you wish to combine, and copy the layer to create two identical layers. Name one layer Add and the other Subtract.
    2. Adjust the Levels
      • To the Add layer: In the Levels window, adjust each channel separately, setting the red and green input levels to 128, 1, 255 and the red and green output levels to 128, 255. Set the blue output levels to 0, 0 to mute this channel.

      • To the Subtract layer: In the Levels window, adjust each channel separately, setting the red and green input levels to 0, 1, 127 and the red and green output levels to 0, 127. Leave the blue channel as is.
    3. Use the Channel Mixer to shift the Add and Subtract layer pixel values to either side of the midpoint (128).
      • To the Add layer: In the Channel Mixer again operate on each output channel separately. For the red channel, set the source channel values to (+100%, 0%, 0%) for (r, g, b) and the constant to -50%. The green channel is similar, except that the source channel for green is set to +100% with the others at 0%. The blue channel has the source channel for blue set to +100% but the constant is set to 0%.
      • To the Subtract layer: Channel mixer values are similar to the Add layer except that the %'s are set to -100% for the source channels and +50% for the constant. For the blue channel, also set the source blue to -100% but set the constant to +100%.
    4. Set the blend modes:
      • For the Add channel, set the blend to Linear Dodge.
      • For the Subtract channel, set the blend to Difference.
    5. Now, import the other normal map image as a layer below the Add and Subtract layers created in the steps above. Flatten the result and save as a TIFF or PNG file.
      • TIFF settings: use LZW compression and discard any layers.

       

     

    The files used in this example can be downloaded from this link

    Go to Rock Farm Home



    =======================================================

    Contact Markus Tessmann at figure@rockfarm.ca

    Please view his resume here

    Go to Rock Farm Home

    =======================================================

    .