Applying a texture map to a polygon mesh

In Maya, surfaces appear in a rendered image based on the shading materials you apply to them. The default shading material that gets assigned to surfaces provides basic attributes such as color, transparency, and incandescence.

Depending on your final image requirements, you can enhance the visual impact of an object by adding one or more texture maps to the assigned shading material. One basic texture map you can apply is a bitmap image also referred to as a file texture. In this lesson, you apply a texture map we’ve created for your use on the cracker box.

For more basic information on shading materials and texture maps see the Rendering chapter of this guide and the Maya Help.

To assign a shading material to the cracker box

  1. In the scene view, select Shading > Smooth Shade All from the panel menu.

    This displays the cracker box with a default gray, smooth shading material, lit using default lighting. Turning on Smooth Shade All displays the assigned shading material you apply to the cracker box in the steps following.

  2. In the scene view, right-click on any region of the cracker box and select Assign New Material from the pop-up menu.

    The Assign New Material window appears.

  3. In the list of materials, select Lambert.

    A new Lambert shading material is created and assigned to the cracker box. The Attribute Editor appears and displays the various attributes for the new Lambert shading material.

    The new Lambert material is identical to the default gray material that was previously assigned to the cracker box. However, it’s always a good practice not to modify the default shading material in the scene. Instead, you should always create a new shading material and modify it to suit your requirements.

  4. In Attribute Editor, double-click in the lambert2 box and then type: box_material to rename the shading material.

    Renaming the shading material lets you easily identify it later on when you need to edit it. Naming items uniquely in Maya is a useful habit.

  5. In the Attribute Editor, move the Color slider fully to the right so that the color box appears white.

    The shading material assigned to the box model also updates in the scene view so it appears in a brighter tone.

  6. Click the Map button located to the right of the Color slider.

    The Create Render Node window appears and lists the various texture options you can apply (or connect) to the color channel of the box material.

  7. Click PSD File from the list of 2D Textures.

    Choosing this option specifies that you want to apply an Adobe® Photoshop® format file as a texture. A PSD format file lets you keep the various components of your texture map on multiple layers. This is useful when you need the ability to edit a component of the texture during production.

    The Attribute Editor updates to display the options for the PSD File texture.

    TipIf the Attribute Editor suddenly appears empty, it indicates that no objects are selected in the scene. Simply select the box model again in the scene to display the attributes for the box.
  8. Click the Browse button (folder icon) to the right of the Image Name attribute to specify the image file for the texture map.

    A browser window appears with the path set to the default project directory. By default, Maya looks for source images for texture maps in a sourceimages folder whenever the project folder is set. Maya can use file texture images from anywhere on your workstation or local network. For example, you can have images on a central disk drive that is shared among users in a production environment.

  9. Select the image file named UVLesson.psd.

    This file can be found in the GettingStarted directory that you set as your Maya project:


    The image contains 2D artwork for the front, back, top, bottom, and sides of the cracker box that was generated in Adobe® Photoshop®.

    A small preview of the image appears in the Texture Sample box in the Attribute Editor.

    When a texture is applied to a shading material its attributes get added to the existing attributes for shading material. That is, all of the existing shading attributes remain unchanged except for the attribute that gets modified by the texture. In this case, the grey color is substituted by the image of the cracker box artwork.

  10. In the scene view, select Shading > Hardware Texturing from the panel menu to display the texture map on the cracker box model.

    The texture map does not appear correctly on the cracker box model. The texture map was designed so that specific sides of the box receive specific regions of the image. Instead, the complete image is being placed on every side of the object.

    To correct this problem you must modify the default UV texture coordinates for the model so they match the layout of the texture image. To do this, you use the UV Texture Editor.