Sapphire Plug-ins for Autodesk: ZDefocus

ZDefocus

In the S_ZBlurs Plugin.

Defocuses areas of the source clip by different amounts using depth values from a ZBuffer input. Separates the input into a number of depth layers and applies different amounts of defocus depending on each layer's depth. To use this effect, first set ZBuffer:Black Is Near or White Is Near according to your Z buffer, then adjust the Focus Depth and Depth Of Field parameters to get the look you want. To help set the Focus Depth, you can use Show: In Focus Zone.

Inputs:

Source: The clip to be processed.

ZBuffer: The input clip containing depth values for each Source pixel. These values should be in the range of black to white, and it is best if not anti-aliased. Normally black corresponds to the farthest objects and white to the nearest, though this can be adjusted using Z Buffer parameter.

Parameters:

Load Preset: Push-button .
Brings up the Preset Browser to browse all available presets for this effect.

Save Preset: Push-button .
Brings up the Preset Save dialog to save a preset for this effect.

Focal Depth: Default: 0, Range: any, Shared .
The depth of the focus plane; 0 is near and 1 is far. Areas with this Z value will be in focus. Objects near this depth may be in focus depending on the Depth of Field parameter. You can use Show: In Focus Zone to show the Focal Depth when adjusting. If the effect of this parameter seems backwards, you can invert the depth values using the Z Buffer parameter.

Depth Of Field: Default: 0.1, Range: 0 to 1, Shared .
Specifies how wide a range of depths near the Focal Depth will be in focus. If the Focal Depth is 0.5 and Depth of Field is 0.2, all objects with Z values from 0.4 to 0.6 will be in focus. Set to zero to have only objects exactly at the Focal Depth in focus. You can use Show: In Focus Zone to show this when adjusting.

Layers: Integer,  Default: 5, Range: 2 to 50, Shared .
The number of depth layers to separate the source into. More layers require more processing but give smoother results in Z. More layers are sometimes needed to avoid visible seams between the layers.

Mode: Popup menu,  Default: Interp .
Determines how the differently blurred layers are combined.
Comp: the closer layers are composited over the farther layers. This method often gives better results if you have objects at different depths overlapping each other with discontinuous values in your depth image. However, this option can be slower, and sometimes artifacts between layers are visible.
Interp: the layers are interpolated using depth image values. This method gives smoother transitions between layers, and is usually better if there are no sharp changes in your depth image.

Z Buffer: Popup menu,  Default: White is Near .
How to interpret the values in the Z buffer.
Black is Near: Black pixels in the Z buffer indicate that the object at that point is near (close to you), and white means far away.
White is Near: White pixels in the Z buffer indicate that the object at that point is near (close to you), and black means far away.

Show: Popup menu,  Default: Result .
Selects the type of output
Result: Shows the final result of the effect.
In Focus Zone: Highlights the in-focus areas of the clip to make it easier to select the focal point and depth.
Shape: Show the iris shape instead of the defocused image.

Width: Default: 0.2, Range: 0 or greater, Shared .
Scales the overall defocus width. This parameter can be adjusted using the Width Widget.

Rel Height: Default: 1, Range: 0.01 or greater, Shared .
The relative height of the iris shape. If it is not 1, circles become ellipses, etc.

Roundness: Default: 0, Range: any, Shared .
Modifies the shape of the simulated camera iris. A value of 1 produces a circle; 0 gives a flat-sided polygon with a number of sides given by the Shape parameter. Less than 0 causes the sides to squeeze inward giving a star shape, while a value greater than 1 causes the corners to squeeze inward, giving a flowery shape. Has no effect if the Shape is set to Circle.

Shape: Popup menu,  Default: Circle .
Determines the shape of the simulated camera iris.
Circle: round.
3 sides: triangle.
4 sides: square.
5 sides: pentagon.
6 sides: hexagon.
7 sides: etc.

Rotate: Default: 0, Range: any, Shared .
Rotates the iris shape.

Bokeh: Default: 0, Range: any, Shared .
Softens the outer edge of the iris shape, which gives a softer look to the defocused highlights. A negative value darkens the center of the iris shape, producing a ring-like defocus shape.

Use Gamma: Default: 1, Range: 0.1 or greater, Shared .
Values above 1 cause highlights in the source clip to keep their brightness after the defocus is applied.

Scale Result: Default: 1, Range: 0 or greater, Shared .
Scales the brightness of the result.

Offset Darks: Default: 0, Range: any, Shared .
Adds this gray value to the darker regions of the result. This can be negative to increase contrast.

Edge Mode: Popup menu,  Default: REFLECT .
Determines the behavior when accessing areas outside the source image.
BLACK: Areas outside the source image are treated as black, which can produce dark areas around the edges of the image. Select this for fastest rendering.
REPEAT: Repeats the last pixel outside the border of the image.
REFLECT: Reflects the image outside the border.

Mix With Source: Default: 0, Range: 0 to 1, Shared .
Interpolates between the defocused result and the original source. Set this to 1 for the original source.

Boost Highlights: Default: 0, Range: 0 or greater, Shared .
The amount to increase the luma of the highlights in the source clip. Increase this parameter to blow out the highlights without affecting the darks or mid-tones.

Hilite Threshold: Default: 0.9, Range: 0 or greater, Shared .
The minimum luma value for highlights. Pixels brighter than this will be brightened according to the Boost Highlights parameter.

Params2:

Lens Noise: Default: 0, Range: 0 or greater, Shared .
Increase to add noise to the iris shape, dirtying up the defocus a little. Can make the result more realistic. Turn up past 1 for a more stylistic result.

Noise Freq: Default: 40, Range: 0.01 or greater, Shared .
The frequency of the added noise. Ignored if Lens Noise is zero.

Noise Freq Rel X: Default: 1, Range: 0.01 or greater, Shared .
The relative horizontal frequency of the added iris noise. Increase to stretch it vertically or decrease to stretch it horizontally.

Noise Seed: Default: 0.123, Range: 0 or greater, Shared .
The seed value for the added noise. To make the noise appear different on each frame, animate this to be different on each frame. The actual value doesn't matter; only that it's different.

Width Rel Near: Default: 1, Range: 0 or greater, Shared .
Scales the defocus width for parts of the image that are nearer than the focal plane.

Width Rel Far: Default: 1, Range: 0 or greater, Shared .
Scales the defocus width for parts of the image that are farther away than the focal plane.

Fog Near: Default: 0, Range: 0 to 1, Shared .
The amount of fog to add to nearby (close) objects.

Fog Far: Default: 0, Range: 0 to 1, Shared .
The amount of fog to add to far away objects.

Fog Color: Default rgb: [0.5 0.5 0.5], Shared .
The fog color should normally match the sky or background color of the source clip. Use gray for mist, brown for smog, blue for underwater, etc.
See general info for: Res , On Fields , Redraw , Undo , Load Defaults , Crop , Add Noise , and Use Gamma .


See Also:

RackDefocus
ZBlur
ZGlow
ZConvolve
ZFogLinear
Sapphire Plug-ins Introduction

PRODUCT UPDATES & SPECIAL OFFERS

Join our email newsletter and keep up to date