Normal Mapping
Lightwave 3D

Introduction:

This tutorial will introduce the technology of Normal Mapping, and cover the basics of the Normal Mapping plugins (found below) which you will need.

Normal Mapping has been mainly used within 3D PC video games and various 3D engines. Game performance is better when there are less polygons to render, so naturally adding surface detail with maps is preferred over increasing poly counts. Normal Mapping gives visible volume and texture to surfaces without adding any geometry.

To understand Normal Mapping, one must understand Bump Mapping, because Normal Mapping is an advanced form of Bump Mapping. As you may know, Bump Mapping uses a grayscale image to add elevations to surfaces. With a range from black to white, (black being lowest and white being the most raised) the rendering software will offset the pixels making some look deep and others more raised on the surface. This is helpful to add surface definition without extra geometry.

Normal Mapping is the same concept, using the color values to offset pixels in a given direction to give extra detail without the extra geometry. However Normal mapping uses RGB values to determine pixel manipulation and offset. Where Bump maps portray highs and lows, Normal maps are the full rainbow spectrum and RGB values determine not only high and low but also x, y, and z axis pixel offsetting. Red's roughly indicate offset to the right, Blues left and down, Greens up and right. (just to give an idea)

Since Normal Maps use the full RGB spectrum they are almost impossible to paint by hand. (which is why there are plug-ins) To make the maps you need a hi-poly model and a low-poly model. The low-poly model must be UV mapped. The hi-poly will be read by the plugin and generate the Normal map to match the UV layout of the low poly model. This means you can get great details of a hi-poly model but on a low-poly model. (saving render times and making rigging easier with fewer polys)

In this tutorial you will learn the basics of the Normal Mapping plugins, get a refresher on UV mapping, and learn common Normal map troubleshooting techniques.

Before you begin:
  • Download the Normal Map plugins .zip file written by Marvin Landis
    link
    link(alternate)

  • Download the tutorial files .zip file
    link

  • Extract the two .zip files to a directory of your choosing
Loading the Normal Map plugins:
After launching Lightwave Modeler:
  • Go to the "Utilities" tab
  • Press "Edit Plug-ins" (alt+F11)
  • Press "Add Plug-ins" in the Edit Plug-ins window
  • Locate and select the files (.p) from the extracted zip
  • Hit Open

A dialog box will appear confirming the plugins were loaded: 
Press "OK". Then "Done" to close the Edit Plug-in window.

Preparing the models part I: Creating a UV map
In this part of the tutorial we will be using the tutorial files download previously.  Later you can make your own models to use.

This first section will review basic UV mapping.  If you feel comfortable with your UV mapping abilities feel free to skip down to the next section.
  • Open "tut_head_LO.lwo" (File > Load Object...)

  • Once in Points Mode (ctrl+G), select the top center point of the head and continue to select the center points down the back of the head to the bottom of the neck.
  • Press Ctrl+U to unweld these points
we are doing this so that when we cylindrically map the UVs, we have an open edge in the model, preventing UVs from stretching top to bottom on the map.




  • Go to the "Map" tab
  • Press "New UV Map"
  • Select Map Type: "Cylindrical"
  • Press "OK"


  • Change one of the viewports to "UV Texture"
  • If nothing has appeared:
    -make sure T is selected on the lower right part of the screen
    -make sure the T map select drop down is on "texture"
  • While still in point mode, adjust the points in the "UV Texture" viewport and make sure no polygons seem to be overlapping.

(this may require unwelding points (ctrl+U), hiding (-), and unhiding(\) geometry)





Manipulate the UVs until you get something similar to this.

Make sure to select all points and press m to merge
From here we will start using the Normal Map plugins.  You can save your work as "tut_head_LO_UV.lwo" OR  Use the "tut_head_LO_UV.lwo" already provided in the tutorial files .zip file you extracted.
Preparing the models part II: Adding the hi-poly model
  • Make sure "tut_head_LO_UV.lwo" is open
  • Open "tut_head_HI.lwo" (File > Load Object...)
  • Copy (ctrl+C) the hi-poly model
  • Switch to "tut_head_LO_UV.lwo"
  • Make sure layer 2 is highlighted and paste (ctrl+V) the hi-poly model into layer 2

Creating the Normal Map:
  • Select layer one (click)
  • Place layer two in the background (ctrl+click)



  • Go to the "Utilities" tab
  • Under the Plug-ins category, pull the "Additional" drop down to NormalMapCreate
Selecting Normal Map output settings:

Now we are into the interface of the plugin.  There are MANY options to be explored but we will cover the simplest yet best looking settings for a basic normal map.

 

  • Select "LW_JPEG(.jpg)" as "Normal map type"
     
  • Set the "Normal map resolution" (default 512) to 1024
     
  • Make sure the "Lo-res UV map" reads "Texture" (which should since that is our only map)
     
  • In the Advanced Parameters section, select Cutoff Angle: Smaller, and Samples per texel: 3 samples
     
  • Press OK
     
  • You will be prompted with a "Save Normal Map Image" box to select the output path
     
  • Make sure you are saving to the same directory as the tutorial files
     
  • Save as "norm_output.jpg" (feel free to replace the existing file)

At this time a progress bar will appear below your viewports and will indicate when the map output process is completed
 

Examining the Normal map: Identify and fix problem areas


  • Open "norm_output.jpg" using a graphics editing program such as Adobe Photoshop

As you can see there are some sharp edges in the map. Some near the mouth and others near the brow.

With this particular model the edges near the mouth do not show up much, but the eyebrow problem is quite distracting.

Sometimes sharp edges are purposeful and necessary depending on the geometry.  Sharp edges that match edges of the geometry are generally not a problem. Sharp edges will be a problem if they appear over a polygon's surface in the UV map.





The eyebrow trouble spots would have fallen on the flat surface of a polygon rather than on an edge

fixing these sharp edges is simple:

  • Use a blur tool over the area

    or
     
  • Use Adobe Photoshop's Patch/healing tools




  • Save the fixed image as "norm_fixed.jpg" in the same directory (or use the pre-existing "norm_fixed.jpg")

 

The Hi-poly model yielded us with a very detailed Normal map that matches the Low-poly models UV mapping coordinates.  Now its time to apply this normal map to our Low-poly model and check out what kind definition we get.


 

Applying the Normal Map: Enabling/adjusting the shader
  • Delete the Hi-poly model from Layer two
     
  • Open the Surface Editor (F5)
     
  • With the Surface named "Default" selected, Go to the "Shaders" tab
     
  • Under the "Add Shader" pulldown select NormalMapShader
     
  • NormalMapShader should now be in the shader list and have a check mark next to it indicating "On"
     
  • Double click "NormalMapShader", a 'Texture Editor - NormalMapTexture' window should appear.

  • Make sure 'Projection' is set to "UV"
     
  • Select "Texture" for 'UVMap'
     
  • Under 'Image' load norm_fixed.jpg
     
  • make sure Pixel Blending and Texture Antialiasing are enabled
Sending the object to Layout:
  • Save the object as "tut_head_LO_NORM.lwo" (or use the "tut_head_LO_NORM.lwo" provided in the tutorial files
     
  • Open Lightwave Layout and open "tut_head_LO_NORM.lwo"
    (File > Load > Load Object...)

From here add light in whatever arrangement you see fit. And establish your camera angle and/or preferred view.

Comparison and samples:
  • This is our 530 poly model. Smoothing: Off
    Antialiasing: Low
  • This is our 11,500 poly model. Smoothing: On
    Antialiasing: Low
    (very detailed surface and edges)
  • This is our 530 poly model.
    Normal Mapping: On
    Smoothing: On
    Antialiasing: Low
    (very detailed surface, some hard edges)
Assessment and Conclusion:
The last section really shows off the capabilities of normal mapping.  The low-poly model, once using the normal map shader, showed little noticeable difference from the hi-poly model.  The main difference is found in the edges, because the silhouette is still that of a low poly model.

The whole point though is to reduce the poly count, saving render times and boosting the capabilities of video cards in gameplay.

Normal Mapping works effectively out side of the game world also.  With figures, weight mapping can get hard to control when there are too many vertices. Normal mapping still gives a lot of capabilities for detail, when movement negates the need for excessive geometry, which can lead to better control over figures.

With the acceptable poly count for games on the rise, combined with technologies like normal mapping, video games will soon be able to soften those edges and close the gap in appearance between hi-poly and low-poly.

Normal mapping still requires making both hi-poly and low-poly, but there are many ways it can help give control and reduce render times without sacrificing too much detail. 

Now that you know its principle and capabilities, consider all the ways it can aid you in being more efficient with your work.