Friday, March 2, 2012

Handling vector blur inside Nuke

How to use Motion vector Pass inside Nuke?

Many peoples struggled getting exact result inside Nuke using motion vector pass. (once me too..)

Here is the solution for that.

what is motion vector pass?
A 2D motion vector image describes the amount of movement that’s happening in a scene by using two luminance maps and combining them into one image.

For more information:

Render motionVector pass from Maya

Mental-ray have 2D motion vector export shader inbuilt. So go to create render passes panel and select "2D Motion Vector"
hit create.

Maya->Render Settings->Passes->2D Motion Vector.

choosing File format for rendering from MAYA

Vector passes contain infinite values so you can't store vector passes on clamped image formates, such as .jpg, .tga etc. So we need to use image format like .tiff, .exr which can store float values.

Enable float values for rendering

Usually MAYA render 8bit per channel as default. You should tell MAYA to render our image as 16bit half float or 32bit float. How to do that.

Maya->Render Settings->Quality->FrameBuffer->DataType

Change it from its default value:
 RGBA 4*8bit -> RGBA (float)4*32bit for 32bit float.
 RGBA 4*8bit -> RGBA (float)4*16bit for 16bit half float.

Thats all now you can render your images as .exr sequances with Motion Vector.

 (want to know more about open EXR

Apply motion blur inside NUKE using 2D Motion Vector pass.

Import your .exr or .tiff image sequence inside nuke.
Nuke display 2DMotionVector pass like right side img
(Look those values going minus).

Dealing with vector blur node

Add vectorBlur node under your Read node.
Change channels all to rgba.
UV channels->your custom channel vector channel name (MV2E_mv2DToxik)
method -> forward  (nuke default backward).

you get the result like below image.

                                        Its look wired why ???? (this is not I'm expecting)

Its happened because off premultiply issue. How to fix it ?

you have to check "alpha" to rgba.alpha. Now you get the correct result what you expect. see below image.

Thats it.

Hope this page help you. If yes leave comments please.

software used: Maya 2012, Nuke 6.3v6.

source files: 
seq file:!254&parid=776F8351D9892B6A!133
Nuke comp file:!255&parid=776F8351D9892B6A!133

scale up and down cornerpin node

global scale up and down cornerpin This script help you to global scale up or down the selected cornerpin. Recently i had situation to ...