---
title: "bokehDefocus"
description: "A photographic lens blur where bright highlights bloom into aperture-shaped discs."
group: "effects"
groupTitle: "Filters & effects"
categoryId: "effects.blurs"
categorySlug: "effects-blurs"
categoryTitle: "Blurs, glows & screens"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/effects/blurs.ts#L1793"
---

# bokehDefocus

A photographic lens blur where bright highlights bloom into aperture-shaped discs.

```ts
bokehDefocus(opts: {
    radius: PropRef
    gain: PropRef
    threshold: PropRef
    shape: PropRef
    blades: PropRef
    rotation: PropRef
    fringe: PropRef
    catEye?: PropRef
}): {compute: GpuComputeNode; gpu: {fragment: (params: GpuFragmentParams) => Expr}}
```

Import `effects` from `shaders/std` and use `effects.blurs.bokehDefocus`.

`radius` (0–100) is the defocus; 100 is a disc about 80 pixels across. `gain` (0–10) is how strongly highlights bloom and `threshold` (0–1) the brightness they must pass. `shape` is a string prop: 'blades' | 'circle' | 'star' | 'heart' | 'flower' | 'cross' | 'ring'. `blades` (0–9) counts blades or points for the blades, star and flower shapes; 0–2 is a round iris. `rotation` is in degrees and `fringe` (0–1) adds color fringing at the disc edges. `catEye` (0–1, optional) clips the discs into cat-eye shapes toward the frame corners, the way a lens barrel vignettes its aperture; 0 is off. Both color and coverage blur, so silhouettes soften like a real lens. Changing the aperture never recompiles. Spread it into a definition with `species: 'custom'`, `requiresRTT: true` and `requiresChild: true`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `opts` | `{
    radius: PropRef
    gain: PropRef
    threshold: PropRef
    shape: PropRef
    blades: PropRef
    rotation: PropRef
    fringe: PropRef
    catEye?: PropRef
}` |  |

## Example

```ts
...bokehDefocus({radius: p('radius'), gain: p('highlightGain'), threshold: p('highlightThreshold'), shape: p('bladeShape'), blades: p('bladeCount'), rotation: p('bladeRotation'), fringe: p('chromaticFringe')})
```

## See also

- [`gaussianBlur`](/docs/primitives/effects-blurs/gaussianblur) — A soft, even blur of the child.
- [`tiltShift`](/docs/primitives/effects-blurs/tiltshift) — Keeps a band of the child in focus and blurs everything beyond it, like a tilt-shift lens.
- [`bloom`](/docs/primitives/effects-blurs/bloom) — A glow: the child's bright parts spread into a soft halo that adds back on top.

## Used by

[BokehBlur](/docs/components/bokehblur)