DOF
A depth-of-field node that computes the circle of confusion (CoC) from a depth texture and mixes a blurred image with a sharp one. The CoC is saturate(|linear depth - Focus Distance| / Focus Range), so the further from the focal plane, the more blurred it gets. The processing is three passes: a 1/2 resolution downsample with CoC, one round trip of separable blur, then compositing.
- Focus Distance — the focus distance. Initial value 30. Guarded at a minimum of 0.01 (
Focus Distanceinput /focusInput) - Focus Range — the CoC reaches its maximum at this distance away. Initial value 10. Guarded at a minimum of 0.001 (
Focus Rangeinput /rangeInput) - Blur Strength — a multiplier for the blur sample spacing. Initial value 2. Negative values are treated as 0 (
Blur Strengthinput /blurInput) - Camera — its near/far are used to reconstruct linear depth
If Depth Texture is not connected, the input passes through unchanged. Connect the depth output of a Render node.
When the Camera input is not connected (or is invalid), it falls back to the default camera values (near=0.1 / far=1000). If the actual camera’s near/far differ from these, the Focus Distance number and the actual focal position will not match.
When compositing, the larger of its own CoC and the CoC on the blurred side is used, so foreground blur bleeds out over the background.
The output alpha is always fixed at 1. Removing the In input clears the output to black.
The output supports HDR, and its resolution is the same as the input.
Input ports
| Port ID | Type |
|---|---|
Render Texture | RenderTexture |
Depth Texture | RenderTexture |
Camera | CameraDataInput |
Focus Distance | float |
Focus Range | float |
Blur Strength | float |
Output ports
| Port ID | Type |
|---|---|
Render Texture | RenderTexture |
Scriptable members
| Path | Type |
|---|---|
focusInput | float |
rangeInput | float |
blurInput | float |
Synapse Apps (scripting)
await synapse.modules.create({ type: "DOF" }) 




