Skip to content
Voro
  1. Image
  2. Effects

Depth Lens

Example Built with Kernel FX Ships with Voro as an example. It may change between versions.

Depth Lens uses a depth map to decide which parts of the image stay in focus. Its iris controls shape the blur around points away from the focus plane. Colour focus offsets and veiling flare add further lens effects.

Place Depth Lens under Effects in the Image view. Connect the picture to image and a matching depth map to field. Depth Anything can estimate that map from the picture.

Move Focus through the depth range until the subject is sharp. Lower f-stop for stronger defocus, then adjust the iris shape.

  • image is the picture to render.
  • field is a single-channel depth map.
  • out is the picture with the lens treatment applied.
  • Focus uses the units of the incoming depth map. Depth Scale expands or contracts that range.
  • f-stop controls the iris opening. Lower values produce stronger defocus.
  • Iris Blades sets the aperture shape. Zero gives a round iris.
  • Bokeh moves light toward or away from the edge of the blur disc.
  • Longitudinal CA separates red and blue focus distances.
  • Veiling Flare spreads light into shadows. Highlight Headroom strengthens the response to bright sources.
  • Image Format and Capture Resolution set the simulated image plane and its sampling detail.

Relative depth estimates do not give a focus distance in metres. Set Focus against the values in your actual map. If those values change scale between frames, the apparent focus can move even with a fixed Focus setting.

Inputs

  • image image required
    RGBA
  • field image
    single channel
  • camera image
    48

Outputs

  • out image
    RGBA
  • focus image
    4
  • lens_source image
    2

Lens

Mix (Mix) Float op('depth_lens').par.Mix

Blend the untouched image to the complete taking-lens result.

Default:
1
Range:
0 to 1
Focus Mode (Focusmode) Menu op('depth_lens').par.Focusmode

Manual sets the focus distance by hand. Auto meters the depth under the focus point and racks the lens to it. Lock freezes the lens exactly where it is, mid-rack included.

Default:
manual
Options:
manual, auto, lock
Focus Distance (Focus) Float op('depth_lens').par.Focus

Depth of the focus plane, in the units the depth input carries: world units from a renderer, 0..1 from a normalised depth map. Zero focuses an unconnected input.

Default:
0
Range:
0 to 10000
Focus Point X (Focusx) Float op('depth_lens').par.Focusx

Where Auto measures, across the frame. 0.5 is the centre.

Default:
0.5
Range:
0 to 1
Focus Point Y (Focusy) Float op('depth_lens').par.Focusy

Where Auto measures, up the frame. 0.5 is the centre.

Default:
0.5
Range:
0 to 1
Focus Spot (Focusspot) Float op('depth_lens').par.Focusspot

Width of the metering patch as a fraction of the frame. Small reads one detail; wide averages a whole subject.

Default:
0.05
Range:
0 to 0.5
Focus Time (Focustime) Float op('depth_lens').par.Focustime

Seconds the lens takes to reach a new focus distance, in Manual as well as Auto. Zero snaps; a quarter second is a fast operator.

Default:
0.25
Range:
0 to 4
Latch Autofocus (Focuslatch) Toggle op('depth_lens').par.Focuslatch

Keep the distance autofocus found after you switch it back to Manual, instead of returning to Focus Distance. Place the point, flip Auto on and off, and the lens rides to what it saw and stays there.

Default:
Off
Options:
Off, On
Show Focus Point (Focusguide) Toggle op('depth_lens').par.Focusguide

Draw the metering spot while you place it: green once the lens has arrived on what it measured. Turn it off to render.

Default:
Off
Options:
Off, On
Depth Scale (Depthgain) Float op('depth_lens').par.Depthgain

How much depth the input spans. Raise it when a depth map uses only part of its range.

Default:
1
Range:
0 to 6
f-stop (Fstop) Float op('depth_lens').par.Fstop

Iris opening. Wide open defocuses hard and shows the blade shape; stopped down brings the whole depth in.

Default:
4
Range:
1.2 to 22
Iris Blades (Blades) Int op('depth_lens').par.Blades

Number of aperture blades. Zero is a round iris; five through nine give a real polygonal defocus shape.

Default:
7
Range:
0 to 11
Bokeh (Bokeh) Float op('depth_lens').par.Bokeh

Where light sits inside the blur disc. Negative is smooth and creamy; positive rings the edge into soap bubbles.

Default:
0.15
Range:
-1 to 1
Longitudinal CA (Ca) Float op('depth_lens').par.Ca

Offsets red and blue focus distances, producing warm and cool fringes around out-of-focus structure.

Default:
0.3
Range:
0 to 1
Veiling Flare (Flare) Float op('depth_lens').par.Flare

Broad light bouncing between the elements and barrel. It lifts and desaturates shadows without blurring the photographed base.

Default:
0.12
Range:
0 to 1
Highlight Headroom (Highlights) Float op('depth_lens').par.Highlights

Restores light above display white so clipped practicals form substantial bokeh discs and veiling flare. It has nothing to restore when Input Is is Linear, because that light was never clipped away.

Default:
2.5
Range:
0 to 12
Optical Model (Model) Menu op('depth_lens').par.Model

Stylised blur grows in a straight line with distance from the focus plane and never stops. Thin Lens is the real relationship: background blur settles towards a limit however far away the background is, and foreground blur runs away far faster.

Default:
stylised
Options:
stylised, thinlens
Focal Length (Focallength) Float op('depth_lens').par.Focallength

The simulated taking lens, in millimetres, used by the Thin Lens model. This is the lens you are photographing THROUGH; it does not change the framing, which belongs to whatever camera rendered the picture.

Default:
50
Range:
4 to 2000
Image Format (Format) Menu op('depth_lens').par.Format

Physical image-plane width. Circle-of-confusion size is measured on that plane, so the same lens resolves differently across formats.

Default:
35mm
Options:
super8, 16mm, super16, 35mm, 65mm
Capture Resolution (Scan) Menu op('depth_lens').par.Scan

Sampling resolution across the image plane. It limits captured detail independently of output resolution.

Default:
4K
Options:
2K, 4K, 6K

Input

Input Is (Inputis) Menu op('depth_lens').par.Inputis

Display treats the image as an ordinary picture: it is decoded to light, worked on, and re-encoded, and anything above white is clipped. Linear takes the image as scene light already and leaves it alone, which is what every Voro renderer publishes and the only setting that keeps highlights above white.

Default:
display
Options:
display, linear
Depth Is (Depthis) Menu op('depth_lens').par.Depthis

Camera Z is the forward distance a raster publishes, and is what a flat film plane actually focuses on. Ray Distance is the camera-to-hit distance a path tracer publishes; it is longer at the corners of the frame, so it is converted here using Field of View. Both ship declared as distance depth and cannot be told apart on the wire.

Default:
cameraz
Options:
cameraz, ray
Field of View (Fov) Float op('depth_lens').par.Fov

Fallback vertical field of view, in degrees. It is ignored while a camera row is connected. Only Ray Distance needs it.

Default:
45
Range:
1 to 175
Alpha (Alphamode) Menu op('depth_lens').par.Alphamode

Keep leaves alpha untouched, which is right when this is the last operator on a finished picture. Straight and Premultiplied defocus coverage along with the colour, which is what an isolated layer needs before anything composites it — blurring colour while alpha stays sharp is not a layer.

Default:
keep
Options:
keep, straight, premultiplied