May 30, 2011

Screen-space Lens-Flare in HomeFront?

I consider myself a practical graphics programmer. I believe mathematically correctness is less important than what looks right(or okay) to gamers.

I recently saw an interesting lens-flare technique that goes along with my belief in a game called HomeFront.
In this game, lens-flare effect is a mere full-screen overlay of a bubble patterned image, which is revealed only on the pixels where bright lights are.

Look at my awesome picture below:

So from the left top picture, let's say the yellow part is where bright light is. (and the chance is you probably have some type of HDR buffer already to do effects like bloom.)  Then it'll use the luminance on each pixel as blend factor for lens flare bubble texture, making the final scene reveal bubble pattern on those bright pixels

I found this lens flare technique looks good enough when the high luminance area is small enough. The only time it looked a bit weird was when a large light, such as campfire, covers a lot of pixel spaces, revealing too much bubbles altogether. It almost made me feel like I was doing bubble bath. Hah! But I won't complain. 

Given that HomeFront was made by our sister studio, Kaos, I can probably ask them if my speculation(?) is correct,  But if I do so, I won't be able to write this blog post without going through our legal team. So let's just leave it as my own speculation.

I liked this technique. That's all I wanted to say.

p.s.  I saw this technique on PC version.

No comments:

Post a Comment