Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting...

17
Autodesk® Viz Material Editor Techniques 1 December 2-5, 2003 MGM Grand Hotel Las Vegas Autodesk® Viz Material Editor Techniques Ted Boardman Code VI 31-1 About the Speaker: Currently, Ted’s primary job description is that of traveling 3ds max and 3D Studio VIZ training consultant. As an Authorized Discreet® Training Specialist, he produces custom productivity- enhancing training sessions in 3D modeling and animation for clients in a wide range of disciplines. Ted is author and co-author of several books, including 3ds max 6 Fundamentals and other titles from the Inside 3D Studio® MAX series. Ted writes a monthly column on visualization topics at www.cgarchitect.com . He is an award winning AU speaker and is founder of the Boston Area 3D Studio® User Group. [email protected]

Transcript of Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting...

Page 1: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

1

December 2-5, 2003 ◊ MGM Grand Hotel Las Vegas

Autodesk® Viz Material Editor

Techniques Ted Boardman

Code VI 31-1

About the Speaker: Currently, Ted’s primary job description is that of traveling 3ds max and 3D Studio VIZ training consultant. As an Authorized Discreet® Training Specialist, he produces custom productivity-enhancing training sessions in 3D modeling and animation for clients in a wide range of disciplines. Ted is author and co-author of several books, including 3ds max 6 Fundamentals and other titles from the Inside 3D Studio® MAX series. Ted writes a monthly column on visualization topics at

www.cgarchitect.com. He is an award winning AU speaker and is founder of the Boston Area 3D Studio® User Group. [email protected]

Page 2: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

2

Avoiding Repetition in Brick Materials In materials created with Bricks map, whether it is actually bricks or any tiling material made with the Bricks map, a common complaint is that over large surfaces the map repeats and looks unconvincing. An understanding of the map itself will help avoid this repetition. Figure 1 shows a 10’high by 30’ long wall with the standard Bricks map applied as color.

The standard pattern is 3 horizontal bricks by 8 vertical courses that, in the real world would cover 2’ by 2’ area. A UVW Map modifier is therefore set to 2’ x 2’ for correctly sized bricks. The pattern clearly repeats itself across the surface of the wall, however, and is distracting.

Figure 1: Repeating standard brick pattern on wall.

The darker and lighter bricks in the pattern are caused by the Color and Fade Variance settings in the Advanced Controls rollout of a Bricks map. This variance is calculated over the total number of bricks in one pattern, in this case 24 bricks. If you increase the number of total bricks in a pattern the variance will be spread over many more bricks and will not be detectable.

If you increase the number of bricks horizontally and vertically by a factor of 10 you get 30 bricks by 80 courses, or 2400 bricks.

Page 3: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

3

Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would put the coverage at 20’ x 20’. Rendering this, however, doesn’t result in a brick pattern. See Figure 2.

Figure 2: Increasing the number of bricks and the area covered by a factor of 10 does not appear correct, yet.

The mortar gap is a fixed number and not tied to the number of bricks. Again, based on a factor of 10, reduce the Horizontal and Vertical gap to 0.1 and you get a pattern that does not repeat over the area of your wall. See Figure 3.

Page 4: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

4

Figure 3: Multiplying the number of bricks by 10 and multiplying the area cover by 10, then dropping the mortar gap to 0.1 makes a random brick layout on the wall.

Again, Bricks map is a very versatile map type and can be used for bricks, tiles, wood board patterns, concrete scoring, etc and this technique will help in many situations.

Falloff Maps Falloff maps are another of the flexible maps that can be used in many situations effectively. In this exercise we will take a look at a few of the attributes that make it useful.

The scene is a wood surface (made with Bricks map) with a lofted glass on it. The falloff map will be applied to several components of the Standard material to illustrate its functionality.

First the Falloff map will be applied to the Diffuse color of the material to give the glass a slightly pink color at the center of the glass that fades toward the edges to a cool blue color.

Page 5: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

5

The default Falloff map applies its effects based on the angle of faces to the viewer. The faces that are perpendicular to the viewer get the Front color, while more parallel faces get increasingly bluer. See Figure 1.

Figure 1: In a default Falloff map used in the Diffuse color slot color is applied based on the viewer to face angle.

Glass, being transparent, should have the Opacity reduced, but simply doing that doesn’t result in convincing glass as you see in Figure 2.

Page 6: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

6

Figure 2: Reducing the Opacity alone doesn’t result in convincing glass.

If you apply a new Falloff map to the Opacity slot, the glass becomes transparent on perpendicular faces and opaque on parallel faces, but the transition is a bit too gradual. To fix this you can switch the Falloff type to Fresnel to force the falloff effect closer to the edges. See Figure 3.

Page 7: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

7

Figure 3: Using Fresnel Falloff type forces the effect to the edges of the glass

Next, a Falloff map can be used as a Mask map applied to a Raytraced reflection map to cause only the parallel faces to reflect the surroundings. See Figure 4.

Page 8: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

8

Figure 4: Using Falloff as a Mask map for Raytrace reflections boost the brightness of the edges by reflecting the surroundings.

Finally, the glass needs a little Specular highlight. By increasing the Specular Level of the material to around 100 for a bright specular highlight and using a Falloff map in the Glossiness slot you have control of the edge of the specular highlight by adjusting the Falloff maps Mix Curve to add two extra control points and forming a sharp transition. See Figure 5.

Page 9: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

9

Figure 5: A Falloff map in the Glossiness slot with a new Mix Curve can be used to define specular highlights that make the glass look hard and cold.

In this example, four Falloff maps have been used to change different components of the glass material to transform it from a dull plastic look to the hard cold appearance more indicative of glass in the real world.

Multiple Materials and Mapping Coordinates on a Single Object A topic that comes up frequently is that of applying more than one set of mapping coordinates to a single object. In this column I’ll walk through a typical architectural scenario, but the technique can be used for everything from racecars to characters.

This exercise uses a scene that contains a small building with a hip roof. It is a single Editable Mesh object with a Multi/Sub-Object material assigned.

In the Modify panel, Stack view, I have already selected the walls and applied a UVW Map modifier that is set to Box mode and gives the stucco exterior the size I want. There is also some graffiti in the material, but you will learn to use Map Channels at the end of the exercise to reveal the text. Figure 1 shows the building and the Multi/Sub-Object material in the Material/Map Navigator that has been assigned.

Page 10: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

10

Figure 1: The building and the seven sub-materials.

Material ID Numbers The roof material is made up of Bricks map in the Diffuse and Bump slots to create a slate appearance. Your task will be to assign materials and mapping coordinates to the planes of the hip roof so that the slates are projected onto the surfaces and sized correctly. You will use a combination of three modifier types for each plane. The MeshSelect modifier will allow you to select only the polygon(s) you need, the Material modifier with change the Material ID #, and the UVW Map modifier will actually orient and size the pattern correctly.

Note: The Bricks pattern has been set to 30 horizontal and 80 vertical bricks. This allows the Color and Fade Variance to be distributed over 2400 bricks to cut down on the repeating pattern that occurs when the default 3 by 8 or 24 brick pattern is used. The Gap setting for Bricks has also been adjusted for increased number of bricks.

Exercise: One Object, One Pattern, Multiple Planes with Mapping Coordinates

1. Open the file called Building_viz4.max and select the building in the Perspective viewport. Select the object named Building. Go to Modify panel. You must assign Material ID numbers to the roof planes and wall surface so they get the correct sub-material in the Multi/Sub-Object material apply to the building.

2. In the Modify panel, choose sub-object Polygon in Stack view. In Named Selection Sets list, choose roof. In the Surface Properties rollout, change the ID to 1 for the Shingles material. This insures that the roof polygons will get the first material in the Multi/Sub-Object material.

Page 11: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

11

3. In the Modifier List choose UVW Map. Render the Perspective viewport and see that one UVW Map doesn’t work for a roof with multiple planes. Remove the UVW Map modifier with the Remove Modifier From the Stack button. In the Stack view, highlight Editable Mesh to exit sub-object mode.

4. Open Material Editor and use Navigator to go to the Diffuse level for Roof Slate. Click on Show Map in Viewport. See Figure 2. This will allow you to see the map on the surface in the shaded Perspective viewport.

Figure 2: Use Material/Map Navigator to go to Roof Slate material, Diffuse Bricks level and turn on Show Map in Viewport.

5. In the Modifier List choose Mesh Select modifier. It does nothing but allow you to make object or sub-object selections and you are using it here so that you have a history of your workflow to make it easier to follow later. Go to sub-object Polygon and, in the Perspective viewport, pick the front roof plane. It will highlight red in the wireframe views and, if you turn on Shade Selected Faces (F2 function key), it will turn transparent red in the shaded viewport.

6. In the Modify panel, Modifier List, choose UVW Map. These mapping coordinates are only for the selected polygon from the Mesh Select below. The map gizmo is not orientated to project planar to the surface, however.

7. In the Modify panel, Parameters rollout, Alignment area, click the Normal Align button and, in the Perspective viewport, click and hold on the selected polygon and move the mouse a little. The UVW Map gizmo will flip to match the Face Normal of that polygon. See Figure 3.

Page 12: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

12

Figure 3: Using Normal Align in the UVW Map Parameters rollout, click and drag on the roof front polygon to align the gizmo with the surface.

8. In the Modify panel, Parameters rollout, enter 30’ (feet) in both Length and Width to size the gizmo. Click the Center button to center the gizmo on the plane. This is 2400 slates over a 30 foot by 30 foot area. Render the Perspective viewport to see the slates are correct on the front roof plane.

9. In the Modify panel, Modifier List, choose Mesh Select and go to Polygon sub-object level. Select the left end roof polygon to highlight it.

10. In the Modify panel, Modifier List, choose UVW Map modifier. Click the Normal Align button and click and drag on the selected polygon. Enter 30’ in Length and Width and click the Center button. You now have two planes with similar sized maps projecting to each respective plane. See Figure 4.

Page 13: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

13

Figure 4: Apply another Mesh Select and UVW Map modifier and adjust the gizmo and size for the new roof plane.

11. Apply Mesh Select and UVW Map to the back roof plane, and again to the right roof plane.

12. After the final roof plane UVW Map adjustment is made apply another Mesh Select that is not in sub-object mode. This returns the stack to the whole object, not just a sub-object selection. The stack and roof should look similar to Figure 5 when rendered in the Top viewport.

Page 14: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

14

Figure 5: Whenever you have a sub-object selection levels, end the stack with a Mesh Select to return control to the whole object.

13. Render the Perspective viewport to see the roof slates and save the file.

Using Map Channels The stucco material on the wall is actually a Composite map type with Stucco map and a Bitmap of some text that contains Alpha channel to make the black area of the map transparent. However, to get the Stucco sized correctly you need a UVW Map modifier that is set to Box mapping type at 1” on each side. This projects the Stucco pattern in six directions to make it appear correct on all sides of the building.

The second level of the Composite, a bitmap of text is using the same mapping coordinates so is restricted to an area of 1” square, much too small for you to see. You need to apply different mapping coordinates to the Bitmap text file to make it fit the side of the building. You will use Map Channels to match a particular map in the material to a UVW Map modifier sharing the same Map Channel number.

Exercise: Setting Map Channels for the Graffiti on the walls.

1. Open the file from last exercise and adjust Perspective viewport to look at the building obliquely from the left front. In the Modify panel, Modifier List, go to sub-object Polygon level of the top Mesh Select in the Stack view. In the Mesh Select Parameters rollout, set ID to 3 in the Select by

Page 15: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

15

Material ID area. Click the Select button to select those polygons in the object that were already assigned Material ID 3, i.e., the walls of the building.

2. From Modifier List, choose UVW Map, choose the Box radio button and enter 1” in Length, Width, and Height. Render the scene to look similar to Figure 6. The Bitmap text and the Stucco are using Map Channel 1 in the Material Editor. The new UVW Map uses Map Channel 1. All other UVW Map modifiers use the default Map Channel 1 also, but the top modifier in the stack wins as it is applied to the whole mesh object as determined by the Mesh Select below it.

Figure 6: The UVW Map modifier, set to Map Channel 1, controls mapping to all the maps in all materials for this object that are set to the default Map Channel 1, also.

3. Apply another UVW Map modifier at the top of the Stack view. In the Parameters rollout, Channel area, enter 2 in the Map Channel field.

4. In the Material Editor, go to the Vandels_text.png Bitmap level. In the Coordinates rollout, change the Map Channel number from 1 to 2. Also, clear the Tiling checkboxes to keep the map from repeating over the surface. This is called Decal mapping. Click the Show Map in Viewport button.

5. In Parameters rollout, click the Normal Align button and click and hold on the left wall of the building to align the gizmo with it and resize the gizmo to 10’ in Length and Width.

6. Render the Perspective viewport and you will see the correctly sized Stucco with the word Vandals painted on the left wall. See Figure 7. Save the file.

Page 16: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

16

Figure 7: Clearing the Tiling checkboxes and setting the correct Map Channel allows you to map differently for different maps within the same material, in this case, as a Decal map.

Learning to use MeshSelect and Material ID modifiers, and UVW Map modifiers and Map Channels is key to successful and productive material mapping.

Page 17: Autodesk® Viz Material Editor Techniques...Autodesk® Viz Material Editor Techniques 3 Adjusting the UVW Map modifier to adjust for 10 times more bricks in a single repetition would

Autodesk® Viz Material Editor Techniques

17