Source Filmmaker
Оцінок: 401
Depth Of Field
Автор: haroonY | speedyzoot™
This guide will teach you how to add Depth of Field to your Source FilmMaker scene
   
Нагородити
До улюбленого
В улюблених
Прибрати
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
ecfcae 25 серп. 2023 о 18:17 
Pluvillion 10 квіт. 2022 о 20:53 
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 12 квіт. 2021 о 10:04 
no dags found
Mesozoic Gamer 26 лют. 2021 о 17:31 
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 20 лют. 2021 о 21:48 
thx
ZACBINE 20 лют. 2021 о 14:31 
doesnt work for me
Glesas 🍍 20 січ. 2021 о 6:31 
Thanks
jURIS 16 груд. 2017 о 18:41 
In dota2 reborn, is there a way to export the depth map pass?
Natsuki- 21 верес. 2017 о 18:44 
Is there a way to only blur behind the pink square?
Yuriyalloween ᗜˬᗜ 3 верес. 2017 о 17:12 
Appreciate it. QUACK