• Advertisement
Sign in to follow this  

Anamorphic lens flare

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

Advertisement
hm im not sure about this, but as far as i know , its still done the old fashioned way, i.e. by drawing quads (sprites).
you might want to check out this pdf. havent read it myself yet, so im not sure if its any good, but the flares look cool :)

also i think the abstract mentioned a scalable quality/speed tradeoff.

let me know if its worth the read :)

Share this post


Link to post
Share on other sites
The DXSDK HDRLighting sample has a jumping-off point you may find interesting, there are 'cinema horizontal/vertical' bloom filters that provide a similar effect. In practice I think you'd want to enhance these with some extra, 'rounder' glare near the source of the flare, but that's really just a question of adjusting sample positions/weights for different blur passes. Depending on art needs, however, you may also have some luck with the billboard method Tasche suggests above, or even a hybrid method.

Share this post


Link to post
Share on other sites
Disclaimer: I have no practical experience implementing this type of thing, so what I am about to say might be useless. If we have an image of the lens flare given a single very bright pixel, one could compute the lens flare for a whole HDR image by convolution. Convolution with an arbitrary image can be implemented using a 2D FFT transform, but I don't know if there is code to do that on a GPU that is fast enough that this would be practical.

Has anyone tried something like this before?

Share this post


Link to post
Share on other sites

Disclaimer: I have no practical experience implementing this type of thing, so what I am about to say might be useless. If we have an image of the lens flare given a single very bright pixel, one could compute the lens flare for a whole HDR image by convolution. Convolution with an arbitrary image can be implemented using a 2D FFT transform, but I don't know if there is code to do that on a GPU that is fast enough that this would be practical.

Has anyone tried something like this before?


Yes, and it definitely works. :wink:

You can do a 512x512 FFT in a fraction of a millisecond on a modern high-end GPU if you do it with a compute shader.

Share this post


Link to post
Share on other sites
It's not really that complicated...just create a downscaled buffer that's had a threshold or lower exposure applied to it (exactly as if you were going to do bloom), then blur only horizontally instead of both horizontally and vertically. Do it at a really low res with a wide kernel (or multiple passes) to get a really wide flare effect.

Share this post


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

  • Advertisement