Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug HDRP Graphics.DrawMesh/Instanced/IndirectInstanced Motion Vectors bug

Discussion in '2023.1 Beta' started by MaxWitsch, Jan 30, 2023.

  1. MaxWitsch

    MaxWitsch

    Joined:
    Jul 6, 2015
    Posts:
    114
    Anything that gets rendered with Graphics.DrawMesh/Graphics.DrawMeshInstanced or IndirectInstanced are rendered with weired Motion Vectors. Does anyone else have this issue.
    I found nothing in the Change log that relates to this Problem, so i'm not sure what causes this.
    upload_2023-1-30_15-3-25.png
     
  2. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    I believe when using instancing objects lose object motion vectors, you can try the HDRP motion vectors debugger to see if it has object motion vectors or not
     
  3. MaxWitsch

    MaxWitsch

    Joined:
    Jul 6, 2015
    Posts:
    114
    obviously they have motion vectors. But wrong ones.
    Btw. Also on objects that don't have been instanced.
     
  4. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    385
    No idea what happens here but as far as I remember motion vectors weren't natively supported in DrawMesh functions in previous versions. You can try to switch to RenderMesh functions as they support motion vectors.

    Anyway this bug looks like something new but it could be related.

    https://forum.unity.com/threads/enabling-motion-vector-pass-for-drawprocedural.939452/#post-7609909
     
    Last edited: Feb 7, 2023
  5. MaxWitsch

    MaxWitsch

    Joined:
    Jul 6, 2015
    Posts:
    114
    upload_2023-2-17_11-30-55.png
    Thanks for your tip, which seems to fix the mesh issue.
    Unfortunately, the terrain system still suffers from the problem as soon as you use your own shader.
    Does anyone know a solution to this?
     
    sqallpl likes this.
  6. MaxWitsch

    MaxWitsch

    Joined:
    Jul 6, 2015
    Posts:
    114
    Sorry for the "BUMP"
    The terrain MotionVectors are still buggy with custom shaders.
     
  7. kojonek2

    kojonek2

    Joined:
    Feb 21, 2022
    Posts:
    3
    I have submitted a bug report with the reproducible example (IN-42096).

    Left cube is rendered with MeshRenderer and right one is renderer with Graphics.DrawMesh. Both Cubes are Stationary. As you can see right cube has wrong motion vectors:
    upload_2023-5-26_15-12-59.png
    upload_2023-5-26_15-13-28.png

    Edit: corrected issue number
     
    Kreshi likes this.
  8. kojonek2

    kojonek2

    Joined:
    Feb 21, 2022
    Posts:
    3
    Kreshi and MaxWitsch like this.
  9. MaxWitsch

    MaxWitsch

    Joined:
    Jul 6, 2015
    Posts:
    114
    You are right. But the Terrain in conjunction with a custom shader has.
    But thanks for the report
     
    Kreshi likes this.
  10. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    452
  11. kojonek2

    kojonek2

    Joined:
    Feb 21, 2022
    Posts:
    3
  12. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    452
    :D:D Unity is drawing terrain details with this "missing feature" in Unity 2023+. Drawing terrain details with motion vectors was not an issue previously, now it is, therefore they have to add this missing feature to support what they used to support with their other details rendering API. :D;)