Join Andy Needham for an in-depth discussion in this video Adding depth of field to the scene, part of Creating a Show Open in Nuke X and CINEMA 4D.
Now that we've added some lighting effects, lets add simulated depth of field. So we're going to use our depth pass for that so if we just press space bar to maximize this area and we'll grab our depth pass and bring it over to here and then come back and let's just take a look at the depth pass. So we have this information here and it's all stored in the red channel. If we just press R on the keyboard we can see that. Nothing in the green or blue.
So what we need to do is move that information from the red channel into a depth channel. So, we can do that by copying it. If we press K on the keyboard to you'll get an error because the B is not what it's looking for. It's looking for the B of what we have here, so we'll move that over. And you'll see we've got this error because it's looking for a channel which doesn't exist, it's looking for an alpha channel and there isn't one so if we change that to red it's all happy again.
So now we can just hover over the view and press R to come back to RGB and what we want to do is copy the red channel into the depth zed channel. So now we have that information, we can use it with the zed defocus node. And I press tab and type zed and zed defocus pops up, and we'll press return to accept that. And if we just connect that to the image mode by dragging it in.
It's already found that we have a depth zed channel and if we didn't it'd probably give us a similar error. If we look through the output, the focal plane set up, what we're looking for is to move the focal point into an area where the area that we're interested in is in focus. Now I want to change the math to direct. And now we can see that the Spaces logo and the area up to that point is going to be in focus that's in green. And then this area is out of focus, and that will be blurred.
So if we just scrub through and you can see that the depth we set up in C4D is having an effect here. If we change the output to the final result, we'll see that the background has been blurred and now our 3D is all kind of in focus, which is the result we're looking for. And if we just move through the shot here the front of it looks good and in focus. And the background is out of focus. So that's looking pretty nice. We can change the size of the blur just to give a more pronounced result.
We could also change the filtering type if we'd like to bladed for example. And you can really kind of design the filter shape and if you really want to do that you can choose your output to be filter shape. And then you can see what kind of shape you're building. Maybe we want to add six blades for example. So when we change back to our result. And have another look at it. Now, we've got some depth of field in our shot.
- Setting up the CAMERATRACKER node
- Solving the camera data
- Setting a ground plane
- Testing the solve with temporary geometry
- Randomizing particle motion
- Lighting the scene
- Compositing in Nuke