Model and Texture a Photorealistic USB Cable with Maya and Mental Ray: Part 2



In this tutorial you will go through the process of modeling and rendering a Photorealistic USB cable in Autodesk Maya. You will also learn to use Mental Ray, along with the new architectural materials, rendering layers, and Photoshop, to create a fast, accurate, and photorealistic depth of field.
Step 1
This is where we left off at the end of Day 1.



Step 2
Go to “Window > Rendering Editors > Hypershade”.



Step 3
Go to “Window > Settings/Preferences > Plug-in Manager”, and locate “Mayatomr.mll". Check off both "Loaded", and "Auto Load" (do this step only if mental ray is not already loaded).



Step 4
With the “Hypershade” window open, change the type of nodes from Maya to Mental Ray, and create a new “mia_material_x”



Step 5
Go to the attribute editor for the new material, name the material, and adjust the attributes as shown.



Step 6
Scroll down to the "Bump" selection, click on the little check board square at the right of "Standard Bump" (this will open a new window). Now scroll to the "3D Textures", and select “Rock”.



Step 7
With the “Bump” attribute editor open, change the “Bump Depth” to '0.062', and click on the door at the right of “Bump Value”.



Step 8
Change “Color 1” to a white grey.



Step 9
In the “Hypershade” editor, create 3 “mia_material_x” materials.



Step 10
Open the attribute editor of one of those materials, name it "mia_cable", and adjust the attributes as shown.



Step 11
Scroll down to the bump section, click on the check board square next to "Overall bump" (this will open a new window), scroll down to 3D textures and select "Brownian".



Step 12
With the "Bump" attribute editor opened, change “Bump Depth” to "0.372", and click on the little door next to “Bump Value”.



Step 13
Name the texture "brownian_cable" and modify the settings as shown.



Step 14
Open the attribute editor for another one of the “mia_material_x” materials, name the material "mia_MetalConnector", and adjust the attributes as shown.



Step 15
Don´t forget to check the “Metal Material” option, at the bottom of the "Reflection" section.



Step 16
Scroll down, open the “Anisotropy” section, and change the “Anisotropy” value to "0.100".



Step 17
Open the last “mia_material_x” material, name it "mia_whitePlastic", and adjust the attributes as shown.



Step 18
Now assign every material to corresponding polygons in the scene. This is how it should look.



Step 19
Select the white box inside of the metal connector, and go to “Window > UV Texture Editor”.



Step 20
Go to “Create UV´s > Planar Mapping”.



Step 21
With the top view active, scale the mapping so it only covers the 2 holes on the metal connector.



Step 22
With the “UV Texture Editor” open, go to “Polygons > UV Snapshot” (this will open a new window).



Step 23
Modify the settings as shown.



Step 24
Open up the UV snapshot file you just saved in Photoshop.



Step 25
Make a White layer.



Step 26
Add some dirt to the image and save it out.



Step 27
Open the attribute editor for the white material, click on the little check board square next to color, and in the new window, click on “File”.



Step 28
Select the image you made with Photoshop, and change the “Filter Type” to off.



Step 29
Go to “Create > Lights > Area Light”, and create 2 lights.



Step 30
Position the lights as shown.



Step 31
Open the light attribute editor and change the “Intensity” to "0.744".



Step 32
Scroll down to the “Shadows” section, check the “Use Ray Trace Shadows” option, and change “Shadow Rays” to "30".



Step 33
Make the same adjustments for the other light.



Step 34
Go to “Create > Cameras > Camera”.



Step 35
In the little menu on top of the perspective view, go to “Panels > Perspective > Camera”.



Step 36
Move the camera to a good position.



Step 37
Open the “Rendering Settings”, and change “Render Using” to "Mental Ray".



Step 38
Go to the “Quality” tab, and adjust the settings as shown.



Step 39
Go to the “Indirect Lighting” tab and activate “Final Gathering”.



Step 40
Go to the “Common” tab, change “Renderable camera” to your main camera, and the image size to "720P".



Step 41
Now render the scene. As you can see, we are only missing the depth of field.



Step 42
Go to the "Rendering" layers editor, create a new layer named “Depth of Field”, and add all the objects in the scene to it.



Step 43
With the new render layer selected, go to the camera attributes, scroll down to “Depth of Field”, right click the option, and select “Create Layer Override” (the words should change to orange).



Step 44
Adjust the settings of the depth of field as shown.



Step 45
Go to the "Depth of Field Tab", click on "Presets", and select "Luminance" map (everything should turn black).



Step 46
This is how the scene should look.



Step 47
Render the layer. Now we have depth of field information for Photoshop.



Step 48
In the “Render View” menu, go to “File > Save Image” and save the image.



Step 49
Now render the master layer, and save the image.



Step 50
Open Photoshop, make 2 layers (1 with the USB, and the other with the depth of field information). Select the depth of field layer and copy it.



Step 51
With the “Channels” tab active, create a new channel, and go to “Edit > Paste”.



Step 52
Hide the depth of field layer, and select the USB layer.



Step 53
Go to “Filter > Blur > Lens Blur” (this will open a new window).



Step 54
Change the source to “Alpha 1”, and adjust the other settings to match you preferences. Click on OK.



Final Result
Now save the image and you are done!!!


