Source: http://www.nukepedia.com/written-tutorials/working-with-zdefocus-node-in-nuke-7
Timestamp: 2019-04-20 22:15:22+00:00

Document:
To add a ZDefocus node to the Node Graph panel, select the input image that you need to blur and then choose the Filterbutton to display the Filter menu. Next, choose ZDefocus from the menu; the ZDefocus# node will be inserted in the Node Graph panel. Also, The ZDefocus# node properties panel will be displayed with the ZDefocus tab chosen in the Properties Bin, refer to Figure art21-1.
You will also notice a focal point widget in the Viewer# panel. This widget is used to adjust the position of the focal plane. On moving this widget, the focus plane and focal point parameters update automatically. If you select the Use GPU if available check box in the node properties panel, the processing of the node is run on the GPU instead of CPU. If GPU is present in the scene, its name will be displayed above the check box, refer to Figure art21-1. You can also select which GPU you need to use. To do so, open the Preferences dialog box by pressing SHIFT+S and then choose the desired option from the GPU Device drop-down of the GPU Device area, refer to Figure art21-2.
Make sure the Read1 node is selected and then press 1 to view its output in the Viewer1 panel, refer to Figure art21-3.
Select Z_Depth from the Channel Sets drop-down; the depth channel will be displayed in the Viewer1 panel, refer to Figure art21-4. Now, select rgba from the Channel Sets drop-down.
Select Z_Depth.red from the depth channel drop-down; you will notice blur in the Viewer1 panel, refer to Figure art21-5.
In the Viewer1 panel, move the focal point widget to the front part of the chopper; the area around the point will be in focus immediately, refer to Figure art21-6.
Select the focal plane setup from the output drop-down; the depth of field information will be displayed in the rgb channels in the Viewer1 panel. Move the focal point to see the output properly, refer to Figure art21-7.
This option is similar to the focal plane setup option but it displays the DOF information after the depth is divided into layers, refer to Figure art21-8. When the automatic layer spacing check box is selected, the ZDefocus node automatically decides how many depth layers to be used based on the value specified by the maximum parameter. When you clear this check box, you can use the depth layers and layer curve parameters to control the numbers of layers and spacing between the layers, respectively.
In continuation with the Part - 1 of this article, we will work with the remaining options available in the ZDefocus node properties panel.
Make sure the Read1 node is selected and then press 1 to view its output in the Viewer1 panel, refer to Figure art22-1.
In the Read1 node properties panel, select the auto alpha check box. You will notice in the Viewer1 panel that highlights are now out of focus, as shown in Figure art22-2.
Enter 2 in the aspect ratio field. You will notice the cat's eye type effect in the Viewer1 panel, as shown in Figure art22-3.
Enter 1 in the aspect ratio field. Next, select bladed from the filter type drop-down; the highlights in the Viewer1 panel will displayed in shape of iris blades, as shown in Figure art22-4.
Enter 3 in the bladed field; the highlights in the Viewer1 panel will display in the shape which is made of 3 iris blades, as shown in Figure art22-5.
Select the gamma correction check box; a gamma curve of 2.2 will be applied on the image before blurring and then reversed for the final result. This will make the bokeh more pronounced, as shown in Figure art22-7.
Check the bloom check box to make the highlights more visible. When you select the check box, the bloom threshold andbloom gain parameters will become active. The highlights above the value specified by the bloom threshold value will be multiplied with the values specified for the bloom gain parameter.
Enter 0.88 and 2.44 in the bloom threshold and bloom gain parameters, respectively. Figure art22-8 shows the highlights after entering the value.
If you select filter shape setup from the output drop-down, the filter shape which is responsible for the shape of the highlights will be displayed in the Viewer1 panel, as shown in Figure art22-9.
Click on the empty area of the Node Graph panel and then add Constant node. Next, set its size to 255x255. The addedConstant1 node will act as a place holder for the Flare node.
In the ZDefocus1 node properties panel, select image from the filter type drop-down; an error message will be displayed in theViewer1 panel because the filter image has no alpha channel embedded in it. To rectify it, select rgba.red from the filter channel drop-down.

References: art21
 art21
 art21
 art21
 art21
 art21
 art21
 art21
 art21
 art22
 art22
 art22
 art22
 art22
 art22
 art22
 art22