Sign in to follow this  
Matso

Anamorphic lens flare

Recommended Posts

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 [url="http://www.mpi-inf.mpg.de/resources/lensflareRendering/pdf/flare.pdf"]this pdf[/url]. 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
[quote name='alvaro' timestamp='1318435725' post='4871887']
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?
[/quote]

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

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