Look at my screenshot: it shows "light flares", not "sun flare". There's only one texture needed for such effect.
Quote:
About detecting lights if they are facing the camera, it only will work fine with directional lighs. Point lights have no direction...
Let's define this as an option.
Quote:
Should the lens flare effect be rendered at the last?
Yep, right, as all translucent textures.
Quote:
Should it be part of the HDR texture?
No. This texture is heavily stretched and use a very low resolution. And effects should be distincts. And currently, HDR is not working (not production ready).
Quote:
Also is needed en occlusion test to avoid show the LF if the light is occluded by an object.
I don't think so. Most of the time, light flares are small. Viewing a small part of the flare when the light is masked is not a problem. Look at this ugly test : the left headlight of the car behing is not visible, but we see the flare .. and it looks cool, no ?
So (for me) GL_NV_occlusion_query isn't needed for such lens flares (but probably for sun flare, but I usually found this effect ugly ... HDR look way better for the same thing, I think).