HOW TO USE MULTI-TEXTURING
In this lesson, you will learn how to use layered textures as well as creating multiple UV sets.
This is a supplementary how-to to the Learning Maya 3 book, and it is suggested that you complete Project One in order to acquaint yourself with the Maya interface and workflows. You should also go through Project Three to help you understand Maya's polygon mapping tools.
Download the project files for your platform:
Press 6 to turn on Hardware Texturing and then press 7 to turn on Hardware Lighting.
By using backface culling, it will disable the display of objects that have their normals facing away from the camera.
To turn on backface culling, select Display > Custom Polygon Display > Options. Change Objects Affected to All and Backface Culling to On. This turns backface culling on for all object whether they are selected or not.
You will now add a new UV set and apply mapping coordinates to them.
You can create new UV sets a few different ways. You can create an empty set, or create a new set when you are applying a texture projection. You can also create UV sets when you Unitize UVs and Create UVs based on the camera view. There can be an unlimited number of UV sets in Maya.
Press F11 to go into Face Component Selection Mode. Select the faces that make up the floor, including faces in the side room. Your selection should match the image above. Do not include the face that represents the floor grate.
Select Edit Polygons > Texture > Planar Mapping > Options. This opens up the Polygon Planar Projection Options. Change the following Attributes:
Mapping Direction to Y Axis
You will now see a thick border around the polygons you have mapped and a Planar Projection Manipulator has been added to the scene. Since the projection covers the 0 to 1 texture space, you can leave it as it is.
Press F8 to return to Object Selection Mode. Press q to return to Selection Mode
With Multiple UVs, it is important to understand the difference between Default Set and Current Set. The Default set is usually the UV set that is first created when texturing. This UV set cannot be deleted, but can be renamed. The Current Set is the UV set that you are currently working on. This can be the Default UV set or any UV set that you select to work on. This UV set can be deleted and renamed.
The Current Set can be selected in a number of ways. If you have not assigned any additional UV sets to the model, then you are already working with the Current UV set. If you have created a new UV set with texture coordinates in it, then this set will become the Current UV set. This is not true when Creating Empty UV sets. If you RMB and hold on the model a popup will come up and if you go down to UV sets, you will see the UV sets listed. The UV sets can be distinguished by the fact that they have a check box next to them. You will also notice a list of recent texture projections as well. This was added to help select projections for editing as it was difficult to locate them throughout the regular UI. As you go through the workflow of Multitexturing later, a few more ways of selecting the Current UV set will be shown.
Now you will add another texture to the floor.
Open the Hypershade and locate the floor shader. Select the floor shader and then select Graph > Up and Downstream Connections. This will show all of the nodes connected to the floor shading group.
Select Create > Textures > Other > Layered Texture. Press with LMB in the Hypershade window to place the new node.
Select the connection between baseFloor and the floor material node. Press Delete on your keyboard to break this connection. You will notice that the texture for the floor disappears in the perspective window.
MMB drag and drop baseFloor onto the layered texture node. Select inputs[n].color >  in the pop-up. This will add the color output of baseFloor to the input color of layer 0 in the layered texture node.
Select Create > Textures > 2D > File. Press with LMB in the Hypershade window to place the new node. Double-click the file node to bring up the Attribute Editor. Click on the folder next to the Image Name text box and select the floor_lightmap.iff file in the textures directory of the project. Change the name to floorLightmap. Close the Attribute Editor.
MMB drag and drop the floorLightmap node onto the layered texture node. Select inputs[n].color >  in the pop-up. This will add the color output of floorLightmap to the input color of layer 1 in the layered texture node.
MMB drag and drop the layered texture node onto the floor material node. Select color in the pop-up.The floor texture now reappears.
You will now select a blending mode in the layered texture node so that it appears as though the floor is being illuminated.
Double-click on the layered texture node. The Layered Texture Attributes section has two areas. The first area shows the layering order of the different textures. Layering in this node goes from left to right with the base layer being on the right. The second area contains the attributes for color and alpha, but more importantly the blending mode of the selected layer. If you move your mouse over the different layers, the names of their inputs will be displayed and allows you to quickly distinguish which texture is on which layer. Selecting the layer will allow you to edit the attributes for that layer.
Select the floorLightmap layer and change the Blend Mode to None.
Select the baseFloor layer and change the Blend Mode to Illuminate. This will illuminate the floorLightmap with the baseFloor layer. This is arranged this way because this blending gives an output that resembles what the textures would look like in a rendered image of this level. If the floorlightmap were to illuminate the baseFloor layer, then the resulting blending would be brighter than a rendered image of this level.
In the perspective window, you will notice that the floor textures do not look the way they should. To force the hardware display to draw properly, add another layer below the floorLightmap layer by simply clicking in the area to the right of it. Set the Blend Mode of this empty layer to None. Press 6 to turn hardware texturing on. The floor texture now looks as if it is being light by the lights in the scene.
There is also a lightmap for the wall1 shader if you would like more practice at using the layered texture node.
Now you will assign the floorLightmap texture to the floorUVs.
After completing the above step you will probably have noticed that the floor texture looks fine. For the purpose of this lesson, the UVs for the floor of the Default set and the UVs for the floor of the floorUVs set are the same to help you visualize the layered texture portion of this how-to. As textures other than lightmaps may require different UVs, this step is important to the workflow. This workflow can be further investigated in the Multi-Texturing section of the Polygon Modeling Documentation.
Select Window > Relationship Editors > UV linking > UV-Centric ... . This relationship editor allows you to select the UV set that you want to link to a certain shader of file texture.
Select the model. In the Relationship Editor, the left window displays the UV sets, while the right window displays the shader and related texture information. Select the floorUVs in the left window. Then select floorLightmap.outColor on the right side. The floorLightmap texture is now using the floorUV texture coordinates.
Selecting a UV set in the left window also changes the Current UV set.
The layered texture node allows you to add many textures to any one shading group. This allows you to layer your textures as you wish within Maya and not have to rely on an external program to do your layering for you. The different blending modes allow you to create entirely new textures from textures that you may already have. These new textures can be written to a file using the Convert Solid Texture operation.
Multiple UV Sets allow you to use different texture coordinates for different textures. These sets can have unique identifiers and can be renamed.