Glare Node Enhancement
Name
Mohamed Hassan Gad
Contact
- Email: [email protected]
- Phone number: +20-112-8896-729
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:
- Re-implementing features to be independent of the quality sitting.
- Using a higher quality down sampling filter would preserve more details mitigating shifting of highlights.
Streaks Mode Redesign
Problems:
- Slow computation, where in the current implementation the compute kernel is dispatched as many times as the number of iterations specified by the user.
- Unintuitive control.
- All streaks are simply added, creating a bump at the center of the filter.
- Resolution dependency.
- 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.