GSoC 2025 Draft Proposal - Compositor: Glare Node Enhancement

Glare Node Enhancement

Name
Mohamed Hassan Gad

Contact

Synopsis

This project aims to enhance Blender’s Glare node by addressing UX and technical limitations, improving usability, and performance. By resolving long-standing issues such as unintuitive controls, resolution dependency, and bad performance particularly in modes like Simple Star and Streaks. The updated Glare node will offer a more intuitive and efficient implementation.
The general improvements I aim to implement are stated in the following task:

Project size: 350 hours.

Deliverables

General Improvements

Problems:
The quality setting sometimes affects the final size of the Glare, and causes shifts in the highlights, modes like streaks and simple star implementations are directly dependent on the quality setting.

Solution:

  1. Re-implementing features to be independent of the quality sitting.
  2. Using a higher quality down sampling filter would preserve more details mitigating shifting of highlights.

Streaks Mode Redesign

Problems:

  1. Slow computation, where in the current implementation the compute kernel is dispatched as many times as the number of iterations specified by the user.
  2. Unintuitive control.
  3. All streaks are simply added, creating a bump at the center of the filter.
  4. Resolution dependency.
  5. Arbitrary filter impulse response.

Solution:
Designing a recursive exponential filter with adjustable parameters to control both the rate of change and the filter’s curve support (i.e., its radius). Reference [1] presents insightful equations that can serve as a foundation for developing this filter, with the following graph closely resembling our desired impulse response (the green curve).


Figure 1: Plot of a point spread function discussed in reference [1].

Also as discussed previously in the general improvements section (quality setting independent features); the radius parameter will be implemented resolution independent.
Also for a more realistic and intuitive result, at the center of the streaks instead of simply adding the streaks we would take the maximum in the overlapping region.
Finally simple star would be re-implemented as a special case of streaks (at streaks = 4), where the gaussian-like impulse response would be an exponential response.

Fog Glow

Implementing the kernel discussed in reference [1] “Physically-Based Glare Effects for Digital Images”.

Sun Beams Integration

Problem: Redundant node and slow computation.

Solution: Integrating the Sun Beams node into the Glare node as a new mode, optimizing it with Monte Carlo line integration for improved performance similar to the approach used in the Lens Distort node. Additionally, introduce a “Distant Light” mode, where rays remain parallel, potentially leveraging streak-based methods.

Custom Kernel Support

Add an option to use a custom glare kernel to be convolved with the highlights using FFT similar to the Fog Glow implementation.

Documentation

  • Update user manual with new parameters and workflows.
  • Provide technical documentation for future contributors.

Implementation Timeline

#Phase Approximate time interval Task
Phase 1 Week 1 General Improvements
Phase 2 Week 2 Custom Kernel
Phase 3 Week 3 Fog Glow
Phase 4 Week 4-5 Sun Beams
Phase 5 Week 6-11 Streaks, Simple star
Phase 6 Week 12 Bug Fixing And Documentation
Total: 350 hours.

Biography

I am a research and development engineer working on an automated handling system project, and a master’s degree student majoring in flight dynamics and control in aerospace engineering department. I earned my bachelor’s degree in Aerospace Engineering from Cairo University in 2022.

I love mathematical challenges, and have been working through my bachelor degree on many different projects that involved implementing various mathematical solutions and algorithms predominantly using MATLAB, and occasionally in C or C++.

I am eager to contribute to GSOC, particularly Blender’s compositor project to improve my code writing capabilities while implementing different mathematical solutions.

As a first contribution to the Blender foundation I committed the following PR 95eee272fe where I had the opportunity to build an understanding of the overall architecture and structure of Blender’s code base.

References

[1] G. Spencer, P. Shirley, K. Zimmerman, and D. P. Greenberg, “Physically-based glare effects for digital images,” in Proc. 22nd Annu. Conf. Computer Graphics and Interactive Techniques (SIGGRAPH '95), 1995, pp. 325–334, doi: 10.1145/218380.218466.

6 Likes

Sorry, are you sure your proposal is up to date?

  1. None of the settings are exposed as inputs, so it is hard to create node groups that contain Glare nodes.

This is fixed already.
In fact, I think almost all points in that improvements ticket is already addressed.

4 Likes

Thanks, you’re absolutely right—I missed that one. I’ve just updated it.
While it’s true that some improvements mentioned in that ticket have been addressed, the specific enhancements I proposed here are still pending.

2 Likes

This point seems more complex in wording than it should be. Furthermore, we already use a downsampling filter, albeit a low quality one. So this point should be simplified to state that “a higher quality downsampling filter should be used to mitigate shifting of the highlights and preserving of details”.

Perhaps I wasn’t clear in the original task, but while simple star is currently a Gaussian-like filter, this is not desirable. So simple star should simply use the same exponential filter used by Streaks. Where Simple Start will essentially be Streaks where streaks = 4.

I would like to see more attention given to the fact that most of the time spent on this point will be about researching and designing an appropriate filter. The implementation should easy to do.

I propose that you switch Phase 2 and Phase 5, that’s because Streaks will take the most research, and you can do your research while implementing earlier phases, at least this is how I tend to do projects that require a bit of research.

1 Like

Also do not forget to state the length of the project, (350h, 175h, or 90h).

1 Like

Thanks Omar, I’ve just updated the proposal according to your notes.