1 The idea
We track and render CG in an undistorted world, then put the lens distortion back (redistort) before merging over the plate. A barrel lens pulls picture from beyond the edges into the frame, so the corners of the result need pixels from outside a normal render.
Render exactly to the frame and the corners come out black. The fix is to render bigger than the frame (overscan), enlarging the resolution and the filmback by the same factor so the middle doesn’t change. Switch to the footprint view: the orange line is where redistort reads from, the red parts where there are no pixels yet.
overscan ≥ k · r²(corner) · r² = 1 + (h/w)², r normalised to the half width2 Hands-on
Task: choose an overscan with no missing pixels, no more than 4% above what’s needed
The corners need the most because they are furthest from the centre. Too much overscan just costs render time.
3 Deep dive
The right order: undistort to track, redistort only the CG
The hero plate doesn’t go through undistort and redistort as a whole: two resamples soften it. Use the undistorted plate for tracking and 3D only. The CG is rendered without distortion, the lens distortion is put back (redistort) on the CG alone, and then it’s merged over the untouched original plate.
- 1Undistort the plate (to track)
- 2Track / solve
- 3Render CG + overscan
- 4Redistort the CG
- 5Merge over the original plate
Why barrel needs pixels from outside
A barrel lens squeezes the edges of the picture towards the centre, so the real frame covers more than an undistorted frame. During redistort each output pixel reads the CG at r × (1 + k·r²) from the centre: the further out, the further it reads. The corners read the furthest.
In the lab, with k = 0.06 the corner reads at 1.079 times its distance, so it needs 7.9% overscan. For an HD plate that means rendering about 2072 × 1166 or more (about 76 px per side beyond 1920 × 1080). A common shortcut: undistorting a barrel plate produces an image bigger than the frame, and that size is the size to render the CG at.
Pincushion works the other way: redistort reads inward and needs little spare edge
Rendering overscan correctly
Overscan enlarges both the resolution and the camera’s filmback (aperture) by the same factor, with the focal length unchanged. The pixels in the middle stay exactly where they were; you just gain a border. Enlarge only the resolution and the picture zooms; enlarge only the filmback and it widens with coarser pixels.
Watch nodes that cut the bbox: a Crop or Reformat before the redistort throws away the overscan you just rendered. CameraShake needs pixels beyond the frame too.
4 In real work
In Nuke
- LensDistortion (NukeX) solved from a grid; keep the master in a backdrop and copy it; set the copy to redistort on the CG branch.
- Or an STMap exported from the solve: the redistort STMap after the CG.
- ScanlineRender: add enough overscan for the redistort, or black slivers appear at the edges.
- Put the bbox Crop after the redistort, then Merge over the original plate with bbox = B.
Common mistakes → the fix
- ✗ Rendering CG exactly to frame, then redistorting✓ Render the overscan the corners need (or the undistorted plate’s size).
- ✗ Undistorting the hero plate, comping, then redistorting everything✓ Leave the hero plate untouched; redistort only the CG.
- ✗ Enlarging the resolution without the filmback✓ Enlarge both by the same factor, focal length unchanged.
- ✗ Cropping the bbox before the redistort✓ Crop after the redistort.
Before you send the shot
- No black or smeared corners after the redistort
- The middle of the overscan render matches a non-overscan render
- The hero plate never went through undistort/redistort
- No Crop or Reformat cuts the overscan before the redistort
5 Check yourself
Why does cropping the CG to the frame before redistort break the corners?
🔒 Answer the question above and this card opens
1. A barrel lens makes the corner read at 1.12 times its distance. At least how much wider and taller, in total, must the render be?
2. To render 10% overscan from the CG camera, what do you change?
Where the numbers come from: Rendering overscan for the redistort, and never cropping it away first, come from KB 152. The distortion here is a one-term radial model (k = 0.06) centred on the frame, simpler than the models in LensDistortion or a real STMap; the real number comes from the shot’s lens and solve. The HD numbers are a worked example. The CG scene is built in code.