Get a free year on Tuts+ this month when you purchase a Siteground hosting plan from $3.95/mo
In this overview tutorial, author Pratik Gulati will give you valuable insight into Lighting and Rendering a scene in Maya using Mentalray. Using his "Abandoned Backyard Lobby" image as a basis, Pratik will discuss how he approached the Lighting setup and walk you through the render settings for achieving a very realistically lit interior scene with Mentalray.
Discover the secrets behind lighting and rendering scenes with Maya and Mental ray in this easy to follow, step by step walk through for a realistic output. Basic parts of the tutorial are Scene and Model layout, with the primary focus on Lighting and Rendering for a realistic\stylized result.
Final Effect Preview
In this tutorial, I’ll be using Maya 2011, but the steps can be easily followed in both older and newer versions. So the first thing would be opening your program, I have created two layers which will help in managing our scene, "Lights" and "Models".
Keep in mind when working with with CG environments, where we want photo real quality it's really important to make sure that our object's scale is accurate or as close as possible. As it plays an important role in achieving a good render, as you can see the scene is quiet simple, mostly modeled with simple box shapes. There is an opening on the front left of the scene for the environment light to enter, which will be our main light source.
Now we click on the render settings tab and choose "Mentalray", this will enable Mentalray as our renderer and also enable Mentalray specific materials.
Now we assign a simple "Lambert" Material to all the objects in the scene, and do the basic scene Lighting and Render settings. This is to finalize the lighting and render settings, and also save time since it will render really fast.
We will now work on additional Lighting and Render Settings to achieve similar result to what's shown below.
We can create a new Light by going to the Create > Lights menu and choosing one from the list.
Let’s discuss the placement for the lights in the scene There are three area lights in the scene, as well as one direction light and one point light. Lights 1-4 affect our scene directly, where as Light 5 has been placed in the opposite direction, and will affect the scene in an indirect way in the form of bounced light.
Area Lights simulate light being cast consistently and continuously from the entire surface of the area. I have applied a "mib_cie_d" node, which helps to assign the proper color according to the light's temperature. It's more accurate than manually assigning a simple color to the light.
The "mib_cie_d" node has only two attributes, "Temperature" and "Intensity". In "Temperature" you simply enter the color temperature you want. "Intensity" has no effect when the "mib_cie_d" node is plugged in as the color value. The intensity is controlled with the default intensity attribute of the light.
Below you can see the color temperature chart by Jermy Brin , we can use these values to get a approximate idea of what color we'll get from a specific temperature.
"Raytracing" is a type of shadow rendering, where the path of individual light rays are calculated from their source (the light), to their destination (the camera). Use Raytraced shadows only to produce more physically accurate shadows (like those in the real world.)
- Shadow Rays - Increasing this will increase the samples of our shadow quality, but will also increase our render times.
- Ray Depth Limit - Is the limit of how many times the light ray will bounce from one surface to another.
We use Directional light to simulate a very distant point light source (for example, the sun as viewed from the surface of the Earth). A "Directional Light" shines evenly in one direction only. It's light rays are parallel to each other, as if emitted perpendicular from an infinitely large plane. Our Directional light also has the "mib_cie_d" in it's color slot, with "Use Ray Traced Shadows" checked.
The Color Temperature of the various lights in the scene are shown below, we are also using "Ray Trace Shadows" for all lights.
A "Point Light" shines evenly in all directions from an infinitely small point in space. We are just using it to brighten up our scene a bit. This light is not casting any shadows.
I have also placed an "Area Light" inside for the simulation of bounced light.
Let's discuss Render Settings, Now in the "Common" tab of the Render Settings rollout, we can change the image "Width" and "Height" size to our desired size.
In the "Features" Tab we turn on both "Raytracing" and "Final Gathering".
The "Quality" tab helps in controlling the quality of the render in terms of Samples and Antialiasing.
- Anti-Aliasing Quality - Controls how Mentalray for Maya, anti-aliases objects during rendering. We choose "Adaptive Sampling" mode and set the "Max Sample Level" to 2
- Adaptive Sampling - The number of samples used per pixel varies depending on the contrast of your scene. The "Max Sample Level" and "Min Sample Level" will not differ by more than 2 .This is the best method and will give a fast and favorable output in less time.
- Min Sample Level - This is the guaranteed minimum number of samples per pixel used when processing an image.
- Max Sample Level - This is the absolute maximum number of samples per pixel used when processing an image.
Under "Multi-Pixel Filtering" - Choose "Mitchell" or "Lanczos". These filters tends to sharpen the final computed pixels. Therefore, if you want to enhance the image details, choose "Mitchell" or "Lanczos" as your filtering method.
Raytracing can produce the most physically accurate Reflections, Refractions, Shadows, Global Illumination, Caustics and Final Gather.
- Reflections - The maximum number of times a ray can be reflected off, reflective surfaces.
- Refractions - The maximum number of times a ray can be refracted through non-opaque surfaces.
- Max Trace Depth - While the Reflections and Refractions settings, each set the maximum number of times a ray can reflect or refract (respectively). This setting sets the total number of penetrations that can occur regardless of whether the penetration is a result of reflection or refraction.
In the "Indirect Lighting" Tab, we turn on "Final Gather" to get indirect illumination in our scene.
- Accuracy - Controls how many rays are shot in each Final Gathering step to compute the indirect illumination.
- Point Density - Controls the number of Final Gather points to be computed, performing the full and time-consuming Final Gather tracing.
- Point Interpolation - The number of Final Gather points to be considered for interpolation at a shading sample during rendering.
- Secondary Diffuse Bounce - Use this attribute to set multiple diffuse bounces for Final Gathering.
Our lights and render settings are now done. I have added simple textures to the scene, there are no complex shaders. Just a reflective Blin Shader on the floor, the rest of the materials just have a map in the "Diffuse" slot. After applying the textures we get a render like this.
The render looks a bit flat, so we need to add Ambient Occlusion to add weight to the scene and darken the corners a bit. Create a New Surface Shader and connect a "mib_amb_occlusion" node to the "Out Color" slot of the shader, apply this to the whole scene.
In the Shader we change the "Samples", "Spread" and "Max Distance".
- Samples - Controls the overall quality of the occlusion. Increasing the number of samples will reduce noise.
- Bright and Dark sliders control the lightest/darkest color of the occlusion.
- Max Distance - Is the how far a ray of occlusion will go in search of another object to occlude.
We also use Mentalray to render this "Ambient Occlusion" pass. It will give us an output like this (shown below.)
The last step would be to "Multiply" or "Overlay" the AO render with our beauty pass (and set the desired layer opacity). We can do this in any image editing Software, such as Photoshop to get the best final result.