This shader will encode a vector representing the motion of the object in the Red and Green components. The following two images illustrate the effect. The first image shows the original scene with motion blur rendered normally. The second shows the false-color effect of the motion vector.
To use this shader correctly, you must enable instantaneous_shutter For Motion Vectors (Motion Blur settings).