Lens Compositing Node

by NM-8 in Materials, Shaders, Textures

This is a compositing nodegroup that replicates lens  abberations in post processing.
see a quick test of the lens node here:


In the film industry lens abberations indicate complex camera lenses, hence a big production budget.
This is the reason why CGI makes heavy use of Lensflares. Since John Knoll's lightfactory the usual and fast way to produce them digitally is by defining a point in the image that shines with a given brightness.
Based on this point the whole effect is created.
The downside of such an approach is that the point doesn't produce the whole area, that actually is bright in the image. Especially big bright areas cannot be represented by one point, neither in position nor in shape.

Therefor the lens compositor node uses the emission and glossy renderpass as input, using every pixel in the rendered image as sources to create complex and vivid lens abberations.

A complex nodegroup with efficient calculation lets you define the intensities of the different lens phenomena:

  • bokeh
  • streak color & streak
  • iris
  • star
  • halo
  • dust

the last parameter is quality which simply downscales the calculation to a smaller resolution. with lower quality the calculation gets slightly faster and phenomena get blurry.

The node is meant for VFX work, Motion Design and huge spaceships with lots of bright windows and engines flying through space approaching even bigger stars...

How to use it:

the download contains a blendfile fromwhich you can append the nodegroup "lens anamorph" or "lens dslr". anamorph will produce horizontally stretch within the bokehs and iris.
Once appended to your scene you can setup the node in compositor as follows:

  1. goto render layers and activate render passes for "emission" and "glossy direct"
  2. goto node editor and choose the compositor view
  3. check "use nodes" to get the renderlayer node and the compositor node.
  4. add the lensnode from "add/groups/lens anamorph"
  5. connect the render layer output (image, emit, glossy direct) to the lens nodeinput, and the lensnode output to the compositor node.
  6. render a frame to see the effect and adjust the parameters to set the intensities of each type of abberation.


The node is meant to be used with the render passes of emission and gloss.
But their input to the node is just like a mask, to determine which pixels glow and which dont.

So any image can be used as input for Emit and Glossy input in the node. In case you have only a rendered Image you could use the bright pixels of this image as source for lensflares.

bias them with a converter/math node set to "greater than" as shown in the image. the brightness bias is set to 0.99 so that only white pixels will be source of light. further soften the mask with a filter/blur set to "fast gaussian". 50 pixels where used in x and y axis in this example.


No FAQ's found for this product.

Item Rating

This item has an average rating of 5 from 1 ratings by the community.

  • Richard Traynor over 2 years ago

    Amaze balls

Purchase this item to leave a review!