Render Based Lens Flare

I had the idea the other day (while playing Killzone 2) of making a lens flare that is derived solely from the render, without any external images or extra geometry. I tried to make the node system as simple as possible, because it occurred to me that the process might also be used as a realtime glsl filter.

The node system works by first flipping the render over the X and Y axes, blurring it heavily, then sizing it down twice. The first size down is tinted blue, and the smaller tinted orange/yellow. These two sizes are added together and then added over the original render.

Anyway, here’s a test animation of the node system:

And the node tree:

ummm, that is a very tenuous flare, I can barely make it out. Do you understand what produces a lens flare? Maybe more contrast would make it look like, something.

Good on you for trying a new thing out.

Well, it doesn’t do the standard lines/stars/circles that a flare has, but it approximates the effect of bright objects in the scene. Honestly, I think that it should be made a little more subtle, mixe with the glare nodes, and use a perhaps simplified version of
which I simplified by using a color ramp to approximate the effect of the the material script node, which was the longest part of the render. Keep in mind the compositing done in his example will begin to take a lot of memory if you aren’t careful. (Save buffers will help)

It doesn’t look anytbing like a lensflare. The Durian developers had proper lensflare on their list

I guess lens glare would be a better name, but the point is the the glare is based off of the render, and will happen for every bright rendered object, instead of based off of one bright point like the sun.

Here’s a test render to better show what the nodes are actually doing.

And, anyway, I wanted it to not be based off of geometry or too many nodes, because I want to be able to adapt it as a glsl filter, if I can.