Depth of Field Quality Adjustment in mental ray

Written December 6th, 2010
Categories: Articles, Rendering / Compositing
4 comments

In this quick article, we’ll be visually exploring how to adjust the quality of the depth of field effect in 3d Studio Max with mental ray.  The process is closely tied with how you increase the quality of your render (sampling).  All you have to do is increase your render sampling to smoothen the depth of field effect. Once you’ve had some practice, you’ll know just how to adjust your render to get great results every time.

Let’s begin with my warehouse sample scene.  There are several aspects of the scene that make it perfect for testing depth of field.

  1. There are numbers around the scene that represent a distance from the camera in feet.  ”2″ is 2 feet from the camera, “4″ is 4 feet from the camera, etc.
  2. There are lots of detail around like girders and windows that will accentuate any blurring effects.
  3. The floor and wall have a checker pattern that is 1-foot by 1-foot squares.  They also help us understand the blurring effect.
basic render of the warehouse

This is a basic render of the warehouse scene. Not great.

We can do better than this, but let’s set up our depth of field effect first.  Once we get an effect we like, we can improve the quality.

Select the camera, and engage the depth of field (mental ray) effect.

engage-depth-of-field-mental-ray-camera

Engage the effect.

When we take another render, we can see that some elements have gotten blurry.  With a target distance of 32 feet, we can see the number “32″ clearly, but the number “2″ is blurrier.

warehouse-render-dof

Warehouse render with default depth of field.

Notice that the image is still pretty grainy, and we’re even getting sampling artifacts on the tile flooring and garage doors.  Let’s improve our render sampling and get a comparison to see how we can improve the quality.  The most direct way to improve the quality is to increase our sampling from {1/4 and 4} to 1 and 16.  We’ll also want to use a better filter type.

increased-render-sampling

Increased render sampling and using a better filter.

Below you can see the new render plus a comparison of key areas before and after the Samples per Pixel change.

warehouse-fine-render

A finer render of the warehouse.

A clear improvement in details.

The depth of field effect improved, too.

Now there’s a catch to all of this.  The original render only took 2:41 while the finer render took 6:53.   Remember not to turn up your depth of field quality settings until you’re ready to take a final render!

VRay Depth of Field

Written April 1st, 2010
Categories: Effects, Rendering / Compositing, Videos
8 comments

This week we’ll be taking a look at how you can set up a depth of field blur effect in VRay for 3d Studio Max.  Since it’s as easy as clicking a checkbox, we’ll also go over how to adjust the effect to different distances and set the quality level so that renders don’t take so long.

Depth of Field

Written February 8th, 2009
Categories: Effects, Rendering / Compositing, Videos
3 comments

This week we’re covering Depth of Field in 3dsMax for both the scanline and mental ray renderers. It’s more of a patch to the Depth of Field Primer I wrote, since it seems like a lot of viewers were coming to the page looking for a “how-to” rather than a “why”. Thus, we’ll cover exactly how to create and control the depth of field effect.

On another note, it seems like everyone on the planet has heard the song above but me. Ignoring the cheesy ’80s undertones, “Puttin’ on the Ritz” is practically my theme song! It’s based on a really old tune (c1920?), and takes on a deep, cryptic interpretation that makes it so solid. It doesn’t get much better than that. If you really listen closely, you can pick up that vintage edge- who’s Gary Cooper?

Introduction to Depth of Field

Written December 6th, 2008
Categories: Articles, Effects, Rendering / Compositing
2 comments

Hello everyone!

Today is a Friday. And on Friday I usually think about what I’m going to do for the Monday Movie that I promise to deliver in a few days. This week, however, I realized that Depth of Field is a topic that a) wouldn’t compress very well in YouTube, and b) deserves more than 10 minutes. Depth of field is one of the many things you can use in your renders to add realism, meaning, and style. Like a lot of other features of 3ds Max, depth of field (DOF) requires tact and care to make a convincing and elegant result.

New: Take a look at my Depth of Field Monday Movie!

The final render.

The final render of the scene.

If you’ve ever done a lot of cooking you can relate to this. Everything tastes great with butter, salt, and pepper. I could serve you a fried brick and it would taste awesome! What separates the good chefs from the great ones is knowing when and how much fat to use to keep everything in balance.

Let’s start with this image below.

No DOF

Beginning image with no depth of field.

Depth of Field Scene Download

You’ll notice that I didn’t use any depth of field at all. However, there are already a lot of visual clues that tip you off that these teapots aren’t huge. The scale of the materials (such as the wood on the floor) are reasonable for ordinary sized objects. The baseboards along the bottom of the wall in the background gives you another clue since those are rarely taller than a few inches. I’m not relying on depth of field to be my scale queue, but instead to be a part of the greater image.

Mental Ray

Let’s add depth of field to this scene. The first thing to consider is what should be in focus. In most cases, it’ll depend on what’s most important. Below you’ll see two examples of renders with different focal points. In the left image, we’re focusing on the boy teapot and the heart, while in the right image we’re focusing on the girl teapot and what she sees.

Image with far focus.

Focus is on the distant teapot.

Image with near focus.

Focus is on the nearest teapot.


I accomplished this effect quite easily. Instead of rendering with the perspective viewport, I hit Ctrl + C which is the default hotkey to create a camera in the active viewport. The camera thus created has a group called “Multi-Pass Effect” in the modify panel. When enabled, and set to “Depth of Field (mental ray)”, this setting will give you the depth-of-field effect. The way I shifted the focus of the shot was by changing the target range of the camera. This spinner is found just below the “Multi-Pass Effect” group. Try twiddling this spinner a bit, and you’ll see the camera’s “target” moving, indicating the distance at which objects will be in focus.

Now you’ll notice that the effect is pretty strong in both images. This is because the f-stop is set to only 2.0 by default in 3d Studio Max. If you’ve taken photography classes or done photography tutorials, you can skip this paragraph. A camera’s f-stop is a measure of how large the camera’s aperture is, where smaller numbers mean a larger aperture. The aperture of a camera is how big the ‘eye’ of the camera is and it determines how much light to let in. Without going into the details, know that a smaller aperture (larger f-stop value) means more of the image will be in focus.

As a visual demonstration, the three images below show differing f-stop values for the camera in this scene. To be explicit, each teapot is about 6″ in diameter.

A low f-stop.

A moderate f-stop.

A high f-stop.

These show varying degrees of blurring. The first image is so blurry we can’t see much of anything. The second image gives us an idea, but it’s still too muddy to make out what the scene is about. The final image makes gentle use of depth of field to convey scale and still make the scene’s objects clear.

Below is a larger render of that third image. The effect is still a little too high for my taste, but I think you get the idea about using Depth of Field in 3ds Max with subtlety.

The final render.

The final render of the scene.

Scanline

Scanline Settings

Scanline Depth of Field Settings

Now that you know how to create depth of field in mental ray, learning it in the scanline renderer is a breeze. Unfortunately, all of my materials were mental ray materials and my light was a mental ray light so I won’t be including quite as many pictures in this last section.

There are several ways of setting up depth of field in the scanline renderer in 3d Studio Max. On the one hand, you could use a similar method as we used in the mental ray renderer version. You’ll create a camera using the Ctrl + C method or by creating one manually, and under the “Multi-Pass Effect” group you’ll enable the “Depth of Field” effect. When you render, however, you’ll notice that it uses a very primitive method for creating depth of field, and this is generally not recommended.

In scanline your best bet is to use the render effect found in the environment and effects panel (hotkey ’8′ and shown on the right with final values). Open this panel and click on the “Effects” tab. Under the “Effects” rollout, you can click “Add…” and select “Depth of Field” from the menu. You will now have to select your camera using the “Pick Cam.” button, as well as select the object you want to be in focus with the “Pick Node” button.

If you render, you will now see that you have the depth of field effect, but it probably won’t be properly adjusted. You can alter the severity of the blurring effect by altering the focal parameters at the bottom of the Effects window. I’ve found that using the “Use Camera” mode and keeping horizontal and vertical losses equal works best (as shown).

In the end, the scanline renderer is actually more complicated to use than the mental ray depth of field settings. I hope this primer has been of use to you, and helped to demystify depth of field in 3d Studio Max. Just remember; subtlety, rather than know how, is the key to using this tool to great effect!

Until next time, happy rendering.

Quickstart Series – Part 5

“This quickstart series contained the information and techniques that can’t be found anywhere else and an equal split between workflows came up with by Dave Cardwell and those invented by Wayne Robson. Before this we already released 4 parts, links can be found on the bottom of this page. In the coming weeks more exclusive tutorials will be available for everyone for free viewing and download.”

What is Z-Depth?

“Today, I will explain to you guys what is Z Depth. Because many of you will undoubtedly not be familiar with z-maps, their creation, or their use. The term z-map might be a little misleading to those who are not familiar…”

Home

“This is a very simple scene. There are only 2 “real” Objects in the scene, the windmill and the homecoming man. The ground is a very simple subpatched object. The footpath has a few more polygons to create bumps and holes. All the bigger Plants, as well as the long grass, are planes with textures from the Total-Textures v10. The small grass was made with Sasquatch.”

Naking of Nature of Man

“This scene was made using Lightwave for modelling, Photoshop was used for the textures, background image and post work. FPrime was used for final rendering.”

Designed by Alejo "Mr. Bluesummers" Grigera"
©2012 MrBluesummers.com