Provide motion vector to deforming mesh renderer

Hi, I’d like to render a deforming mesh to a mesh renderer, and would like to also provide motion vectors, similar to “skinned motion vectors” in SkinnedMeshRenderer.

Is this possible to do this? I only see options for object or camera motion vectors. My deformation and motion vectors get calculated in a Compute Shader.

Found a way to do it, don’t know if this is the simplest way:

  • Set compute buffer to material,
  • add custom function node in shader graph,
  • read buffer in custom function, write to Velocity Input of Vertex Stage (after turning on “Add Custom Velocity”), and
  • turn “custom vector for vertex animation” on in Material.

Is there an easier way?

Did you manage to find better way?

nope, doing it like I described. feels hacky, but it at least works…

1 Like