Skip to main content
GameDev.net gamedev.net
🔒 Locked

Lens "Diffraction"/Anamorphic Lens Flares

Started by Styves Jan 28, 2010 at 1:00 AM 2 replies 4.6k views
Original Post
Styves
Styves
I've been working on a lens flare shader recently (done entirely in post-processing). So far it looks great, but there's one thing I'm curious about, and that's "diffraction" (that's what it was called on wikipedia anyway). Basically, this is what it looks like (image from wikipedia). Colors aren't important, but that's the basic idea. So here are my questions: What would it take to pull off this effect? Can it be done entirely in a pixel shader or do I also need to edit the vertex shader? Can it even be done in image-space? I think it can, but confirmation would be great. :) My lens flares are calculated the "Masaki Kawase" way, by taking a sample of a glow/bloom buffer and inverting it's coordinates with some scaling to produce a flare. I do this a few times to create the effect. I'm hoping I can do the same for this. I'd also like to know if there's a more performance-friendly way of achieving an anamorphic flare, using the same technique above (or something similar anyway). Something like this: Currently I'm using Masaki's technique for streaks, but that's both hard on performance (I have no source code access, so I can't change the resolution of the render target I'm using), and doesn't produce results that I'm pleased with. Thoughts? [Edited by - Styves on February 4, 2010 9:04:29 PM]
cignox1
cignox1
To get the correct effect you would need to trace rays through the lens of your virtual camera smohow, I fear. You could try to fake it by offsetting a bit the position of the gloom for each color channel, so that they do not overlap perfectly...
Styves
Styves
I take it nobody has a clue then? :(
szecs
szecs
Take a look into this. Long thread, read through, you will understand, why I linked it.

For the lens flare stuff (your lower image), I would guess they are just 2D textured billboards for each light source. Like any other lens flare effects.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.