weird Depth of Field issue

Hey Everybody,

I’m having a weird depth of field issue.

I’ve got a scene with two spheres and a cube, as a test.

There’s a weird issue going on when I try to render with dof. There’s an area where the cube overlaps the sphere that’s in focus and there’s way more of a defocusing effect on the edges of the cube that are over the hfri BG image than the edges that are overlapping the sphere.

does anyone know why this is happening? Is this just the way blender’s dof system works?


when you try to add dof in post you have to keep in mind that the foreground object that is out of focus will be “bigger” than its original “footprint” in the image. This is something that the zdepth cannot take into account (or at least, I’ve never found a way to fix it :smiley: )

to avoid this one option is to render the forground on a separate layer so you can apply the dof on that without having to worry about the zdepth.

I had this issue myself in the past, but I couldn’t find a way of working on a single layer and being able to correctly defocus foreground objects without having those ugly issues on the object silhouettes.

hope this helps. Maybe someone will be able to give you a better solution.

Post processed DOF as many issue, it’s just because of the way it works.
You can read what they say about it on a well known DOF plugin : http://frischluft.com/lenscare/
Look at the end under Issues.

You can try to separate into layers, or use cycles DOF that will work in all cases.

Thanks for the help guys. I was afraid that it might be something like that.

Are there any recommended tutorials for rendering your scene on different renderlayers? I’ve played around with renderlayers, but only a little bit. I’m usually good to just render everything on the same layer.

I can’t figure out how to render a layer with the hdri in the BG unless I use it as an image file.

other than that…

I think I’ve got it about figured out. Not perfect, by any means. But it’s a work in progress.

I may end up doing compositing in after effects or something like that though. Not loving Blender’s compositor.


usually I set the bg as transparent, and then then on an empty render layer I activate the environment pass so I have a layer just for the bg. Since that pass is empty (you can exclude any other render layer and set the samples for that layer to 1) it will be super quick to render.