DOF with a mirror?

I am working on a Medusa scene where she is staring into a mirror. We are looking at her from behind, looking into the mirror.

I want to use DOF, However if you look closely the mirror is completely in focus (the grunge is tac sharp) but her reflection is blurry.

How do I get around this?

• Cycles is quite physically accurate, but I'm not sure if it can deal with reflection based DOF, you might have to do it in compositing Aug 2 '18 at 16:14
• Actually it does, ill post an answer shortly Aug 2 '18 at 16:18

1 Answer

Cycles is quite physically accurate, depth of field in reflections works like it would outside them. All you have to do is account for total actual "distance to the object reflection".

Say if an $$Object A$$ is at $$2$$ unit from the reflecting surface $$Mirror$$, and the mirror is at $$4$$ units from the $$Camera$$. Then a ray traveling from the camera to the "object reflection" will have to travel the cumulative distance from the $$Camera$$ to the $$Mirror$$, plus the distance from the mirror to the reflection beyond it.

This would be equivalent to the cumulative distance from the camera to the mirror plus from the mirror back to the object, hence $$2 + 4 = 6$$, which would give us the correct value to insert in the camera Focus Distance parameter of the camera.

In following example the camera is $$4$$ units away from the mirror, the red cube is $$2$$ units away from the mirror and the blue one 1 unit.

Each cube has $$0.4$$ units width, you can see each side independently focus for each $$0.2$$ units increment of Focus Distance parameter.

• Thank you as always, This makes sense. I thought I had it in focus at one point (accidentally) but I had no clue what happened, and I could never get it back in focus again. Aug 2 '18 at 16:58