3ds Max 2012 Bible - Kelly L. Murdock [231]
The MaterialByElement modifier enables you to change material IDs randomly. In this tutorial, you reproduce the effect of lights randomly turning a marquee on and off by using the Multi/Sub-Object material together with the MaterialByElement modifier.
To create a randomly lighted marquee, follow these steps:
1. Open the Marquee Lights.max file from the Chap 18 directory on the DVD.
This file includes some text displayed on a rectangular object surrounded by spheres that represent lights.
2. Open the Material Editor and double-click the Multi/Sub-Object material from the Material/Map Browser. Give the material the name Random Lights.
3. Double-click the Multi/Sub-Object material node and in the Multi/Sub-Object Basic Parameters rollout, click the Set Number button, and change its value to 2. Then click the Material 1 button and select the Standard material type, and in the Material name field give the material the name Light On. Select the material button in the Multi/Sub-Object Basic Parameters rollout and set the Diffuse color to yellow and Self-Illumination to yellow. Then double-click again on the main material node.
4. Name the second material Light Off, and click the material button to right of the name field and select the Standard material type. Then click the material button again and select a gray Diffuse color. Then click the Multi/Sub-Object material node.
5. Select all the spheres, and click the Assign Material to Selection button to assign the material to the spheres.
6. With all the spheres selected, open the Modify panel and select the MaterialByElement modifier from the Modifier List drop-down list. In the Parameters rollout, select the Random Distribution option and set the ID Count to 2.
Figure 18.7 shows the marquee with its random lights. (I've always wanted to see my name in lights!)
Tip
If you want to have the lights randomly flash, then simply animate the changing Seed value. •
FIGURE 18.7
This marquee is randomly lighted, thanks to the MaterialByElement modifier.
Disp Approx and Displace Mesh modifiers
You can change the geometry of an object in several ways using a bitmap. One way is to use the Displace modifier (found in the Modifiers⇒Parametric Deformers menu). The Displace modifier lets you specify a bitmap and a map to use to alter the object's geometry. Black areas on the bitmap are left unmoved, gray areas are indented, and white areas are indented a greater distance. Several controls are available for specifying how the image is mapped to the object and how it tiles, and buttons are available for setting its alignment, including Fit, Center, Bitmap Fit, Normal Align, View Align, Region Fit, Reset, and Acquire.
Note
Max also supports Vector Displacement maps, which are found in the Maps category of the Material/Map Browser. Vector Displacement maps require the mental ray renderer and they allow displacement in any direction and not just along surface normals like other displacement methods. Autodesk's Mudbox provides a good way to create this type of map saved using the EXR file format. •
Another way to displace geometry with a bitmap is to use a displacement map. Displacement maps can be applied directly to Editable Poly and Mesh, NURBS, and Patch objects. If you want to apply a displacement map to another object type, such as a primitive, you first need to apply the Modifiers⇒Surface⇒Disp Approx modifier, which is short for Displacement Approximation. This modifier includes three default presets for Low, Medium, and High that make it easy to use.
Cross-Reference
More details on working with maps are covered in Chapter 17, “Adding Material Details with Maps.” •
One drawback to using displacement maps is that you cannot see their result in the viewport, but if you apply the Modifiers⇒Surface⇒Displace Mesh (WSM) modifier, then the displacement map becomes visible in the viewports. If you change any of the displacement map settings, you can update the results by clicking the Update Mesh