How to create a Motion Vector map

@vis_prime There could be a few variances that cause the edge flicker as you see it, are you using a 4x4 grid of images? If so what is the degree of rotation per frame? One simple fix I found was bringing displaceStrength right down to like 0.01, however if this doesn’t help I think you may need to check how many degrees of rotation per frame there are and try to reduce the ratio of rotation per frame (and or increase your grid size to 8x8)…

On a side note, the demo here… Motion Vectors for 3D Content actually uses a ktx2 CompressedArrayTexture, which from what I understand doesn’t need to be a grid and simply holds the red and green channels as data per layer, I made a quick demo on how to unpack these and render the required values…

The pen above is only to visualize the array texture values but in essence uses the same logic without being *as limited by oversized images (both px and file size) as you can see in the render of the vector map itself, which has to be in the range of 128-256 px squared (haven’t checked for definite)…

PS: I’m not sure you’ll be able to entirely eradicate the edge distortion as you can see in one of @akella 's latest streams

But hopefully the above points can serve as a direction to reduce these edge defects…

also @vis_prime, what order are your frames in (if gridded)? I think the direction of motion may determine the order of frames somehow (through experimentation)

Pps: @vis_prime, your node setup doesn’t seem to include normalisation nodes before conversion back to rgb values / combine :thinking: maybe you know better than I if these are necessary or not?

4 Likes