MentalRay is tricky, but I find the default settings that come with Maya and 3D Studio Max aren’t any good.
Here are my performance tips.
Samples per pixel:
In 3D Studio Max they rate this as percentages, and in Maya as samples. Either case the rule tents to be the same. Keep your sample range no more then 3 units aparts. The wider the range the long the render will take. I’m not sure why, but it could be that Mental Ray has to perform more samples to see if antialaising is happening when the range is wider. So in Maya something like 0 to 2 is fine, but -2 to 4 is bad. Better off with 2 to 4.
Jitter: Jittering in MentalRay doesn’t effect performance, but by default it’s turned off in Maya and 3D Studio Max. Turn it on.
Bucket Size: Always work with larger buckets. Something like 64 or 128 can improve performance. Specially if you are using satellites.
Scanline: Some people have told me that they get better performance out of MentalRay with the scanline rendering turned off. This might be true if you have a lot of reflections.
BSP: There is no question that the BSP is the best way to boost performance of MentalRay. Changing these settings directly effects the performance of calculating FG and reflections/refractions. The default BSP depth in 3D Studio Max is 40. When I render my highway with 40 it takes 2 minutes. If I change this value to 1,000 it takes 58 seconds. That is a huge performance boost. What I can figure is that out of the box products like Maya and 3D Studio Max have defaults for people with about 1Gig or less of memory. If you are like me and have lots to spear then boost those BSP settings. I also set the Size (or width) to 2 not 10.
On the other side of the coin. Decreasing these values slows down MentalRay but greatly frees up memory. If you find you are swapping while rendering then lower the BSP settings.
Trace Depth: I always set these values to 2. Anything more is for illustration.
Final Gather
The default method that MentalRay uses to compute the radius of FG rays is to take the size of your whole scene and divid it by 100. So ray width = scene width / 100.
The best tip I can give for controlling the performance of FG is to never allow it to calculate the pixel radius values. Always define the min/max range for FG rays. I usually work with the radius in pixels of 35 to 30. Keep your range narrow (again wide ranges in MentalRay don’t give you better performance).
The trace depth for FG should be reduce to 2 for everything. Unless you are rendering a visualization for print, or you have very rich secondary lighting.
Some have told me that setting the falloff range for FG rays can boost performance. It does seem to help, but not by much. It depends a lot on your scene.
The Best Tip for Mental Ray users
MentalRay has to convert all textures into it’s native MR texture format (or MAP). It often has to do this on the fly while setting up the scene. One of the problems is that MR will use default settings when doing the conversion.
If you convert your textures to MAP by hand, and turn on the mip-map feature. The texture file will be larger, but rendering will be faster. Since MR doesn’t have to perform as much texture anti-aliasing filtering. A mip-map texture is one that has been scaled by 2 several times, and MR can use the best sized texture that has been pre-filtered.
So take the time and convert your TGA, JPG and GIFs to MAP.
The results
By using the same final gathering settings. I was able to render the same image that took 2 minutes in just 1 minute, but making the correct changes to textures, BSP and filtering.
Don’t live with the defaults.
