bokehBlur
Throws the picture out of focus as a lens does, its highlights blooming into discs.
tsx
import { Clip, Composition, Track } from "@uberscene/kit";
// bokehBlur: Throws the picture out of focus as a lens does, its highlights blooming into discs.
export default function Video() {
return (
<Composition fps={30} width={640} height={360}>
<Track id="main">
<Clip
id="shot"
src="asset:espresso"
in={2}
out={5}
fit="cover"
effects={[
{
type: "bokehBlur",
highlights: 0.8,
radius: [
{ at: 0.5, value: 0, easing: "easeInOut" },
{ at: 1.5, value: 16 },
],
},
]}
/>
</Track>
</Composition>
);
}The coffee footage is Pixabay videos 209419, 209424, 46989 and 251, under the Pixabay Content License. The maker of the machine in the red cup shot has nothing to do with this project.
Params
Drawn as a shader.
| param | type | default | description |
|---|---|---|---|
radius | number (0..200) | 12 | How far each point spreads: the radius of the lens's disc, in pixels. |
highlights | number (0..1) | 0.5 | How much the bright parts bloom into discs: 0 weighs every point alike, 1 the most. |