problems using defocus node

hey guys, first time poster here. Anyway i am just beginning to delve into blender and i watched a tutorial on how to get a Depth of Field effect in blender using the defocus node, only problem is my renders come out really weird.

i have attached a picture of one of my tests … hopefully someone knows what the problem is?


I don’t see any problem, it looks like the node is working?

Did you add a focus object to the camera? Try adding an empty to your scene and then select the camera. Type the name of the empty into the DOF OB field and also change the DOF Dist value to something like 0-30.

I generally set my samples, in the defocus node, to something high, like 128. I set my fstop to 5.6 and connect the Z distance to the scene to the Z–input of the focus node and turn off the no-z-buffer.

Here is an example I posted in the test section.

the problem i am talking about is on the cube in the foreground where the blurring stops, the edge is really sharp and looks bad.

my node set up is as follows:
the render layer Image and Z is connected to the Defocus Image and Z
the Defocus Node has these settings: fstop 5.6, preview off, no z-buffer
then the Defocus Image goes to the Composite node

The defocus node is not perfect, but you could have better results if you change the Bokeh Type to Pentagon. Try to decrease the threshold value too.