CAP 202 - Computer Animation II

Lesson 4 - Chapters 3 and 6


This lesson describes the creation of objects to use in an urban environment game. Objectives important to this lesson:

  1. Shaders
  2. Shader effects
  3. Texture tutorials

We continue with Chapter 3 (page 67) to discuss shaders and materials. Some of this material has been examined already, so chapter 3 will not seem too long.

A shader is defined on page 67 as "a mini-program that processes graphic effects in real time". This means that the effect can change with the light in a scene, and with the movement of a character. This makes it hard to display the effect of a shader in a still frame, but the author provides some stills that show impressive skin tones on page 68.

The concept may begin to sound more familiar in the discussion on page 69, where the author mentions the names Phong and Blinn. You may recall that these are shader types that are included in 3DS Max. This discussion becomes more interesting in the illustration on page 71. This page illustrates three separate maps being combined by a shader to get an interesting result. In this case, we see a diffuse map (for the main colors), a specular map (for the parts of the image that reflect the most light), and a normal bump map (for the parts of the image that show 3D relief). Again, this should remind you of applying these effects through the Material Editor in 3DS Max.

There is some new information about shaders in various parts of the chapter. On page 76, the author begins a discussion of the blend effect. You are informed that a blend shader can create a look in three basic ways:

  • additive - On page 78, we see an image of a brick wall as the base image, and an image of a beige skull and cross-bones (on a black background) as the image that will be added. The result is that the black areas in the added image are ignored, and the lighter tones are added to the first image: the skull and cross-bones look like they have been painted on the wall. The texture of the wall is undisturbed. The original image is mostly there, with some material from the additive image blended into it.
  • subtractive - This time we start with the wall again as the base, and the subtractive image looks like a black explosion (on a white background). This time, the subtractive process ignores the white background, and the black image overrides the pixels in the base image. It's as though there are holes cut in the base image through which we see the subtractive image.
  • average - On the upper right corner of page 78, we see an image of what might be a pattern of mold or dirt that will be applied to the base image. The result of the average process is an even blend of each pixel from each of the images. The details of both images are averaged into the result.
Chapter 6:

The author begins with a discussion of the need for detail in the environment of a driving game. He recognizes that the player will be trying to speed past any detail that the game artist provides, and that the game may use intentional blurs to enhance the illusion of speed. As such, there is little need for detail except where the racer will be moving slowly, or may be stopped. Be aware that not all games have this characteristic. Other game types allow the player to proceed at their own speed, exploring the environment as desired. Exploration can be one of the things a player will want to experience in a game, which is enhanced by a more interesting environment.

The author turns to a series of discussions that lead you to creating some textures for the urban setting. He has provided some art files on the CD (in the Project_Files folder) that will assist you in constructing these textures. You will also want to examine the illustrations from the text that are included in the Figures folder, because some of the illustrations are not reproduced accurately in the printed text. Figure 006-003, for example, looks very different on the CD from the way it looks in the book. We can assume that the one on the CD is more accurate.

Use PhotoShop to carry out the texture exercises starting page 156.

Exercise 8: Asphalt/Base Streets

Before you carry out the instructions to make a street texture, examine the several illustrations on page 158. The illustration labeled "Lines" is of no help, since it does not resemble what the author wants you to do.

If you look instead at the "Final" illustration in file 006-002.jpg on the CD, you will see that the author actually wants you to make a texture that runs from the middle of the street to its edge, with enough room to add an overlay for the sidewalk, which you will create in another exercise. Assume three lanes for traffic, with the yellow line at the edge opposite the sidewalk.

The street texture is meant to be tiled on one side of the road, rotated and tiled on the other side of the road. As noted above, the printed version of this image is not as clear as the one on the CD. I did not realize what the author wanted until I had already completed this exercise incorrectly. Save yourself some time by looking carefully at the desired final result first.

To add the yellow or white lines (page 157), try making a marquee selection in the current layer, the size you want a stripe to be. Then right-click, choose Fill, and use the options provided.

When the author tells you to open the second jpg file and copy it, try opening the file in PhotoShop, selecting the whole thing with a marquee, and pressing ctrl-c to copy it. Then return to your project file, and press ctrl-v to paste the image as a new layer. Continue as instructed.

Exercise 9: Base Cement and Sidewalk

Continue with this exercise, in which the author has resumed providing numbered steps. The base cement image in the text, again, does not match the one on the CD. Adjust settings as needed to get close to the author's reference image.

Continue with the remaining exercises in the text, as time permits. We will work on this lesson in class next week as well.