This page exists within the Old ArtZone Wiki section of this site. Read the information presented on the linked page to better understand the significance of this fact.
This tutorial shows you how to set up your scene to use Depth of Field in your renders. It also shows you how to adjust the settings according to your needs.
For the purpose of this tutorial and to keep things simple I've created a scene using three primitives, a cube, a ball and a cylinder. Once you understand how this works you will be able to use it any scene that you build.
I've loaded a second ball to the scene so that I could parent it to the camera that I am working in. In this case I am working with the main camera. After I have parented the ball I can move the ball where I want the point of focus to be.
With the parented ball selected and the position I want, I then load the Python Script as shown above.
You can now run the script.
Select the value that was produced in the script window and Copy (ctrl-c) and paste (ctrl-v) the value in the focus_Distance parameter of the camera that you are using. Again, I am working with the main camera.
For now we are going to leave the fStop Value at the default setting, as we'll get to that shortly. Next I selected the parented ball once again, and unchecked the visible box in the properties tab of the parameter dials window.
Something to keep in mind is that every time you'reposition the parented ball, you will need to run the dof_p5.py Python Script again and paste the results into the focus_Distance parameter.
You will find that you will need to experiment with fStop to find the right settings depending on your scene and your focus_distance.
There is no set value for the fStop, however it should be noted that the lower the fStop number is, the stronger the effect/blurring. The higher the fStop number the effect/blurring is weaker.
In order for the Depth of Field effect to work, you must use the Firefly renderer and have Raytracing selected.
To smooth out the rough edges and produce a better quality render you can raise the Pixel Sample rate. You should keep in mind that raising the Pixel Sample also increases your render time.
You can also use the Post Filter Size and Post Filter Type settings, but these are optional