Zenith: Physically Based Lens Flares for Houdini

Zenith: Physically Based Lens Flares for Houdini

in

Physically based lens flares for Houdini Copernicus.

Zenith renders the flare a real lens would produce. It traces light through a lens prescription (the radii, spacings and glasses of every element) and follows every path that reflects off two lens surfaces before reaching the sensor. These reflections are the ghosts: the coloured discs and polygons strung out along a line through the light. Their shape, colour and position come from the optics, not from hand-placed sprites. Zenith also renders the iris’ diffraction starburst and a soft veiling glare halo around each light.

Zenith is free for non-commercial use, with a paid commercial licence for client and production work.

Get Zenith on

Features

  • Real lens ghosts. Every two-bounce reflection, traced through the lens, with anti-reflection coatings and dispersion.
  • Lights from your plate. Bright regions of an HDR plate become lights, calibrated from their pixels, so the flare matches the plate’s brightness.
  • Scene-aware manual light. Place a light by hand, or follow a sun angle, a direction or a LOP/OBJ light through your camera. The flare keeps going after the sun leaves the frame.
  • Slap comp ready. In a Karma or viewport slap comp, Zenith reads the camera from the image itself, viewport camera included, so the flare stays locked to your sun as you tumble the viewport.
  • Occlusion. A mask input, or the plate’s alpha, hides the light behind foreground objects and fades the flare smoothly as the sun slips behind an edge.
  • Built-in lenses. Five lens designs from a 28 mm wide angle to a 300 mm telephoto, plus your own Zemax/OpticStudio .zmx prescriptions.
  • Custom apertures. Any blade count, or an image for dust, scratches and custom iris shapes. It shapes the ghosts and the starburst alike.
  • Spectral rendering. Trace up to 256 wavelengths for true coating colours and dispersion, output in Linear Rec.709 or ACEScg.
  • Fast. Renders on NVIDIA GPUs with CUDA and falls back to the CPU automatically. A preview mode keeps it interactive.

A sun flaring through the lens

A chain of hexagonal ghosts strung along a line through the sun, with its starburst and veiling glare.

Quick start

Zenith ships as a single Copernicus node, Zenith Lens Flare.

  1. In a Copernicus network, press Tab and create Zenith → Zenith Lens Flare.
  2. Connect your plate to the first input, source. The flare takes its resolution from it, and with Image Lights on, its lights come from the plate’s bright regions. With no plate, connect a black Constant of the size you want and use the Manual Light.
  3. Pick a Lens in the Camera folder and set Sensor Width to your camera’s film back (36 mm is full frame, Super 35 is about 24.9 mm).
  4. Adjust brightness with the Intensity of the image lights or the manual light.
  5. When the look is right, turn off Preview for the full-quality render.
  6. Add the flare over the plate, for example with a Blend COP in Add mode.

The output is the flare alone, in linear light, on black. It isn’t composited over the plate, so you can grade it separately and add it back.

Inputs

Input What it does
source The plate (RGBA). Sets the output resolution, and its bright regions become lights. Required.
aperture Optional mono image of the iris (0 = opaque, 1 = clear). Use it for dust, scratches and custom iris shapes.
camera Optional camera from a Camera or Camera Import COP, used to project scene lights into the frame.
mask Optional occluder matte for the manual light (1 = blocks it), such as the alpha of a foreground render.

Lights from the plate

With Image Lights on, every region of touching pixels brighter than Light Threshold becomes a light at the region’s centre, with its colour. Each light is calibrated so that its image through the lens carries the same energy as the region’s pixels. On an HDR plate, the flare’s brightness matches the scene without adjustment.

Three image lights

Three image lights from an HDR plate: the sun, an orange lamp and a blue light.

  • HDR plates (EXR from a camera or a render) work at Intensity 1.
  • Clipped plates (JPEGs and display-referred footage stored at 1.0 or below) lose the light’s real brightness. Raise the image lights’ Intensity until the flare looks right; a sun often needs tens to hundreds.
  • If a large bright area such as an overcast sky turns into a single light, raise Light Threshold.
  • Max Lights keeps only the brightest lights. Each light costs a full set of ghosts, so lower it on busy plates.

Following a light in the scene

Image lights only see the pixels in the frame, so a sun’s flare stops the moment it leaves the frame. The Manual Light can follow it instead, on screen and off, as the camera moves.

A light just outside the frame

A light just outside the frame. Its starburst and glare reach in from the edge, and its ghosts still cross the frame.

  1. Give Zenith the camera. In a slap comp, leave the camera input empty: Slap Comp Import’s Import Cameras with Slap Comp Inputs (on by default) puts the render camera, viewport camera included, on the image itself, and Zenith uses it. For a plate without a camera, connect a Camera Import COP pointing at your render camera to the camera input.
  2. Set Light Position to match how your scene defines the sun:
    • Light Node for a distant light, point light or any other LOP or OBJ node. Animated lights are followed frame by frame.
    • Elevation / Azimuth for a sun given as angles, such as a sky texture on a dome light. The convention matches FreeFlight’s Sky Texture, so you can copy its values.
    • Direction for a world-space vector pointing towards the light.
    • Image Position to place it by hand with Light X / Light Y (−1 to 1 across the frame; values beyond ±1 put it outside the frame).
  3. Set Intensity and Light Color by eye. Unlike image lights, the manual light isn’t measured from pixels.
  4. If the sun is visible in the plate, hide its disc in the render or turn Image Lights off, otherwise it flares twice.

Occlusion

Connect a foreground matte to the mask input, or turn on Occlude by Source Alpha, and the manual light dims by the fraction of its disc that’s covered. Light Size sets that disc’s angular size (the sun is 0.53°), so the flare fades smoothly as the sun slips behind a building or a planet instead of popping off.

Flare composited over a plate with a sphere partially occluding the sun The flare pass on its own Left: the flare added to the plate. Right: the flare pass on its own.

Lenses

The lens decides almost everything about a flare: how many ghosts there are, their size and spacing, and their colours. Zenith includes five lenses, synthetic designs built to be representative of their type. Lenses with more surfaces produce more ghosts and render slower.

Long Telephoto 300mm Retrofocus Wide 28mm Triplet 50mm Long Telephoto 300mm f/5.6 (the default), Retrofocus Wide 28mm f/2.8, Triplet 50mm f/3.3

Double Gauss 50mm Telephoto 135mm Double Gauss 50mm f/2, Telephoto 135mm f/2.8

Bring your own lens

Set Lens to From File and point Lens File at a Zemax/OpticStudio .zmx file; it’s converted when loaded. Many published lens designs are available in this format. Zenith currently reads spherical surfaces only (files with aspheric or conic surfaces or mirrors are refused with an error naming the surface), in millimetres with the object at infinity. For zoom lenses, Zemax Configuration picks the zoom position.

Flare from a custom lens

You can also write Zenith’s own .lens format by hand: a plain text file with one surface per line, front element first.

# The built-in Triplet 50mm f/3.3
# radius  thickness  n_d      V_d    semi_ap  flags
  22.01     3.26     1.62041  60.32  10.0     coat=550   # N-SK16
-435.76     6.01     1.0       0.0   10.0     coat=550
 -22.21     1.00     1.62004  36.37   8.0     coat=550   # F2
  20.29     2.50     1.0       0.0    8.0     coat=550
   0.0      2.25     1.0       0.0    6.0     stop
  79.68     2.95     1.62041  60.32   8.0     coat=550   # N-SK16
 -18.40    42.44     1.0       0.0    8.0     coat=550

Aperture and starburst

Aperture Blades sets the iris shape, which shapes both the ghosts and the starburst spikes. Connect an image to the aperture input instead and it replaces the blades entirely, for dust, scratches or any iris shape you like. The starburst is computed from the iris itself, so whatever is in the aperture image shows up in the diffraction too.

Heart-shaped aperture

A heart-shaped aperture image: the ghosts take the shape of the iris.

An iris with an odd number of blades really produces twice as many spikes as blades. Turn on Physical Starburst Spikes (in Advanced) to render that.

Starburst spikes with 3 and 5 blades

Top row 3 blades, bottom row 5. Left: Physical Starburst Spikes on. Right: off, one spike per blade.

Spectral rendering

By default Zenith traces three wavelengths, one each for red, green and blue. Turn on Spectral and it traces many wavelengths between 380 and 730 nm and combines them as a camera would, giving smooth rainbow fringes and accurate coating colours. 16–32 Wavelengths with Interpolate Wavelengths on usually look the same as 256 without it.

RGB rendering Spectral rendering Left: Spectral off, a caustic splits into separate red, green and blue lines. Right: Spectral on, 16 wavelengths.

Tips

  • Work with Preview on, and turn it off only for the final render. Preview uses fewer pupil samples and wavelengths to stay interactive.
  • Render time grows with the number of lights, the number of lens surfaces, Pupil Samples squared and, in spectral mode, the number of wavelengths.
  • Ragged ghost edges? Raise Pupil Samples (or Preview Pupil Samples while previewing).
  • Composite with Add, not Over or Screen. The flare is light that reaches the sensor in addition to the image. It’s linear and unclipped, so grade it like any other light pass.
  • For a dirtier lens, connect an aperture image with dust or scratches and raise Veiling Glare.
  • In a slap comp the flare lags the camera? Disconnect the camera input; the slap comp image already carries the exact camera.

Requirements

  • Houdini 22.0 (Copernicus), on Windows 10/11 x64 or Linux (RHEL, Rocky or Alma 8 and newer).
  • For GPU rendering: an NVIDIA GPU from the Turing generation (RTX 20 / GTX 16 series) or newer, with a driver that supports CUDA 13. No CUDA Toolkit is needed.
  • Without a usable NVIDIA GPU, Zenith renders on the CPU. The output is the same, only slower.
  • Works in Houdini FX, Core, Indie and Apprentice.

Installation

Zenith is a Houdini package. Unpack the release into your Houdini packages folder so that zenith.json and the zenith-<version> folder sit side by side:

  • Windows: %USERPROFILE%\Documents\houdini22.0\packages
  • Linux: tar -xzf zenith-v*-linux-x86_64.tar.gz -C ~/houdini22.0/packages

Restart Houdini and look for Zenith → Zenith Lens Flare in the Copernicus Tab menu. The node’s Render Device line tells you whether it’s using your GPU. The full user guide, including studio installs and troubleshooting, is included in the download under docs/index.html.

Licensing

  Non-Commercial Commercial
Price Free $29.99, one-time
Use Personal projects, learning, teaching and non-profit academic research Paid work, client projects and anything sold, advertised or monetised
Resolution Up to 1920×1080 (or 1080×1920) Unlimited
Seats   1 seat, perpetual, unlimited render nodes (hython, Husk, farm) for your own jobs

Both editions render the same image. Zenith is in beta (version 0.1.x); feedback and bug reports are very welcome.

Get Zenith on

Based on the method of Hullin et al., Physically-Based Real-Time Lens Flare Rendering (SIGGRAPH 2011).