This shader will encode a vector representing the motion of the object in the Red and Green components. To use this shader correctly, you must enable motion blur in the render options and use an instantaneous shutter: the shutter start/end values should both be set to the same value. 

The following two images illustrate this effect. The first image shows the original scene with motion blur rendered normally. The second shows the false color effect of the motion vector.


The correct workflow is to add an instantaneous shutter range (meaning a shutter_start and shutter_end at the same value) to the camera. If you have a center of frame based position for the motion blur, you should have a shutter_start and shutter_end of 0.5.

The motion vector will appear as if it happened during a normalized camera shutter of [0,1]. This means that if you have a 180-degree shutter (i.e. start=0.25, end=0.75) you will have to scale the motion vector by 0.5.

Do not disable 'ignore motion blur' in this scenario. It is meant for debugging purposes only.


The vector won't be normalized.
Sample time for shutter start.
Sample time for shutter end.
When greater than 0, this is the maximum amount of screen-space motion. The motion vector encoded in the RG components is then normalized to this value. This is better when writing to 8 or 16-bit formats like JPEG, TIFF etc. On the other hand, when this value is less than or equal to zero, magnitude encoding is used instead: RG holds the unit direction vector, and B holds the magnitude. This is better when writing to floating point formats (EXR etc). 
  • No labels