Monday, April 25, 2011

Mental Ray Sampling cont. -- Fast Rasterizer, Shades per Pixel

In this post we'll look at some renders using the Fast Rasterizer having determined that 64 Samples per Pixel will provide a good quality render, as good as the  Minimum Maximum render sampling option set to 4 & 64.
Rendering with 1 Shade per Pixel seems to look good enough but further evaluation of some different parts of our renders will show that we need to increase the 'Shades Per Pixel" to insure the best quality.

Example 1 shows a benchmark using the Minimum Maximum method reviewed a few posts back. We've set min = 4 and max=64 as demonstrated in that post for best quality. Let's focus on the shadow created by the sign highlighted in red. Render time = 16 minutes for the full frame (864 x 486) of which this is only a small portion:

Next is an Example using Fast Rasterizer with Samples set to 64 and Shades Per Pixel set to 1. Clearly some artifacts in the shadows of the signs. These will flicker in an animation also. However, note that the render time = 2.5 min!:

Example 3 shows the result of increasing Shades Per Pixel to 4. Clearly an improvement, but careful examination will show that the shadows are still not quite as cleanly anti-aliased as example 1:


Finally, let's increase the Shades Per Pixel to 6. This will yield a render as good as the Min Max option in example 1, but the render time?.....4.3 minutes!

In summary, the Fast Rasterizer is a much faster rendering algorithm than the default Minimum Maximum option and with some tweaks can provide superb quality renderings in 1/2 to 1/4 the render time. I noted an exception to this in an earlier post. This occurs when you are rendering a frame that contains mostly a blank background or background image, for example a render intended for compositing. The Minimum Maximum sampling option discriminates about the amount of sampling to do for each pixel based on the Spatial Contrast settings. Some buckets will render very fast while others will take a long time. With an absence of 3D elements in the bucket, the renderer will blow through these buckets very quickly. The Fast Rasterizer is not so discriminating and will render all buckets with a more uniform render time, regardless of what is being rendered and hence these types of frames can take longer to render with fast rasterizer.

Next I'll show some quick examples of the parking lot stripes rendered in an animation to show how the results affect anti-aliasing "flicker".

Mental Ray Sampling cont. -- Fast Rasterizer

In this post we'll consider the same scene as the last post but we'll change the Rendering Algorithm and Sampling options to "Fast Rasterizer". This option ignores the Minimum Maximum and Spatial Quality settings and includes its own "Samples" and "Shades per pixel" settings instead.

Example 1 : This is rendered with the default settings for Fast Rasterizer, 16 samples and 1 shade per pixel.
An improvement over anything but the best settings from the Minimum Maximum option discussed earlier, however, still rather poor quality anti-aliasing. Note that this will also flicker badly in an animation. Render time for the full frame (640 x 360) =  35 sec.

Example 2: Fast Rasterizer Samples set to 36. 1 Shade per pixel. Again, a slightly better quality as expected:

 Next Example is the same as above but uses the "Mitchell" filter (4x4). Still a better render:

Finally, a Fast Rasterizer Example with Samples set to 64 and 1 Shade, using the Mitchell filter: 
Now the big news. The above example, rendered at full frame (640 x 360) and equal or better in quality than the best render with Minimum Maximum method, rendered in 45 seconds. That's half the time!
Next we'll look at the 'Shades per Pixel" option with the Fast Rasterizer.

Mental Ray Sampling cont. -- Min/Max method

This is a multi-part post continuing with findings related to Mental Ray's various "Sampling" settings in 3ds Max. The test scene (taken from a recent project) involves an exterior with a camera fly-down. Included in the scene is a parking lot with 3D stripes on a terrain surface and later, a view from near the surface of the parking lot with a few street signs casting shadows. Both the stripes and the shadows figure strongly in decisions related to the sampling settings required to create a quality rendering, both for an animation and for still shots.
First some examples to help make some decisions about utilizing the "Minimum Maximum" sampling option. The "Fast Rasterizer" and "Min Max" options are mutually exclusive with some different choices related to quality and speed of render. In a previous post I mentioned that the Fast Rasterizer method seemed a better choice for speed vs quality and the examples in these next 2 posts will bare this out with one exception which I'll note later. Before we discuss the issue with animations, lets take a look at some single frame renders. Note that all the following renders are zoomed in portions of a full frame at 640 x 360. The zoomed in region will make the differences presented more easily seen. We are interested in settings to create the final beauty shot here, not previews or test renders.

Example 1 shows a render with the Minimum Maximum method set to 1 and 16 respectively. No pixel will be sampled less than once. A decent setting but as the render shows, the parking lot stripes barely even show up, so this is not a viable option for a quality render and so not worth discussing further. (Note that 3ds max considers this to be a "High" quality setting).

Example 2: So what happens if we increase the Minimum to 4. Notice that it's an improvement, but some of the stripes either don't show up or show up poorly:
Example 3: Well, what if we increse just the Maximum option (1 and 64 repsectively). Again, missing or poor quality stripes:

Example 4: If we use 4 and 64 for min and max respectively we'll get an acceptible rendering:


All of the above renders used the "Box" filter set to 1 x 1. Render time for the full frame of the last sample at 4 and 64, min & max, was 1:33. As a comparison, here is the same render with the "Mitchell" filter set to 4x4 which provides a slightly better anti-aliasing computation at the cost of a little more render time (1:53):

In the next post we'll look at the same scene and views with the Fast Rasterizer.