Flicker-free FG animation with mental ray in 3ds Max

FG is always blamed for flickering animation and in this tutorial I'm going to share some tips about how to get flicker-free FG animation with mental ray in 3ds Max. I'll be using one of the production scenes from my latest project to demonstrate this, as it contains a large amount of polys.

So let's start with this snowy airport scene. I have enough RAM that I can render out entire scenes. The whole scene is lit with single skylight and sky texture as an environment. I also have an Environment/Background Switcher map loaded in environment slot and have used a sky Arch: Env blur shader inside the environment slot of the Switcher map. That's about it for the lighting, which is simple. Now let's talk about FG (Fig.01).

Fig.01

Fig.01

In this scene, everything is still and just the camera is moving around, so I chose Project Points Along Camera Path (as the camera is moving) and Single file mode (as everything is still and there's no animation). Also FG Bounce was set to 1 and I kepy Trace Depth to 2-1-1. I didn't need much reflection or refraction here. Noise filtering was set to None (Fig.02) and, of course, Antialiasing was set to 1-16 high settings with 0.05 default Spatial Contrast and Mitchell Filter.

Fig. 02

Fig. 02

So I generated a FG map for every fifth frame (for 50 frames), then locked it and rendered with those AA settings and here is the result (watch in full screen with HD on) (Fig.03).

Fig.03

As we can see, it's flickering there. But wait, it's not FG flickering. How do we know that? There are diagnostic tools in mental ray. Go to Diagnostic tools and enable Final Gather and now render out the sequence with that enabled. The result will be like Fig.04. As we can see, all those green dots aren't moving or jumping but sticking to planes and ground (watch in full screen with HD on).

Fig.04



So what is the flickering then? It's antialiasing flickering. It's always antialiasing flickering not FG. FG doesn't flicker if the correct settings are chosen. Let's enable Sampling Rate and disable Final Gather in Diagnostic tools, and render out the sequence. Here is the result (watch in full screen with HD on)(Fig.05).

Fig.05

As we can see, the current AA settings (1-16, 0.05) aren't enough to generate nice, fine details. Check on background geometry and you can see how those lanterns and hangar buildings have bad outlines. Also there isn't much detail generated on the front planes in the foreground. We need higher settings. So I would up Min-Max to 4-64 and Spatial Contrast to 0.02. Here is the result (Fig.06).

Fig.06

Fig.06

Still there are little details not generated. Check the lanterns and those buildings in the background. So let's lower the Spatial Contrast setting to 0.01 (for all RGBA) and check the result (Fig.07).

Fig.07

Fig.07

The details look good! For the final animation, I changed the FG point density to 1.0, FG points to 150 and AA settings to 4-64, with 0.012 Spatial Contrast and little bit of glow using a Glare output shader. (Note: those background lanterns have been intentionally given a higher self-illumination value to get the glow. Physically it should be lower as it fades into the distance). Let's see the result (watch in full screen with HD on)(Fig.08).

Fig.08



As we can see, it's flicker-free animation. So whenever it's flickering in mental ray, it's mostly due to bad sampling/AA values. (Note: we must check these using the Diagnostic tool after calculating FG maps. For some reason I find that rendering with FG is much faster than rendering without FG. So use the Diagnostic tool to fine-tune the AA after calculating the FG map).

Final Thoughts

1. Calculate the FG map first, then use diagnostic utilities to fine-tune the FG map and AA settings. Use the Compare tool or load in "Ram Player" with different AA settings and diagnostic images, and compare the differences. Use Trace Depth values according to reflection/refraction amount you need in the scene.

2. A Sampling value for AA Min-Max of 4-64 is the optimal value and will work for most types of scenes. When you need to, adjust the Spatial Contrast settings according to your needs.

3. If you are rendering with mental ray, always render in high resolution like full HD 1920 x 1080 pixels. The above tests were done with 1280 x 720 pixels size because of Vimeo 720p upload limits. I am not saying that you need to render at double or more resolution than the required size to not get that AA flickering issue, but you will always get viewable details with full resolution and 1920 x 1080 pixels size is the minimum for rendering in mental ray.

4. Also, as you increase resolution, you can use higher values with Spatial Contrast settings. In this example, if I would do rendering with the 1920 x 1080 pixels size, which will require 0.017 Spatial Contrast settings. And, of course, the rendering time was just five minutes per frame (for 1280 x 720p res) on i7 930 overclocked 4.0 Ghz.

Reference and resources: Zap Anderson (http://mentalraytips.blogspot.com) and Jeff Patton(http://www.jeffpatton.net). Thanks for providing great learning materials for mental ray.

Fetching comments...

Post a comment