From the course: Cinema 4D R18 Essential Training: Product Visualization and Design

Adding depth of field - CINEMA 4D Tutorial

From the course: Cinema 4D R18 Essential Training: Product Visualization and Design

Start my 1-month free trial

Adding depth of field

- [Instructor] Alright, let's take a look at setting up depth of field in Cinema 4D, and so we have a scene with a few cubes in, and our goal is to focus on this one here, so I'm going to create a camera, and what I want to do is I'll look through my camera, and we'll go into our perspective view here, look through the camera, and I want to just come around a bit. I'm going to filter off the grid, so we can just be less distracted, and something like so. That's how we'll want to set it up. Okay, so to add some depth of field, we need to come into the details tab, and the key thing with the camera in the Standard Renderer is you've got this focus distance, that's in the object tab, and currently, if we come to the top view, we can see that is this point here. It's actually not in a bad position for where we want to focus. If we wanted to focus on this first cube, we'd move it back down, the second one, third one, but this is our focal point that we want to be on. You can also take this and kind of pick the cube that we want to focus on, so we can just click it onto the Viewport, and you'll see the focus distance jump to that point. So I'm going to make it 1700, and what I want to do is then enable my details tab, and then I can turn on my depth of field map front blur, and the rear blur, and you see these two things have been added to the camera. So, this is the area that will be in focus and it's kind of anything in this region. And this is the area where our front blur would begin. Generally speaking, you want to that to be on the lens, so the value is exactly the same value that you have in the focus distance, so it's up to you, but I will tend to keep it like that, so I'm going to put it into the end, so 1700, and that will jump right back onto the camera lens. So, now if we just zoom back out, we could setup our end depth of field to be maybe around here. So this will be in focus and then the rest will be blurred out. So I'll just make that something like 500. So what we can do with the standard renderer is add an effect called depth of field, and we'll just see what it looks like when we render the Viewport to the Picture Viewer. So you can see its added the effect after the rendering, so it was quite a crisp render, and then the effect got added. Now, our cube is in focus, and we've got that depth of field thing happening. Let's crank up the effect, so the blur strength, and we can start to see some of the limitations of actually using this effect. So, the depth of field is taking a longer time to render. We also start to get some strange issues, like here is not very desirable. So, there are some limitations to using this. Now, I want to look at a practical example, because we've just learned how to quickly set up the depth of field, and I want to come over to a scene that I've set up here. And we're looking through this camera at a, if I press N + A on the keyboard, we have a ring in a box, and we've got the cologne bottle in the background. So we'd kind of like the ring to be in focus, and the bottle to be out of focus. Let's come and look at our top view. One thing that you'll probably notice immediately is that this camera is absolutely massive relative to the objects in the scene. This is quite important when you start to use the depth of field and the Physical Renderer, and we'll come to that in a minute. I just want to show you how we've got this all set up, so I'm going to come into my render settings, and don't worry about what's going on here for now. I've got it set up in the Standard Renderer, so we'll press the Render To Picture Viewer button, and we'll let that render through. Okay, so if I just double-click to zoom in onto that, we have rendered this with the Standard Renderer, so we've got a nice comparison when we do our Physical, and so let's go and set that up now. I'm going to press Alt + R on the keyboard, and I'm just going to bring this out here, and this brings up the Interactive Render Region, and now I'm going to switch over to my Physical Renderer Settings. And again, don't worry about what we've got set up there, you can come back in and have a look in your own time of course. So I'm going to turn this down, so we've got a sort of lower quality, and we'll get a faster preview, see that little triangle there. And I just want to point out something that's a bit of an issue with rendering transparencies and transparent materials when we have a material with an alpha channel on as well. And you might have seen it just flick up in the preview there. And I don't want to move my mouse because it will stop rendering, but we've got this pretty horrible halo happening around the logo, the h logo. So how do we fix that? Okay you can see it quite clearly there, it's really not looking good. So we want to separate that object, and I have it set up here actually, but I'll show you how I created the label separately. So I'll delete that layer. We have our original bottle, and we have a polygon selection to let us know where the labels should be positioned. Well, I will duplicate this layer, so I'm going to hold down Command, click and drag out to make a copy. I'm going to hide that original bottle layer. Then, I'm going to double-click to load in the polygon selection, and you're seeing it load in here. Let's just disable the Interactive Render Region for now, and I'm going to press U + I to invert my selection. Now, I've got my mouse over the Viewport, so I'm just going to press delete to delete those polygons. I'm going to switch over to Point Mode, and you will see that we now have loads of points that we don't need, so I'm going to press U + O to optimize that, and I'm going to delete these two tags that we don't need, that's the material and the compositing tag, and now we just have our label. So I'm going to rename this to be label, and enable the bottle without a label, and we'll press Alt + R, and we'll bring up the Interactive Render Region once again, and all being well, that issue with the label having that horrible halo has in fact disappeared. So, let's take a quick look at the Physical Camera Settings for getting this depth of field, because it's very different to the Standard Renderer. The details tab isn't so important anymore. You have the Physical tab available to you, and the key is the F-Stop value. So, before we jump into that, other aspects are, of course, your focal distance, focus distance, your sensor size can really play a part as well. If you adjust this though, you're going to reframe your shot, so consider that before you start messing around with it, or don't get your final shot and then have to come back and tweak this, because you will have to reframe it. Back in the Physical tab, the F-Stop value is absolutely crucial to the depth of field as in a real camera. And so you can play with different values here, and we're going back to the point I made about the scene scale. It's absolutely, these are tiny, these objects, they're modeled to more real-world scale, so you would expect them to be a lot smaller. That's why we have to use these sort of normal F-Stop values. I've worked with scenes before where they're built using, if we were to just quickly jump into our setup scene, these cubes are all 200 by 200 centimeters. They're pretty massive when you're comparing them to a ring, which would be a lot smaller, and if we turn on the Physical Renderer for this scene, let's just go Physical, and depth of field, and Alt + R, and let's just see if we can get something going on here. Yeah, so at F8 we can't really see much blur. We'd have to, even at F1, not a lot happening. Let's go down to 0.1, there we have, finally, some depth of field happening in our render. So you can see that your scale is so important. Hopefully that point is very, very clear to you by now. Now, we're going to move back into our depth of field scene, and I'm going to press Alt + R, we don't need the Interactive Render Region anymore. So, very important to note the F-Stop on this, and let's render that to the Picture Viewer. And we can remove this one that we don't need, and we'll compare with our Standard Renderer, with our Physical, and that's actually doing something I don't want it to do, so I will stop the render. If you come back into the render settings, for testing reasons, I turned on the Render Region, so I don't want that to actually be there anymore. So I can turn that off. It's very useful to turn on, if you want to just focus on a small aspect of your render, and it will save you a lot of time than having to render the whole scene. So I'm going to delete that one that I don't like, and come back in, and we'll just see how this is coming along. So with the Physical Renderer complete, we can compare it with the Standard Renderer that we have, and you can see that the quality of the Physical is a lot better, actually, and it did take a lot longer to render. And to get nice results, you have to use pretty high sort of settings here to get that nice, clean blur. And again, if we show the Picture Viewer again, we can see it's still not perfect, there's areas that can be fixed. So would I want to sit through that again, probably not. I'd like to control the depth of field myself, and my preferred method is actually to use a Multi-Pass Render, and I'm using a technique to hide objects from the renderer, which I'll go over in the next chapter and especially in our chapter on Multi-Pass Renders, but if we just have a look at what we're doing here, we can add a depth Multi-Pass to a Multi-Pass Render, and we'll enter that view, and you can see if we go into the layers in our Multi-Pass, we have a Depth Pass here that we could then to composite with a clean version of the render. And so that was so quick to render and it just gives us a lot more control, and it's all based on how we set up our camera with these details here. So if we were to turn one of these off, we would get a much different-looking Depth Pass. So just consider those settings in conjunction with your Depth Pass, and when you're using the Standard Renderer, these are the key settings, along with the focus distance, and when you're using the Physical Renderer, it's all about the F-Stop as well as the focus distance and the sensor size.

Contents