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.
Like 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)
06bc805f-3d2d-42ed-ab10-33a6bee645ab|0|.0