• Advertisement
Sign in to follow this  

Screen Space 'Psuedo' Lens Flare

This topic is 2137 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

After posting in a [url="http://www.gamedev.net/topic/620699-bf3-lens-flares/"]recent topic on lens flare[/url], I revisited my quicky implementation and made some improvements which I've outlined in a wee [url="http://www.john-chapman.net/content.php?id=18"]tutorial here[/url]. The technique is based on MJP's old [url="http://mynameismjp.wordpress.com/2009/12/15/more-post-processing-tricks-lens-flare/"]blog post about Killzone 2[/url], plus some inspiration from BF3. Here's a video of it in action:

[media]http://www.youtube.com/watch?v=w164K5nuak8[/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.

Share this post


Link to post
Share on other sites
Advertisement
[quote name='johnchapman' timestamp='1331330162' post='4920770']
I'm interested in any cunning ideas for overcoming this problem;
[/quote]

Frequency space [img]http://public.gamedev.net//public/style_emoticons/default/wink.png[/img]

Share this post


Link to post
Share on other sites
As far as making it look more flare-like, you can do what [url="http://www.daionet.gr.jp/~masa/rthdribl/"]RTHDRIBL[/url] does and use a [i]much[/i] 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 [url="http://www.daionet.gr.jp/~masa/column"]Masaki Kawase's papers[/url] 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. [img]http://public.gamedev.net//public/style_emoticons/default/happy.png[/img]

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. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Share this post


Link to post
Share on other sites
[b]@Styves[/b]
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 [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img].

[b]@MJP[/b]
I've seen some very cool-looking post processing in the frequency domain in 3DMark11 - Fourier transforms frighten me, though [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]. 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 [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img].

Share this post


Link to post
Share on other sites
[quote name='johnchapman' timestamp='1331568187' post='4921375']
[b]@MJP[/b]
I've seen some very cool-looking post processing in the frequency domain in 3DMark11 - Fourier transforms frighten me, though [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]. 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 [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img].
[/quote]

Yeah the Futuremark stuff is a good starting point, and if you do it right you can get some [i]really[/i] 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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement