Skip to content

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.

paramtypedefaultdescription
amplitudenumber (0..200)10How far the waves push the picture, in pixels.
wavelengthnumber (2..4000)120The distance from one wave to the next, in pixels.
anglenumber90The direction the waves travel, in degrees clockwise from up: 90 runs them left to right.
speednumber (-2000..2000)40How fast the waves travel, in pixels per second; 0 holds them still.

All effects and transitions · Units

MIT licensed.