Thursday, May 30, 2013

Working with the ZDefocus node in Nuke 7 Part - 2

In continuation with the Part - 1 of this article, we will work with the remaining options available in the ZDefocus node properties panel. Read Part - 1 here.

Step - 1
Navigate to the following link and then download the image with the name city_illumination.jpg on your hardd drive.

Step – 2
Load the city_illumination.jpg file into the script; the Read1 node will be inserted in the Node Graph panel.

Step – 3
Make sure the Read1 node is selected and then press 1 to view its output in the Viewer1 panel, refer to Figure 1.
Figure 1
Step - 4
Connect a ZDefocus node to the Read1 node. You will notice an error message in the Viewer1 panel about the missing depth channel. This error is generated because by default the ZDefocus node looks for depth information in the depth.z channel which is selected by default in the depth channel drop-down and there is no depth channel available in the city_illumination.jpg file.

Step - 5
In the ZDefocus tab of the ZDefocus node properties panel, select rgba.alpha from the depth channel drop-down; an error message will be displayed in the Viewer1 panel about missing alpha channel.

Step - 6
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 2.
Figure 2
By default, the disc option is selected in the filter type drop-down. As a result, a round disc filter will be applied to the image. The filter shape parameter is used to dissolve the shape between 0 (gaussian, blobby shape)  to 1(disc) range.

Step - 7
Enter 2 in the aspect ratio field. You will notice the cat's eye type effect in the Viewer1 panel, as shown in Figure 3.
Figure 3
The aspect ratio parameter controls the aspect ratio of the filter. The default ratio is 1:1.

Step - 8
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 4.
Figure 4
Step - 9
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 5.
Figure 5
The roundness parameter is used control the rounding of the polygon edges of the filter. If you set zero value for this parameter, no rounding will occur. The rotation parameter is used to define the rotation of the filter in degrees. The inner size parameter is used to control the size of the inner polygon. The inner feather parameter is used to add feathering around the outward and inward edges of the inner polygon. The inner brightness controls the brightness of the inner polygon. Adjust these parameter as per your requirement.

Step - 10
Select the catadioptric check box. This check box is used to produce annular defocused areas thus producing the donut-shaped highlights. The catadioptric parameter is used to control the catadioptric hole in the bokeh. This parameter will only be available, if you select the catadioptric check box. Figure 6 shows the bokeh created using the following values:

filter type: bladed
aspect ratio: 1.04
blades: 7
roundness: 0
roatation: 66
inner size: 0.105
inner feather: 0.285
inner brightness: 0.07
catadioptric: Selected
catadioptric size: 0.41
Figure 6
Step - 11
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 7.
Figure 7
Step - 12
Check the bloom check box to make the highlights more visible. When you select the check box, the bloom threshold and bloom 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.

Step - 13
Enter 0.88 and 2.44 in the bloom threshold and bloom gain parameters, respectively. Figure 8 shows the highlights after entering the value.
Figure 8
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 9.
Figure 9
Step - 14
Select bladed from the filter type drop-down and then adjust the parameter corresponding to bladed filter type. You will notice the change in the shape in the Viewer1 panel.

Next, you will apply a custom filter to the ZDefocus node. You can create a filter image using a Flare or Roto node.

Step - 15
Rest the ZDefocus node properties. Next, select rgba.alpha from the depth channel drop-down.

Step - 16
Click on the empty area of the Node Graph panel and then add Constant node. Next, set its size to 255x255. The added Constant1 node will act as a place holder for the Flare node.

Step - 17
Make sure the Constant1 node is selected in the Node Graph panel and then connect a Flare node with it. Next, press 1 to view the output of the Flare1 node in the Viewer1 panel.

Step - 18
In the Viewer1 panel, use the position widget to position the flare at the center of the Constant node's result.

Step - 19
In the Flare tab of the Flare1 node properties panel, enter 16 and 1 in the edge flattening and corner sharpness parameters, respectively.

Step - 20
Connect the filter input of the ZDefocus1 node with the Flare1 node.

Step - 21
Select the ZDefocus1 node and then press 1 to view its output.

Step - 22
In the ZDefocus1 node properties panel, select image from the filter type drop-down; an error message will be displayed in the Viewer1 panel because the filter image has no alpha channel embedded in it. To rectify it, select rgba.red from the filter channel drop-down.

You will  notice in the Viewer1 panel that the shape of the highlights is changed according to the output of the Flare1 node.

This concludes part - 2 of "Working with ZDefocus node".

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...