(render after everything, if a ray-check passes)
Still waiting for a coder to comment on how expensive this would be...
Maybe a view-angle dependend shader would be a cheaper soltion and put off some workload from the CPU.
And in all honesty, I wanted a lensflare system like this before, but this method seems outdated. Using the pixel bightness seems to be a way more accurate way.
I still think it makes sens for the sun, cause in terms of brightness, the sun is somewhat special. The flares on everything else should work and look the same.
I can wait for the HDR rendering.
If you're desparate, alter the current bloom effect. You can easily turn it into a flare-like streak effect by blurring it on one axis only.