lightRays
Draws the picture's highlights out into shafts of light from a point.
tsx
import { Clip, Composition, Track } from "@uberscene/kit";
// lightRays: Draws the picture's highlights out into shafts of light from a point.
export default function Video() {
return (
<Composition fps={30} width={640} height={360}>
<Track id="main">
<Clip
id="shot"
src="asset:redCup"
in={18}
out={21}
fit="cover"
effects={[
{
type: "lightRays",
center: [0.85, 0.1],
threshold: 0.7,
intensity: [
{ at: 0.5, value: 0, easing: "easeInOut" },
{ at: 1.5, value: 2.2 },
],
},
]}
/>
</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 |
|---|---|---|---|
center | [number, number] | [0.5,0.5] | Where the light comes from, as [x, y] fractions of the frame from the top left. |
length | number (0..4000) | 240 | How long the rays are at the corner farthest from the centre, in pixels; they shorten toward it. |
threshold | number (0..1) | 0.6 | The brightness the rays start from, 0 to 1: only what is brighter throws a ray. |
intensity | number (0..4) | 1 | How strong the rays are, as a multiplier; 0 leaves the picture as it was. |