# 2d vs 3d Depth of Field

What is the difference between Depth of Field rendered at render time (3d) compared to Depth of Field created in post (2d). Both are depth of field, they look very similar if not the same. 2d depth of field has the advantage of being faster to compute and being and you can easily change what part is in focus, whereas if you use 3d depth of filed and you want to change it after then render you have to start over. I am primarily focusing on cycles

I ran some tests with 100 samples each with this scene:

# Defocus Node:

Time: 2:01 + roughly 7 seconds for compositing = 2:08

# Cycles DoF:

Time: 2:02

# Conclusions:

Based on the above results, rendered DoF seems more reliable and realistic, as well as a little bit faster in this case.

The main advantage of composited DoF is the ability to tweak the settings after the render.

• did you use an Anti-Aliased z-pass? If you did, you are not supposed to because the pixels after being anti-aliased reflect an incorrect z-depth. – Vader Feb 28 '14 at 2:36
• @Vader The Z is plugged straight into the defocus node which is plugged straight into the composite node. Added .blend to question – gandalf3 Feb 28 '14 at 3:51
• Your example file, though helpful in highlighting the difference in quality, is pretty extreme (my best Canon lens only goes down to f/1.4. I'd love to get my hands on your f/0.1 lens, haha). What is the visual difference with a more realistic example? – Justin Aug 25 '16 at 20:54
• @Justin Don't have time to test in-depth right now, but a quick re-rendering of the scene in the answer suggests that the defocus node does much better, however cycles and the defocus node didn't seem to agree on just how blurry f/1.4 should be.. – gandalf3 Aug 26 '16 at 3:29
• The cycles DOF is higher quality (although maybe the compositing workflow could be improved), but the cycles image is noisier overall, therefore cycles DOF requires more samples, therefore in is not faster. Also see blender.stackexchange.com/questions/67437/noisy-depth-of-field – lbalazscs Nov 17 '16 at 19:04