Search Unity

Motion vector debug view color space

Discussion in 'Image Effects' started by obrens, Nov 28, 2018.

  1. obrens

    obrens

    Joined:
    Mar 26, 2016
    Posts:
    1
    I'm using the post-processing debug view to render motion vectors and then capture a screenshot of that. The pictures look good for my purposes. But I need to know the exact color space being used to render the motion vectors.

    The documentation says that the RGHalf space is used to represent motion vectors internally, but what is being rendered in debug view clearly involves colors of all hues. It seems like hue represents the direction of motion, and value (or something of that sort) represents the magnitude of motion. I need exact formulas though, so that it's possible to later get the X and Y components of the motion that the color of each pixel represents.

    Alternatively, directly saving the RGHalf representation would also work for me, but I don't know how to do that if it's even possible. The R and G dimensions map to X and Y motion, right?

    Hope somebody can help me. Thanks for reading :)

    PS Just to make it clear, it's not a game, I'm just rendering some images.