Sign in to follow this  

light streak techniques

This topic is 2399 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

I was wondering if anybody knew of any cheap light streak techniques. By light streaks I mean what http://www.daionet.gr.jp/~masa/rthdribl/ calls "glare patterns". The DirectX demo seems to blur similar to bloom, but while I can't get performance numbers, from my implementations this would be way to slow. Also, after playing Mass Effect 2 I would assume theirs is done by rendering something like particles at light positions.

I wanted something that looked as good as Unreal's technique, but more dynamic. Does anybody know any techniques? Maybe I'm asking too much. =(

Share this post


Link to post
Share on other sites
[quote name='allingm' timestamp='1306141379' post='4814511']
I was wondering if anybody knew of any cheap light streak techniques. By light streaks I mean what [url="http://www.daionet.gr.jp/%7Emasa/rthdribl/"]http://www.daionet.g...~masa/rthdribl/[/url] calls "glare patterns". The DirectX demo seems to blur similar to bloom, but while I can't get performance numbers, from my implementations this would be way to slow. Also, after playing Mass Effect 2 I would assume theirs is done by rendering something like particles at light positions.

I wanted something that looked as good as Unreal's technique, but more dynamic. Does anybody know any techniques? Maybe I'm asking too much. =(
[/quote]

Yeah Kawase did pretty much everything through blur kernels. It's true that lots of blurs can get expensive, but doing them at lower resolution can help quite a bit in that regard. You can also go pretty low res, since you don't have to worry about depth occlusion or anything like that (although flickering can be a problem).

I don't know for sure, but I would guess that Mass Effect did their lens flares with 2D billboards/sprites placed over the location of light sources (perhaps using occlusion queries to get proper occlusion). It's obviously not very dynamic, but the upside is that the artists get to exactly control how the flares look.

A more fancy/modern take on this problem is what Futuremark did for their recent 3DMark demo. They converted the entire screen to frequency space using a compute shader FFT, and then convolved it with various kernels based on the iris shape to get glares and lens reflections. Very cool, but you need top of the line hardware and a good understanding of FFT.

I made a [url="http://mynameismjp.wordpress.com/2011/04/19/bokeh-ii-the-sequel/"]demo[/url] that fakes bokeh by picking out hot spots on the screen, appending them to the list, and then rendering bokeh-shaped sprites at those points. There's no reason you couldn't do something similar for glares. Doing it the way I implemented requires DX11 hardware since I used an AppendStructuredBuffer, but others have implemented a similar technique on DX10-level hardware by using vertex shader texture fetches.

Share this post


Link to post
Share on other sites
They key to Masaki's streaks is ping-ponging; using the last rendered streak as input for the next one. The idea is similar to a separable blur, but each iteration is just scaled in the direction of the streak. The actual flare elements are just inverted/scaled samples of a strong bright pass bloom image at a lower resolution with different color offsets. There are some papers about it online, including on Masaki's site.

Also doing this on a downscaled image will be a lot faster than on a normal one. Masaki uses a 1/4 sized target for streaks I think, at most 1/2.


Mass Effect & Unreal use billboard lens flares. These are more customizable and perhaps more realistic if used correctly, I suppose. However they are less dynamic and require the usual visibility checks, whereas dynamic "HDR flares" do not. Plus the later is so much simpler to implement.

One thing that bothers me about HDR flares though is the lack of flare coming in from outside the frame. Since each flare is created using the image buffer, nothing outside the screen can cast a flare, and this may or may not be desirable. I personally find flares coming from out-of-frame to be quite stylish, but that's just me. :)

Share this post


Link to post
Share on other sites

This topic is 2399 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this