Search Unity

Question Motion Vectors don't display correctly in viewport camera

Discussion in 'Image Effects' started by Racso250, Mar 9, 2023.

  1. Racso250

    Racso250

    Joined:
    Apr 25, 2020
    Posts:
    1
    Hello, I'm currently using an ImageEffect applied on the camera to create a post processing effect in the Built-In RP (2022.2.9). I want this post processing effect to show both in the game camera & viewport camera. I have the image effect in a script in the main camera with the [RequireComponent(typeof(Camera))], [ImageEffectAllowedInSceneView], [ExecuteAlways] attributes applied to the class.

    So far all the effects I have tried have worked well in both cameras but when I set the depth texture mode to Motion Vectors and I move the game camera it shows the motion vectors correctly in the game view but that doesn't work with the Viewport camera (it shows the same vectors regarding on the camera movement). Is that related to the Viewport camera not being an actual camera and thus not accounting for changes in velocity & rotation? Is there something I can do to make the viewport camera behave like the game camera?

    Thank you in advance!