Hello everybody and welcome back in this lecture.
We are going to talk about depth of field specifically in blender render its set up different in cycles
and we'll cover that later on in the course.
So what is depth of field.
Well as you can see in this picture that I've got in blender here the black piece is in the background
are blurred.
In fact some of these white pieces are also blurred with the only object being in focus our night.
So what this allows us to do is separate parts of our scene by blurring some of them out.
And this is a technique that's used in the cinema with videos.
It's used in photography especially in portrait photos.
It's use all the time and it really does add to your scene.
Now of course we're at the stage now where we're starting to produce some really nice models and we
want to show them off and using depth of field is going to help with that.
There are a couple of things and new things that we're going to have to learn at this point.
So let's go ahead and do that now.
Well the first thing we need to do is I'm going to hop back over into my 3D view and when we get my
views set up in order to do this we're going to have a new view called the node editor.
And I also want a UV image editor open as well.
Now I'm not sure how I'm going to go about splitting this.
I'm going to do a vertical split here and a horizontal split here I think that's what I'm going to go
for.
So I need to go ahead and make one of these a node and a term probably going to use the bottom ones
or change that to an editor type node editor so that's switched across there now.
It might not go to this view straightaway if you've been playing about in blender.
But you should have your render layers over on the left and a compositor node on the right.
And that's basically saying we're going to render an image and then something is going to happen to
it and the composer is what you see at the very end of it.
Now if you dont see that for whatever reason on the head a bar make sure out of these three buttons
the middle one is selected and use nodes has a tic on it.
Okay.
So with that out of the way the next one of these windows is going to have to be a lets say a V image
editor so when we do our rendering when we go ahead and press F 12 it goes ahead and renders for us.
Now in this case its gone ahead and done that.
Why has it done that.
Well its simply done that because this was already selected on an image we might not have wanted it
to overwrite that.
So we can go ahead and change that to render result.
And at this point I can change this back to a node down there and when we press F 12 it'll then render
in the appropriate window.
So we go we've got it rendering out there and we are in blender render.
That is something important more about to set up will only work in blender render.
As I said we'll cover cycles later on.
I'm going to get rid of my tool shelf and Properties window there so we can focus on.
Now you may be viewing your 3D view ever so slightly differently.
That's not a problem if you are pressed numb pads zero in order to bring the camera view background
or you can go to a view camera and we can see there no pads zero.
Okay so now we've got everything all lined up.
What do we need.
Well we need to do a couple of things we need to make sure the camera is an appropriate place to get
a good shot.
So I'm in 3D view I'm going to press shift an F and that will enable me to go into first person mode
and I can probably just lower this down a little.
So we've got objects in the foreground and the background just like that I'm happy with that view just
there from the camera's perspective.
Now that I've gone to heaven done that it's all a matter of picking what we want to focus on and setting
something up down at the bottom here.
We'll go ahead and set up the nodes we need now we only need one additional node in this node editor
here.
So we go to add.
And it's under a filter and it's called defocus.
If we go ahead and click on that so you'll see that this new node appears and it floats.
And then we move over the top of this orange line.
What it will do is it will place it appropriately in there.
Let's go ahead and press F 12 and see if anything's changed.
What we'll find is that the rendered image renders out and then something will happen with the defocus.
But we've not set anything up yet.
Now one of the things that you'll notice over render images is that we have an image and our far and
a depth output.
Notice that the image is a yellow colour.
The little dot there that means three values are coming out colour values are grb red green and blue
values are coming out of that Alpher and depth or single values rather than three individual values.
So they are grey and that's typical of all of the node editor.
Now we want to focus on this depth output Now previous versions of blender previous to two point seven
nine would have called this a Z depth rather then or just Z rather than depth.
So we're going to need that and we need to plug that into the Z inputs on the defocus So let's link
those two together you click on that grey node and we plug it into z and we can see something just happened
at the very top there.
I don't think it's done much or has it.
Yes we're starting to get some blurring going on.
And you can start playing with some of these features here but we can see at the moment it seems to
be doing some arbitrary blurring.
There's nothing controlling how this is it and how it's actually blurring.
So the next scene we need to do is in the camera properties and making sure the outline and you have
your camera selected Go to your camera properties.
And if we scroll down somewhere in here here we go.
Depth of field.
I'm going to use these little eight dots on the top right of this and move it up a little so that's
right under the camera lens settings.
Now you can change the focal length to make it a wide angle shot or or really focussed in shot if you
want to I'm going to play with that at the moment.
Why want to change and the only thing we're focussing on here is the focus tab.
We've got a little pet there.
We go ahead and click on that and then we can select different objects that we want to focus on.
So we selected this white porn at the very front.
We can see that focus field now has white pawns in 0 6.
If we didn't want that say Oh I've missed clicked I actually wanted that night.
We can go ahead and click for cross get rid of that.
Use the Pipettes again and select the Knights.
Now you can use a drop down here and type things in if you wanted to so we knew we were looking for
a night I can start typing in night and select from one of these nights.
Now I will admit at this point my naming hasn't been very very good here.
I don't have a clue which night is which at this point so I am going to use the pipette in order to
pick the appropriate night.
It just happens to be cold night.
Okay so now we've selected that let's see what happens now.
Let's go ahead press 12.
You'll notice it renders out which is good.
And then there's a second pass.
And yes the background here is definitely getting blurry.
So let's have a look in more detail at this node editor and more appropriately.
The defocus.
So we got a Boca type.
Now this is the type of blurring that is going to happen.
Now if you want it to look attractive and this is a really subjective thing you can play this to your
heart's content but if you wanted to look attractive usually hexagonal works really well.
Again you can play to your heart's content and as you see if I switch that around there is doing some
more compositing it's building up the image for us.
Now the other thing that we're not using at the moment is we're not really using this depth coming out
we've told it what we want it to focus on the night.
So we now need this depth information to be controlled and we can see here there's a use Z buffer and
I'm going to put a tick in that box.
And what that should now allow us to do is control the focus around our night.
Our focus points.
So we have a look back at the node editor and have a look at the f-stop value the lower this is the
more blurring your image will be separated from the thing youre focussed on.
Now you may find even even if you lower it down to less Let's lower it down to two and see what happens
to our image.
Everything that's gone blurry you may say But no there is a little sliver in there somewhere of complete
InFocus.
This is a word in focus.
But anyway there's part of us in focus even though it looks kind of blurry and we can play with these.
We can perhaps up this to maybe 20.
There we go to get a blurred background and a sharper foreground here so that's starting to look really
nice.
We can play with these other selections as well.
One of the ones I often play with is the threshold as well that keeps more of the objects in focus before
it starts bleeding out so maybe a value of 5 in there to see what's going on.
Now of course once you've gone ahead and done that we can blow this up just a little bit more to see
what's going on.
We can see that we've got this in focus.
The background is out of focus starters look pretty nice.
We can lower this back down it is all now about tweaking which of course now means it's time for your
challenge.
And your challenge.
Well I'd like you know that we finished all of the modelling to rescale your model to a realistic scale
so I think at the moment we've got things that are about four meters across and eight metres high is
time to take that down to a realistic scale and the reason why I'm telling you that is because your
depth of field calculations or so work on realistic scales properly at the moment if we've got things
that are as tall as buildings eight meters tall that's going to change the depth of field that you're
going to be working with.
So it's often better to have your role models at a realistic scale for this process because then things
are more in line with what you would get in reality if you're used to using photography and setting
up your f-stop numbers on your cameras et cetera.
But anyway what we want here is to Freescale the model to a realistic scale then set up some lovely
depth of field shots and finally render it and share with us.
I can't wait to see what you guys get up to when you start adding debt for phil. they already look amazing.
I'm looking forward to seeing those ones as well.
So go ahead pause a video and give that a go.
OK everybody welcome back.
Let's go ahead and rescale my model and then set up a depth of field shots.
See over in blender.
Okay.
So back over in blender and we've got a bit of a mess of windows here.
So the first thing I'm going to do is I'm going to select everything in my scene and hopefully it will
just move everything at the same time.
And we've got a height of eight meters here and really.
What we looking at here in fact here let's select an object who got the king here it's 4.5 meters tall.
And if we were to scale it appropriately so that needs to be scaled down by a factor of 100 some would
select everything and with everything selected I'm going to scale.
And then by a point 0 0 1 okay that's scaling around an arbitrary point.
I don't want it doing nani's come out of this 3D view and just make sure it.
Oh we've already lost the sun lamps over there.
Okay.
So we're going to have to do a bit of moving as well by the looks of things because with everything
in the scene especially these lamps completely in the wrong place has the you know what if I move those
hajee and not on the z and just place approximately over our scene we shouldn't have too many issues
from then onwards.
One of the issues at the moment of course is that it is all the way over there so one with scaling around
everything it's just doing a crazy scale.
So now everything's relatively close together to scale by point zero 0 or 1.
I think it is.
Everything would have gotten a lot smaller.
Let's focus in on that so view.
You selected.
Or the number pad period key.
And there we go.
There is everything and we've now got the clipping issues.
This is one of the reasons why we set it top initially and no no I've gone too far off of made it a
factor of a thousand.
My mistake.
So that's come out of that.
There you go.
Hopefully now we can said it right.
Yes.
A case as scale by.
So point one would be 10 percent and then point not one.
Yeah I did it far too small.
Now everything's all the way over here at the moment.
And we want it all the way over there.
And I'm a child my lighting to the board and pieces as well as the camera.
Everything's all under one mesh object or parenting to that.
And then I can select this and type in a value of zero on all of my location transforms.
And then if I flip over to there we can see smack bang in the middle of the scene.
Excellent.
So you got everything organized as we'd expect there.
Let's just do a test rendering now we've got our save before I do anything else.
Let's do a test rendering and see how it comes out.
Now of course the settings that we had before they are going to be completely off now.
Well she's still got still but some of it in focus hasn't it.
So let's go into here and make sure that the camera itself has the appropriate object.
You know what I'm going to do my queen this time round so let's go into the three of you go to the camera
of you shift and F to move around the scene.
And that's a bit odd.
We still got something else selected.
That's just to shift and F again.
Michelle looking through the camera.
I'm going to presume that.
Funny movement is because it's just parents it's going to clear the parents.
And my cameras disappeared somewhere else Where's our scene or there is over there.
Wow that really did disappear.
So was zooming back to our scene now all.
Well that's a funny angle isn't it.
So that's come around here.
I yes my camera's got some funny rotations on it so I'm just going to clear those rotations and then
find ourselves the right spot moving a bit quickly here so I'm going to use my scroll wheel to adjust
it accordingly.
Still moving a bit quick Fairy galgut a bit more granular control now.
Now there is still a bit of rotation on this why here so I'm going to clear that down.
And I'm just wondering whether my board or pieces has a rotation on it.
Yes it does.
Now that's what was confusing me.
Let's go back to the camera.
Right now we can set it up in an appropriate location.
I focus on my queen I think.
Yes something like that that's what I'm going to go for there.
So on the camera itself of course we need to focus on something.
So I'm going to focus on the Queen the low poly queen there and let's just do an initial render to see
how that is looking.
And post-processing OK.
So the queen has some areas in focus so we're not far away from what we need.
Let's go to the node edita now and will the f-stop I could increase that ever so slightly.
So if we went to 18 it will immediately start redoing it which is good.
And I'm going to increase my threshold is when can I go up to 10 on this if I can keep more of that
in focus.
That's starting to look much better.
And increase this one small.
It is a balance between all of these little bits and bobs and until you get what you want.
I'm like that that's that's in focus enough for me.
Has it got any funny edges.
It's got a little bit around the gist here.
So we could probably increase the threshold just a little bit more so maybe 15.
There you go.
That's that's artefact out away but has everything else now come into focus.
It has.
So let's lower that down to maybe 12.
Yeah that's that's better now that the max Bleu here we can increase as well but we do be careful if
you increase it too much.
It's going to cause it just to take longer.
It's as simple as that.
But there we go we've now got complete isolation.
That's probably a little bit too far.
I'm going to bring that back down to maybe 20.
I think it was on 16 before again going backwards and forwards and just iterating these.
There we go.
That's really focussed in on the queen there and everything else is a little bit blurry.
I'm happy that I'm going to go ahead and save that as an image and then make sure it's in my renders
folder and I'm going to call this chest.
Depth of field and a longer pope dash there and a queen that's one that I showed off earlier on.
So now I've got this one and this one.
And of course you can go ahead and make some wonderful compositions now that you know how to do the
depth of field looking really forward to seeing what you guys come up with.
What did you focus on.
Perhaps you've arranged your scene as well.
You know if you've got a piece that's been knocked flying I can't wait to see ones like that.
But with the depth of field there as well you can really start bringing the whole board to life.
Looking forward to seeing them remember to share them I do love seeing your work and so do the other
students as well.
And I'll see you all in the next video.