Now we'll see how to adjust the appearance of the defocus parts of the picture, as well as how to create a depth map for a live-action plate with no depth channel, so we can add our own depth of field to it. Now this area down here is to affect the BOKEH. The BOKEH is the brightness and appearance of the defocused parts of the picture. So let's have our output back to result, and we'll zoom in, to a part of the picture that has some nice highlights to play with. Filter type is the shape of the filter; you have disk bladed, which can be a heptagon, octagon, pentagon or image, in which case we will have an input image.
We'll start with the disk; these sliders affect the disk shape. Now this is not actually the shape of the disk, when the filter shape is set to 1, you're getting a solid disk, if you slide that down to 0, it becomes a bell curved Gaussian type shape. So you can then slide that back and forth to pick the best look. The aspect ratio allows you to stretch in X or Y the overall disk shape. If we choose the bladed filter, you then have a whole list of different parameters for adjusting the look of the blade, you can spend an entire afternoon playing with this one.
We'll go back to disk, now to show you the image option, I've created a little shape here with my Roto Node, okay. So I want to just hook that up here, go back to the composite and we'll zoom back in to our area here to see the effect of the image, so I'll tell it to now go look at that image input. So I'll select the image input for the filter type and it will be looking at this image here, so let's push in a little closer. Now the filter bounds effect the results, if I set up for shape, it's just going to look at that image within the bounding box, but if I set it for format, it takes a larger view, and I get these lovely little X patterns, which is exactly what my little shape is.
So this will control the BOKEH shape, down here we control the BOKEH brightness, if you turn on Gamma Correction, the ZDefocus node applies a gamma of 2.2 in the image, applies the filter, and then puts it back to linear, this has the effect obviously of brightening things up for you. The Bloom parameter gives you two sliders, one, the bloom gain, let me gain down my viewer, so you can see this better. The bloom gain is how much brighter the blooms get, so if I turn this down, you see they get darker, and I bring it up, and they get a lot brighter, okay.
So we can affect how bright they are with this. I'm going to leave it to a high value. The Bloom Threshold is the cutoff point; any bloom that's brighter than .8, will get the bloom gain, anything below that will not. So if I lower the threshold, more of those guys are going to pickup the bloom gain. Alright, I will just turn those off. Reset the viewer gain, back to default, and re-home the Viewer, and down here at the bottom of the defocused Property panel, the mask and mix parameters are the usual stuff.
Now let's take a look at the ZDefocus node used for some live action work. I will cruise over here, hook up my Viewer, so if you like to play along, you can go get the alley.jepg image out of the Tutorial assets. All right, so let's see what we got here, so I would like to use the ZDefocus node and a major depth of field to this shot. So what I've done is I've used the Roto Node to create a synthetic depth channel if you will. I'm going to put the depth Z into the Viewer's Alpha Channel so you can see it, open up my Roto Node.
So I just drew a little rectangle and pulled out the feathered edges. The key is to put the output into the depth channel, so that the ZDefocus node can find it. We are done with that and go back to RGB. So let's add our ZDefocus node, we'll use the tab search function here and type zd, and there it is, okay add that in, first I'll check that the depth channel is set correctly, okay, that's good.
Then I want to move my focal point to here, because I want the foreground to be in focus. Now this doesn't look right, because I haven't set the math correctly, because I use the Roto Node my far distance is 1, so we'll pop up the math, we'll say, far is equal to 1, now we are set up correctly. Next, let's take a look at the focal plain setup, I have no depth of field, 0, so let's introduce some depth of field, maybe a little more, more, more, more, okay and then I'll move the focal point here to walk the depth of field into this area of the picture, so it'll be in complete focus, and out here, it's where I'll get my depth of field effect.
So we'll set the output, back to results, home the viewer, and I'm going to just punch up the size, just so it is really obvious, there we go, all right. So I'm going to zoom in here. So the foreground is completely in focus, and as we walk towards the background, it gets progressively out of focus, which I exactly what I wanted. By the way, if you have any old Nuke scripts that use the old ZBlur node, not to worry. The Foundry kept the old ZBlur node here in the basement in Nuke.
If you get all nostalgic and you want to actually use the ZBlur node, you can do that by putting a cursor in the node graph, type X to get this little browser window, make sure it's set for TCL and not Python, then type ZBlur, remembering that they are case sensitive. Now we click OK and there is the old ZBlur node. Nuke 7's new ZDefocus node offers major improvements in speed, creative control, and ease of use, and is equally useful, for both CG and live action.
Released
4/26/2013This course was created and produced by Steve Wright. We are honored to host this content in our library.
- Working with stereo in the RotoPaint node
- Keyframe tracking
- Exploring Primatte Keyer
- Setting up and using Motion Blur
- Adding depth of field with ZDefocus
- Animating warps and morphs
- Measuring and viewing deep data
- Retiming a shot with optical flow
- Tracking and point generation in the PointCloudGenerator
- Creating separate cameras and points with the Camera Tracker
- Setting up displacements
- Modeling more complex geometry with the ModelBuilder node
- Casting semitransparent shadows
- Relighting renders
Share this video
Embed this video
Video: Adding depth of field to a live action plate