HDRP Graphics.DrawMesh/Instanced/IndirectInstanced Motion Vectors bug

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.

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

obviously they have motion vectors. But wrong ones.
Btw. Also on objects that don’t have been instanced.

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://discussions.unity.com/t/801912/37

8813761--1199251--upload_2023-2-17_11-30-55.jpg

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?

1 Like

Sorry for the “BUMP”
The terrain MotionVectors are still buggy with custom shaders.

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:


Edit: corrected issue number

1 Like

Issue confirmed with ID UUM-37788:

On my project, I have successfully changed Graphics.DrawMesh to Graphics.RenderMesh and Graphics.DrawMeshInstancedIndirect to Graphics.RenderMeshIndirect without much trouble. These methods do not have a problem with motion vectors.

2 Likes

You are right. But the Terrain in conjunction with a custom shader has.
But thanks for the report

1 Like

the issue is related to this:
https://forum.unity.com/threads/terrain-detail-rendering-motion-vectors-broken.1433722/

and it’s still borken in 2023.1.0b19

According to unity this is a feature request and was never supposed to work. Unity Issue Tracker - Motion Vectors are incorrect when using Graphics.DrawMesh

:smile::smile: 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. :smile::wink: