Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply best practices for creating programmatic videos with Remotion and React
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/light-leaks.md
1---2name: light-leaks3description: Light leak overlay effects for Remotion using @remotion/light-leaks.4metadata:5tags: light-leaks, overlays, effects, transitions6---78## Light Leaks910This only works from Remotion 4.0.415 and up. Use `npx remotion versions` to check your Remotion version and `npx remotion upgrade` to upgrade your Remotion version.1112`<LightLeak>` from `@remotion/light-leaks` renders a WebGL-based light leak effect. It reveals during the first half of its duration and retracts during the second half.1314Typically used inside a `<TransitionSeries.Overlay>` to play over the cut point between two scenes. See the **transitions** rule for `<TransitionSeries>` and overlay usage.1516## Prerequisites1718```bash19npx remotion add @remotion/light-leaks20```2122## Basic usage with TransitionSeries2324```tsx25import { TransitionSeries } from "@remotion/transitions";26import { LightLeak } from "@remotion/light-leaks";2728<TransitionSeries>29<TransitionSeries.Sequence durationInFrames={60}>30<SceneA />31</TransitionSeries.Sequence>32<TransitionSeries.Overlay durationInFrames={30}>33<LightLeak />34</TransitionSeries.Overlay>35<TransitionSeries.Sequence durationInFrames={60}>36<SceneB />37</TransitionSeries.Sequence>38</TransitionSeries>;39```4041## Props4243- `durationInFrames?` — defaults to the parent sequence/composition duration. The effect reveals during the first half and retracts during the second half.44- `seed?` — determines the shape of the light leak pattern. Different seeds produce different patterns. Default: `0`.45- `hueShift?` — rotates the hue in degrees (`0`–`360`). Default: `0` (yellow-to-orange). `120` = green, `240` = blue.4647## Customizing the look4849```tsx50import { LightLeak } from "@remotion/light-leaks";5152// Blue-tinted light leak with a different pattern53<LightLeak seed={5} hueShift={240} />;5455// Green-tinted light leak56<LightLeak seed={2} hueShift={120} />;57```5859## Standalone usage6061`<LightLeak>` can also be used outside of `<TransitionSeries>`, for example as a decorative overlay in any composition:6263```tsx64import { AbsoluteFill } from "remotion";65import { LightLeak } from "@remotion/light-leaks";6667const MyComp: React.FC = () => (68<AbsoluteFill>69<MyContent />70<LightLeak durationInFrames={60} seed={3} />71</AbsoluteFill>72);73```74