Maps and Mapping - March 2005
Ted Boardman tedb@tbmax.com http://www.tbmax.com
While it is still the middle of February here in New Hampshire, there are indications that spring will eventually get here. Last weekend drenching rain blew in from the northeast all one night and the better part of the next day until it eventually turned to snow and deposited nearly 7 inches before morning. It really looked like winter was back for the duration.
And now, a few days later, the sun emanating from bright blue skies is warming temperatures to over 50°F and nearly has my un-shoveled driveway down to bare, black pavement. If the temperatures hold, as they're supposed to for a few days more, I would almost expect to see crocuses poking their noses through the dirt on the sunny side of some houses. But, just as likely, I'll see another 7 inches of cold wet snow.
One very positive sign of spring that isn't likely to go away for long, even if there is new snow, is the bright red cardinal that sits at the very top of the maple tree behind the house that calls loudly across the neighborhood each morning.
I'm going to spend some time in this column covering the Gradient Ramp map. While everyone knows what a gradient ramp is, and might even use the Gradient Ramp map occasionally themselves, most users don't take advantage of the substantial power and flexibility the map offers.
I'll then take a look at three 3ds max 7 specific tools that have incredible potential for architectural users; the Projection modifier, Normal maps, and the Render to Texture tools. Using these three items you can use high-resolution models to generate special Normal maps that can be applied as bump maps in materials projected onto low-resolution models. This allows you to efficiently simulate complex geometry while considerably reducing the face count in your scenes.
Gradient Ramp: More than Meets the Eye
The Gradient Ramp map that has been included in several versions of 3ds max 7 and VIZ is usually applied "out-of-the-box" as a Linear gradient. I use it for most of my skies and often as a mask to get a transition between different maps or materials. However, there are a number of other gradient types that I'll throw out in this column just to give you food for thought to develop your own variations.
Initially, I'll start off by using the Gradient Ramp map in the bump slot of several materials that are applied to boxes in the scene. I don't have VIZ handy on my machine so I'll do the exercise in 3ds max 6 so that the file may be opened in Viz. 2005 or 3ds max 6 and higher, but even if you have VIZ4 the examples are simple enough for you to re-create.
Gradient Ramp Bump Maps
In the sample file called Gradient Ramp_max6.max there are several objects, each with a material applied using Gradient Ramp maps, and I'll explain the variations used to create a particular effect. There's nothing too complex, just something to make you aware of some of the possibilities that you can use as a starting point on your experimentation.
In Figure 1, you'll see an object in the scene called Box bump in which the Gradient Ramp has new black and white flags positioned near the center of the gradient for a quick transition between the two colors, and with the Gradient Type changed from Linear to Box. A UVW Mapping modifier is used to tile the map several times over the surface of the box.

Figure 1: A Gradient Ramp map set to Box type in the Bump slot of a material
This example could be used for wood panels, concrete structures, or distant high-rise buildings in the background of the scene. Again, use your imagination to come up with examples that fit your needs.
Figure 2 shows essentially the same Gradient Ramp map with a Gradient Type set to Radial. This technique could be used for rubber flooring or the group on a golf club, for example.

Figure 2: A simple change from Gradient Type Box to Radial opens many new possibilities for this simple black-and-white ramp.
Later in the column you'll see how to combine these first two techniques into a material that might otherwise seem very complex. The point here is that the process is very simple to create and, even more important, very easy to make quick changes to.
In Figure 3, the Gradient Type has been set back to Linear with one white and one black flag making a simple gradient. The UVW Mapping modifier has been adjusted to to create 8 inch repeats over the box's surface to create the illusion of clapboard or bevel siding. However, the trick to making this effective is increasing the Blur setting in the Coordinate rollout. Without adjusting the Blur setting the transition is too abrupt to be convincing.

Figure 3: Increasing the Blur value is often necessary to create smooth transitions in your gradient maps.
In the next example, the flags have been set to black flags with one white flag in the center of the gradient to give the illusion of roundness similar to what you might find in roof tiles or corrugated metal and cardboard. The Gradient Ramp is simple enough, but the key to making this one work is increasing the Blur Offset value to smooth the transition between the flags as seen in Figure 4.

Figure 4: Increasing the Blur Offset value smoothes out the illusion of waviness in this example.
Tip: The Blur setting blurs high contrasting pixels in a map, whereas the Blur Offset setting blur's all pixels in the map. Assigned a Checker map to the Diffuse slot of a material and adjust both Blur and Blur Offset independently to see the results.
The next example takes the process a step further. In Figure 4 a Blend material type contains one sub material with the Box Gradient Ramp map and the other sub material with the Radial Gradient Ramp map in the bump slot. The Box ramp is then used in the Mask slot to create the illusion of riveted steel plates. In order to correctly positioned and will resize the "rivet" map the Offset and Tiling have been adjusted in the Coordinates rollout. See Figure 5.

Figure 5: The Box and Radial Gradient Ramp can be combined in a Blend material for interesting results.
Another interesting twist on this variation is to use Tile map type in place of the Box gradient. This allows you to vary the lay-up of the tiles to simulate the steel plates on the side of a ship, for example.
Gradient Ramp Color
So far the Gradient Ramp map has been applied to the bump slot of materials using just black and white flags. Most everyone knows that by right-clicking on a flag and choosing Edit Properties you can pick the color swatch and adjusted for any color you want. A more powerful option that often gets overlooked is the None button in the Flag Properties dialog that allows you to assign any other map in place of the solid color flag.
In the next Gradient Ramp example, a hilly landscape, I've added three flags for a total of five flags and have changed the flight colors to greens, browns, and black. I then right-clicked on flag #3 and added a Noise map and the right-clicked on flag #4 and added a Speckle map. Now, instead of solid colors transitioning from one to the next the corresponding maps blend into each other. In the Gradient Ramp Parameters rollout, Noise group, I increased the Amount slightly and reduce the Size to rough up the transition from one map or color to another. In the Coordinates rollout, the map is rotated 90 degrees in the W. angle.
The material was then assigned to a hilly landscape object in the scene and a UVW Map modifier was assigned. Using the View Align button and the Fit button in the Alignment group, I project at the material from the side of the landscape and make it fit the mesh exactly, so that the full gradient runs from the bottom to the top of the mesh. See Figure 6.

Figure 6: a Great into Ramp map in the Diffuse color slot has maps assigned to to of the flags in the gradient in the map is projected from the side to fit the mesh.
This same technique could be used to create banded materials for walls that have brick and concrete block banding or perhaps brick with granite or stucco accent strips. You should investigate the Solid option in the Interpolation of the gradient for more control in this area.
3ds max 7 Normal Maps
I'm going to introduce you to one of the new features of 3ds max 7called Normal mapping. I'll just briefly go over the process in this column and then, at some later date, write a column detailing some more specific architectural uses of Normal mapping, for example shadow reveals on building façades.
In essence, Normal mapping is an enhanced method of Bump mapping. You all know that Bump mapping is an illusion at render time created by the Luminance value of the pixels in the Bump map; white pixels bump up, black pixels don't do anything, and gray pixels give the illusion of some height in between. Normal mapping, on the other hand, creates a special map based on the Face Normal direction of high resolution geometry. This Face Normal direction information that is stored in the Normal map is then projected onto a low resolution geometry. The result is a Bump map that much more accurately represents lit and shaded areas on the surface.
Several elements must be used in this Normal map process; low and high resolution geometry, a Projection modifier, and the Render to Texture option in 3ds max 7.
The example I'll use here will be very simple so you see how the process works. The base scene has two boxes and some text with a Bevel modifier. The number of faces in one box and the text is just over 9100, which is considerable and should be avoided if possible. See figure 7.

Figure 7: The 3D box and text have a combined density of 9111 faces.
The low resolution object, another box in this case, must occupy the same space in the scene is the box used in defining the high resolution geometry. The Projection modifier is then applied to this low resolution object, in this scene a box called Normal. In the Modify panel, Geometry Selection rollout, you choose the other box and the text to have their Face Normal information projected onto the low resolution box. The Cage of the Projection modifier must have been edited at Cage in sub-object level to completely include all the high resolution geometry. See figure 8.

Figure 8: The Cage of the Projection modifier must enclose the high resolution geometry. The Cage is set here to Shaded mode.
You then click Render to Texture in the Rendering pull-down menu and, in the Render To Texture dialog, enable Projection Mapping, in the Options dialog, set Normal Map Space to World, and clear the Sub-Objects Levels checkbox. See figure 9.

Figure 9: In Render to Texture you must enable a Projection modifier and set it to use World space.
In the Render To Texture dialog, Output rollout, you click the Add button and double-click NormalsMap in the Add Texture Elements dialog. You then set the file name and folder and set the Target Map Slot to Bump. For this example, you can also set the resolution to 1024. In the Selected Element Unique Settings group, check Output into Normal Bump. The Normal Bump map, which is also new in 3ds max 7, will contain the NormalsMap image.
In the Baked Material rollout, Baked Material Settings group, choose the Output Into Source radio button. This applies the maps directly to the current material on the low resolution object. Click the Render Button in the Render To Texture dialog. This renders and automatically unwraps the six sides of the high resolution objects. See figure 10.

Figure 10: The high resolution objects are rendered to an unwrapped image. The back and instance of the objects are not visible because they are not lit in this scene.
Figure 11 shows three examples; the top of box has a material with the old-style Bump map, in the center is the box and the high resolution geometry used to generate the Normal map, and at the bottom is a simple box with the Normal map material assigned to it. In this example it is very difficult to differentiate between the high resolution geometry in the Normal map object.

Figure 11: The left image compares a typical Bump map at the top, high resolution geometry in the center, and Normal mapping at the bottom.
The potential for Normal mapping for architects and background artists is enormous. Trim details, shadow reveals, and signage are just a couple examples of where it could be used to save large amounts of detail geometry.
Summary
I'll encourage you to spend some time investigating the Gradient Ramp map for old versions of 3ds max and VIZ to see what new methods and techniques you come up with to increase your productivity and make your scenes more convincing to the viewer.
For those of you who have 3ds max 7 you definitely want to start finding ways to utilize Normal mapping into your production workflow. Normal mapping is one of those features intended for computer games that can be incorporated into architectural work with substantial benefits.
Download Support files
(148KB)
Good luck and have fun,
Ted |