What are Motion Vectors?

I know that Motion Vectors is a 16-bit channel vector in Screen Space telling us the change in pixel-position of a pixel. Yet, if this is a screen-space delta, does that mean that we are dealing with values that have been normalized by the pixel-width and pixel-height or some variation of that?

Example:

  • I have a 1920 by 1080 screen.
  • An object moves 30 pixels to the left, and 50 pixels up.
  • Does this mean that the Motion Vector buffer holds a value around (0.01562500, 0.04629630) in the next frame, over the same area that the object now covers?
  • Or, does it hold values around (0.03125000, 0.09259259)?
  • Or, does it hold values of (30, 50)?

When we read the Motion Vector buffer, what are we reading?

I took a quick look at the docs, and the sections on Motion Vectors don’t actually tell me anything concrete about Motion Vectors that doesn’t have to do with enabling/disabling Motion Vectors.

You should try looking at the shader that generates the motion vectors:

The short version is the motion vectors are the difference between the current and previous frame’s viewport position, which is in a 0.0 to 1.0 range for objects in view. So your case of 30 to the left, 50 up the motion vector texture should be (-30/1920, 50/1080), or (-0.015625, 0.0462962).

3 Likes