Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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:
    112
    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,117
    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:
    112
    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:
    372
    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:
    112
    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:
    112
    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:
    112
    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:
    431
  11. kojonek2

    kojonek2

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

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    431
    :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;)