Mental Ray – Optimization

Category : Advanced, Featured, Written · by Nov 24th, 2009

header

In this tutorial we are going to look at the process of rendering in a more in depth way.

Rendering involves far more than just hitting a button and letting the computer do its thing. As with everything else in Maya, you have a million settings to make it do what you want. Some are more apparent than others and some are more costly in terms of render time than others.

This tutorial, rather than being solely a step-by-step how to, is going to be a balance between introduction and instruction. I am going to introduce you to some concepts, some settings and some tools and then leave the work to you. For those of you who are sweating right now, don’t worry. I will still give you some step-by-steps and screen shots for setups, etc. I just won’t hold your hand the whole time. You are big kids now after all aren’t you?

So, our models are textured and our animations are done. Now we need to render it… Ok… Can’t we just hit the button? The short answer is, um…well…yeah. The long answer is NO, ARE YOU KIDDING ME?!?!?!?

You just spent all that time working meticulous detail into your model and animation and you just want to let Maya have it and spit something out. Don’t you think you owe it to yourself to at least spend a little time trying to make the render look good? After all, that is what you will be showing everyone upon completion. Possibly for your mom’s fridge, your boss at work or, oh I don’t know, your TEACHER?

Alright, so now you are thinking, geez… this guy just won’t let up…Fine… I will just crank all of the settings to the max and THEN hit the render button. Uber Max Quality couldn’t possibly be a bad thing right? Again, you can do that if you want, but then again, you will probably still be waiting for it to finish while everyone else is retiring.

Are you frustrated yet?

Don’t worry, we are going to look at the important base level settings that you will need to worry about to get your renders to look nice and still have a decent render time. As a bonus for your hard work I will also show you some cool stuff that will make your renders look even better. It’s okay. You can say it. I’m happy that I’m your teacher too. :-)

By the way, for continuity we will be using Mental Ray for the rendering in this entire tutorial.

For the first part of the tutorial we are going to look at render quality vs. efficiency. Below is a checklist of those items.

Here they are:

  1. Anti-Aliasing
  2. Raytracing
  3. Scene and Render Resolutions
Lets get started shall we!

First we need to Acquire a model to work on.

  1. 1. Download mentalRay.zip and save it to your maya projects directory
  2. 2. Unzip/Extract the mentalRay.zip file so that you have the stillLife project folder in your maya projects directory.
  3. 3. Open maya and go to file> Project> Set
    • Navigate to your maya projects directory and choose the mentalRay project.
  4. 4. Go to file>Open Scene and choose the stillLife_clean.ma file
  5. 5. Once the file is opened you should see the Still Life model sitting on the grid. See image below.

Next, lets do a quick render to see what we get by doing nothing to our settings.

To make sure we are rendering in Mental Ray:

1. Open your Render Settings window.
2. Click and hold on the drop down menu at the top.
3. Choose mental ray from the list.

Yuuuuuuuuuuucccccckkkkkkk!!!!!

If you don’t see why I am so upset. Look again. Check out the edges where it goes from Model to background. What you are seeing is something called Aliasing.

Aliasing is the process where a grid of pixels (or our image) tries to define a diagonal line and you tend to get a stepped pattern. Look at the 2 letters below.

letters

The ‘A’ on the left is a fully ‘aliased rendering.’ It’s kind of like trying to build a diagonal line with Lego blocks. Sure you can make it happen, but it gives you a stepped look.
The ‘A’ on the right has gone through a process called ‘anti-aliasing’. What happens is the pixels that surround those that quickly go from Black to White are given a value of gray to help ‘smooth’ the transition. While there is still a clear stepping patter evident with these large letters, at a low-resolution it definitely looks more smooth.

Lets look at how this is handled in Maya.

Open Maya’s Render Settings. Click on the mental ray tab and open up the Anti-Aliasing Quality section (see image below).

antialising

Among all of these settings there are mainly 2 that you need to worry about.

1. The Max Sample Level

2. Filter

Right now the Max Sample level is set to 0. Which yields a sampling of 1 sample per pixel. What this means is that during render time when Mental Ray renders a given pixel it only samples itself to determine whether any anti-aliasing needs to be applied. Basically having this at 0 means you get a fully aliased image.

Changing the Max Sample Level to 1 will now set the sampling to 4 samples per pixel, which is better, but still pretty aliased (see image below).

sample1

Changing the Max Sample Level to 2 will now set the sampling to 16 samples per pixel. This time it is pretty darn good, but in circumstances like this we need just a bit more (see image below).

sample2

Finally, changing the Max Sample Level to 3 will now set the sampling to 64 samples per pixel. This is about as clean as we really need to get for a rendering like this (see image below).

sample3

I hope you noticed that your render times got longer as you increased the Max Sample Level. You need to be aware of how this number affects both your final render “look” and your final render “time.”If your render times are getting really long, but you are not seeing a significant change in the quality. Do not worry about bumping your levels higher. Treat it on a case-by-case basis.

As I mentioned above the other section to look at here is the “filter.”

The filter is the algorithm that is used for “how” the pixels are sampled and how smooth/sharp the final render will become.

The choices you have are ‘box’, ‘triangle’, ‘gauss’, ‘mitchell’, ‘lanczos’.

Box tends to be a bit sharp, but a bit low quality.

Triangle is a little softer then box and a medium quality.

Gauss is the most soft of all of them and has a fairly high quality.

Mitchell is the sharpest of them all and has a high quality.

Lanczos is a balance between Gauss and Mitchell in terms of sharpness and has a high quality.

You will want to treat each render separately as to which filter to use. In some cases even the low quality one will work best. I tend to use the Mitchell filter 99% of the time.

Below is our final image Rendered with a Max Sample Level of 3 with the Mitchell filter.
sample3mitchell

While it looks WAAAAAY better than our first image, it definitely took longer to render. In our case this render time is more than fine, however, you will need to judge this on a case-by-case basis.

Now you know how though!

Milestone ‘A’ has been covered! We now know what anti-aliasing is and how to control it. Let’s recap and see what we need to do next.

  1. Anti-Aliasingcheck
  2. Ray Tracing
  3. Scene and Render Resolutions

Milestone B is to look at Ray Tracing. What it is and how to control it to get the best quality for the least amount of render time.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • MySpace
  • Technorati
SHARE :

(4) comments

Andrew
1260 days ago · Reply

This file is also not here?

agdsqpvgz
944 days ago · Reply

Bxdne7 hdxnlgtssnbk, [url=http://shryweccaziy.com/]shryweccaziy[/url], [link=http://eonbvsgiaiey.com/]eonbvsgiaiey[/link], http://vkwfglmuqnmy.com/

Mr Mitchell Lanczos
51 days ago · Reply

While gaussian filtering is, indeed, “soft” looking, there is nonetheless a particularly significant reason it is the default multi-pixel filtering method used for the production preset:

Both mitchell and lanczos filtering algorithms are able to achieve slightly higher contrast by (simplistically speaking) exaggerating the weighting of the sub-samples relative to the gaussian method. But a shortcoming of either algorithm is that they will, if unaltered, potentially produce negative pixel values. To correct this any negative pixel values are clipped at pure black. This effectively reduces the resulting range of pixel values that would otherwise be produced when compared to the gaussian algorithm and the discrepancy is viewed, from a technical perspective, as a shortcoming that is often significant enough to discourage its application in professional production.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>