Baking MotionVector into color attribute

   456   3   1
User Avatar
Member
64 posts
Joined: Sept. 2006
Offline
Hello gang,
Having a bit of a headache outputting a proper motionVector AOV out of vray for a pointcloud. Never used this plugin, so its a bit of a mystery as to why it just keeps rendering grey. The pointcloud's point count is constant (try saying that outlout 3x in row), the manual covers that but im still lost.
So i decided to 'Houdini myself out of it', and successfully rendered the 'v' att into a color vector and that renders out great! ie. I see colors! Blue shouldnt be there, but I shuffle that to Green in nuke.
The question i cant answer atm is: is that pointing the right way round to properly blur the pixels in comp? I need to color correct my way into something that looks motion blurred, but should I not align vectors to camera first -from/toNDC()- or something along these lines?
Thanks a million for any light on the matter.
Edited by axelsp - June 17, 2022 10:00:52
User Avatar
Member
64 posts
Joined: Sept. 2006
Offline
just tried:
@myvel = toNDC('camerastring' , v@v )
i think thats all i ever needed
Waiting for renders .. oh the anxiety
User Avatar
Member
6076 posts
Joined: Sept. 2011
Offline
axelsp
just tried:
@myvel = toNDC('camerastring' , v@v )
i think thats all i ever needed
Waiting for renders .. oh the anxiety

That won't work as @v is a derivative whose magnitude varies in screen space. What I use in mantra shaders is toNDC(P1) - toNDC(P0) where P0 and P1 are positions at the two shutter times. I'm not sure if it will work as an attribute in vray, I thought vray had a dedicated motion vector pass built in.
User Avatar
Member
64 posts
Joined: Sept. 2006
Offline
Hey @jsmack thanks for this! that makes total sense.
I tested with a time shift set to `$F-1` and seems to work well enough for me atm. Thanks for this!
vector previous = point(1, 'P', @ptnum);
@myvel = toNDC('camerastring' , @P ) - toNDC('camerastring' , previous );

Vray does have a velocity node in the box, but im missing something surely.

Their documentation says if the point count is the same, @v will be discarded and transformation/deformation will be used instead.
Velocity should work, without enabling motion blur. But it just outputs grey, until i 'attach some polys to the points', then i get a velocity output, but then my shader is broken and it takes too long to pre-render.

So for now, Ill keep the houdini attribute baked in. It will render so long as Houdini feeds Vray a color type attribute.
Edited by axelsp - June 20, 2022 07:47:19
  • Quick Links