Maya 4.5 Fundamentals

Having reviewed the major material types, now take a look at the variables available in the Blinn material that you'll use in this tutorial. The other primary materials Phong, PhongE, and Lambert have many of the same variables.

To edit material settings, double-click on any material in Hypershade's top or bottom tabs. Usually, you create a Blinn material in the Work Area of the bottom tab panel, and then double-click it to edit it in the Attribute Editor. See Figure 9.3 for the following discussion of the Attribute Editor's sections.

Figure 9.3. A basic Blinn material is shown in the Attribute Editor. If you apply a texture, the checkered icon changes to a connection icon, and the slider and swatch can no longer be edited.

Notice the material name at the top of the Attribute Editor, which Maya sets to blinn1 for a default starting name. Maya increments the number if you create more Blinn materials. You should edit this text to something more descriptive, however, to help you navigate through your scene materials.

The image next to Material Sample shows a rendered sample sphere that updates as you change attribute values. You use the Type drop-down list to change a material to another type; if the new material type has different parameters, however, it automatically has the default settings, and the name is reset to the default name.

Next is the Common Material Attributes section, followed by the Specular Shading section. These two sections, displayed by default, are used the most in material editing. The other sections remain closed unless you click to expand them.

Note that the first four variables under Common Material Attributes have a color swatch, a slider, and a checkered button. You can brighten or darken these variables with the slider, but you must click the color swatch (which opens the Color Chooser) to fine-tune a color. Use the checkered button to override a solid color with a texture.

These are the Blinn attributes in the Common Material Attributes and Specular Shading sections:

  • Color The base color of the surface.

  • Transparency Adjusts the surface opacity. As soon as it's raised above 0 (black), Maya changes the sample background to a checkerboard to help gauge the transparency effect. You can use colors to create a tinted glass effect.

  • Ambient Color Adds to and blends with the color value. It's a good idea to leave this value set to 0 (black) except for special effects, because it diminishes the contrast and 3D depth in your rendered results where it's applied.

  • Incandescence A simulation of emitted light. At low values, it tints and self-illuminates the material, and at high values, it overtakes the material's color and becomes self-illuminated. Keep in mind that the rendered material might look like it's luminous, but it doesn't cast light into the scene; you have to simulate that by adding lights in the standard Maya renderer.

  • Diffuse Intended to simulate a material scattering light, but it works like a scaling factor on the color. By default, it's set to 0.8, which dulls down the color value you've set. Often, animators apply "dirt maps" in this attribute to add realistic dirt and wear that darken a surface.

  • Translucence A special effect in which light is absorbed and scattered as it passes through an object, useful for simulating materials such as frosted glass. This effect relies on the light sources around and behind the object you're applying the translucent material to.

  • Translucence Focus Controls how light scatters from the surface. Lower values make the light scatter heavily and results in a soft, blurry translucence.

  • Eccentricity The width of the highlight, simulating how polished or rough the surface appears.

  • Specular Roll Off The brightness/intensity of the highlight.

  • Specular Color The color of the highlight; usually set to white or a gray value.

  • Reflectivity The strength of reflections on the object. Reflections can be raytraced or use texture maps. If no texture is assigned to the Reflected Color attribute, you need to enable raytracing to see any results from this setting. You can enable raytracing in the Render Global Settings window (unless you're using reflection maps).

  • Reflected Color For Blinn, the color swatch and slider have no effect. However, when a texture map is applied, it appears to be reflected by the material. Usually, you use one of the environmental texture types. Environment textures are used to simulate an environment surrounding the scene; when applied to a material's Reflected Color attribute, they're used to fake reflection. This technique is often used to get a shiny, reflective effect without slower rendering times caused by raytracing the actual surroundings. Also, sometimes there are no surroundings to reflect; for example, flying logo effects are often set in a black void.

Take a look at the following figures to see the differences between some of these attributes. In Figure 9.4, Transparency is applied to the square on the left so that you can see the object behind it. The square on the right has Translucence applied, so that it allows light and shadow to come through.

Figure 9.4. Transparency versus Translucence: The scene is backlit by a shadow casting light.

Figure 9.5 shows spheres with similar reflective materials applied, but the sphere on the right has a fractal map applied to its Diffuse attribute. The effect is apparent only where the map is darker, which causes a "dirt" effect meaning the sphere is darker and its reflections are less intense in those areas.

Figure 9.5. The Diffuse attribute can darken the color and diminish reflectivity.

In Figure 9.6, the Reflectivity attribute is set at a constant 1 (100%) throughout the images, but different approaches are used to get these varying effects. The leftmost image has nothing applied to the Reflected Color attribute. The next image has a chrome environment map in the Reflected Color attribute, which creates the impression of a background despite the sphere's actual surroundings. In the third image, raytracing is enabled, but the Reflected Color attribute is disabled, so a perfect reflection is computed. The rightmost image shows the effect of combining raytraced reflections with environmental texture mapping to produce real reflections that have priority over the environmental (Reflected Color) reflections.

Figure 9.6. Using different approaches with the Reflectivity attribute.

The Color Chooser

The Color Chooser appears whenever you click on a color swatch. The 14 color buttons at the top are a clipboard. To select the color for a color button, you simply click on it. To replace a color button, right-click it. Use the eyedropper tool to pick a color anywhere in the window.

A color spectrum appears in the Wheel area. Generally, the best way to select a color is to use the sliders below the wheel (see Figure 9.7). The sliders can be set to RGB (red-green-blue) or HSV (hue-saturation-value) mode in the list box at the bottom of the Sliders section, but HSV mode is often the most useful. Pick the color tint first in the hue slider, and then select the color's intensity, as compared with gray, in the saturation slider. Finally, adjust the darkness, or black mix, with the value slider. At the bottom is the alpha slider for setting transparency, but it's rarely if ever used.

Tutorial: Creating Solid Materials

The most basic materials have a solid color and a consistent surface. In this tutorial, you'll use Hypershade to create some solid-colored surfaces and apply them to objects. Load the scene file noted next to the DVD icon so that you have a starting point for the sample world you're adding materials to.

On the DVD

Chapter_09\movies\ch09tut01.wmv

Pottery

For the pitcher, you'll apply a pottery material created by using a dark orange color in a Lambert material.

On the DVD

Chapter_09\ch09tut01begin.mb

  1. Open Hypershade with Alt+h. Make sure the Create Bar and both tab panels are showing. Right-click in the bar at the top of the Create Bar and choose Create All Nodes. MMB-drag a Lambert material type to the bottom tab panel named Work Area. Double-click the new material, and the Attribute Editor opens with the new material ready to edit. If this doesn't work, you can right-click on the new material and choose Attribute Editor.

  2. Rename the material from lambert2 to pottery. Set the color to dark orange in the Attribute Editor by clicking the swatch next to the Color value, and setting the color in the Color Chooser. You can also set the values numerically: Set the Hue to 18, Saturation to .9, and Value to .7. Click the Accept button in the Color Chooser.

  3. Select the pottery pitcher object in the scene, right-click the edited material in Hypershade, and choose Assign Material to Selection. You should see the pottery object in the Shaded view become dark orange.

    Plastic

    For plastic materials, you'll use the Blinn material with bright highlights.

  4. In Hypershade, MMB-drag a Blinn material to the bottom tab panel. Open the Attribute Editor as before, and rename the material from blinn1 to red_plastic.

  5. Set the color swatch to bright red. You can click the red color button in the Color Chooser, or use the HSV sliders to get a red you like.

  6. In the Specular Shading section of the Attribute Editor, make the shine level bright and tight by setting Eccentricity to 0.06 and Specular Roll Off to 2.0, and dragging the Specular Color slider all the way to the right to get a pure white. The material sample sphere at the top of the Attribute Editor should look like shiny red plastic.

  7. Select the Plate object in the scene. In Hypershade, right-click on the red plastic material, and choose Assign Material to Selection. You should see the plate turn red in the Shaded view.

    Metal

    Creating metal requires a trick. The sliders in the Attribute Editor imply upper and lower limits that don't really exist. You can type in any value in most of the numeric entries, and the slider adjusts its ranges. In some cases, you can get useful and unique results from "overdriving" a value in this way.

  8. MMB-drag a new Blinn material type from the Create Bar to the bottom tab panel. Open the Attribute Editor for this new material, and name it gold.

  9. In the Color Chooser, set the color swatch to dark brown (HSV: 40, 0.8, 0.2), and click Accept. Under the Specular Shading section in the Attribute Editor, leave the settings at their defaults: Eccentricity at 0.3 and Specular Roll Off at 0.7.

  10. To get the metal look, click the Specular Color swatch and set it to orange, but with a value higher than 1 (HSV: 40, 1.0, and 2.0), as shown in Figure 9.8.

    Figure 9.8. Setting the highlight color for a gold material.

  11. Shift-select the small stands under the four sphere objects in the scene. Right-click on the gold material in Hypershade, and choose Assign Material to Selection. The object in the Shaded view should turn gold.

  12. Try a test render to see what the materials really look like. Right-click in the Perspective view, and render by clicking Hotbox | Render | Render Current Frame.

  13. A Render View window appears and the image is rendered. Leave this window open.

    Reflective Raytraced Metal

    The gold looks metallic, but what if you want it to reflect its surroundings? There's a Reflectivity slider in the Attribute Editor, but you won't see any results unless you enable raytracing in the renderer or apply an image to the Reflected Color attribute.

  14. In the gold material's attributes, leave Reflectivity at its default 0.5. Click the clapboard icon to the left in the Render View window, and the image will render again. However, the gold still isn't reflective.

  15. Click the Render Globals button, shown in Figure 9.9. In the Render Global Settings window, go to the Maya Software tab and find the Raytracing Quality section, and then select the Raytracing check box. Set Reflections to 3, Refractions to 3, and Shadows to 3, and then close the Render Global Settings window. Render again by clicking the clapboard icon, and you should see reflective effects in the gold object. Orbit the Perspective view and render from some different angles to see the effect. Notice that the red plastic material is also reflecting. The default setting for Reflectivity is 0.5 half reflective. You need to change this value when you don't want reflections on materials.

    Figure 9.9. Open the Render Global Settings window to enable raytracing for reflections and refractions.

    Refractive Raytraced Glass

    You can also have transparent materials that refract light. That is, light passes through the objects but is bent, so you see a distorted view of what's behind the refractive object.

    tip

    You can zoom and pan the rendered image as in any 3D panel. You can also zoom and pan the swatches in either tab panel in Hypershade.

  16. MMB-drag a Blinn material to the bottom tab panel. Open the Attribute Editor and name the material glass.

  17. Set the Color to black and Transparency to white. As soon as you begin to raise the Transparency value, you'll see a checkered background appear behind the swatch in the Attribute Editor and in Hypershade, which means that the material is transparent. Set Eccentricity to 0.1, Specular Roll Off to 1, and Specular Color to white.

  18. Now, open the Raytrace Options section in the Attribute Editor. Select the Refractions check box, and set the Refractive Index to 1.5. This is similar to glass. Most materials have an index between 1 and 2. Select one of the four spheres to the left in the scene, right-click on the glass material in Hypershade, and choose Assign Material to Selection.

    Duplicating Materials

    You can start with an existing scene material and then duplicate it so that you can use the old material as a starting point for an unassigned new material.

  19. Select the gold material in Hypershade, in either tab panel, and press Ctrl+d to duplicate. A new material named gold1 appears.

  20. In the Attribute Editor, rename the material as chrome. Change the Color to dark blue by setting Hue to 240 in the Color Chooser. Set Specular Color to white by changing Saturation to 0. You now have a bluish metal look. Crank up the Reflectivity up to .85, and assign the material to the next sphere in the scene. Render the Perspective view image. The sphere looks like a mirror, reflecting the scene around it.

  21. Render the Perspective view. If it looks a bit fuzzy in the refractive and reflective areas, that's because the quality is set low for faster response. To turn the quality up, open the Render Global Settings window. In the Anti-aliasing Quality section, select Production Quality in the Quality drop-down list, as shown in Figure 9.10. You might also want to increase the resolution; currently, it's only 320x240 pixels. In the Resolution section, select Full 1024 from the drop-down list box, which gives you a 1024x768 resolution image. This setting takes a bit longer to render than before, but behold the final image! To see the image at full scale, click the 1:1 button on the Render View window's toolbar.

    Figure 9.10. Turning up the rendering quality level in the Render Global Settings window.

Figure 9.7. Maya's Color Chooser in HSV mode.

Категории