MiniBokeh is a lightweight depth-of-field effect for Unity's Universal Render Pipeline (URP).
Instead of sampling a camera depth texture, MiniBokeh models scene depth with a single reference plane. It assumes content lies on or near that plane, which makes it a good fit for planar scenes such as tabletop games, card games, or top-down strategy titles, and less suitable for general 3D scenes.
MiniBokeh uses a user-defined reference plane to compute depth. Place content near that plane for best results.
MiniBokeh works well for top-down strategy scenes, especially when aiming for a miniature look (tilt-shift effect).
It uses efficient separable blurs and provides two variants:
- Hexagonal Separable Filter (L. McIntosh et al.) 1
- Circular Separable Convolution Depth of Field (K. Garcia) 2
By using separable filters, MiniBokeh reduces GPU load compared to typical depth-of-field implementations, making it well-suited for mobile use.
- Unity 6
- Universal Render Pipeline (URP)
- Render Graph enabled: MiniBokeh requires the URP Render Graph backend and is not compatible with "Compatibility Mode (Render Graph Disabled)" in the URP Global Settings.
The MiniBokeh package (jp.keijiro.minibokeh) can be installed via the
"Keijiro" scoped registry using Package Manager. To add the registry to your
project, please follow these instructions.
- Add
MiniBokehFeatureto the Renderer Features list in your URP Renderer asset. See the Unity documentation for step-by-step instructions. - Attach the
MiniBokehControllercomponent to each camera that should use the effect. The effect runs only on cameras with this component.
Transform that defines the reference plane used to compute depth.
When enabled, focus distance is computed by intersecting the camera's forward ray with the reference plane. Disable to set it manually.
Manual focus distance, used when Auto Focus is off.
Controls bokeh sensitivity. Higher values create stronger blur with smaller depth differences. Value represents blur radius (% of screen height) when object distance equals focus distance.
Maximum blur radius limit, specified as a percentage of screen height.
Controls edge darkening for out-of-bounds samples. See Limitations: Edge Sample Artifacts for details.
Aperture shape. Hexagonal is faster but may show artifacts; Circular is smoother but uses more bandwidth.
Processing resolution. Half is faster with a slightly softer result; Full preserves more detail at higher cost.
Hexagonal mode can produce artifacts near bright highlights.
These artifacts are most visible in high-contrast scenes, for example with bright floating particles on a dark background.
Bokeh shapes can appear distorted (teardrop-like) when the camera views the reference plane at a shallow angle.
A correct DoF scatters using the source pixel’s CoC; MiniBokeh gathers and uses the receiver’s CoC, which leads to distortion.
MiniBokeh uses clamp texture sampling for out-of-bounds samples. This can cause noticeable temporal artifacts at boundaries, especially with high-frequency elements (e.g., small dots, thin lines).
You can reduce these by darkening out-of-bounds samples using the Boundary Fade property.
However, this also darkens screen edges, so balance it to suit the scene's tone.
- Highway lnterchange, Overpass by Metazeon (CC-BY)
- City by Invictus.Art.00 (CC-BY)
- Medieval City - Minecraft by cubical.xyz (CC-BY)











