The Defocus node simulates the effects of an out-of-focus camera lens, including blooming and image flaring. It provides a fast Gaussian mode, as well as a more realistic but slower Lens mode.
Defocus Node Inputs
The two inputs on the Defocus node are for connecting a 2D image and an effect mask that can be used to limit the simulated defocused area.
- Input: The orange input is used for the primary 2D image for defocusing.
- Effect Mask: The blue input is for a mask shape created by polylines, basic primitive shapes, paint strokes, or bitmaps from other tools. Connecting a mask to this input limits the defocus to only those pixels within the mask. An effect mask is applied to the tool after it is processed.
Defocus Node Setup
The Defocus node receives a 2D image like the MediaIn1 shown below. The output continues the node tree by connecting to another 2D image-processing node or a Merge node.
Defocus Node Controls Tab
The Controls tab contains all the primary controls necessary for customizing the defocus operation.
Use this menu to select the exact method applied to create the defocus. Gaussian applies a simplistic effect, while Lens mode creates a more realistic defocus. Lens mode takes significantly longer than Gaussian.
- Lock X/Y
When Lock X/Y is selected, this performs the same amount of defocusing to both the X- and Y-axis of the image. Deselect to obtain individual control.
- Defocus Size
The Defocus Size control sets the size of the defocus effect. Higher values blur the image by greater amounts and produce larger blooms.
- Bloom Level
The Bloom Level control determines the intensity and size of the blooming applied to pixels that are above the bloom threshold.
- Bloom Threshold
Pixels with values above the set Bloom Threshold are defocused and have a glow applied (blooming). Pixels below that value are only defocused.
The following four lens options are available only when the Filter is set to Lens.
- Lens Type: The basic shape used to create the “bad bokeh” effect. This can be refined further with the Angle, Sides, and Shape sliders.
- Lens Angle: Defines the rotation of the shape. Best visible with NGon lens types. Because of the round nature of a circle, this slider has no visible effect when the Lens Type is set to Circle.
- Lens Sides: Defines how many sides the NGon shapes have. Best visible with NGon lens types. Because of the round nature of a circle, this slider has no visible effect when the Lens Type is set to Circle.
- Lens Shape: Defines how pointed the NGons are. Higher values create a more pointed, starry look. Lower values create smoother NGons. Best visible with NGon lens types and Lens Sides between 5 and 10. Because of the round nature of a circle, this slider has no visible effect when the Lens Type is set to Circle.
- Clipping Mode
This option determines how edges are handled when performing domain-of-definition rendering. This is profoundly important for nodes like Blur, which may require samples from portions of the image outside the current domain.
- Frame: The default option is Frame, which automatically sets the node’s domain of definition to use the full frame of the image, effectively ignoring the current domain of definition. If the upstream DoD is smaller than the frame, the remaining area in the frame is treated as black/transparent.
- Domain: Setting this option to Domain respects the upstream domain of definition when applying the node’s effect. This can have adverse clipping effects in situations where the node employs a large filter.
- None: Setting this option to None does not perform any source image clipping at all. This means that any data required to process the node’s effect that would normally be outside the upstream DoD is treated as black/transparent.
Defocus Node Settings Tab
The Settings tab in the Inspector is also duplicated in other Blur nodes. These common controls are described in detail HERE.
About the Author
Justin Robinson is a Certified DaVinci Resolve, Fusion & Fairlight instructor who is known for simplifying concepts and techniques for anyone looking to learn any aspect of the video post-production workflow. Justin is the founder of JayAreTV, a training and premade asset website offering affordable and accessible video post-production education. You can follow Justin on Twitter at @JayAreTV YouTube at JayAreTV or Facebook at MrJayAreTV