Website powered by

It's about Motion Vectors - Maya - Arnold - Redshift workflow

Article / 12 May 2021

This post is about some discussion about Arnold and Redshift's motion blur render and motion vector passes for compositing. Please feel free to join the discussion and express your opinion/workflow.

By default, the scene looks like this. A rotor that's rotating and a ball falling. So we have both directional and rotating motion blur.

 

Motion blur rendered in Arnold with default settings (check the nice rounded motion blur of the rotor). This needs a hell lot of AA samples and time to render.

Firstly, to get a motion vector in Arnold, you have to

  • enable motion blur (Render Settings > Motion Blur > Enable)
  • and turn it off in the Diagnostics tab (Render Settings > Diagnostics > Ignore Motion Blur)
  • add a motion vector AOV

Now, Arnold's default motion vector pass produces raw motion vector data. That means it's 32-bit data and the value of the motion vector pass can go well outside the 0-1 range. It goes to positive and negative values depending on the amount of motion produced by the object.

From the info region, we can notice that the data for the rotor's movement is there. The range of the value is really high. It seems like there's no data for the ball in the motion vector pass, but the ball was going down, so al the values are negative and eventually show black on the screen but holds the proper data.

From my research from the internet forums, I figured that Arnold's motion vector data doesn't work with RSMB (Reel Smart Motion Blur). But I guess that info is quite old cause it seems it works now. (the reason was RSMB expects normalized motion vector data, 0-1 range, whereas Arnold MV produces Raw 32 bit data)


RSMB Motion Blur from Arnold's motion vector pass. Seems quite fine. The angular motion blur will never work with post-motion blur, so that's alright. Here are the settings:

For Raw data, the maximum displace value should be 1.

Since it didn't use to work before, there was a workaround. Add a custom AOV for Arnold and connect aiMotionVector shader to it.

I renamed the custom AOV to RSMB.

this one is the aimotionvector shader settings. We can use two options. Encode Raw vector or use the max displace. First, The raw one.

Looks like the same, but the values are a little different on the rotor.

Result of aiMotionVector Raw data. Rotor's motion looks really weird. Also, got to use blur amount 1 (this is supposed to be equal to the Length value in the motion blur segment of Arnold render settings which is 0.5 for cinematic motion blur aka 180-degree shutter angle. So basically, double the blur amount to match the ball's motion blur.

Next, for the clamped motion vector. Uncheck encode raw motion vector and use max displace equal to the width of the render. (in my case, 960, cause render is 960x540, God! I'm such a cheapo)


Now it looks familiar at last, hahaha. This is the result for clamped motion vector from aiMotionVector shader.

Notice that the motion blur is actually half. So, to match the rendered motion blur, either the motion blur amount or the maximum displacement needs to be multiplied by 4. That seems really weird, along with the rotor motion blur.

Now for Redshift

Rendered motion blur is a match with Arnold's one. (what else was I expecting?!)

Now, in Redshift's motion vector pass, there's also an option for Raw and clamped.

Which produces a Raw motion vector, nothing unusual there.

The result for Raw motion vector from Redshift

With value of Blur amount 0.5 and Max displace 1, the rotor motion blur is quite nice, but the ball's motion blur is doubled. 

Let see the result of clamped one. I used max motion 960 here (in redshift motion vector pass settings). Generally, with redshift, I use an estimation of the highest possible movement in pixels in my scene. But for this example, I used 960 to keep things equal to Arnold's settings.

Used the value, blur amount 0.5, which it should be, and Max Displace 960, which also should be. Now the ball's blur matches the render motion blur but the rotor's blur is cut in half. Kind of a weird outcome.

So, I found out that rendered motion blurs are the most accurate. If I want to apply motion blur in post, I have several ways to follow, but I have to use my artistic and logical decision to determine how much motion blur I should apply or if it's live-action footage, gotta match the amount of motion blur in the footage. 

Let me know what you use, or a better workflow in the comments.


  

Report

Lens Distortion from PfTrack to After Effects; is there any better way?

General / 05 May 2021

So, I was working on matching a CG element with Live-action footage. I tracked with PfTrack, Used Maya, Substance Painter for CGI, and composited in After Effects. 

I undistorted the footage in PfTrack with a lens grid/distortion grid. The footage was from my DJI Mini 2 drone and undistorted using PfTrack's Line method. Value was Low order: 0.000930 and High order: 0.022561. The distortion is very less but I wanted to use the correct workflow.

I haven't seemed to find a proper way of re-distorting the composited footage accurately in After Effects over the years. There are effects by which you can eyeball it, but there's no specific Nuke type node where you can put the value from PfTrack and accurately re-distort.

I tried using

  • CC lens (eyeballing)
  • Optics compensation (eyeballing)
  • Red Giant's Lens Distortion Matcher (very good usage, but not default effect of After Effects)

So, I haven't yet found a way in default effects of After Effects to properly incorporate with PfTrack workflow. But there is a workaround, again with eyeballing.

  • I exported the undistorted image sequence from PfTrack. Then brought the distorted and undistorted footage in After Effects. Then put the undistorted one on top and set the blending mode to difference. 

  • With the "difference" blending mode, the trick is that if the footage matches, the result will be black. 

  • Now, I applied the "Optics Compensation" on the undistorted footage and tweaked the "Field of View" Value until my result in the viewer is black or very close to black.


Regular Footage (distorted)


Difference mode


Footages don't match, hence some parts are not black.


Optics compensation on undistorted footage.


Now they match, or at least close.


  • Now that I got the value of FOV, I can apply to my CG elements to redistort them and match them with the actual distorted footage.


I hope someone knows an accurate way to transfer lens distortion data from PfTrack to After Effects. And I hope to see a better effect in AE to integrate with the pipeline.


Report

Arnold Imagplane visibility issues

General / 28 April 2021

So, one problem that I faced last week while I was working on a live-action shot is how to hide the image plane/backplate in alpha but still make it visible in the reflection. I generally work more with Redshift rather than Arnold, so it seems a little weird not being able to make the backplate's alpha 0 in the render.

The backplate is visible in beauty, which is good. But when I check the alpha, it's white where the backplate is. Btw, I am using a plane with matte shadow material to capture cast shadow.

This seems to be a problem. Now turning off the primary visibility of the image-plane doesn't work somehow with Arnold. There is one workaround that is basically writing

 background_visibility 0

in Arnold render settings diagnostic tab.

It solves the alpha, but the whole visibility in color, reflection, refraction is gone.

So, the proper way to do this is in the Image-plane Display mode or the Alpha gain of the Image-plane. Either, you can go for RGB display mode, which will still show the alpha of the HDR as white, or you can make the image-plane alpha gain 0, which will make the alpha 0 where the image-plane is. So, this, eventually solved my problem.




Report