This is a four-part tutorial about adding motion blur to a Maya render by first creating a 2D motion vector sequence and then using it with ReelSmart Motion Blur in post production. I’ll be covering Maya 2009’s 2D motion vector pass as well as installation and use of the lm_2DMV shader for earlier Maya versions. Once this technique is part of your pipeline, it can be a tremendous time saver compared with creating (and waiting for) motion blur from within Maya. It also provides the flexibility of applying any amount of motion blur without having to re-render.
Part 1: Motion Vector Basics and Other Fine Tips
In these tutorials, I will be using After Effects CS4 as a compositor and Vista 64 as the OS. File paths for the Mac will be listed, but have not been tested. The ReelSmart Motion Blur plugin is available for most compositors, so you should still be able to follow along if you are using something other than After Effects.
Know, first of all, that ReelSmart Motion blur is intended to be used on one object at a time, not on the entire scene. It is a useful technique, for example, if you have a fast-moving character and are able to (1) make a separate render layer for its motion vectors and alpha and (2) then have the background on a separate render layer that you don’t intend to blur (or will blur separately). I have also used this technique with moderate success on a full-scene basis by simply adding a big blur to the motion vector sequence.
Additionally, if you have an animation sequence in which your object-to-be-blurred is rendered on a separate layer than the background, then ReelSmart is able to try to calculate the motion blur without using a motion vector pass. It tries to track the pixels automatically from one frame to the next. This is a less accurate method, but sometimes it is good enough.
Below is the final animation that I made to demo this technique. Click on the icon to open it up. You should be able to drag the time slider back and forth to see areas where the blur is happening more or less on the character. This was created with the 2D motion vector remap pass and the RSMB Plugin.
What Is a Motion Vector??
A 2D motion vector image describes the amount of movement that’s happening in a scene by using two luminance maps and combining them into one image. One luminance pass describes the X translation (horizontal movement) by laying down black and white values (50% gray means no movement) into the image’s red color channel. The other is the Y translation (vertical) and is described in the image by using the green color channel. The blue channel is normally not used. Visually the result looks like a dark yellow image in areas where there is no movement (the 50% gray of the red and green channels combine to make 50% luminance pure yellow), and so the movement areas shift into red or green hues.
When you tell the motion blur plugin to look at this in post, it evaluates this description of X and Y movement and uses that description to determine how much blur to apply.
There are two ways to render motion vector data in Maya that the plugin can understand, and both will give identical results. Which method you use is up to you. The first way is to install a shader in Maya that you can assign as a layer override and can render as a separate sequence. The second way is to use Maya 2009’s render pass system, which should produce a quicker result, because it will make the vector output at the same time as your main render. These two methods are covered in the next two parts (see below for an index).
Common Rules, No Matter Which Method Is Used
- You will need to use Mental Ray, not software render.
- Render output to a 16-bit image in order to give enough detail in the color data. I’ll be using .EXR format with a 16-bit float frame buffer. Do not use an 8-bit buffer.
- When rendering as a 16-bit file, you may not be able to visually see green/red gradations in your rendered image because they go beyond the range of what your screen can display. That doesn’t mean that your render didn’t work right. I tweaked the contrast on the sample above so the result would be visible.
- If you are rendering out a depth map as well because you intend to add lens blur in post, it’s going to get weird on top of the ReelSmart plugin. You can kind of get around this quirk by 2D motion blurring the foreground geometry depth pass in a precomp so that it matches the main motion blur.
- You’ll probably need to turn on Full motion blur with matching open/close shutter settings for every other (non-motion blurred) layer in your scene so that they will match temporally. (see below)
Differences Between lm_2DMV and Mental Ray’s 2D Motion Vector (Remapped) Pass
- With lm_2DMV shader, you have to turn on Mental Ray motion blur and then set the shutter open and shutter close to the same value. The manufacturer recommends 0.5.
- With Mental Ray motion vectors, you do not need to turn on motion blur, but be aware that it turns on motion blur internally at render time. It sets the shutter open and close values to the same value for any render layer for which you have a motion vector pass applied. The value that it sets is close to .00001.
- lm_2DMV produces output image channels called R, G, and B.
- Mental Ray produces motion vector output image channels called X, Y, and Z.
- The largest displacement clamping value (normalize) available on lm_2DMV is 512.
- The largest displacement clamping value (max disp.) available on Mental Ray motion vectors is 1024. This value may be better than lm_2DMV’s if you are rendering HD scenes with a very fast object, but 512 will be more than enough for most situations.
- Intro: You’re lookin’ at it. General items that pertain to both workflows and other tips.