How can I add Lens Flares/Halos?

Is there an addon, or an easy way to add lens flare effects or light aberrations in Blender? I've been using Blender for a while now, and it's very time consuming to always have to export to another software to do them, and sometimes it's impossible if the scene is complex.

• Do you mean light glares/flares that analyzes an image and add the flares/glares on top, or custom flares (i.e. you position it where you want it)? – CharlesL Jul 17 '13 at 14:22
• either one I guess. I know blender has the com positing capabilities with the glare node and such, but it's not very versatile... – Wilhelm Jul 17 '13 at 14:37
• In what way? The glare controls are robust enough, and if you want more or less flare, you can adjust the contrast. – CharlesL Jul 17 '13 at 15:43

There is an OSL lens-flare shader by iReboot (aka Dylan Whiteman) which may interest you.

From his blog post referring to a lens-flare shader originally written for the Renderman language by Larry Gritz & Tony Apodaca of pixar, iReboot writes:

I decided to try and port this to OSL - (...) I added a few features, such as user definable images for lens-flare elements and have got to a point where the shader can now be released.(...) - along with video tutorial links

• but this blog is for 2.67, the nodes have already changed, so how do you adapt it? – user58715 Jul 28 '19 at 13:50

In addition to the OSL shader mentioned by zeffi, you can try these:

• Blender Internal only:
You can use the Halo material with the Flare option enabled to fake lens flares.

• Cycles and BI:
Using Compositing nodes:
You can use a Glare node set to Ghosts to make a lens flair.
For chromatic aberration, you could use a Lens Distortion node with the Dispersion value set to something greater than zero.