Closed adepierre closed 7 months ago
Could you provide the complete code?
What do you mean the complete code? I just ran the CopyBuffer scene from this repo with no modifications.
I think this is expected, when you rotate the camera it doesn't change the position of objects in the camera relative space so the motion vector is only relative to the rotation of the camera in screen space.
In any case, if you don't have an issue with temporal effects, then it means that the motion vectors are correct, and since this is only a copy it should work as expected.
Hello!
I've tried to run the CopyBuffer scene to see how motion vectors work. And there is something weird about them: when the camera is moving (translation), they seem to work correctly, with the objects being kind of visible in the motion vector display (picture 1). However, when the camera is simply looking around (no translation, rotation only), it seems that the objects don't appear (picture 2).
I'm not sure if this is just a misunderstanding of motion vectors from me or a real error, but any info about this matter would help me a lot!
Edit: I tried to copy the render texture to a normal texture in order to inspect the values using the following code, but it seems RGHalf is not the right format. The RenderTextureFormat is 29, which ... doesn't exist in the enum?
Camera translation:
Camera rotation only:
Unity: 2021.2.16f1 HDRP: 12.1.6