Rendering Realistic Lens Flare



Abstract
In this project, I investigated various techniques related to rendering lens flare, which occurs in the form of multiple ghosts with color variations as well as a starburst pattern around the main image of the light source.
The challenge of rendering lens flare lies in the high dimensionality of rays associated with this effect, causing a lot of noise sampling based methods. Therefore, I decide to use texture mapping based approach for rendering, which includes three steps:
  • Divide the front pupil into a sparse quad-mesh and trace rays through each vertex of the mesh; to handle dispersion, indices of refraction and Fresnel reflectivity are evaluated per wavelength and ray tracing is performed per wavelength too.
  • Based on the ray tracing results, compute an aperture truncation texture that maps densely discretized front pupil coordinates to a binary indicator of light transportation; To account for ringing, transform this texture with FrFT.
  • Map the aperture image to the sensor plane, normalize the solid angle accordingly.
    To improve the efficiency of the method, insignificant ghosts are ignored during the rendering. To speed up rendering of individual ghosts, I designed a local mesh refinement algorithm to adaptively subdivide the mesh where lacks information and needs more rays to be traced.
    My implementation is able to render interesting lens artifacts including optical aberrations starbursts, and lens flares of complex deformations.

  • Publication
  • Tang, H., Rendering Realistic Lens Flare, Report for CSC2522, Department of Computer Science, University of Toronto, 2012. [pdf]