Source Filmmaker

Source Filmmaker

401 ratings
Depth Of Field
By haroonY | speedyzoot™
This guide will teach you how to add Depth of Field to your Source FilmMaker scene
   
Award
Favorite
Favorited
Unfavorite
What is Depth of Field?
In optics, particularly as it relates to film and photography, depth of field (DOF) is the distance between the nearest and farthest objects in a scene that appear acceptably sharp in an image. Although a lens can precisely focus at only one distance at a time, the decrease in sharpness is gradual on each side of the focused distance, so that within the DOF, the unsharpness is imperceptible under normal viewing conditions. Source: Wikipedia[en.wikipedia.org]

In English, Depth of Field is the focus of an object, that will blur out objects behind and/or in front of it, making the subject more sharp. It can be used to get the viewer to focus on a certain part of your scene.

A diagram of how Depth of Field works. Source; Wikipedia[en.wikipedia.org]
How to add Depth of Field to SFM
Adding DoF (Depth of Field) to Source FilmMaker is a relatively easy and painless task to accomplish. First of all, we will need our camera to be in the animation set. Make sure you have a scene camera, then click on the button, and chose the "Create Animation Set(s) for Existing Element(s)". There should be a camera named "Camera1". Add it to the animation set list.

Next, we will need to change the "focalDistance" of the camera. This is located underneath the sliders that have "Zero, Smooth, Jitter" etc. by default:


Go onto the Motion Editor (TAB by default) and drag the focalDistance slider either way. You should notice a purple sheet take up some of the screen. It will probably look something like this:


So let's explain what it is. In short; whatever is inside the purple bit (the bit that clips through stuff) is what will be in focus. Anything behind, or in front, will become out of focus. We will also need to turn the slider "aperture" up. Nono, not the company. That went out of business years ago. The aperture is what applies the blur to the camera. Once you have turned it up to an amount you like (I personally like 0.5) and hit TAB. Now you should see some blur!

Here is what you should get:

Before:
After:

The difference of the shed in the background is the most obvious. Play around with different setting until you get one you like.
Conclusion
Congratulations! You have just learned how to add Depth of Field to the Source FilmMaker! You can use this to add some atmosphere to your scenes! I swear I've worded something wrong somewhere. Paranoia's time to kick in!

Thanks for reading! Feedback is greatly appreciated.

Credit given where credit is due;

One image and some text is from Wikipedia[en.wikipedia.org].
One image from the Valve Developer Wiki. Go check it out for some detailed help!
Stuff to take note on
Thank you to Sooperphilly letting me know, for the depth of field to take effect in the viewport, you need to be on the timeline view. If you are in the graph / motion editor, none of the DoF will have any effect on the viewport at all. All DoF changes will still show in a final render, though.
47 Comments
ecfcae Aug 25, 2023 @ 6:17pm 
Pluvillion Apr 10, 2022 @ 8:53pm 
Heads up, in some cases, the clearest part of the image would be something that's slightly behind the purple box. Experiment because it's really wonky.
grey Apr 12, 2021 @ 10:04am 
no dags found
Mesozoic Gamer Feb 26, 2021 @ 5:31pm 
I feel like either A, this doesn't work anymore, or B, I somehow did something wrong despite following the directions down to the letter, because one, the purple box thing does not show up, and secondly, even when I fiddle with the focalDistance and aperature settings, I see literally no change whatsoever in the viewport, or in the ending render.
Dudud Feb 20, 2021 @ 9:48pm 
thx
ZACBINE Feb 20, 2021 @ 2:31pm 
doesnt work for me
Glesas 🍍 Jan 20, 2021 @ 6:31am 
Thanks
jURIS Dec 16, 2017 @ 6:41pm 
In dota2 reborn, is there a way to export the depth map pass?
Natsuki- Sep 21, 2017 @ 6:44pm 
Is there a way to only blur behind the pink square?
Yuriyalloween ᗜˬᗜ Sep 3, 2017 @ 5:12pm 
Appreciate it. QUACK