![zdefocus nuke 10 zdefocus nuke 10](https://3.bp.blogspot.com/-mfklO88QLtc/WWj5GNcoXgI/AAAAAAAAK4A/WH4AzbNPD0QoCOI0qegD5gh3U85TVO1YgCLcBGAs/s1600/final%2Bclose%2Bup.jpg)
If the far/white value is set to 1, the formulaīecomes simply pixelValue = distance. PixelValue = distance/(far-0)+0 to pixelValue = distance/far. If the near/black value is set to 0 we can simplify the formula from black=0, white=1: The formula for how the pixel values are set in the zdepth pass is.We are setting this manually insteadīased on scene measurements (described below). Depth from camera: uses the clipping plane settings in the Maya camera.Note: This option is found at the bottom of the in Render Elements tab in the Render settings. Set the unfiltered fragment method to "Closest to camera.".In the Vray render elements for the zdepth pass set the following: However, it can require rendering on multiple render layers in some cases. We typically prefer this method over rendered DOF. This basically involves generating a zdepth pass in Vray. To increase the amount of defocus, lower the camera's F-number. This will make the camera stay focused on this object throughout the shot.
![zdefocus nuke 10 zdefocus nuke 10](https://lh6.ggpht.com/-10WciJ-g4n4/UaXk31p9aqI/AAAAAAAAAbw/0O9PekT9zy8/art21-2_thumb%255B1%255D.jpg)
Finally, connect the distanceDimentionShape node of the distance tool into the "focal distance" of the physical camera.then vertex snap the other locator to the object you wish to focus on.Next, create a distance tool, parenting the first locator under the camera and zeroing out its translations and rotations.turn on "enable depth of field" and "focal distance".uncheck "exposure color correction" and vignetting.The setup is simple: You make a physical camera with DOF, and use a distance tool to control its focal point. Rendering depth of field has the advantage that it is perfectly accurate, and the disadvantage that it is slower and that the DOF is locked down in the render and cannot be tweaked in comp. There are two ways to create depth of field in Vray: in the render and in comp.