Cubic Lens Distortion Shader

Introduction

Cubic Lens Distortion (or undistortion as well) is well known in compositing or any VFX package. Basic Lens Distortion would usually solve the distord plate a the center, but closer you would get to the border of the picture, more the distortion will still there. The Cubic parameter let you control that.
It could also be used to give a “Chromatic Aberration” effect

This shader is based on the Algorithm shared by ssonTech website. This algorithm is used in SynthEyes (matchmove software) and is pretty simple.


Examples

k = -1.0 ; kcube = 0.0
k = -1.0 ; kcube = 0.0
k = -1.0 ; kcube = 0.5
k = -1.0 ; kcube = 0.5
Chromatic Aberration example : k = -0.15 ; kcube = 0.15  ||  using red distord channel with green and blue undistord channel
Chromatic Aberration example : k = -0.15 ; kcube = 0.15 || using red distord channel with green and blue undistord channel



Shader (Media Player ClassicHLSL)


code on Pasteall.org

Reblog this post [with Zemanta]

3 thoughts on “Cubic Lens Distortion Shader”

  1. "La Maison" My dream company ^^

    Nice tip, I'll take a look into it 😉

    (vous cherchez pas un matchmover par hasard ? )

Leave a Reply

Your email address will not be published. Required fields are marked *