Jump to content

  • Log In with Google      Sign In   
  • Create Account

light streak techniques


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 allingm   Members   -  Reputation: 250

Like
0Likes
Like

Posted 23 May 2011 - 03:02 AM

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. =(

Sponsor:

#2 MJP   Moderators   -  Reputation: 5643

Like
0Likes
Like

Posted 23 May 2011 - 12:12 PM

I was wondering if anybody knew of any cheap light streak techniques. By light streaks I mean what http://www.daionet.g...~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. =(


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 demo 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.

#3 Styves   Members   -  Reputation: 336

Like
0Likes
Like

Posted 24 May 2011 - 01:38 AM

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. :)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS