Vector motion blur with jit.gl.pix

Matteo Marson's icon

Hi everybody

I read many posts about motion blur and I came across some techniques and algorithms to achieve it (accumulation, sub-frame rendering, etc...) but I found no information about vector motion blur.
I'm new to shader programming and i'm not quite shure i can figure it out by myself, so i'm asking you if you have any tip on the subject or even already done patches.

I know how to get velocity information for the current frame, but i've no idea how to apply it to blur the image accordingly.
Maybe create a mask to damp the blurring effect according to the motion vectors?

Thanks!

Rob Ramirez's icon

check out the pass.motionblur.maxpat example patch. this uses jit.gl.pass with the motionblur builtin effect. this effect loads a shader file called mrt.motion.blur.jxs, and uses the built in VELOCITY buffer capture to achieve the effect.

feel free to ask follow up questions here.

Matteo Marson's icon

Thanks Rob!
I saw pass.motionblur.maxpat already, but seems like the blurring effect is clipped within the bounderies of the shape, im i right?
It's great for things like rotating objects but is there a way to avoid this?

Rob Ramirez's icon

it may be, but there is the motion-guass-blur variation which blurs the velocity texture prior to applying the effect.

Matteo Marson's icon

Thanks again Rob!

Max Patch
Copy patch and select New From Clipboard in Max.

Blurring the vectors' texture works very well!
here's an example

Greg Finger's icon

really well put together example. had to put the shadowquality down to "med", my computer can't handle those nice HD shadows :P

Antoine Goudreau's icon

Hiya, looked at the pass.motionblur.maxpat patch recently and Matteo's patch above, it seems this shader is no longer compatible with GL3......