1/19/2011

Depth Of Field, Anyone?


A question I get asked a lot is how I implement depth of field within my RuneScape videos. Fortunately, the question is very easy to answer, but not so easy to do. In this tutorial I'm going to show you how to manipulate depth of field in a RuneScape video, and how to obtain depth of field in real life filming.

Real life filming:
Right off the bat it's nice to know what depth of field is, if you don't already. Depth of field is when something in a scene is in focus, while the rest of whatever is in the scene isn't. Depth of field is commonly used to emphasize something, or create a sense of depth (no way!), so be sure you're using it for the right reasons. It's not always necessary to have depth of field in a photo, film, or drawing. In most of my videos I've included a depth of field because my videos are very dark, and having an emphasis on whatever it is I'm emphasizing makes the "dark effect" far more powerful. Let's jump right in on what depth of field look like through a real life camera lens.


Photo by Ben Davis. 2010.
This photo was taken on a Canon Vixia HV40 video camera. As you can see it has a fairly shallow depth of field, giving it a more intense sense of depth, blurring out the tree in the background. This puts an emphasis on the berries in the front, thus, creating the subject of the picture. This applies to all the variants of depth of field, so make sure when you're using it that you have something you're emphasizing. Otherwise, you may just have a blurry picture or an accidental tilt shift image.

In-game filming:
When you're in the game (using RuneScape as an example again) it is helpful to use the chroma key to your advantage. I call this type of scenery "set building for RuneScape." I say that because you need to mask out objects you want to emphasize within the game, reconstruct them in a purposeful manner, and then apply camera effects to them. This allows you to manipulate the DOF however you want to. You'll feel a great sense of freedom when you're editing: however don't be put off by how much work is put in to doing it. Let's go step by step to show you how I construct my sets. First off I start with looking around RuneScape for objects that seem respectively "maskable" in Vegas.  I then recorded them with Camtasia.


Draynor Mansion stairway

After I've found something I like, I make a decent mask, which is cutting a part of the scene out using the mask tool in Sony Vegas. I'm left with stairs with part of the Draynor Mansion flooring showing in between the stair posts. To fix this, I first duplicate the track that the stairs were on in Sony Vegas.

Duplicated tracks of the Draynor Mansion stairs.
After duplicating the track, I then begin to mask out the spaces individually. This process will seem a little tedious, but it is a very easy solution to the problem.

Masking the Draynor Mansion stairway spaces in between the stairway handle posts.
 That's definitely the hardest part of this, which isn't very hard at all. After that, I appy the "Color Corrector Secondary" effect to the duplicated layer (the one we just did the masks on). I set the hue to bright green, and turn the saturation all the way up, along with the gamma as well. Don't worry about the other knobs and switches.

Turning the Chrominance to bright green, saturation to 3.000 and gamma to 2.000

You just learned how to mask things even if they have obstructions in them, good job! Now you need to flatten this image and get rid of all of those layers. So, all you have to do is make sure your project settings are correct, put the preview mode into "Best (Auto)" and hit that little floppy disk icon right above the preview screen. BE SURE TO SAVE THE FILE AS A .PNG. If it is saved as a .jpg your image will not be transparent, it will just be stairs with a black background.

Saving the image of the green screen stairs as a .png file
After that, find your image in your project media, drag it back onto a time line and apply the "Chroma Keyer" effect to the image. You'll see a little eye dropper icon on the left side of the color rectangle. Click that then drag your mouse over to the green part of the stairs in the preview screen, and click the green! Voila, you have just successfully masked an abstract object in the game, with obstructions and chroma keyed them away. Now it's time to do the depth of field part!

Now, you're going to want to go into your Pan/Crop tools for this image, and zoom out on it. Don't make it tiny, but just zoom out enough so it's not hogging the entire frame.

Zooming out on the stairs with the Pan/Crop tool with the preview screen showing as well

After that comes applying the blur to the image. Go to the "Gaussian Blur" effect in your effects panel. Apply the effect to the clip. Set the Horizontal to 0.003 and the Vertical to 0.003. This gives you a nice even blur that isn't one ugly smudge.

Applying the Gaussian Blur effect to create the depth

If you can't tell by now, the effect is almost done. Now all you need to do is insert another track and put something on top of it. It helps to darken the stairs as well. Just simply apply a bump map to the stairs and fiddle with it until it looks right. After that, you can apply another bump map to the object on top to have matching lighting.

The finished product!


Congratulations! You successfully made the depth of field effect. Not only that, you masked an abstract object in the game, chroma keyed its obstructions out of the way, and applied a low lighting to make it feel like a suspenseful "What could be up those stairs!?" scene! You're a genius. I hope this helped a lot of you out there, and if you have any questions feel free to ask. Have a good one.

3 comments:

  1. Wouldn't it be easier to just set the masking areas between the staircase bars to negative? This would remove the need to add the color correction to Chroma Key it out afterwards.

    Nice guide though. :)

    ReplyDelete
  2. @Anonymous

    You can do that, but I prefer to have it chroma keyed, thus removing sharp masked edges as well.

    ReplyDelete
  3. Alright, so depth of field is basically when something in the background is being blurred so that it can focus on something. Please correct me if I'm wrong, Also its nice coming home from school and reading these. I find these blogs very interesting! I hope you don't delete these tutorials because I feel that these will help me in the future!

    ReplyDelete