Velocity Pass in Houdini?
36017 16 3- abahena
- Member
- 33 posts
- Joined: Feb. 2009
- Offline
- stevenong
- Member
- 1631 posts
- Joined: July 2005
- Offline
- abahena
- Member
- 33 posts
- Joined: Feb. 2009
- Offline
- abahena
- Member
- 33 posts
- Joined: Feb. 2009
- Offline
- xtimmyx
- Member
- 166 posts
- Joined: Oct. 2008
- Offline
That looks like RSMB (Real Smart Motion Blur) which I would also like to see an implantation of in Houdini. The math behind it isn't directly rocket science as far as I can see. Though programming is not my strong side and I may be wrong. But anyway there is info on their web page on how the math behind it works. And it shouldn't be impossible to recreate this in VEX.
http://www.revisionfx.com/support/faqs/motion_vector_FAQs/motion_vector_math/ [revisionfx.com]
http://www.revisionfx.com/support/faqs/motion_vector_FAQs/motion_vector_math/ [revisionfx.com]
- abahena
- Member
- 33 posts
- Joined: Feb. 2009
- Offline
- jason_iversen
- Member
- 12397 posts
- Joined: July 2005
- Online
Here is an example of generating motion vectors, the way SESI intended it:
Look in the attached file and notice:
1./ The object is animated the normal way. (ie. No additional attributes are needed)
2./ A ROP is created, and “Allow Motion Blur” is enabled. Do a quick test render, and see if motion-blur is working correctly.
3./ A shader is constructed which takes the screen-space position of a sample at the start and end of the motion-blur, and exports it into a export variable (I called it ‘vel’).
4./ Back in the ROP, make sure you output this ‘vel’ variable in the Extra Image Planes.
5./ To the ROP, add a Rendering Parameter called “Allow Image Blur”, and deactivate it. This will ask Mantra to perform all the motion blur calcs internally, but not actually blur the image.
6./ Use the image in your compositing software, using the ‘vel’ layer to vector-blur the RGBA layer (“C” in Houdini). Note, that the way I exported the ‘vel’, you'd need to unpremultiply the vel by Alpha. You can probably avoid this by changing your ROP's Sample- and Pixel-Filters to something like “minmax min” and “closest sample” respectively.
Unfortunately it seems as if Houdini's own Velocity Blur COP doesn't really do a usable job. :cry: I've reported the problem and perhaps they'll be able to fix it sometime soon. If you want to see the intended COPs workflow, look in the COP network in the file too.
Naturally, going out to another compositing package requires a full license and you'd probably write to an OpenEXR format image.
I hope this helps a bit,
Jason
Look in the attached file and notice:
1./ The object is animated the normal way. (ie. No additional attributes are needed)
2./ A ROP is created, and “Allow Motion Blur” is enabled. Do a quick test render, and see if motion-blur is working correctly.
3./ A shader is constructed which takes the screen-space position of a sample at the start and end of the motion-blur, and exports it into a export variable (I called it ‘vel’).
4./ Back in the ROP, make sure you output this ‘vel’ variable in the Extra Image Planes.
5./ To the ROP, add a Rendering Parameter called “Allow Image Blur”, and deactivate it. This will ask Mantra to perform all the motion blur calcs internally, but not actually blur the image.
6./ Use the image in your compositing software, using the ‘vel’ layer to vector-blur the RGBA layer (“C” in Houdini). Note, that the way I exported the ‘vel’, you'd need to unpremultiply the vel by Alpha. You can probably avoid this by changing your ROP's Sample- and Pixel-Filters to something like “minmax min” and “closest sample” respectively.
Unfortunately it seems as if Houdini's own Velocity Blur COP doesn't really do a usable job. :cry: I've reported the problem and perhaps they'll be able to fix it sometime soon. If you want to see the intended COPs workflow, look in the COP network in the file too.
Naturally, going out to another compositing package requires a full license and you'd probably write to an OpenEXR format image.
I hope this helps a bit,
Jason
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
- xtimmyx
- Member
- 166 posts
- Joined: Oct. 2008
- Offline
- xtimmyx
- Member
- 166 posts
- Joined: Oct. 2008
- Offline
Now I've uploaded the shader to the Exchange. As mentioned there I'm not 100% certain it's completely bullet proof but so far it's worked fine in my tests.
http://www.sidefx.com/exchange/info.php?fileid=608&versionid=608 [sidefx.com]
http://www.sidefx.com/exchange/info.php?fileid=608&versionid=608 [sidefx.com]
- stevenong
- Member
- 1631 posts
- Joined: July 2005
- Offline
- abahena
- Member
- 33 posts
- Joined: Feb. 2009
- Offline
- xtimmyx
- Member
- 166 posts
- Joined: Oct. 2008
- Offline
stevenong
Hi xtimmyx,
The shader is working though you should use $T or $FF in your example because on frame 3, the arrows' translation is the same on frame 4 thus no transformation blur.
Great work and thanks for putting it on the exchange too!
Cheers!
steven
You're welcome. I don't quite get what you mean. Where in my scene should I use $T or $FF instead?
- circusmonkey
- Member
- 2624 posts
- Joined: Aug. 2006
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: Aug. 2006
- Offline
- kaschalk
- Member
- 5 posts
- Joined:
- Offline
I'm trying to use this method to give the object translation value in pixels. Assuming the vector blur data is in ndc space, I would think multiplying against the resolution would give you the desired result, but I don't find a correlation.
For example, I have an object moving 136 pixels in Y. The image is 1K square. The value returning is 0.511 (x1000 = 511)
Any ideas of what's missing, or is my logic completely off?
Thanks!
For example, I have an object moving 136 pixels in Y. The image is 1K square. The value returning is 0.511 (x1000 = 511)
Any ideas of what's missing, or is my logic completely off?
Thanks!
- xtimmyx
- Member
- 166 posts
- Joined: Oct. 2008
- Offline
kaschalk
I'm trying to use this method to give the object translation value in pixels. Assuming the vector blur data is in ndc space, I would think multiplying against the resolution would give you the desired result, but I don't find a correlation.
For example, I have an object moving 136 pixels in Y. The image is 1K square. The value returning is 0.511 (x1000 = 511)
Any ideas of what's missing, or is my logic completely off?
Thanks!
I haven't used the shader in quite a while and just noticed that it doesn't seem to work in H11. There seems to be no “tondc-node” anymore.
I suppose it's possible to write the shader in VEX from scratch but that's unfortunately nothing I've got time to do right now since I've never written any VEX-shader without VOP and have my hands full with production stuff.
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
-
- Quick Links