How to set the focal point by using the z-depth pass ?


Is it possible to change the focalpoint with a z-depth pass ?

In my scene there is a house in the forest.
I want the house to be sharp and the foreground and the background has to be unsharp.

I rendered the z-depth but I can set the foreground as unsharp, only the background.
Is it possible to get an unsharp foreground as well with the same z-depth or do I have to set the focus in the camerasetting before rendering ?

Kind regards

You can use the camera setting to set the focus to a particular object. The focus will lock to this object so if the camera or object moves the focus will as well.
Then you could use the camera Depth of Field settings in cycles or use the z depth value in the compositor with a Defocus node

@Richard Marklew

In other words: I have to set the Focalpoint before rendering because there is no way to modifiy it in the Compositor ?

Kind regards

No, The focal point is based off the scenes active camera… but does not require any re rendering… So have your normal comp setup in a seperate file… and just make sure there is a camera in the 3d scene… select it via the outliner and change the distance parameter to change the focus point.

**** NOTE, once you change the distance parameter on the camera, refresh your comp by changing a value up and then back down on one of hte nodes.

That means that the Focaldistance of the Cameraobject is directly linked to the Z-Depth Pass in the Compositor and it updates automatically without rerendering the hole Scene ?

If yes, does it also work if I use external, separate MultilayerOpenEXR Files in the Compositor ?

Kind regards