Nodes · More
Bokeh
Morev1core
Overview
Nuke's Bokeh node, knob for knob: the depth-driven lens defocus. The stream's depth channel sets each pixel's circle of confusion around the focal plane — from a real lens (focal length, f-stop, film back) or from a multiplier — with a focus region, front and back regions with their own amounts, a kernel that is a circle, an iris of curved blades or an image, bloom and aberrations, corrective depth slices so near blur covers far, and five output types. Wire depth-carrying footage (EngineLive, a Render3D pass, an EXR with a Z layer); without depth the image passes through and the node says so. For a flat 2D disc blur, use Defocus.
How to
How-to
- Wire footage that carries depth (EngineLive, a Render3D pass, an EXR with a Z layer) and set
depthChannelto its layer. Without depth the image passes through and the node says so. - Set
worldScaleto the depth's unit (EngineLive writes metres) andfocalPlaneto the distance that stays sharp;focusRegionSizewidens the sharp plateau. multiplieris the amount. Or turn onrealWorldLensand type the plate'sfocalLength,fStopandfilmFormat— the defocus then matches the lens.outputType= Focal Distance Visualization shows where the plane sits (red) against front (green) and back (blue); switch back to Defocused Image.- Shape the bokeh on the Kernel page: a disc, an iris of
kNumSidesblades, or an image on the Kernel input;kSoftnessandkCurvatureround it off. correctiveSliceskeeps near blur over far; 0 is the fast single pass.bloomand the aberrations are on Optical Artifacts.
Inputs
| Input | What it takes |
|---|---|
| in | the image this node works on |
| kernel | — |
| mask | limits the effect to this matte — the engine's universal mask slot, applied for every node that declares it |
Outputs
| Output | Type |
|---|---|
| out | Image |
Parameters
| Parameter | Type | Default | What it does |
|---|---|---|---|
| channels | Choice | rgba | Which channels the defocus is applied to; everything else passes straight through. allrgbargbalphanone |
| depthChannel | Text | depth | The channel that carries depth (Nuke's depth.Z; here the stream's depth layer). Its values are world distances in worldScale units — or 1/z when depthStyle says so. |
| outputType | Choice | Defocused Image | What the node renders. Defocused Image: the result. Lens Bloom: only the bloom. Focal Distance Visualization: red where the focal plane is, green in front, blue behind, brighter the more defocused. Filter Shape: the kernel drawn at its maximum size. Focus Mattes: r the front matte, g the back matte, b in focus. Defocused ImageLens BloomFocal Distance VisualizationFilter ShapeFocus Mattes |
| focusOutput | Choice | Both | Which side of the focal plane gets defocused: Front (nearer than the plane), Back (farther), or Both. FrontBackBoth |
| multiplier | Float | 1.0 | The overall amount of defocus. Without a real-world lens, 1 gives ten pixels of circle of confusion at infinity, scaling with distance from the focal plane like a thin lens. With one, it scales the lens's own result. |
| frontmultiplier | Float | 1.0 | Extra amount for the front region (nearer than the focal plane): 1 leaves it as computed. |
| backmultiplier | Float | 1.0 | Extra amount for the back region (farther than the focal plane): 1 leaves it as computed. |
| depthStyle | Choice | Real | How the depth channel is read: Real — world distances (EngineLive, most renders); 1/z — inverse depth as ScanlineRender writes it. Real1/z |
| focalPlane | Float | 100.0 | The distance that is totally in focus, in worldScale units. Nuke's default 100 is a metre when worldScale is cm; set worldScale to what your depth carries (EngineLive writes metres). |
| focusRegionSize | Float | 1.0 | The thickness of the in-focus plateau around the focal plane, in worldScale units. Everything within half of it either way stays sharp; the defocus starts at its edges. |
| focusRegionFalloff | Choice | Linear | How the defocus grows from the focus region's edge: Linear (the lens's own curve from the edge) or Smooth (eased in over one region width). LinearSmooth |
| defocusMatteChannel | Text | none | A channel that scales the defocus per pixel (0 sharp, 1 full): none uses the Mattes input when one is wired, else the whole frame; a layer name uses that layer of the input. |
| normalizeVisualization | Bool | true | Focal Distance Visualization: limit the colour to 0–1 (by the maximum kernel size) so it reads on a monitor. |
| realWorldLens | Bool | false | Compute the circle of confusion from a physical lens — focal length, f-stop, film back, world scale — instead of the multiplier. Match a plate's lens and the defocus matches the plate. |
| focalLength | Float | 35.0 | Real-world lens: the focal length in millimetres. |
| fStop | Float | 6.0 | Real-world lens: the aperture as an f-number. Lower is a wider aperture and more defocus. |
| worldScale | Choice | cm | The unit the depth channel and focalPlane are in: mm, cm, m, in or ft. EngineLive and most renders are metres. mmcmminft |
| worldScaleMultiplier | Float | 1.0 | A multiplier on worldScale for depth in some other scale (2 if a unit is two centimetres). |
| filmFormat | Choice | 35mm | The film back the real-world lens projects onto: 35mm (22×16 mm), Super 35, Full Frame, APS-C, or Custom to type the aperture yourself. 35mmSuper 35Full FrameAPS-CCustom |
| apertureWidth | Float | 22.0 | Custom film format: the film back's width in millimetres. Sets how many pixels a millimetre of blur on the sensor is. |
| apertureHeight | Float | 16.0 | Custom film format: the film back's height in millimetres. |
| bloom | Float | 0.0 | How bright the bloom is: what is brighter than bloomThreshold spreads under the defocus and is added on top. 0 is off. |
| bloomCurvature | Float | 2.0 | How far the bloom spreads relative to the defocus: 2 blooms twice as wide as the circle of confusion, 1 as wide. |
| bloomThreshold | Float | 0.7 | The brightness above which pixels bloom (scene-linear). |
| kSphAbb | Float | 0.0 | Spherical aberration: 0 is an even disc, 1 puts the disc's light on its rim — the bright-ringed bokeh of a fast lens. |
| kChrAbb | Float | 0.0 | Chromatic aberration: how far each colour's disc departs from the others, by kChrAbbOff. 0 is off; fringes grow with it. |
| kChrAbbOff | Color | [0.6, 1.0, 1.0, 1.0] | Chromatic aberration: the per-channel (r, g, b) size of the disc relative to 1. The default shrinks red to 0.6 — the classic red-inside, blue-outside fringe. |
| kernelType | Choice | Circular | The filter's shape. Circular: a disc. Aperture Blades: an iris of kNumSides blades, kCurvature bowing them toward a circle, kRotation turning it. Input: the image on the Kernel input, sampled as the shape (white where it weighs). CircularAperture BladesInput |
| max_kernelsize | Float | 256.0 | The largest circle of confusion allowed, as a diameter in pixels (Nuke's 256). It is also how far the node reaches for neighbours, so it is the cost. |
| expandBBoxToMaxKernelSize | Bool | false | Grow the output's bounding box by half the maximum kernel size so blur can spill past the input's edges. Off (Nuke's default) keeps the input's box. |
| kAspectRatio | Float | 1.0 | The kernel's aspect: below 1 squeezes it into the ovals of an anamorphic lens. |
| kSoftness | Float | 0.1 | How soft the kernel's edge is, as a fraction of its radius: 0 is a hard disc (the crispest bokeh), 0.1 takes the aliasing off, 0.5 is a soft blob. |
| kNumSides | Int | 6 | Aperture Blades: how many blades the iris has, 3 to 16. 5–9 is a camera. |
| kCurvature | Float | 0.1 | Aperture Blades: how much the blades bow outward, 0 straight (a polygon) to 1 fully round. |
| kRotation | Float | 0.0 | Aperture Blades: turn the iris, in degrees. |
| catadioptric | Float | 0.0 | Ours, not Nuke's: a mirror-lens hole in the kernel — 0 none, 0.9 a thin ring (donut bokeh). |
| correctiveSlices | Int | 10 | How many depth bands the image is cut into and defocused separately, far to near, so a near blur covers what is behind it and a far blur never bleeds forward. 0 is the single pass (fastest, and the GPU path); Nuke's 10 handles most shots; more for many depth layers. |
| overrideNearAndFarForSlices | Bool | false | Take the depth range the slices cover from depthSlicesNearAndFar instead of measuring it from the frame. |
| depthSlicesNearAndFar | Float2 | [0.0, 0.0] | With the override on: the near and far depths (in worldScale units) the corrective slices are spread across. |
| disabled | Bool | false | Bypass: the node passes its first input through untouched (D in the graph). The knobs keep their values for when it comes back. |
| label | Text | A note shown under the node in the graph — what this node is FOR. Never affects the render or the cache. | |
| hide_input | Bool | false | Draw the node without its input wire — a tidy graph for a node whose source is obvious (a Dot, a viewer tap). |