Adding Texture Mapping to Base Materials

table of contents

By now, you should have a basic understanding of how textures work with the materials and how to place 2D textures on objects in your scene. In this next tutorial, you'll apply these methods to the house's base materials you created and assigned in the earlier tutorial.

Tutorial: Texturing the Doorknob, Walls, and Windows

Having a solid color for the doorknob isn't as realistic as it could be. Earlier you learned how you can use a material's Diffuse attribute to create a dirty look, which is exactly what you'll do for the doorknob.

  1. First, load your scene into Maya. You can continue from the previous house tutorial, or load the file noted below the CD icon.

    graphics/ch08q_icon.gif graphics/ch08h_icon.gif
  2. Start by changing the layout you're working with. If you haven't already done so, hide the UI elements, and change to the saved layout for working with materials (Hotbox Panels Saved Layouts Hypershade/Render/Persp).

  3. Hide all the layers except DoorL. To begin, you'll modify the texture on the doorknob. By adding a map to the Diffuse attribute, you can achieve a worn metallic look for the doorknob. Select the outer doorknob and focus on it (hotkey: f ). IPR render the doorknob and select it for update in the Render View window.

  4. In Hypershade, make sure the top and bottom tabs are visible (click the Show Top and Bottom Tabs button if they aren't). Double-click the DoorKnob_Blinn material to open the Attribute Editor so that you can map a texture to the Diffuse attribute. Click the checkered button to the right of Diffuse to open the Create Render Node dialog box. Under the 2D Textures section, make sure the Normal radio button is selected for placement, and click the Fractal type. The Attribute Editor switches to show the Fractal attributes. Looking at the IPR render, you'll see that it has updated.

  5. By changing settings for the procedural texture, you can get a brushed effect on the doorknob; as you change the settings, watch the IPR render to see how the texture is affected. Click the fractal1 tab in the Attribute Editor. Under the Fractal Attributes section (see Figure 8.24), change Amplitude to 0.5 , Threshold to 0.1 , Ratio to 0.77 , and Frequency Ratio to 8 . Now click the place2dTexture tab. Under the 2D Texture Placement Attributes section, change the second text box (for V) to the right of Repeat UV to 0.15 . Last, set the Noise UV to and 0.75 . Adding this UV noise to the Fractal attribute "swirls" it more. Close the Attribute Editor.

    Figure 8.24. Using the Attribute Editor, IPR, and Hypershade, you can easily add textures to your materials.

    graphics/08fig24.gif

  6. Focus on the door, and redo the IPR render with more of the door in the view. Double-click Door_Blinn in Hypershade to open the Attribute Editor. You'll assign a texture to the Diffuse attribute just as you did with the doorknob, but this time you'll create a Noise texture. To do that, in the noise1 tab, change the values under Solid Fractal Attributes (see Figure 8.25): Set Amplitude to 0.8 , Ratio to 0.35 , Frequency Ratio to 20 , Depth Max to 3 , and Noise Type to Wispy. In the place2dTexture tab, change the first text box for Repeat UV to 4 . Finally, hide DoorL because you have finished applying textures to it.

    Figure 8.25. Use these settings to change the Noise texture you just mapped to Door_Blinn's Diffuse attribute.

    graphics/08fig25.gif

  7. Next, you'll add some texture to the walls. Display the OuterWallsL layer, and IPR render the walls so that you can see them clearly. Open Walls_Blinn in the Attribute Editor, and change the Reflectivity to . Map a Noise texture (again confirming that Normal is selected at the top of the Create Render Node dialog box) to the Color attribute of Walls_Blinn. Use the settings shown in Figure 8.26: Set Amplitude to 0.5 , Ratio to 0.77 , Frequency Ratio to 2 , Depth Max to 20 , Density to 5 , Spottyness to 0.3 , and Falloff to Bubble.

    Figure 8.26. Settings to change the Noise texture mapped to the Color attribute for Walls_Blinn.

    graphics/08fig26.gif

    Maya provides a "color balance" option to easily adjust the brightness and contrast of the noise. You'll use that now to darken and mute the noise effect:

  8. Under the Color Balance section for the Noise, set the Color Gain in the Color Chooser (HSV: 41 , 0.315 , 0.656 ). Then change the Color Offset (HSV: 45.5 , 0.393 , 0.120 ). After setting those values, click the place2dTexture tab and set Repeat UV to 1 and 5 to make the texture compress in the V direction. Save your scene.

  9. Select Walls_Blinn again and map a 2D Mountain texture to the Diffuse attribute. In the place2dTexture tab, change the Repeat UV to and 3 and set Noise UV to and 0.005 . You should also change the values in the mountain1 tab, as shown in Figure 8.27: Amplitude to 0.75 , Snow Altitude to 1 , and Snow Dropoff to 1 .

    Figure 8.27. Settings for the Mountain texture mapped to the Diffuse attribute of Walls_Blinn.

    graphics/08fig27.gif

  10. Now you can move on to the foundation. Open the Attribute Editor for Foundation_PhongE by double-clicking on the material in Hypershade. You'll map an image file to the Color attribute by clicking on the checker button for the Color attribute. The texture list should appear. Select File. The Attribute Editor displays the file settings. We could now click the Folder button to select the image map by name , but there's an easier way, shown in the next steps.

  11. In HyperShade, choose Tabs Create New Tab. In the Create New Tab dialog box, enter M4F maps in the New Tab Name text box, select the Bottom radio button for Initial Placement, select the Disk radio button for Tab Type, and then point the root directory to the Chapter_08\Textures folder on the CD-ROM (see Figure 8.28). Click the Create button.

    Figure 8.28. Adding a new tab to Hypershade.

    graphics/08fig28.gif

  12. In Hypershade, click on the bottom tab Shader Library, and then click the new tab you created. You should see swatches appear for all the textures in the selected folder. These are thumbnail images of the available textures that you can zoom and pan. Click cobblestones.tif to select it, and then MMB-drag the texture to the Image Name text box in the Attribute Editor. The file's location is automatically placed in the text box. Press Enter, and the Texture Sample swatch updates to show the new texture. If you do a test render, you'll see the material applied to the foundation, as in Figure 8.29.

    Figure 8.29. The cobblestones.tif texture has been linked to the File node.

    graphics/08fig29.gif

  13. Click the place2dTexture tab. Under the 2D Texture Placement Attributes section, change Repeat UV to 3 and 2 . Click Foundation_PhongE again to open it in the Attribute Editor. Map the 2D texture Noise to the Diffuse attribute, and in the noise3 tab, change the Solid Fractal Attributes to match Figure 8.30: Set Amplitude to 0.7 , Ratio to 0.77 , Frequency Ratio to 5 , Depth Max to 2 , Frequency to 10 , and Noise Type to Perlin Noise. This adds a heavy "grime" layer to the texture. Raising the Threshold value will lighten the noise color and therefore diminish the grime effect.

    Figure 8.30. Placing this Noise texture on the Diffuse attribute gives the cobblestone a very dirty look.

    graphics/08fig30.gif

  14. Hide the OuterWallsL layer and display the ChimneyL layer. Zoom in on the chimney and IPR render. If you are having trouble seeing it because some areas are not illuminated enough, select spotLight2 in the Outliner and increase its Intensity to 1.2 in the Channel Box.

  15. Click ChimneyBase_Lambert in Hypershade. In the Attribute Editor, map a File 2D texture node (the Normal radio button should be selected for placement) to the Color attribute. Just as you loaded the cobblestone texture for the foundation, in the Shader Library tab, locate bricks .tif and MMB-drag it to the Image Name text box in the Attribute Editor.

  16. The IPR updates, but the brick is stretched . To fix that, RMB-click ChimneyBase_Lambert and choose Graph Network. Click the place2dTexture node for the brick. Under the 2D Texture Placement Attributes, change the Repeat UV to 1 and 6 . The brick looks too clean, so you'll add a Solid Fractal 3D Texture map to the material's Diffuse attribute. To do that, in the place3dTexture tab, click the Fit to Group bbox button. Under the Solid Fractal Attributes section, change the Amplitude to 0.8 , Frequency Ratio to 5 , Ripples to 2 , 3 , and 5 , and Bias to 0.05 .

  17. In the Perspective view, rotate around. Notice that on two sides of the chimney, it seems as though the texture is moving in the wrong direction (see Figure 8.31). The surface's direction is going in the opposite direction as the other sides of the chimney. In other words, the U and V coordinates have been switched, which is typical of NURBS cubes in Maya. To change the direction of a surface, select the side of the chimney with the direction problem, and reverse the surface direction (Alt+z LMB-click Reverse Surface Direction option box). Make sure the Surface Direction is set to Swap. Click the Reverse button to see the texture magically repositioned in the Perspective view. You'll need to IPR render again to see the change. There are two sides of the chimney with this problem, so repeat Step 17 on the opposite surface.

    Figure 8.31. Reversing the surface direction will fix the texture mapping on the NURBS object in one step.

    graphics/08fig31.gif

  18. Before going any further, be sure to save your scene. The last step is to add a texture to the Transparency attribute for your Window_Anisotropic material. Make all layers visible except for PorchL because the porch isn't anywhere near the windows. You can do an IPR render of the window, but it won't show much without raytracing . In the Attribute Editor for Window_Anisotropic, map a 2D Texture Ramp (select the Normal radio button) to the Transparency attribute.

  19. A Ramp texture can give you a wide range of effects. You can think of it as a gradient, with one color blending into another. Click the ramp1 tab, and select Circular Ramp in the Type drop-down list box (see Figure 8.32). The Texture Sample swatch updates to show what the Ramp looks like. You can specify the areas that will be transparent by setting a ramp color (the circular color buttons ) to white. The Interpolation list box, below Type, defines how the blending (intermediate) colors change; it should be set to Linear.

    Figure 8.32. The default Ramp has been changed to a Circular Ramp.

    graphics/08fig32.gif

  20. After modifying all the settings, you will have a faded, more transparent look around the edges of the window. Using the IPR render can help you tweak the positions of the fading transparency. In the Attribute Editor for the Ramp texture, notice that three separate colors are displayed by default. If you click anywhere in the Ramp, you create another color. To move the colors, click on the circles to the left; to delete the colors, click the small squares on the opposite side. Click the green square to delete its color, and click the blue circle to select it. Under this color swatch, set Selected Color to almost completely black. Changed Selected Position to 0.810 , U Wave to 0.150 , Noise to 0.150 , and Noise Freq to 0.600 . Watch the IPR render update with each change. Change the other color in the ramp to pure white by clicking the red circle and setting Selected Color to white. Change Selected Position to 0.415 . Your Ramp settings should now resemble Figure 8.33. Don't forget to save your scene.

    Figure 8.33. The Ramp texture has been set up for the window glass.

    graphics/08fig33.gif

At this point, you can continue on your own to apply textures to the rest of the house. You have walked through applying textures for the walls, chimney, door, and glass. The next section of this chapter introduces yet another important attribute for materialsbump mapping.

graphics/ch08s_icon.gif


Maya 4. 5 Fundamentals
Maya 4.5 Fundamentals
ISBN: 0735713278
EAN: 2147483647
Year: 2005
Pages: 201

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net