feat: add LensFlareEffect
Related issue: https://github.com/pmndrs/postprocessing/issues/581
Description
This PR adds a LensFlareEffect based on https://www.froyok.fr/blog/2021-09-ue4-custom-lens-flare/.
Limitations
- Uses a simple bloom glare instead of a starburst shape.
- Ghosts and halos are not configurable.
- No anamorphic distortion.
Considerations
- Luminance threshold and bloom overlap with existing effects and passes. Separating them would require two additional passes, but is a possible option.
- The downsampling follows Sledgehammer Games’s method 1 2, which differs from DownsamplingMaterial. I have yet to compare and determine which is better.
- Ghosts could be made configurable, but it might require a bit complex parameter interface.
Thanks! I'll take a closer look at this when I have more time on my hands.
At a glance, it looks like this effect duplicates the bloom effect which is suboptimal from a maintenance perspective. If this effect doesn't require the bloom-related code, it should be removed.
It might also make sense to create a dedicated LensFlarePass for the LensFlareFeaturesMaterial to implement lens-flare-specific configuration options in that pass. The pass would then be used instead of the internal ShaderPass.
I'm also not sure about the duplicated luminance threshold and downsampling code. It would be better if the existing passes could be reused.
Thanks for reviewing! I agree with your points and will work on those changes.
Wow excited for this one, thanks @shotamatsuda for your work!