Introduction

Flares Science is a set of tools for generating all parts of photorealistic lens flares.

This book will cover all aspects of Flares Science, beginning with introducing all parts of real flares, continuing with the physics behind them, and finally how to generate each using Flares Science tools.

Assumptions

To model any physical system, one needs to make assumptions about the system. This document should cover most of the assumptions that are used in Flares Science.

Point light source

Probably the most fundamental assumption is that the light source is a point light source, which is infinitely far away. This means that all rays of light have the same direction and only the position varies.

Because of this, area light sources are not supported natively in Flares Science. They can however be simulated by rendering multiple times with slightly different positions or approximated with a blur on the output.

Black body light source

While not a fundamental part of how the rendering works, the current implementation of Flares Science assumes that the light source behaves like a black body1.

Various others

Many other assumptions needed to be made and will be discussed in the realism subsections of the application in which they are relevant.

Parts of a flare

A real lens flare is the combination of several physical phenomena, which have to be modeled individually for photorealistic rendering.

Real lens flare A real lens flare with the central flare and several ghosts visible

The two main parts of a lens flare are the central flare and the ghosts.

The central flare is the starburst pattern that is covering the light source, which is surrounded by the ghosts.

Ghosts

Because the ghosts are highly dependent on the exact construction of the lens, it is basically impossible to generate a perfect replica of a real lens flare unless the lens design is known. This is why the Flares Science main application ships with several lens prescriptions.

Ghosts Ghosts generated by Flares Science Polyflare. Notice the subtle chromatic aberration

Central flare

The central flare however is only dependent on the aperture shape, which is significantly easier to find out for any given lens.

Central flare Central flare generated by Flares Science Starburst

Central flare

On any bright light source, the central flare will be visible. Its shape is defined by the aperture of the lens and any dust or scratches on the lens. It is caused by diffraction at the aperture of the lens.1

Ghosts

Ghosts are different shapes on the resulting image caused by internal reflections of bright light sources off different lens surfaces.1

Realism

Rendering photorealistic lens flares requires in-depth knowledge of the physics of how light travels through lenses.

This section is dedicated to explaining the physics of lens flares and how they are modeled in Flares Science. Starting with general concepts that apply to all our technologies, we will then go into more specific details of how each technology works.

As Flares Science is based on the bachelor's thesis of Lukas Sabatschus, there is a lot more detail available on most topics discussed here in it. It is available for free at https://luksab.de/projects/thesis/.

General

Spectral Rendering

As opposed to the traditional rendering of a scene, which only takes into account the colors, spectral rendering takes rays of all wavelengths into account to model spectral effects natively.

This is especially important for the rendering of lens flares, as there are many such effects visible. The most visible of which is dispersion on the edges of the ghosts, but many others will be discussed in their respective subsections.

Here is a comparison of a single ghost rendered with (left) and without (right) spectral rendering:

spectral rendering

Wavelength to color conversion

Flares Science converts wavelengths to colors using measured data from real camera sensors. This results in a more accurate color mapping, and also additional artistic control over the colors.

Here is a comparison of the same central flare rendered with a Hasselblad H3D (left) and a Leica M8 (right):

wavelength to color conversion

Starburst

For realistic modeling of the central flare there are five components:

  • Aperture Generation
  • Adding Dust and Scratches
  • Fourier Transform
  • Spectral Integration
  • Wavelength to Color Conversion

We will go over these one by one and discuss how we model each step to ultimately achieve the highest level of realism.

Aperture Generation

Looking at real apertures, we observe that they are made up of a number of semicircular blades that move in and out as the aperture opens and closes. In some lenses these blades rotate while moving, whereas in others, they do not.

The aperture is modeled in Starburst as the intersection of a user-specified number of blades rotated by a user-specified amount.

Polyflare

In Polyflare light is modeled as a collection of rays, therefore ray-optical effects can be modeled. These include refraction, multiple reflection, and anti-reflection coatings.

Assumptions

Currently, only spherical and cylindrical lens elements are supported. This is, because the ray-element intersection can be calculated analytically for these.

This means, that Polyflare cannot model aspheric lenses, but this is not a fundamental limitation of the algorithm, but rather a limitation of the current implementation and could be implemented in the future at the expense of performance.

Usage

Starburst

Online version

Approximate Image Size: integer

Gives the resolution of the output image. This is only approximate, because there are some rounding errors resulting from internal scaling.

Number of Aperture Blades: integer

How many blades the aperture has. Many apertures have 6 Blades.

Aperture Size: float

A value of 0 means a fully closes aperture, resulting in a black image. A value of 1 is fully opened and because of how apertures work, results in a circular aperture.

Noise Level: float

A value of 0 to 1 gives how much non-anamorphic noise is present. This represents for example dust.

Anamorphic Noise Level: float

A value of 0 to 1 gives how much anamorphic noise is present. This represents for example scratches or hairs.

Offset: Vec2

This moves the light source relative to the apterture.

High-res Preview: boolean

Whether to render the preview with the approximate image size or a lower, constant resolution.

Render Starburst to EXR

Download a full-resolution, high dynamic range EXR render of the Starburst

Polyflare