prekabreki Posted March 22, 2016 Share Posted March 22, 2016 I'm trying to generate a motion vector pass for use in Nuke later. The way I've usually done it is like this, inside a shader: http://imgur.com/tSbatjM Well that's not working now, and strangely if I set all the motion blur settings to 0 but I enable motion blur I still get motion blur. http://imgur.com/7htfLLi When I change the shutter time setting on the camera in the scene, that seems to be influencing the motion blur. http://imgur.com/gNgKfru Is there any way I can extract a useable motion vector pass for Nuke from what the camera is seeing, or am I going about this all wrong? Quote Link to comment Share on other sites More sharing options...
paxsonsa Posted March 22, 2016 Share Posted March 22, 2016 Hey Petur, Sorry for the late reply, hopefully this didn't cause you too much trouble, but for anyone out there looking for this solution here it is. Petur your setup is very close. What is different to my setup is I never source the P (position) attribute into my motion vector from the globals. You need two 'getPBlur' nodes. Their input values for the time input are 0 and 1 (t0 and t1 respectively). t0 represents the position are the beginning of frame and t1 is the position at the end of frame. Next we should normalize the positions into the screen space using the toNDC node. Next we get the difference between the two position values (t1-t0). Finally, its a good idea to make the value represent pixel movement so multiple the position vector by the resolution of the camera (1920, 1080, 0). Export this out with a bind. I call my export attribute vel usually. Depending on the MotionVector tool you may need to remap the vectors further (i.e. RSMB uses 0-1 space and 0.5 is not moving.) Mantra Notes: 1.Make sure allow motion blur is turned on. 2.Turn off Allow Image Motion Blur. 3. For objects using velocity make sure to turn on Hip File is attached. MotionBlurFun.hip 2 Quote Link to comment Share on other sites More sharing options...
prekabreki Posted March 23, 2016 Author Share Posted March 23, 2016 Thank you so much for the hip file! So thorough and helpful! It totally solved the problem! Your way is so much better than my was Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.