In this part of the tutorial, you'll learn how to unwrap and texture the shark model. This time we'll explore a different method of texturing inside Maya, which is called 3D paint. This is somewhat like painting in ZBrush or MudBox and allows for direct 3D painting in Maya's viewports.
To start, let’s open the shark file which we saved in the previous part of the tutorial.
In the previous part, we applied UVs to the shark's body before converting it into subdivision. So we now need to flatten each part so we can use the 3D Paint Tool in Maya. With the shark body selected and while in Polygon mode, go to the Edit UVs menu and select UV Texture Editor.
This will open the UV Texture Editor window.
Now press the F10 key to enter Edge Selection Mode, and then Double Click on both side fin edges to select the entire loop as shown.
With the edge loops selected, go to the Polygon menu in the UV Texture Editor window and select the Cut UV Edges command to extract a separate shell.
Now Right Click on the shark UVs in the UV Texture Editor, and select UV in the fly-out menu as shown in the following image.
Select the UVs of the fin shell (which we cut in Step 4) and with the Control key pressed, Right Click on the fin shell and choose the To Shell command, to select all the UVs for the shell.
Now move the shell away from the main body UVs and place it in a different location, as shown.
Using the same technique, extract the fin shell and the other side. And also move it away as shown.
While in Edge Selection Mode, Double Click on the edge that outlines the shark's mouth, to select the entire loop.
With the edge loops selected, once again go to the Polygon menu in the UV Texture Editor, and select the Cut UV Edges command to extract the separate shell.
Using the same procedure, I have extracted all the folded UV shells and arranged them separately as shown below.
Next we need to relax and unfold all the UV shells. With one of the UV shells for the shark's body selected, go to the Polygon menu in the UV Texture Editor window, and click on the Relax options box.
In the Relax UVs Options window, check on Pin UV Border and set the Maximum Iterations value to 2, and then click on the Relax button.
You will see the selected UVs being relaxed into a proper flow.
Following the same method, I have also relaxed the UVs for the other side.
We now have to cut and separate the top and bottom faces of the shark's fins. So, press the F10 key to enter Edge Selection Mode, and then select the edge loops of both fins as shown.
Go to the Polygon menu in the UVs Texture Editor window and select Cut UV Edges.
Following the same process, I have extracted the shells for both fins properly.
We now need to take care of the flipped faces. To see which faces are flipped, click on the Shaded UV Display button in the UV Texture Editor window. This will display the flipped UVs in red.
Next select any of the flipped UV shells, go to the Polygons menu in the UV Texture Editor window and click on the Flip command to flip the selected UV shells.
You will see the selected UV shells are now flipped.
Repeating the same process, flip all the necessary UV shells one by one.
After flipping the UV shells, we need to sew and flatten them. With one side of the border edge selected (highlighted below), go to the Polygon menu and select Move and Sew UV Edges. This will sew the corresponding edges together.
After sewing the shells together, we need to relax and unfold them. So with a UV shell selected, go to the Tool menu and select the Smooth UV Tool.
You'll see the Smooth UV Tool on the grid. Click on the Unfold and Relax buttons as required to flatten the UVs as shown.
Here you can see the selected UV shell unfolded and relaxed properly.
Using the same techniques, I have unfolded and relaxed each and every UV shell. Now it’s time for painting and applying our texture map.
2. 3D Texture Painting: Color Map
Before starting our 3D painting, we have to remember one thing. We already converted the mesh from polygons into subdivision earlier in part 1, but then converted it back into polygons, so the unwrapping could be completed properly and in detail.
Since we have now completed the unwrapping process properly, it’s time to convert the polygon mesh back to subdivision once again. So with the shark's body selected, go to the Modify menu on the main menu bar and select the Polygon to Subdiv command, from inside the Convert submenu.
Now turn on Rendering mode (or press the F6 key on the keyboard.)
Go to the Texturing menu and click on the 3D Paint Tool options box.
This opens a new panel for the 3D Paint Tool inside the Attribute Editor.
Inside the 3D Paint Tool attributes, open the File Textures drop down menu and set the Attribute to Paint option to Color, and then click on the Assign/Edit Textures button to assign the texture map. This step is necessary as you can’t paint without setting this up.
Clicking on the Assign/Edit Textures button opens the Assign/Edit File Textures window. Here set the values for Size X and Size Y to 2048, and choose JPEG (jpg) as the Image Format. Then click on the Assign/Edit Textures button, to create and assign the texture to the selected mesh.
Also expand the Stroke drop down menu, check on the Reflection option, with the Reflection Axis set to X. With this option turned on, you can paint on both sides of the mesh symmetrically.
Now we'll start painting. First, choose a dark black Color with the Opacity value set to something like 0.21.
Go to the Flood panel and set the Color to pure white, then click on Flood Paint button to apply the white color onto the entire shark mesh.
You can see the result below.
Now with the dark black color selected, start painting on the shark’s upper body. Something similar to what's shown below.
Now we'll paint some dirt and dust patches on the shark's body. Change the Color to very dark black and increase the Opacity value to something like 0.32. Then click on the File Browser button.
Clicking on the File Browser button opens the Open window. Here select dapple.jpg file (included with the default Maya install.)
With the dapple.jpg image selected, start painting dust and dirt on the shark model.
You can also use the Blur tool inside the Paint Operations panel.
Now try to blur the patches in an artistic way, and also blur the paint seams if needed.
Once again with the same texture brush selected, change the Color to pure white and increase the Opacity value to around 0.75. Also turn on the Paint Radio button, as shown in the image.
Now paint some white patches as shown.
To add more variety, change the texture brush file to hatch.jpg (also included with the default Maya install) to paint some scratches on the skin. You can also use your own textures.
Take the white color and increase the Opacity value to something like 0.95.
Now paint some scratches on the skin.
We'll also paint some more patches, such as dotted spots. So first change the texture to sand.jpg (also included with the default Maya install.)
This area should also have some color. Change the color to red, with an Opacity value of 1.0. Now if you paint the bottom of the fin, you'll see some red spots. Keep painting artistically according to your needs.
Now we'll paint the gums of the shark. Pick a pink color with an Opacity value of 0.67, and start painting the gums as shown in the image.
With the same brush, color and opacity values selected. Increase the brush size by pressing B and dragging the Left Mouse Button to the left and right, to increase or decrease the size. With an increased brush size, paint some patches on the bottom of the shark.
We have completed the 3D painting on the shark's body. You can always choose your own colors and settings to further customize the look of your model.
After completing the texture painting, we need to save the texture for retouching in Photoshop, so we can get a much better look for the texture and colors. Scroll down in the 3D Paint Attributes and go to the File Textures option, and click on the Save Textures button to save the texture file.
3. 3D Texture Painting: Bump Map
Now we'll generate the bump map. Open the Attribute to Paint drop down menu and select BumpMap, as shown in the image.
After selecting Bump Map, select the shark and click on the Assign/Edit Textures button to assign the bump map to the selected shark mesh. When we apply a bump map for painting, the color texture may not display in the viewport.
After clicking on the Assign/Edit Textures button, it will open the Assign/Edit Textures settings box. Here set the Size X and Size Y values to a 2048 resolution, and then click on the Assign/Edit Textures button.
Now click on the File Browser button in the 3D Paint Attributes, and select the sand.jpg file for the texture brush profile. Finally click on the Open button.
Paint the bump wherever you want to have it. You can’t see the bump in the viewport, only in a rendered frame.
Render a frame to see how it looks. There is excess bumpiness, which is not looking good.
To adjust the bump depth, go to Window > Rendering Editors > Hypershade to open the Hypershade window.
In the Hypershade window, apply the Blinn 3 shader node (which is a bump texture node.) Select it and drag it inside the Work Area, as shown in the image below.
To rename the shader node, Right Click on it and select Rename from the fly-out menu.
In the Rename node box, type Shark Texture and click OK.
Again Right Click on the same Shark Texture node and choose Graph Network from the fly-out menu, to extract the node connection.
Now you can see the extracted graph nodes as shown in the image. Double Click on the Bump node to open the bump Attribute Editor.
In the Attribute Editor, under 2d Bump Attributes, set the Bump Depth value to 0.020.
Now render the frame again and you'll see the bumpiness has been reduced.
4. 3D Texture Painting: Specular Map
Let’s now apply a specular color texture map, just like we did for the color and bump. Go to the 3D Paint Attributes Editor and choose SpecularColor, from the Attribute to paint drop down menu, inside the File Textures section.
After clicking on the Assign/Edit Textures button, it will open the Assign/Edit Textures settings box. Again set the Size X and Size Y values to a 2048 resolution, and click on the Assign/Edit Textures button.
After assigning the texture, select the Artisan Smooth Blur Brush and a white color, and start painting the specular around the top surface of the shark mesh.
After painting the specular color, the rendered scene will look like this.
To see the texture in viewport, change the Attribute to paint option to Color, from inside the File Textures section of the 3D Paint Attribute Editor.
5. Applying Shaders
Now with both eyeballs selected, Right Click and select Assign Favorite Material > Blinn.
In the Blinn Attribute Editor, change the color to a dark blue as shown in the image.
Scroll down to the Specular Shading panel and change the Eccentricity value to 0.150, the Specular Roll Off value to 0.800 and the Specular Color to white, to add glossiness to the eyeballs.
We now need to apply a shader to the teeth mesh group. First go to Window > Outliner. We have already grouped all the upper and lower teeth in the Outliner window, so select the Teeth group.
With the Teeth group selected, apply a new Blinn shader node and change its color to pure white.
We have now completed the shark texturing process. Be sure to Save the file to use in the next part of the tutorial.
This is the final result of our well textured shark.
After doing some lighting and compositing in Photoshop, it looks like this.