Not good Depth of field behind glass.

Hello, I have created a scene (not done yet) with a car, but I have a problem: Behind the glass there is no good dof. I’m doing this with a defocus node in the compositor. It’s a bit hard to explain, so I have 2 images: (the camera’s focus is on the empty.)




Thanks.
(sorry for my bad English)

Post DOF using the compositor and z depth fails with transparent objects because z depth is generated by surface info not material info. Try using a mist pass instead.

Thanks I will try that soon and share the result.

You may have to normalise the mist value, there are a few threads and tutorials to accomplish this effect if you google it.

thanks for your help, but there is 1 problem:
I can’t let the camera focus on the empty anymore when I use the mist pass. Isn’t there a other way to do this?

[ATTACH=CONFIG]339402[/ATTACH]well, Instead of the z pass, I inserted the mist-pass. But as you can see, it’s horrible… I have no idea how to do this, isn’t there a way to fix this? How did other people this? There are no more people who have problems with this?

Hey, I was with the same problem with a character with glasses. The way I found to solve this is going the Render layers tab, inside of the panel Passe, there is a slider Alpha Threshold, I set to zero and it’s works for me. The ID Mask also looks better now too.


Well how about that, I’ve never seen this value?

Are you using cycles? If so, just use the dof built into the camera. Its much better.

And slower. And destructive.

render in layers: Background and foreground seperate