Motion blur using motion vector AOV (rollover image)
This tutorial aims to demonstrate how to use the Motion Vector AOV in a pool ball scene. We will talk about the advantages and disadvantages of using this technique compared to true 3D motion blur. The Motion Vector AOV outputs a color channel that shows object movement within the scene. This AOV can be used by post-processing software to calculate a 2D motion blur effect. The advantage is that it is usually quicker to render compared to true 3D motion blur.
Creating The Pool Ball Layer
Before we render the Motion Vector AOV, we must first separate the pool ball from the background. We will render the pool ball (with Motion Vector AOV) separately and composite them together in a post processing program like Nuke.
- Prior to rendering the separated pool ball layer, you must set an instantaneous shutter for the camera. The reason being is that we don't want motion blur in the render but we still want the motion velocity information in our motion vector AOV. To do this, select the camera and go to the Arnold section of the Attribute Editor. There you can set a value for the shutter_start and shutter_end attributes. Depending on the position offset of the motion blur in the global renderer settings (that specifies the shutter time interval of the whole scene), the instant value will be different. By default the position is set to Center on Frame, which means a value for the shutter_start and shutter_end of 0.5. If you set Start on Frame the value for the shutter_start and shutter_end should be 0.0. If you set End of Frame the value should be 1.0.
Shutter start/end are set to zero (correct)
Shutter start/end are set to different values (this is incorrect)
- Create a render layer for the pool ball. Select the geometry in the scene (except the pool ball that we want to motion blur) and disable their 'Primary Visibility' in the attribute editor. When you render the layer you should just get the pool ball on its own as in the image below.
Pool ball render (primary visibility disabled for the rest of the scene)
Creating The Background Layer
- Create a new render layer for the background. Assign the geometry to the render layer and disable primary visibility for the pool ball that we want to motion blur. When rendered, you should see the background objects and only the shadow of the motion blurred pool ball.
Background render (primary visibility disabled for the pool ball)
Adding The Motion Vector AOV
- With the pool ball render layer activated, select the AOV tab in the Render Settings window. Under 'AOV Browser' select '
' and then create Motion Vector AOV. Make sure the AOV filter is set to closest.
Built in Motion Vector AOV added to Active AOVs
- Under AOVs, to the right of the newly created Motion Vector AOV, there is a downward pointing arrow. Click on that and choose 'Select Driver' from the menu.
Select Driver by clicking on the downward arrow to the right of the Motion Vector
- The Arnold driver should appear in the attribute editor. Select 'Merge AOVs'. This will combine the Motion Vector AOV with the rendered EXR as one file.
Enable 'Merge AOVs' stores the AOVs in one EXR file
- Render both render layers (background and pool ball) as EXR files.
- Open the two EXR files in a post processing package (in this case Nuke).
- Connect a 'Vector Blur' node to the pool ball render. We will use the Vector Blur node to blur the pool ball using the 'Motion Vector AOV'.
- Select the Vector Blur node. Change the 'uv channels' to 'motionvector' and the 'mv presets' to 'Arnold'. Enable 'uv alpha' and choose 'rgba.alpha' to prevent the blur from being clipped by the alpha of the Motion Vector AOV.
Vector Blur node settings in Nuke
VectorBlur: alpha disabled: incorrect VectorBlur: alpha enabled:correct
- Use a 'merge' node (operation set to 'over') with its A input as the Vector Blur and its B input as the background render.
Finally, you should see the pool ball render composited onto the background render as follows:
?Pool ball rendered with Motion Vector AOV Background render Pool ball composited onto background?
There are are some limitations when rendering a 2D motion vector compared to rendering Arnold's native 3D motion blur. Some of these limitations include motion blur in a reflective surface, deformation blur, no true 3D motion blur effects such as a wheel spinning that is not facing the camera, and time lapse effects using motion blurred light sources.
Reflected motion blur is not possible when using Motion Vector blur (rollover image)
The motion vector AOV has a problem handling deformation motion blur. If you need to render a proper motion vector AOV for deformation motion blur, you must create a custom AOV with a motion_vector shader attached to it. A tutorial that demonstrates how to do this can be found here.