Want a free year on Tuts+ (worth $180)? Start an InMotion Hosting plan for $3.49/mo.
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.
This is where we left off at the end of Day 1.
Go to “Window > Rendering Editors > Hypershade”.
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).
With the “Hypershade” window open, change the type of nodes from Maya to Mental Ray, and create a new “mia_material_x”
Go to the attribute editor for the new material, name the material, and adjust the attributes as shown.
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”.
With the “Bump” attribute editor open, change the “Bump Depth” to '0.062', and click on the door at the right of “Bump Value”.
Change “Color 1” to a white grey.
In the “Hypershade” editor, create 3 “mia_material_x” materials.
Open the attribute editor of one of those materials, name it "mia_cable", and adjust the attributes as shown.
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".
With the "Bump" attribute editor opened, change “Bump Depth” to "0.372", and click on the little door next to “Bump Value”.
Name the texture "brownian_cable" and modify the settings as shown.
Open the attribute editor for another one of the “mia_material_x” materials, name the material "mia_MetalConnector", and adjust the attributes as shown.
Don´t forget to check the “Metal Material” option, at the bottom of the "Reflection" section.
Scroll down, open the “Anisotropy” section, and change the “Anisotropy” value to "0.100".
Open the last “mia_material_x” material, name it "mia_whitePlastic", and adjust the attributes as shown.
Now assign every material to corresponding polygons in the scene. This is how it should look.
Select the white box inside of the metal connector, and go to “Window > UV Texture Editor”.
Go to “Create UV´s > Planar Mapping”.
With the top view active, scale the mapping so it only covers the 2 holes on the metal connector.
With the “UV Texture Editor” open, go to “Polygons > UV Snapshot” (this will open a new window).
Modify the settings as shown.
Open up the UV snapshot file you just saved in Photoshop.
Make a White layer.
Add some dirt to the image and save it out.
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”.
Select the image you made with Photoshop, and change the “Filter Type” to off.
Go to “Create > Lights > Area Light”, and create 2 lights.
Position the lights as shown.
Open the light attribute editor and change the “Intensity” to "0.744".
Scroll down to the “Shadows” section, check the “Use Ray Trace Shadows” option, and change “Shadow Rays” to "30".
Make the same adjustments for the other light.
Go to “Create > Cameras > Camera”.
In the little menu on top of the perspective view, go to “Panels > Perspective > Camera”.
Move the camera to a good position.
Open the “Rendering Settings”, and change “Render Using” to "Mental Ray".
Go to the “Quality” tab, and adjust the settings as shown.
Go to the “Indirect Lighting” tab and activate “Final Gathering”.
Go to the “Common” tab, change “Renderable camera” to your main camera, and the image size to "720P".
Now render the scene. As you can see, we are only missing the depth of field.
Go to the "Rendering" layers editor, create a new layer named “Depth of Field”, and add all the objects in the scene to it.
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).
Adjust the settings of the depth of field as shown.
Go to the "Depth of Field Tab", click on "Presets", and select "Luminance" map (everything should turn black).
This is how the scene should look.
Render the layer. Now we have depth of field information for Photoshop.
In the “Render View” menu, go to “File > Save Image” and save the image.
Now render the master layer, and save the image.
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.
With the “Channels” tab active, create a new channel, and go to “Edit > Paste”.
Hide the depth of field layer, and select the USB layer.
Go to “Filter > Blur > Lens Blur” (this will open a new window).
Change the source to “Alpha 1”, and adjust the other settings to match you preferences. Click on OK.
Now save the image and you are done!!!