waveWarp
Bends the picture in travelling waves, as a flag or a heat haze.
tsx
import { Clip, Composition, Track } from "@uberscene/kit";
// waveWarp: Bends the picture in travelling waves, as a flag or a heat haze.
export default function Video() {
return (
<Composition fps={30} width={640} height={360}>
<Track id="main">
<Clip
id="shot"
src="asset:coffeeWide"
in={4}
out={7}
fit="cover"
effects={[
{
type: "waveWarp",
wavelength: 90,
speed: 60,
amplitude: [
{ at: 0.5, value: 0, easing: "easeInOut" },
{ at: 1.5, value: 8 },
],
},
]}
/>
</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 |
|---|---|---|---|
amplitude | number (0..200) | 10 | How far the waves push the picture, in pixels. |
wavelength | number (2..4000) | 120 | The distance from one wave to the next, in pixels. |
angle | number | 90 | The direction the waves travel, in degrees clockwise from up: 90 runs them left to right. |
speed | number (-2000..2000) | 40 | How fast the waves travel, in pixels per second; 0 holds them still. |