October 13, 2011

GLSL Cubic Lens Distortion

Few years ago I ported HLSL Cubic Lens Distortion shader made by a really nice guy François Tarlier. I slightly modified it, but the algorithm basically is the same one used in SynthEyes.
I encourage to visit François homepage and blog for Blender, AfterFX, compositing, VFX and mathcmoving related stuff. He is a former Environment and VFX artist at Ubisoft hehe.

Here are few screenshots of the shader in action:
undistorted:

distorted w chromatic abberration and slight blurring at edges:


lens distortion & my BPCEM reflection scene:


a screenshot in my real-time snowflake growth demo with lens distortion shader applied:

more info about the snowflake project HERE

download link to snowflake demo blend (for Blender 2.5x & 2.6x):
HERE

download link to blend file for lens distortion demo (for Blender 2.5x & 2.6x):
HERE

controls: mouse&WASD - camera movement
1 - disables the filter
2 - enables the filter

glsl fragment shader:
http://dl.dropbox.com/u/11542084/lens_distortion

No comments:

Post a Comment