Screen Space 'Psuedo' Lens Flare

Started by
4 comments, last by MJP 12 years, 1 month ago
After posting in a recent topic on lens flare, I revisited my quicky implementation and made some improvements which I've outlined in a wee tutorial here. The technique is based on MJP's old blog post about Killzone 2, plus some inspiration from BF3. Here's a video of it in action:

[media]
[/media]

The main issue is that the 'features' generated are just copies of the bright spots as sampled from the source image, not a function of the lens aperture as they should be. I'm interested in any cunning ideas for overcoming this problem; until then it's best kept as a subtle addition to sprite-based effects.
Advertisement

I'm interested in any cunning ideas for overcoming this problem;


Frequency space wink.png
As far as making it look more flare-like, you can do what RTHDRIBL does and use a much stronger brightpass for the flare generation. This gives you sharper flares without that "inverted bloom" look that several games suffer from and avoids over-flaring of bright sources on the image. Pop some streaks on top and you've got yourself a really nice flare. Maybe give some random scaling to each flare element and a color, that can help too.

On the note of RTHDRIBL, maybe read Masaki Kawase's papers if you haven't already, AFAIK he's the father of this technique and has plenty of awesome reading material (some of them are in English, others only in Japanese, but you can just translate or look at the pictures to get an idea. :D) that may help to improve your results. IMO his demo is still the most impressive demo I've seen using this technique.

Of course none of this really solves the lens aperture issue but it'll still help make it look better. happy.png

PS: If you can't view the links, pop them into Google translate and set source language to Japanese and target to English. Should work. smile.png
thanks for sharing your technique - will give it a try in the near future :)
@Styves
Kawase's results are really amazing, thanks for pointing me there. I'm thinking I should make friends with someone who can read Japanese, though smile.png.

@MJP
I've seen some very cool-looking post processing in the frequency domain in 3DMark11 - Fourier transforms frighten me, though tongue.png. I suppose we're in the age of the compute shader, now, so I should buck my ideas up! Also, thanks for your blog; very interesting and informative smile.png.

@MJP
I've seen some very cool-looking post processing in the frequency domain in 3DMark11 - Fourier transforms frighten me, though tongue.png. I suppose we're in the age of the compute shader, now, so I should buck my ideas up! Also, thanks for your blog; very interesting and informative smile.png.


Yeah the Futuremark stuff is a good starting point, and if you do it right you can get some really cool results. If you're using DX11 there's actually a FFT helper class in D3DX that you can use, which will save you from having to implement the FFT compute shader yourself. Otherwise there are some Nvidia samples you can look at both for D3D and for Cuda. Either way you'll probably want to do some background reading on image processing in frequency space, which is actually a very common technique outside of real-time graphics.

This topic is closed to new replies.

Advertisement