Accounting for Lens Distortion
By default, any CG elements you add to your 3D scene do not have lens distortion applied to them. As a result, when you combine them with your 2D footage, they can look like they weren't shot with the same camera. To fix this, you can:
• Use CameraTracker to calculate the lens distortion on your 2D footage and generate a LensDistortion node that applies the same distortion to your CG elements. See Distorting Your CG Elements to Match Your 2D Footage.
• Use CameraTracker to calculate the lens distortion on your 2D footage and generate a LensDistortion node that undistorts the 2D footage to match your CG elements. See Undistorting Your 2D Footage to Match Your CG Elements (Using LensDistortion).
• Use CameraTracker to both calculate the lens distortion on your 2D footage and undistort the footage to match your CG elements. See Undistorting Your 2D Footage to Match Your CG Elements (Using CameraTracker).
Note: The above assumes you set LensDistortion to Unknown Lens before creating the solve. If you set Lens Distortion to No Lens Distortion and used a separate LensDistortion node to remove lens distortion from your footage before camera tracking, you can use the same LensDistortion node to either apply the distortion to your CG elements or to undistort your 2D footage. See Working with Lens Distortion for more information on using the LensDistortion node in Nuke.
Distorting Your CG Elements to Match Your 2D Footage
1. | In the CameraTracker properties, set the Export menu to Distortion and click Create. |
CameraTracker creates a LensDistortion node that is set to apply the lens distortion that exists in your 2D footage.
2. | Connect the LensDistortion node to the output of your ScanlineRender node. |
The LensDistortion node distorts the CG elements in your 3D scene to match your 2D footage.
3. | Composite your CG elements and 2D footage together as necessary. |
Undistorting Your 2D Footage to Match Your CG Elements (Using LensDistortion)
1. | In the CameraTracker properties, set the Export menu to Undistortion and click Create. |
CameraTracker creates a LensDistortion node that is set to remove the lens distortion that exists in your 2D footage.
2. | Connect the LensDistortion node to the output of your 2D footage. |
The LensDistortion node removes the lens distortion in your 2D footage to match your CG elements.
3. | Connect the LensDistortion node to the bg input of ScanlineRender. |
The undistorted 2D footage is used as a background image for the 3D scene.
Undistorting Your 2D Footage to Match Your CG Elements (Using CameraTracker)
1. | In the CameraTracker properties, enable Undistort Input. |
CameraTracker removes the lens distortion that exists in its input footage.
2. | Connect the CameraTracker node to the bg input of ScanlineRender. |
The undistorted 2D footage is used as a background image for the 3D scene.