Depth of field

Lens blur, with a focus plane and an aperture.

Without depth of field
Without depth of field
With depth of field
With depth of field

The Depth of field section trades the pinhole camera for a real lens. Only what sits at the focus distance comes out sharp; everything else spreads into a circle that grows wider the farther it is from the focus plane.

Controls

  • Enable depth of field: Turns the lens on. With it off, everything is sharp from the foreground to infinity.
  • Focus distance: The distance in meters between the camera and the plane that stays sharp. In the images above the focus is on the front sphere.
  • Aperture (f-stop): The f-stop, from 0.5 to 32. A low number is a wide lens, with little in focus; a high number closes the lens and brings the whole image back.
  • Bokeh blades: The number of diaphragm blades, from 0 to 12. From 3 up they shape the blur of a point of light: with 6 blades, a small out of focus highlight becomes a hexagon. Below that the aperture is round.

How to use it

Measure the distance in the project itself: put the camera where it is going to sit and use the distance to the main object as a starting point, adjusting until its edge is sharp.

The blur comes from the lens itself, not from a smudge applied at the end, so each sample sees the image through a different point of the lens. With few samples the blur looks dirty: when you turn depth of field on, raise Antialiasing samples on the quality page.