FocalBlur

Renders depth of field effects based on a 2D image with a depth channel ( by default, “Z” ).

The depth of field parameters can be driven by a camera from a 3D scene, or entered manually.

Applying this node to an image rendered with DOF disabled should result in a similar amount of blur to an actual 3D render done with DOF enabled ( though the edge quality will not be quite as good, since there is information lost due to occlusion in the 2D image ).

user

Container for user-defined plugs. Nodes should never make their own plugs here, so users are free to do as they wish.

in

The input image

out

The output image generated by this node.

enabled

Turns the node on and off.

focusDistance

The depth value that is perfectly in focus.

cameraScene

Connect a scene here to drive the DOF and Camera parameters from the render camera of the scene.

computedFocusDistance

The depth value that is perfectly in focus ( driven by cameraScene ).

focalLength

The focal length is one of the primary attributes of a real lens.

In conjunction with the aperture, this defines the camera’s field of view.

fStop

The setting equivalent to the f-number on a camera, which ultimately determines the strength of the depth of field blur. A lower value produces more blur. As in a real camera, fStop is defined as focalLength / lens aperture.

focalLengthWorldScale

The scale to convert from focal length units to world space units.

Combined with f-stop to calculate the lens aperture. Set this to scale the lens units into scene units, to ensure the depth of field blur correctly scales to the scene. Once this plug is set, the fStop plug can be adjusted to match a real-world lens setting.

blurMultiplier

A global multiplier on the amount of blur, multiplied onto whatever blur results from the DOF and Camera parameters.

computedFocalLength

The focal length is one of the primary attributes of a real lens ( driven by cameraScene ).

In conjunction with the aperture, this defines the camera’s field of view.

horizontalAperture

The horizontal size of the film back for modelling a camera lens.

In conjunction with the focal length, this defines the camera’s field of view. For the purpose of computing focal blur, we just take the horizontal aperture, which we expect to correspond to the horizontal resolution of the input image.

computedHorizontalAperture

The horizontal size of the film back for modelling a camera lens ( driven by cameraScene ).

In conjunction with the focal length, this defines the camera’s field of view. For the purpose of computing focal blur, we just take the horizontal aperture, which we expect to correspond to the horizontal resolution of the input image.

computedFStop

The setting equivalent to the f-number on a camera, which ultimately determines the strength of the depth of field blur ( driven by cameraScene ).

A lower value produces more blur. As in a real camera, fStop is defined as focalLength / lens aperture.

maxBlurRadius

A clamp on the maximum amount of blur. Very large blurs can be expensive, and there is some overhead in preparing data structures to allow for large blurs, so setting this as low as possible is good for performance in several ways.

computedFocalLengthWorldScale

The scale to convert from focal length units to world space units ( driven by cameraScene ).

Combined with f-stop to calculate the lens aperture. Set this to scale the lens units into scene units, to ensure the depth of field blur correctly scales to the scene. Once this plug is set, the fStop plug can be adjusted to match a real-world lens setting.

depthPlaneScalingFactor

The ratio between pixel radius for each depth plane. This controls how many depth planes are needed, and how quickly occlusion is applied as depth increases. Lower values are more efficient, and capture less occulsion, higher values result in more occlusion. The default value of 0.5 is good for both performance and aesthetics ( setting it too high can result in too much occlusion between features that are actually close together ).

approximationThreshold

The maximum acceptable error caused by omitting anti-aliasing for a particular disk in the internal disk blur. Since very large disks often contribute very little to each individual output pixel, omitting anti-aliasing for them can provide a substantial speed improvement.

backgroundDepthValue

The value to be subtracted before the depth channel is unpremultiplied. When rendering filtered depth from Arnold, this value is the far clip plane of the render camera.

infilling

Enable additional blur to infill gaps.

When there is a sharp variation in the amount of blur between different pixels, gaps are created because the algorithm doesn’t know what was behind something that has been blurred out. For example, consider a small object that is completely out of focus in front of an in-focus background. The small object will be completely blurred out, leaving a hole in the in-focus background.

The infilling algorithm fills in these holes, using a series of blurs that try to estimate what colors would be behind the missing contributions.

The current infilling approach is quite slow, so you may want to deactivate it if dialing in the blur interactively.

cameraMode

Determines the source for camera paramaters that affect the blur:

  • None : There is no modelling of a physical camera. Just set the focusDistance to the depth value that should be in focus, and use the blur multiplier to set the amount of blur.

  • Scene Camera : Use camera parameters found on a camera connected to the cameraScene plug.

  • Custom Camera : Use camera parameters, entered manually.

cameraPath

The scene path to the camera in cameraScene that you want to take settings from. If unset, defaults to the render camera set in the scene globals.

depthChannel

Which image channel to use as the depth when computing the amount of blur.

depthInterpretation

How the depth channel should be interpreted :

  • Premultiplied : Depth has been premultiplied by the alpha (typical when writing depth with a regular pixel filter).

  • Unpremultiplied : Depth has not been premultiplied by the alpha (typical when writing depth with a pixel filter such as “closest”).

  • Filtered with background value (Arnold) : Depth includes a constant value for empty pixels, which needs to be subtracted before unpremultiplying. (typical with Arnold filtered depth which includes the camera far clip plane).