Home >

Chromatic Aberration Effect with WPF, HLSL, and Lena

19. October 2010

Chromatic aberration can be intentionally added as an artistic effect to production video and design. I have wanted to create a pixel shader effect to do this for some time. When I eventually sat down with Walt Ritscher’s Shazzam shader-effect tool the code I came up with was so simple I was disappointed I’d put off writing it for so long.

ChromaticAberrationWPFLike all effects this will work with controls and UI elements, images and video. You set the R, G and B offsets as ‘points' (so they have an X and Y offset). The RGB offsets can be animated (they’re dependency properties after all). Small offset values tend to look best.

You can download the source and sample application here: LearnWPF.ChromaticAberration.zip (112.46 kb)

Comments (2) -

10/20/2010 3:11:44 PM #
That's a nice effect. Will try in some of my animations in WPF.
pooran
pooran
10/25/2010 12:58:31 AM #
Isn't this the same technology used for 3D?

Pingbacks and trackbacks (3)+

Comments are closed