Physically-based lens flare rendering using spectral raytracing on the GPU.
Install using uv:
git clone https://github.com/beatreichenbach/realflare.git
cd realflare
uv venv --python 3.13
uv pip install -e .Or without:
git clone https://github.com/beatreichenbach/realflare.git
cd realflare
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -e .- Python 3.11–3.13 (OpenEXR ships no 3.14 wheels yet)
- OpenGL 4.3+ (compute shaders required)
- Discrete GPU recommended (NVIDIA/AMD with 4GB+ VRAM)
| Platform | Status | Notes |
|---|---|---|
| Linux (Wayland) | Partial | Use egl backend and wayland Qt Platform |
| Linux (X11) | Supported | Use glx backend and xcb Qt Platform |
| Windows | Supported | Install GPU drivers |
| macOS | Not supported | Apple stopped at OpenGL 4.1 |
If not automatically detected:
export QT_QPA_PLATFORM=wayland
export PYOPENGL_PLATFORM=eglForce to use the discrete NVIDIA GPU:
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia# Launch the GUI
flare gui
# Render a project from CLI
flare render --project path/to/project.json
# Render with animation
flare render --project path/to/project.json --animation path/to/animation.jsonA Nuke plugin is available for rendering lens flares from the Nuke gizmo. See plugins/nuke/README.md for installation and usage.
Primary research this app is based on:
- Physically-Based Real-Time Lens Flare Rendering, Hullin et al., 2011
- Temporal Glare: Real-Time Dynamic Simulation of the Scattering in the Human Eye, Ritschel et al., 2009
- Glare Generation Based on Wave Optics, Kakimoto et al., 2014
Additional interesting research:
- General Spectral Camera Lens Simulation, Steinert et al., 2011
- Efficient Monte Carlo Rendering with Realistic Lenses, Hanika and Dachsbacher, 2014
- Sparse high-degree polynomials for wide-angle lenses, Schrade et al., 2016
- Brute-force calculation of aperture diffraction in camera lenses, Schrade et al., 2019
- Polynomial Optics: A Construction Kit for Efficient Ray-Tracing of Lens Systems, Hullin et al., 2012
- Reference Implementation for papers titled Real-time ray transfer for lens flare rendering using sparse polynomials and Efficient tile-based rendering of lens flare ghosts
Further references:
- Johannes Hanika
- Zhongyi Flare Test, YouTube, 2016
- Diffractsim: A diffraction simulator for exploring and visualizing physical optics
See CONTRIBUTING.md for development setup, the project layout and the layering rules.
Copyright (c) 2026 Beat Reichenbach. This project is licensed under the GPLv3 License.

