Lens Defocus generates realistic, camera-based bokeh using focal length, f-stop, and depth inputs.
It fixes ZDefocus artifacts, supports RenderMan depth channels, and allows custom or image-based bokeh shapes.
Lens Defocus
First submitted: 19 November 2025
Author: Luan_KOLB
Website: https://luan_kolb.artstation.com/
Compatible Nuke versions: All
Compatibility: Source
Lens Defocus is an advanced defocus node designed to provide physically informed bokeh based on actual camera parameters such as focal length, f-stop, and aperture shape offering a level of realism that goes beyond Nuke’s native ZDefocus.
Built on top of the pxf_defocus architecture, this version has been further optimized for production workflows, especially for renders coming from RenderMan or any renderer that stores the depth value in the red channel of __depth. This ensures accurate depth-based defocus without the inconsistencies or artifacts commonly encountered in Nuke’s default ZDefocus implementation.
In addition to its physically driven mode, the node allows you to generate fully custom bokeh shapes directly inside the interface or to feed an external bokeh image as an input, providing complete creative control over the final look.
The node also resolves several known issues in Nuke’s ZDefocus specifically aberrations, edge inconsistencies, and depth discontinuity artifacts—resulting in cleaner, more stable defocus behavior across the image.