Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question HDRP, Graphics.DrawMeshInstancedIndirect and motion vectors

Discussion in 'High Definition Render Pipeline' started by larsbertram1, Mar 11, 2020.

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    does anybody have an idea how to draw motion vectors for meshes renderd by script using Graphics.DrawMeshInstancedIndirect?
    by default unity does not seem to issue any draw when it comes to motion vectors which makes DrawMeshInstancedIndirect more or less worthless in case taa is enabled.
     
  2. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    Do you use vertex animation on these meshes?

    I'm still on old HDRP version (5.13). I've noticed that when using DrawMeshInstanced and enabling 'motion vectors for vertex animation' in the material inspector, the meshes are not rendered at all (material uses HDRP Lit Master Node shader graph with dynamic vertex position input).

    When the 'motion vectors for vertex animation' option is disabled, the mesh is rendered and dynamic vertex position is working.

    Is it possible to use motion vectors for vertex animation with DrawMeshInstanced and DrawMeshInstancedIndirect at all?
     
    Last edited: Mar 16, 2020
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    yes.
    it should but it is not: unity does not issue any draw call for meshes being drawn using DrawMeshInstancedIndirect.
     
  4. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    858
    I am facing the exact issue almost three years later. Did anyone succeed in drawing motion vectors using DrawMeshInstancedIndirect in HDRP?