PixelBender Cubic Lens Distortion for After Effects


Introduction


If you are doing Matchmove, you probably bumped into Lens work-flow issue, where you have to un-distort the footage in your matchmove software, then track it, and export a new undistorted footage, so your client can compose the 3d rendering on top of it and then distort it back.
I don’t really like this work-flow, since for instance AfterFx do not have Cubic Lens Distortion FX and it would be really hard for the client trying to match the distortion back.

After watching Victor Wolansky’s FXPHD Class on SYN202 (syntheyes) about Lens work-flow, I thought : “hey why not porting the lens distortion algorithm ?”. Pretty easy to do, since I already did it for HLSL & Martins Upitis did port my shader to GLSL !
Thanks to SSonTech for sharing there alogrithm


Pixel Bender Cubic Lens Distortion :

Not much to say, it does what it suppose to do ! You can copy & paste values from Syntheyes and it will match perfectly (or it should at least). See the screenshot below.

  1. Download CubicDistortion.pbk here : http://aescripts.com/ft-cubic-lens-distortion/
  2. Place it in your “Support Files” folder (which is in your AE install folder)
  3. Launch AE
  4. Look for the effect called Cubic Distortion

UPDATE : now with scale factor & chromatic aberration, see the post here

Thanks to Jerzy Drozda Jr (aka Maltaannon) for his great tips about Pixel Bender.

So now, you can create a new comp with your distorted footage > pre-comp it > undistorted it with the shader > track it in syntheyes > export the camera to a 3d package > render the scene > import the render into your pre-comp > desactivate the shader. Should match perfectly 🙂



Screenshots

(yeah I know, PFTrack grid with Syntheyes … not cool ! :p )

Distorted Grid
Syntheyes Cubic Undistortion
AE with Cubic Lens Distortion shader
compare AE & Syntheyes Lens distortion


Donation

If you wish




8 thoughts on “PixelBender Cubic Lens Distortion for After Effects”

  1. I believe it's in "program File/Adobe/Adobe After Effects CS3/Support File"

    either way, I'm not sure pixel bender is supported in CS3, is it ? I think it's only since CS4

  2. Hi Francois,

    this is great!

    Only thing is, i have AE CS3 and i can't find my Support Files folder in my installation directory…

    How come? Am i doing something wrong?

    Thanks in advance and keep up the good work!

    Giso (the Netherlands)

Comments are closed.