# no depth of field defocus with glossy shader (cycles)

but i want to defocus the distant part of the image casted on the mirror
so i calculate the distance from camera to mirror to distant object and set it as distance in the depth of field under camera options.
but the image on the plane doesn’t get defocused?

i tried even the minimum and maximum distances but the image on plane isn’t defocused.

is the glossy shader physically correct?

From my understanding this is correct. Take a slightly different setup:

4 meters from the camera to the mirror surface. The mirrored object (sphere) has the same distance from the mirror than the camera. The focal distance for the sphere will now be TWICE the distance from the camera to the mirror.

Focal distance = 4 meters = mirrored image out of focus,
Focal distance = 8 meters = mirrored image in focus:

That’s because the mirror shows no “superimposed” image (like a TV screen or a poster or an image painted on it etc.), but the reflected object rather appears to be into the mirror:

Same goes with your example: The light rays travel from the background objects to the camera via the mirror. Therefore the focal distance for the reflection is almost identical to the one for the background objects, hence both are in focus.

OMG! thanks
thanks for the explanation, works now.

I almost feared I failed to convince you…
Therefore I prepared a few images closer to the setup you wanted to achieve (Erm, this is supposed to be a stylized dead end street with a patch of water on the ground and some random spheres…):

So depth of field in Cycles will blur reflections independently of the surface reflecting them. And this is IMHO in line with the behaviour in real world: If depth of field blur through reflections (and refractions, for that matter) worked on the surface creating the effect (rather than the object being reflected or refracted), then how would camera lenses or mirror telescopes work? You would have to focus on the lens element/the mirror itself and then everything would be in focus - that isn’t right.

I think this is a “sign of quality” for Cycles as a renderer, because some scanline renderers calculate DOF only from the z-buffer and will fail miserably in scenarios like this, because to them the reflection on the mirror is just like color information painted on. Same goes for post-pro DOF solutions, which will also not produce realistic results in these scenarios.

All this can be different, though, if the mirror is not flat, but has a curved surface. Curved mirrors are basically lenses (“mirror lenses”: http://en.wikipedia.org/wiki/Curved_mirror) and can show distant objects in focus, while outside of the curved surface the distant objects are blurred.

oh my gawwd! thank you…
you really explained this to me real good, thanks
i’m afraid my work is done so no need for further explaining this to me but you really set out good examples and images

do you write like written tutorials? if not then you should…

thanks again

Well, my grandparents were teachers, my parents were teachers - I guess it runs in the blood…
I am glad I could help.

Does this not work in Blender anymore? I can’t seem to get reflections to stay in focus no matter what I do in 2.90.

Works for me in Cycles. I don’t use Eevee enough to know:

Here I’m focusing behind the checkered mirror to get the red sphere in focus.