/DrawMeshWithMotionVectors

An example showing how to generate per-object motion vectors when using DrawMesh.

Primary LanguageC#

DrawMeshWithMotionVectors

This is an example showing how to generate per-object motion vectors correctly when using Graphics.DrawMesh to draw objects.

gif

The sphere in the gif above is drawn with using Graphics.DrawMesh. The previous versions of Unity can't generate per-object motion vectors on this sphere, so that only camera motion is applied in motion effects (motion blur, temporal anti-aliasing, etc.).

Unity 5.6 introduced BuiltinRenderTextureType.MotionVectors that provides access to the internal motion vectors buffer. One can overwrite the buffer with using command buffers to generate per-object motion vectors on objects drawn with DrawMesh and its variants.