Filter node
Depth of Field
Cinema focus driven by a depth image: what sits at Focus Distance stays sharp within Focus Range, everything nearer or farther blurs by its distance from focus, up to Blur Amount pixels. Cable the 3D Scene's Depth pass in — then animate Focus Distance with an LFO for a rack focus. And because Depth is just an image, any grayscale drives it: a linear gradient makes a tilt-shift, a painted mask makes selective focus.
Inputs
| Port | Type | Default |
|---|---|---|
| EnableOff passes nothing: the texture is cleared. | bool | true |
| ImageThe picture to focus. | image | — |
| DepthThe depth image that steers the focus — the 3D Scene's Depth pass, or ANY grayscale: a gradient makes a tilt-shift. | image | — |
| WidthWidth of the output picture in Grafit units (default 2, the full height of the view). Cable the source's Width to keep its size. | float | 2 |
| HeightHeight of the output picture in Grafit units (default 2). | float | 2 |
| Focus DistanceWhere on the depth ramp (0 near, 1 far) the image is sharp. Animate it for a rack focus. | float | 0.4 |
| Focus RangeHow wide the sharp band is around Focus Distance. | float | 0.15 |
| Blur AmountThe largest blur, in pixels, for what is farthest from focus. | float | 12 |
| QualityThe sample budget per pixel: 8 taps is fast and grainy in big blurs, 16 the working default, 32 for renders where the bokeh must hold up. Small blur circles always use half the budget. | int | 1 |
Outputs
| Port | Type |
|---|---|
| ImageThe picture to focus. | image |
| WidthWidth of the output picture in Grafit units (default 2, the full height of the view). Cable the source's Width to keep its size. | float |
| HeightHeight of the output picture in Grafit units (default 2). | float |
How It Works
Depth of Field is cinema focus driven by a depth image. Whatever sits at Focus Distance on the depth ramp stays sharp within Focus Range; everything nearer or farther blurs in proportion to its distance from focus, up to Blur Amount pixels. Quality trades sample count against speed.
The natural source is a 3D Scene's Depth pass — cable it in and the scene gains a real lens. But because Depth is just an image, any grayscale can drive it: a linear gradient makes a tilt-shift, a painted mask makes selective focus, and a Depth Estimation map gives a live camera a lens it never had.
Use Cases
- Rack focus — An LFO or a Timeline curve on Focus Distance pulls focus between a foreground and a background subject.
- Tilt-shift — A vertical Gradient as the Depth input makes the world look like a model.
- Live camera bokeh — Depth Estimation into Depth, and a webcam gets a shallow depth of field.
- Focus on the tracked subject — Sample the depth at a tracked face's position and drive Focus Distance with it.
- Selective blur — A hand-painted grayscale as Depth blurs exactly the regions you chose.
Tips
- Focus Range is the sharp band's half-width in depth terms — widen it when the subject has depth of its own.
- Depth Adjust between the depth source and this node is the fastest way to get the focus into a usable part of the ramp.
- Big Blur Amount values need higher Quality or the bokeh will band; small blurs look fine at low quality.
- The 3D Scene renders its Depth pass only while something consumes it, so this node is what turns the pass on.
- Animating Focus Distance beats animating Blur Amount — a real lens changes where it focuses, not how blurry it is.
Open Depth of Field in the interactive catalog →
Depth of Field is one of 381 nodes in Grafit Pro.
Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.