Mental Ray


Tutorial: Noa Kaplan
Conrad Egan
Download the scene file used in this tutorial.

Indirect Lighting with Mental Ray
Indirect lighting is the effect that occurs when photons come out of a direct light source, such as a directional light, bounce off of a surface, and hit another surface. The secondary lighting effect, the light that you see on the other surfaces, is known as indirect lighting. Mental Ray is a production quality rendering application that generates convincing indirect lighting effects.
Scene rendered with Maya Raytracing vs Arnold vs Mental Ray
Mental Ray and Arnold calculate bounced light and polygons are more rounded. Arnold has no shadows with transparent.

General Set-up
To render your scene with Mental Ray, first you need to open up your Render Settings:

Open Windows->Rendering Editors->Render Settings... render_settings_button

Under the Common Tab:  down at the bottom: Render Options
     Uncheck Enable default lights You will render with light reflected from background.

Under Render Using:

Click the drop down list and choose mental ray  (If you do not see this option, load the plugin, follow the directions below.)

Install plugin, if you do not see Mental Ray options
Keep in mind that Autodesk did not develop Mental Ray; it is a plug-in for Maya, so you may have to enable it in the Plug-in Manager before you can see it as an option in your Render Settings window.
     To enable the plug-in:  Window>Settings/Preferences>Plug-in Manager
Check both the Loaded box and the Auto Load box next to the  Mayatomr.mll and

Global Illumination
Once you have your scene set up with several surfaces and direct light sources, you are ready to incorporate indirect lighting. Create a point light, in addition to the other light/lights in your scene. Position this point light close to one of the other lights.

Create>Lights>Point Light
Position the light above the scene.

Select the light and go to the Attribute Editor.

Under Shadows
     Under Raytrace Shadow Attributes:
          Select Use Raytrace Shadows
         Input Ray Depth Limit 3, so you can see shadows in the reflections.
Next, under mental ray:  (Does not seem to make a difference anymore.)
    Under Caustic and Global Illumination:
         Check Emit Photons
Change the value of Photon Intensity to 8000
Change the value of Exponent to 2.0

Create a red Mental Ray shader
Windows->Rendering Editors->Hypershade
Choose mi_car_paint_phen_x for glossy red
Assign this to the red ornament.

Windows->Rendering Editors->Hypershade
Choose Blinn
    Color Black
    Transparency white
    Eccentricity .1
    Specular Roll Off  1
    Specular Color darker
    Under Raytrace options,
Check  Refractions
    Change Refractive Index to .9

Open Windows->Rendering Editors->Render Settings or press render_settings_button
Under Quality

Under Trace Depth:
Change Reflection 4
Change Transmission 6
Change Maximum Trace Depth  10 (needed for layers of glass)
But you will have to play with some settings to make the lighting more realistic.

Final Gather
Open Windows->Rendering Editors->Render Settings or press render_settings_button

Select the Quality
Select Indirect Diffuse (GI) Mode-> Finalgather

Here are a few great guides for Mental Ray specific shader settings:


Transparency Maps
Create an image with 1 alpha channel, the alpha channel will automatically create a transparency map when you apply the image as a color map.
In Photoshop:
Make a 256x256 image with an Alpha channel.
     Select the Channels window
          Select New Channel... from the windows menu
          Select the Alpha1 channel
          Paint the transparent sections black, opaque white.

Save the file into your Unity Assets
folder as a tiff and or your Maya scenes folder too.

Double click a Maya shader ball.
Click the Map Button across from Color map_button.jpg
     Select the File icon texture_file_icon_create_render
     Change Filter Type to Off (less blurry)
     Image Name, select your tiff file that has an alpha channel
     A transparency map will be automatically generated along with the color map.
Some settings to take care of shadow render issues with transparency maps:
Maya Shader:
Translucence depth 0 (default .5)
Raytrace Options->Shadow Attenuation 0 (default .5)
If the transparancy is not working:
Raytrace Options
     Turn on Refractions
     Change Refraction Limit to 0

Transparency problems Ncloth
Select the original, non ncloth model, use attribute editor to look at Render Stats and Mental Ray
Everything should be checked for refraction
Look at the next tab over for Ncloth, same thing