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]
Share and Enjoy:
  • Twitter
  • Facebook
  • LinkedIn
  • StumbleUpon
  • Posterous
  • Tumblr
  • Digg
  • FriendFeed
  • del.icio.us
  • Netvibes
  • RSS
  • email
  • Print
  • PDF
  • Google Bookmarks
  • Blogplay
This entry was posted in CG/Animation, R&D and tagged , , , , , , , , , , , . Bookmark the permalink.

3 Responses to Cubic Lens Distortion Shader

  1. Pingback: PixelBender Cubic Lens Distortion for After Effects | François Tarlier's Blog > CG Artist, Matchmover, VFX, Open Source topics, Computer Vision, and geek stuff !

  2. François says:

    “La Maison” My dream company ^^

    Nice tip, I’ll take a look into it ;)

    (vous cherchez pas un matchmover par hasard ? )

  3. maximd says:

    At “la maison” (vfx company in Paris/Saint-Cloud) a Softimage XSI/Mental Ray shader has been developed to apply lens distortion from 3D Equalizer’s data. The name’s lmWarpDistort.

    It’s open source (GNU LGPL license), so it may interest you: http://bitbucket.org/lamaison/lmwarpdistort/wiki/Home

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>