Depth of Field

 

What is it?


Depth of Field is the portion of the scene that appears sharp as it is near the depth of field, whereas everything else in the scene based on the distance from depth of field appears out of focus. Adding a depth of field can give an image a touch of photorealism.

The Basics


Depth of field can be accomplished in a distributed ray tracer by understanding the fact that if a slightly modified ray still intersected the same point on the plane as the original, it would cause points on the plane to be unmodified and points farther away to deviate.


The image below shows a great example of this effect. The quality of the depth of field is correlated to the number of additional perturbed rays sent, with their colour averaged.