CAP 202 - Computer Animation II

Lesson 7 - Chapter 11

Objectives:

This lesson concerns the last chapter in the text, which is about normal maps and shaders. Objectives important to this lesson:

  1. Normal maps
  2. Shaders
  3. Creating a normal map
Concepts:

The author begins with a paragraph that does not seem to apply to the chapter. I wonder if he put it in to prove that the proofreader was not doing a good job?

The second paragraph of chapter 11 begins the lesson on normal maps. Over the next few pages, the author explains that a normal map is a map that simulates a complex surface on an object that does not actually have a complex surface. This topic was discussed earlier in the term. A normal map makes a low polygon model look and act like a high polygon model.

A normal map would just be a map if it did not make the low polygon model reflect light like a high polygon version of the same model. Page 339 explains that a normal is the direction a point on a face is facing. Think of every point on a surface as having a geometric face. That face must be "looking" in some direction. A normal map would include information about the direction that each point is facing (looking). Imagine a rolling landscape laid out in a grid. At each intersection in the grid, there is an arrow pointing not up, but perpendicular to the ground at that point. Some of the arrows will point up, and some will point at angles based on the curving landscape. These arrows are the normals for all of those points. (Look at the similar illustrations on page 342.) This becomes useful when we think about light in the next few pages.

The author moves on to discuss two lighting techniques that may be used in games that calculate lighting in real time.

  • vertex lighting - assigns a brightness value to each vertex of a polygon, and creates a gradient of light between those values
  • per-pixel lighting - a brightness value is assigned to every pixel

The discussion of how normals are used in calculating vertex lighting is interesting. The brightness of each vertex is calculated based on the angle of the light source and the angle of the normal of the vertex. As shown on page 340, this can be summarized as the angle between the normal and the light source. Greater angles make darker surfaces, lesser angles make brighter surfaces.

The author revisits the definition of a normal map again on page 341. He adds more to it: a normal map also includes the x, y, and z coordinate information for each normal that is in it. In other words, it remembers where the normal is located, including how high it is above the baseline of the figure.

3DS Max 2012 uses the red, green, and blue channels of a normal map for separate purposes. The red channel stores information for the left-right axis of the view in which it is captured, the green channel stores information for the up-down axis, and the blue channel stores information for what that view would have seen as vertical depth.

Exercise: Normal map tutorial on Vimeo

You can carry out this tutorial, with the notes below.

  1. The demonstrator begins by showing us a high poly count object whose features he would like to capture in a Normal Map.
    He has already created a low poly count version of this model. To create and use the Normal Map, you will need both such models. In my test of the procedure, I opened one of my soldier models, cloned it, and then added an Optimize modifier to make it different. I then collapsed the stack to simplify the new model.
  2. The demonstrator removes all the lights in his scene, then creates a new light that will help capture the Normal Map. On the Create panel, click the Lights tab, then toggle the dropdown to Standard and click Skylight.
  3. Before creating the Skylight, the demonstrator turns on the Cast Shadows feature, found on the Render rollout of the Create panel. He then creates the Skylight on the base grid of the scene.


  4. Autodesk provides a set of instructions that work from this point. The next step is to select the low poly count model.
  5. Open the Rendering menu and choose Render to Texture.
  6. On the dialog box that appears, find the Objects to Bake rollout. Locate its Projection Mapping group, and click the Pick button.
  7. You should see a new dialog box. Choose the high poly count model and click Add. This will add a Projection modifier to the low poly count model.
  8. You should now be back to the Projection Mapping group from step 6. Turn on Enable (if it is turned off). then click Options. You will not need to set any options at this time, but Autodesk wants you to know they exist.
  9. Find the Output rollout on Render to Texture dialog box. Select NormalMap element, and assign Bump as its target slot.
  10. Find the Selected Elements Unique settings group. Turn on the checkbox for Output into Normal Bump. Just above that section, turn on the checkbox for Use Automatic Map Size.
  11. Click Render. A new modifier will be added to the low poly count model. It contains the rendered Normal Map.