Tuesday, February 14, 2012

Maya: Simple HDRI Rendering Setup in Mental Ray

This tutorial will show a method for quickly setting up an HDRI lit scene in mentalray for Maya.  HDRI stands for High Dynamic Range Image.  Images of this type hold color intensity values beyond the black to white limits of a standard 8bit image file.  For more information and sample HDRI maps see the site of Dr. Paul Debevec a pioneer of this type of image (http://www.pauldebevec.com/Probes/).  We will use this type of rendering to setup a scene quickly for realistic lighting and reflections.



We will start with the object we modeled in the last tutorial for our scene.  I will also create a ground plane and some spheres to test materials.

First we will setup our render settings.  To access the render settings you can go to Window>Rendering Editors> Render Settings in the menu toolbar.  The first tab, "Common" allows you to set your image size, image type and output (single frame or animation), rendering editor and default light options.  We will set our "Render Using" tab to "mental ray." Mental ray is a powerful rendering engine which will allow us to create ambient lighting conditions.  Under "File Output" we will set the image type to tiff and give a name to our image under "file name prefix."  We will also set our image size to 640x480 under "Image Size".  The only other option we must be sure to check off is the "enable default lights" option under "Render Options"

The next tab we will need to adjust in the render settings is the "Quality" tab.  Start off by switching the "Quality Presets" setting to "Production."  This is a heavier setting than we need, however we can come back and reduce quality where we want to.

First we will adjust the "Multi-Pixel Filtering" from Gauss to Mitchell.  Mitchell will give sharper edges in our image, which I prefer for single frame renders.

Next we will go to the "Raytracing" tab.  This tells the rendering engine how many times it should bounce rays through a scene to search for reflection, refraction and shadow color.  To speed up the rendering I have reduced the reflection settings to 4.  This means when calculating a reflection, mental ray will bounce a ray 4 times through the scene, and then output black if additional bounces are required.  It is unlikely for our scene that we will need more than 4.  Similar I reduce the other settings.  This will improve speed.


Next we are going to go to the "Indirect Illumination" tab.  Under "Final Gathering" turn on "Final Gather."  Lower the default accuracy to around 40 to start.  A lower number in Accuracy will result in blotchy output, while a higher one will give more accurate lighting but a longer render time.  In order to compensate we are going to increase Point Interpolation to 40.  This averages out the blotches to make the image smoother but also removes some accuracy.


Now we can set up our HDRI lighting environment.  To do this, click on the "Create" button for "Image Based Lighting".  When you do this, the attributes for your image environment should appear in the attribute editor.  Under "image name" in the attribute editor, I will click the folder to open up the file browser and select my .hdr image.


Since most of you are using Maya with z up to streamline translation to Rhino, we will also need to rotate the Image Sphere that the HDRI is mapped onto.  To do this zoom out from your scene and select the sphere.  In the attribute editor, set the x rotation to 90.


Now if you render the scene, you should get a grey smooth shaded image like the one below.  Now lets move onto mental ray's material options.



No comments:

Post a Comment