Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

feat: grid wave

kapishdima5e1c59a7a5e7
diff --git a/components/docs/examples/canvas-scenes.tsx b/components/docs/examples/canvas-scenes.tsx
new file mode 100644
index 00000000..8f6b5a0d
--- /dev/null
+++ b/components/docs/examples/canvas-scenes.tsx
@@ -0,0 +1,116 @@
+"use client";
+
+import { AbsoluteFill } from "remotion";
+
+const SANS =
+ "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif";
+const MONO =
+ "var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace";
+
+const INK = "#f2f2f2";
+const MUTED = "#8b8f9a";
+const MINT = "#a1eebd";
+const PEACH = "#ffb38e";
+const LAVENDER = "#d4b3ff";
+
+const BARS = [0.32, 0.51, 0.43, 0.68, 0.57, 0.86, 0.64, 1];
+
+const JOBS = [
+ { file: "intro-scene.mp4", state: "Done", tone: MINT },
+ { file: "feature-tour.mp4", state: "Rendering", tone: PEACH },
+ { file: "pricing-outro.mp4", state: "Queued", tone: LAVENDER },
+];
+
+export function CanvasSceneA() {
+ return (
+ <AbsoluteFill
+ style={{
+ background: "#0a0a0a",
+ padding: 96,
+ justifyContent: "center",
+ fontFamily: SANS,
+ }}
+ >
+ <span style={{ fontSize: 34, color: MUTED }}>Deploys this week</span>
+ <span
+ style={{
+ marginTop: 6,
+ fontSize: 152,
+ fontWeight: 600,
+ letterSpacing: "-0.04em",
+ lineHeight: 1,
+ color: INK,
+ fontVariantNumeric: "tabular-nums",
+ }}
+ >
+ 2,481
+ </span>
+ <div
+ style={{
+ display: "flex",
+ gap: 16,
+ alignItems: "flex-end",
+ height: 190,
+ marginTop: 52,
+ }}
+ >
+ {BARS.map((height, index) => (
+ <div
+ key={height}
+ style={{
+ width: 74,
+ height: `${height * 100}%`,
+ borderRadius: 10,
+ background: index === BARS.length - 1 ? MINT : "#23262e",
+ }}
+ />
+ ))}
+ </div>
+ </AbsoluteFill>
+ );
+}
+
+export function CanvasSceneB() {
+ return (
+ <AbsoluteFill
+ style={{
+ background: "#101828",
+ padding: 96,
+ justifyContent: "center",
+ fontFamily: SANS,
+ }}
+ >
+ <span style={{ fontSize: 34, color: MUTED }}>Render queue</span>
+ <div style={{ marginTop: 34 }}>
+ {JOBS.map((job) => (
+ <div
+ key={job.file}
+ style={{
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "space-between",
+ padding: "30px 0",
+ borderTop: "1px solid #23304a",
+ }}
+ >
+ <span style={{ fontFamily: MONO, fontSize: 44, color: INK }}>
+ {job.file}
+ </span>
+ <span
+ style={{
+ padding: "12px 26px",
+ borderRadius: 999,
+ fontSize: 30,
+ fontWeight: 500,
+ color: "#101828",
+ background: job.tone,
+ }}
+ >
+ {job.state}
+ </span>
+ </div>
+ ))}
+ </div>
+ </AbsoluteFill>
+ );
+}
diff --git a/components/docs/examples/ember-burn-example.tsx b/components/docs/examples/ember-burn-example.tsx
index b9c60faa..6f8b0e4d 100644
--- a/components/docs/examples/ember-burn-example.tsx
+++ b/components/docs/examples/ember-burn-example.tsx
@@ -1,36 +1,12 @@
"use client";
import { linearTiming, TransitionSeries } from "@remotion/transitions";
-import { AbsoluteFill } from "remotion";
+import {
+ CanvasSceneA,
+ CanvasSceneB,
+} from "@/components/docs/examples/canvas-scenes";
import { emberBurn } from "@/registry/remocn/ember-burn";
-const FONT_FAMILY =
- "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif";
-
-function Scene({ label, background }: { label: string; background: string }) {
- return (
- <AbsoluteFill
- style={{
- background,
- alignItems: "center",
- justifyContent: "center",
- }}
- >
- <span
- style={{
- fontFamily: FONT_FAMILY,
- fontSize: 96,
- fontWeight: 600,
- letterSpacing: "-0.03em",
- color: "#f2f2f2",
- }}
- >
- {label}
- </span>
- </AbsoluteFill>
- );
-}
-
interface EmberBurnExampleProps {
patches?: number;
edgeSoftness?: number;
@@ -51,7 +27,7 @@ export function EmberBurnExampleScene({
return (
<TransitionSeries>
<TransitionSeries.Sequence durationInFrames={60}>
- <Scene label="Scene A" background="#0a0a0a" />
+ <CanvasSceneA />
</TransitionSeries.Sequence>
<TransitionSeries.Transition
timing={linearTiming({ durationInFrames: 40 })}
@@ -65,7 +41,7 @@ export function EmberBurnExampleScene({
})}
/>
<TransitionSeries.Sequence durationInFrames={60}>
- <Scene label="Scene B" background="#161014" />
+ <CanvasSceneB />
</TransitionSeries.Sequence>
</TransitionSeries>
);
diff --git a/components/docs/examples/glitch-cut-example.tsx b/components/docs/examples/glitch-cut-example.tsx
index dc50b324..daf6b57a 100644
--- a/components/docs/examples/glitch-cut-example.tsx
+++ b/components/docs/examples/glitch-cut-example.tsx
@@ -1,36 +1,12 @@
"use client";
import { linearTiming, TransitionSeries } from "@remotion/transitions";
-import { AbsoluteFill } from "remotion";
+import {
+ CanvasSceneA,
+ CanvasSceneB,
+} from "@/components/docs/examples/canvas-scenes";
import { glitchCut } from "@/registry/remocn/glitch-cut";
-const FONT_FAMILY =
- "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif";
-
-function Scene({ label, background }: { label: string; background: string }) {
- return (
- <AbsoluteFill
- style={{
- background,
- alignItems: "center",
- justifyContent: "center",
- }}
- >
- <span
- style={{
- fontFamily: FONT_FAMILY,
- fontSize: 96,
- fontWeight: 600,
- letterSpacing: "-0.03em",
- color: "#f2f2f2",
- }}
- >
- {label}
- </span>
- </AbsoluteFill>
- );
-}
-
interface GlitchCutExampleProps {
intensity?: number;
slices?: number;
@@ -47,14 +23,14 @@ export function GlitchCutExampleScene({
return (
<TransitionSeries>
<TransitionSeries.Sequence durationInFrames={45}>
- <Scene label="Scene A" background="#0a0a0a" />
+ <CanvasSceneA />
</TransitionSeries.Sequence>
<TransitionSeries.Transition
timing={linearTiming({ durationInFrames: 12 })}
presentation={glitchCut({ intensity, slices, rgbSplit, blockNoise })}
/>
<TransitionSeries.Sequence durationInFrames={45}>
- <Scene label="Scene B" background="#141318" />
+ <CanvasSceneB />
</TransitionSeries.Sequence>
</TransitionSeries>
);
diff --git a/components/docs/examples/grid-wave-example.tsx b/components/docs/examples/grid-wave-example.tsx
new file mode 100644
index 00000000..72237abe
--- /dev/null
+++ b/components/docs/examples/grid-wave-example.tsx
@@ -0,0 +1,76 @@
+"use client";
+
+import { linearTiming, TransitionSeries } from "@remotion/transitions";
+import {
+ CanvasSceneA,
+ CanvasSceneB,
+} from "@/components/docs/examples/canvas-scenes";
+import { type GridWaveDirection, gridWave } from "@/registry/remocn/grid-wave";
+
+interface GridWaveExampleProps {
+ tileSize?: number;
+ waveWidth?: number;
+ lift?: number;
+ gap?: number;
+ tint?: string;
+ direction?: string;
+}
+
+export function GridWaveExampleScene({
+ tileSize,
+ waveWidth,
+ lift,
+ gap,
+ tint,
+ direction,
+}: GridWaveExampleProps) {
+ return (
+ <TransitionSeries>
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <CanvasSceneA />
+ </TransitionSeries.Sequence>
+ <TransitionSeries.Transition
+ timing={linearTiming({ durationInFrames: 36 })}
+ presentation={gridWave({
+ tileSize,
+ waveWidth,
+ lift,
+ gap,
+ tint,
+ direction: direction as GridWaveDirection | undefined,
+ })}
+ />
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <CanvasSceneB />
+ </TransitionSeries.Sequence>
+ </TransitionSeries>
+ );
+}
+
+export const gridWaveExampleCode = (
+ values: Record<string, unknown>,
+): string => {
+ const tileSize = (values.tileSize as number) ?? 90;
+ const waveWidth = (values.waveWidth as number) ?? 0.16;
+ const lift = (values.lift as number) ?? 2;
+ const gap = (values.gap as number) ?? 0.12;
+ const tint = (values.tint as string) ?? "#8fb4ff";
+ const direction = (values.direction as string) ?? "ripple";
+ return `import { TransitionSeries, linearTiming } from "@remotion/transitions";
+import { gridWave } from "@/components/remocn/grid-wave";
+
+export const MyVideo = () => (
+ <TransitionSeries>
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <SceneA />
+ </TransitionSeries.Sequence>
+ <TransitionSeries.Transition
+ timing={linearTiming({ durationInFrames: 36 })}
+ presentation={gridWave({ tileSize: ${tileSize}, waveWidth: ${waveWidth}, lift: ${lift}, gap: ${gap}, tint: "${tint}", direction: "${direction}" })}
+ />
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <SceneB />
+ </TransitionSeries.Sequence>
+ </TransitionSeries>
+);`;
+};
diff --git a/components/docs/examples/particle-dissolve-example.tsx b/components/docs/examples/particle-dissolve-example.tsx
index 4ebf85db..2be445e6 100644
--- a/components/docs/examples/particle-dissolve-example.tsx
+++ b/components/docs/examples/particle-dissolve-example.tsx
@@ -1,39 +1,15 @@
"use client";
import { linearTiming, TransitionSeries } from "@remotion/transitions";
-import { AbsoluteFill } from "remotion";
+import {
+ CanvasSceneA,
+ CanvasSceneB,
+} from "@/components/docs/examples/canvas-scenes";
import {
type ParticleDissolveDirection,
particleDissolve,
} from "@/registry/remocn/particle-dissolve";
-const FONT_FAMILY =
- "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif";
-
-function Scene({ label, background }: { label: string; background: string }) {
- return (
- <AbsoluteFill
- style={{
- background,
- alignItems: "center",
- justifyContent: "center",
- }}
- >
- <span
- style={{
- fontFamily: FONT_FAMILY,
- fontSize: 96,
- fontWeight: 600,
- letterSpacing: "-0.03em",
- color: "#f2f2f2",
- }}
- >
- {label}
- </span>
- </AbsoluteFill>
- );
-}
-
interface ParticleDissolveExampleProps {
particleSize?: number;
scatter?: number;
@@ -54,7 +30,7 @@ export function ParticleDissolveExampleScene({
return (
<TransitionSeries>
<TransitionSeries.Sequence durationInFrames={60}>
- <Scene label="Scene A" background="#0a0a0a" />
+ <CanvasSceneA />
</TransitionSeries.Sequence>
<TransitionSeries.Transition
timing={linearTiming({ durationInFrames: 36 })}
@@ -68,7 +44,7 @@ export function ParticleDissolveExampleScene({
})}
/>
<TransitionSeries.Sequence durationInFrames={60}>
- <Scene label="Scene B" background="#12141a" />
+ <CanvasSceneB />
</TransitionSeries.Sequence>
</TransitionSeries>
);
diff --git a/config/site.ts b/config/site.ts
index 9da13d2e..d710c859 100644
--- a/config/site.ts
+++ b/config/site.ts
@@ -86,6 +86,7 @@ export const NEW_BADGE_PATHS = new Set<string>([
"/docs/transitions/glitch-cut",
"/docs/transitions/ember-burn",
"/docs/transitions/particle-dissolve",
+ "/docs/transitions/grid-wave",
]);
export type FooterGroup = {
diff --git a/content/changelog/2026-08-02-canvas-transitions.mdx b/content/changelog/2026-08-02-canvas-transitions.mdx
index 47b5dd0d..40ca949d 100644
--- a/content/changelog/2026-08-02-canvas-transitions.mdx
+++ b/content/changelog/2026-08-02-canvas-transitions.mdx
@@ -12,6 +12,7 @@ Every transition in the catalog so far animates a scene from the outside — opa
- [Glitch Cut](/docs/transitions/glitch-cut) — the frame breaks into horizontal slices that slide apart, the colour channels separate, and blocks of the picture corrupt into the wrong scene. Each slice hands over to the incoming scene on its own beat around the midpoint, so the cut is torn rather than flat. Built for short timings — 12 frames is the recommended default.
- [Ember Burn](/docs/transitions/ember-burn) — the outgoing frame catches fire where it is brightest, so a headline burns away before the background it sits on. Ahead of the flame the picture boils in the heat; at the rim it chars to black; behind it the frame blows away as sparks that carry the colour of the pixels they destroyed. Remotion's own `filmBurn()` is a different thing — a full-frame warm flash that never consumes the frame and never looks at what is in it — and the two can live in one project.
- [Particle Dissolve](/docs/transitions/particle-dissolve) — the frame is ground into fine dust. Each speck wanders away from the pixel it came from, and how far it gets is set by that pixel's brightness, so highlights and text disintegrate before flat background does. Colour drains out of the grain as it flies, red and blue fringe apart, and then the whole motion reverses and the next scene gathers out of the same dust.
+- [Grid Wave](/docs/transitions/grid-wave) — a wave travels across the frame and wherever it passes the picture divides into cells that rise off the surface as solid blocks: a lit top face carrying its piece of the picture, a shaded side extruded below it, blocks occluding each other by height. Each block goes up with the outgoing scene and comes down with the incoming one, the hand-over hidden at the crest. Blocks rise from their own footprint, so the frame stays anchored while the wave travels through it, and nothing fades.
- Canvas Presentation — the shared scaffolding behind the category, installed alongside any canvas transition. It owns the support check, a full-screen WebGL2 scene shader that receives both sides of the cut as textures, and the routing that swaps in a CSS fallback where the browser has no html-in-canvas.
### Improvements
diff --git a/content/docs/components.mdx b/content/docs/components.mdx
index f293c063..89e57907 100644
--- a/content/docs/components.mdx
+++ b/content/docs/components.mdx
@@ -517,6 +517,12 @@ Scene transitions, camera moves, and stylized wipes.
status: "stable",
href: "/docs/transitions/particle-dissolve",
},
+ {
+ name: "GridWave",
+ description: "Send a wave across the frame that raises the picture into solid blocks and sets them down carrying the next scene",
+ status: "stable",
+ href: "/docs/transitions/grid-wave",
+ },
]}
/>
diff --git a/content/docs/transitions/grid-wave.mdx b/content/docs/transitions/grid-wave.mdx
new file mode 100644
index 00000000..608d2600
--- /dev/null
+++ b/content/docs/transitions/grid-wave.mdx
@@ -0,0 +1,155 @@
+---
+title: Grid Wave
+description: Send a wave across the frame that raises the picture into a grid of solid blocks and sets them back down carrying the next scene
+component: grid-wave
+vibe: tech
+length: 36
+useWhen:
+ - "A product or interface demo needs a cut with craft — the frame is handled as a surface rather than blended away."
+ - "The moment can afford well over a second; the wave has to travel far enough to read as a wave."
+ - "The two scenes are both structured and graphic, so the grid reads as a deliberate device rather than as noise over busy footage."
+avoidWhen:
+ - "The cut needs to be quick or invisible — this one asks to be watched; use `zoom-blur`."
+ - "You want the frame to come apart into matter rather than be handled as tiles — use `particle-dissolve`."
+---
+
+<ComponentPreview name="grid-wave" />
+
+<CanvasTransitionNote />
+
+## Installation
+
+<InstallBlock name="grid-wave" />
+
+## Usage
+
+`gridWave()` is a Remotion transition presentation. Pass it to a
+`TransitionSeries.Transition` between two sequences. A wave travels across the
+frame; wherever it passes, the picture divides into cells and each one rises off
+the surface as a solid block — a lit top face carrying its piece of the picture,
+a shaded side below it where the block has come away, and a highlight around the
+top edge. The block sets back down as the wave leaves, carrying the next scene.
+
+Each block rises from its own footprint. The frame as a whole never moves: only
+the ring of blocks under the wave is off the surface at any moment, so the
+picture stays anchored while the wave travels through it.
+
+```tsx
+import { TransitionSeries, linearTiming } from "@remotion/transitions";
+import { gridWave } from "@/components/remocn/grid-wave";
+
+export const MyVideo = () => (
+ <TransitionSeries>
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <SceneA />
+ </TransitionSeries.Sequence>
+ <TransitionSeries.Transition
+ timing={linearTiming({ durationInFrames: 36 })}
+ presentation={gridWave()}
+ />
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <SceneB />
+ </TransitionSeries.Sequence>
+ </TransitionSeries>
+);
+```
+
+`direction` decides how the wave travels. `"ripple"` spreads outward from the
+centre like a drop landing on the surface; an axis sweeps it straight across.
+
+## Why this one needs the canvas
+
+A grid-shaped mask over a crossfade is something CSS can do. A raised solid is
+not. Each block is projected rather than masked:
+
+- **The top face is re-projected.** It is offset upward, leaned slightly away
+ from the frame's centre for perspective, and magnified — so the pixel being
+ written samples the scene somewhere else entirely, and the amount depends on
+ how high that particular block has risen.
+- **The side face is extruded.** The strip of footprint the block has vacated
+ samples the top face's own bottom edge and repeats it downward under shading,
+ which is what gives the block visible thickness instead of reading as a
+ floating rectangle.
+- **Blocks occlude each other.** A pixel is resolved against the neighbouring
+ blocks and the highest one wins, so a raised block correctly covers the gap
+ and the shoulder of the one behind it.
+
+All three are reads at coordinates other than the pixel being written, which is
+exactly what a mask or a blend mode cannot express.
+
+## The entrance mirrors the exit
+
+There is no separate treatment for the incoming scene, because it is the same
+block. A block goes up carrying the outgoing scene and comes down carrying the
+incoming one, and the hand-over sits at the crest — the moment the block is
+highest, largest and most lit, and the eye is least on its contents. Play the
+transition backwards and it is the same wave carrying the other scene, exactly.
+
+Both ends are exact. The wave starts and finishes outside the frame, and every
+lift is scaled by the wave's own pulse, so at progress 0 nothing is raised and
+the outgoing frame is untouched; at progress 1 the same is true of the incoming
+one. Nothing fades at any point.
+
+## Determinism
+
+The wave position and every block's lift, lean, magnification, shading and
+hand-over are closed-form functions of the transition's progress and the block's
+own coordinate — no simulation, no wall-clock time, nothing carried between
+frames. The same frame renders identically in every chunk of a parallel render.
+
+## Fallback
+
+Where html-in-canvas is unavailable the incoming scene resolves through a short
+scale-and-fade settle. It keeps the timing; the tiles need the outgoing scene's
+pixels, so none of the props apply there.
+
+## Props
+
+`gridWave(props)` accepts:
+
+<PropsTable
+ rows={[
+ {
+ name: "tileSize",
+ type: "number",
+ default: "90",
+ description:
+ "Size of one cell in pixels. Large cells read as panels, small ones as a fine mosaic.",
+ },
+ {
+ name: "waveWidth",
+ type: "number",
+ default: "0.16",
+ description:
+ "Thickness of the wave as a fraction of its travel. This is the pacing knob: a narrow wave is a sharp crest that snaps past each cell, a wide one has half the frame divided at once.",
+ },
+ {
+ name: "lift",
+ type: "number",
+ default: "2",
+ description:
+ "How high a block rises at the crest, which also sets how deep its side face reads. 0 keeps the frame flat, so the wave degrades to a grid-shaped wipe.",
+ },
+ {
+ name: "gap",
+ type: "number",
+ default: "0.12",
+ description:
+ "Space between blocks as a fraction of one cell. Some gap is what lets a raised block's side face be seen against its neighbours; 0 closes the grid into a continuous surface and the depth stops reading.",
+ },
+ {
+ name: "tint",
+ type: "string",
+ default: '"#8fb4ff"',
+ description:
+ "Colour that cells blend toward at the crest, as a hex string. Set it to a brand accent to carry colour through the cut.",
+ },
+ {
+ name: "direction",
+ type: '"ripple" | "left" | "right" | "up" | "down"',
+ default: '"ripple"',
+ description:
+ "How the wave travels. \"ripple\" spreads outward from the centre; an axis sweeps it straight across from that edge.",
+ },
+ ]}
+/>
diff --git a/content/docs/transitions/index.mdx b/content/docs/transitions/index.mdx
index 77023493..aced2ae7 100644
--- a/content/docs/transitions/index.mdx
+++ b/content/docs/transitions/index.mdx
@@ -146,6 +146,12 @@ Pixel-level transitions. These read the actual pixels of both scenes through the
status: "stable",
href: "/docs/transitions/particle-dissolve",
},
+ {
+ name: "GridWave",
+ description: "Send a wave across the frame that raises the picture into solid blocks and sets them down carrying the next scene",
+ status: "stable",
+ href: "/docs/transitions/grid-wave",
+ },
]}
/>
diff --git a/content/docs/transitions/meta.json b/content/docs/transitions/meta.json
index fdb4bddb..d9f3c23d 100644
--- a/content/docs/transitions/meta.json
+++ b/content/docs/transitions/meta.json
@@ -22,6 +22,7 @@
"glitch-cut",
"ember-burn",
"particle-dissolve",
+ "grid-wave",
"slide-swap",
"spring-settle"
]
diff --git a/registry-artifacts/ember-burn.json b/registry-artifacts/ember-burn.json
index 60e8cd57..705bdc7f 100644
--- a/registry-artifacts/ember-burn.json
+++ b/registry-artifacts/ember-burn.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/ember-burn/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n makeCanvasPresentation,\n makeSceneShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type EmberBurnProps = {\n patches?: number;\n edgeSoftness?: number;\n contentBias?: number;\n heat?: number;\n glowColor?: string;\n emberAmount?: number;\n};\n\nconst DEFAULTS = {\n patches: 5,\n edgeSoftness: 0.07,\n contentBias: 0.6,\n heat: 0.5,\n glowColor: \"#ff7a2f\",\n emberAmount: 0.5,\n};\n\nfunction hexToRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) {\n return [1, 0.48, 0.18];\n }\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_from;\nuniform sampler2D u_to;\nuniform float u_progress;\nuniform float u_aspect;\nuniform float u_patches;\nuniform float u_softness;\nuniform float u_content;\nuniform float u_heat;\nuniform vec3 u_glow;\nuniform float u_embers;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float EMBER_GRID = 110.0;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x),\n u.y\n );\n}\n\nfloat fbm(vec2 p) {\n float sum = 0.0;\n float amp = 0.5;\n for (int i = 0; i < 5; i++) {\n sum += noise(p) * amp;\n p *= 2.03;\n amp *= 0.5;\n }\n return sum * 1.032;\n}\n\nfloat luma(vec3 c) {\n return dot(c, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec2 skewed = vec2(v_uv.x * u_aspect, v_uv.y);\n float alive =\n smoothstep(0.0, 0.06, u_progress) * smoothstep(1.0, 0.94, u_progress);\n\n float brightness = luma(texture(u_from, v_uv).rgb);\n float field = clamp(\n clamp(fbm(skewed * u_patches), 0.0, 1.0) *\n (1.0 - u_content * brightness * 0.9),\n 0.0,\n 1.0\n );\n\n float soft = max(u_softness, 0.004);\n float margin = soft * 3.0 + 0.02;\n float front = mix(-margin, 1.0 + margin, pow(u_progress, 1.2));\n float depth = field - front;\n\n float intact = smoothstep(-soft, soft, depth);\n float arrived = 1.0 - intact;\n\n vec2 shimmer = vec2(\n noise(skewed * u_patches * 2.4 + vec2(0.0, u_progress * 3.1)) - 0.5,\n noise(skewed * u_patches * 2.4 + vec2(5.2, 1.7 + u_progress * 4.3)) - 0.5\n );\n float boil = exp(-pow(depth / (soft * 6.0), 2.0)) * alive * u_heat * 0.14;\n vec4 from = texture(u_from, v_uv + shimmer * boil * intact);\n vec4 to = texture(u_to, v_uv - shimmer * boil * arrived);\n\n float ramp = depth / (soft * 2.2);\n float charred = intact * exp(-pow((ramp - 0.55) * 1.5, 2.0)) * alive;\n float molten = arrived * exp(-pow((ramp + 0.55) * 1.5, 2.0)) * alive;\n float rim = exp(-pow(depth / (soft * 1.1), 2.0));\n\n float since = clamp(-depth / (soft * 3.0), 0.0, 1.0);\n vec2 emberSpace = skewed + vec2(0.0, u_progress * 0.42);\n float cellSeed = hash(floor(emberSpace * EMBER_GRID));\n float ember =\n step(1.0 - u_embers * 0.08, cellSeed) *\n arrived *\n exp(-pow(depth / (soft * 2.6), 2.0)) *\n alive;\n vec3 sparkSource = texture(u_from, v_uv + vec2(0.0, since * 0.07)).rgb;\n\n vec4 color = mix(to, from, intact);\n color.rgb *= 1.0 - charred * 0.92;\n color.rgb += (color.rgb * 1.2 + u_glow * 0.6) * molten;\n\n vec3 spark = mix(u_glow, sparkSource * 1.4 + u_glow * 0.3, 0.5);\n float light = min(rim * 0.85, 1.4);\n color.rgb += u_glow * light + spark * ember * 1.3;\n color.a = clamp(color.a + light + molten + ember, 0.0, 1.0);\n\n outColor = color;\n}`;\n\nconst shader = makeSceneShader<EmberBurnProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n patches = DEFAULTS.patches,\n edgeSoftness = DEFAULTS.edgeSoftness,\n contentBias = DEFAULTS.contentBias,\n heat = DEFAULTS.heat,\n glowColor = DEFAULTS.glowColor,\n emberAmount = DEFAULTS.emberAmount,\n } = passedProps;\n const glow = hexToRgb(glowColor);\n gl.uniform1f(uniform(\"u_patches\"), patches);\n gl.uniform1f(uniform(\"u_softness\"), edgeSoftness);\n gl.uniform1f(uniform(\"u_content\"), contentBias);\n gl.uniform1f(uniform(\"u_heat\"), heat);\n gl.uniform3f(uniform(\"u_glow\"), glow[0], glow[1], glow[2]);\n gl.uniform1f(uniform(\"u_embers\"), emberAmount);\n },\n);\n\nconst EmberBurnFallback: React.FC<\n TransitionPresentationComponentProps<EmberBurnProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { glowColor = DEFAULTS.glowColor } = passedProps;\n\n if (presentationDirection === \"exiting\") {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const p = presentationProgress;\n const reveal = Math.min(1, Math.max(0, (p - 0.25) / 0.5));\n const flash = Math.max(0, Math.sin(p * Math.PI)) ** 0.6 * 0.4;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: reveal }}>{children}</AbsoluteFill>\n <AbsoluteFill\n style={{\n background: glowColor,\n mixBlendMode: \"screen\",\n opacity: flash,\n pointerEvents: \"none\",\n }}\n />\n </AbsoluteFill>\n );\n};\n\nconst presentation = makeCanvasPresentation<EmberBurnProps>({\n shader,\n fallback: EmberBurnFallback,\n});\n\nexport function emberBurn(\n props: EmberBurnProps = {},\n): TransitionPresentation<EmberBurnProps> {\n return presentation(props);\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n makeCanvasPresentation,\n makeSceneShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type EmberBurnProps = {\n patches?: number;\n edgeSoftness?: number;\n contentBias?: number;\n heat?: number;\n glowColor?: string;\n emberAmount?: number;\n};\n\nconst DEFAULTS = {\n patches: 5,\n edgeSoftness: 0.07,\n contentBias: 0.6,\n heat: 0.5,\n glowColor: \"#ff7a2f\",\n emberAmount: 0.5,\n};\n\nfunction hexToRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) {\n return [1, 0.48, 0.18];\n }\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_from;\nuniform sampler2D u_to;\nuniform float u_progress;\nuniform float u_aspect;\nuniform float u_patches;\nuniform float u_softness;\nuniform float u_content;\nuniform float u_heat;\nuniform vec3 u_glow;\nuniform float u_embers;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float EMBER_GRID = 110.0;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x),\n u.y\n );\n}\n\nfloat fbm(vec2 p) {\n float sum = 0.0;\n float amp = 0.5;\n for (int i = 0; i < 5; i++) {\n sum += noise(p) * amp;\n p *= 2.03;\n amp *= 0.5;\n }\n return sum * 1.032;\n}\n\nfloat luma(vec3 c) {\n return dot(c, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec2 skewed = vec2(v_uv.x * u_aspect, v_uv.y);\n float alive =\n smoothstep(0.0, 0.06, u_progress) * smoothstep(1.0, 0.94, u_progress);\n\n float brightness = luma(texture(u_from, v_uv).rgb);\n float field = clamp(\n clamp(fbm(skewed * u_patches), 0.0, 1.0) *\n (1.0 - u_content * brightness * 0.9),\n 0.0,\n 1.0\n );\n\n float soft = max(u_softness, 0.004);\n float margin = soft * 3.0 + 0.02;\n float front = mix(-margin, 1.0 + margin, pow(u_progress, 1.2));\n float depth = field - front;\n\n float intact = smoothstep(-soft, soft, depth);\n float arrived = 1.0 - intact;\n\n vec2 shimmer = vec2(\n noise(skewed * u_patches * 2.4 + vec2(0.0, u_progress * 3.1)) - 0.5,\n noise(skewed * u_patches * 2.4 + vec2(5.2, 1.7 + u_progress * 4.3)) - 0.5\n );\n float heatBand = depth / (soft * 6.0);\n float boil = exp(-heatBand * heatBand) * alive * u_heat * 0.14;\n vec4 from = texture(u_from, v_uv + shimmer * boil * intact);\n vec4 to = texture(u_to, v_uv - shimmer * boil * arrived);\n\n float ramp = depth / (soft * 2.2);\n float charBand = (ramp - 0.55) * 1.5;\n float moltenBand = (ramp + 0.55) * 1.5;\n float rimBand = depth / (soft * 1.1);\n float charred = intact * exp(-charBand * charBand) * alive;\n float molten = arrived * exp(-moltenBand * moltenBand) * alive;\n float rim = exp(-rimBand * rimBand);\n\n float since = clamp(-depth / (soft * 3.0), 0.0, 1.0);\n float emberBand = depth / (soft * 2.6);\n vec2 emberSpace = skewed + vec2(0.0, u_progress * 0.42);\n float cellSeed = hash(floor(emberSpace * EMBER_GRID));\n float ember =\n step(1.0 - u_embers * 0.08, cellSeed) *\n arrived *\n exp(-emberBand * emberBand) *\n alive;\n vec3 sparkSource = texture(u_from, v_uv + vec2(0.0, since * 0.07)).rgb;\n\n vec4 color = mix(to, from, intact);\n color.rgb *= 1.0 - charred * 0.92;\n color.rgb += (color.rgb * 1.2 + u_glow * 0.6) * molten;\n\n vec3 spark = mix(u_glow, sparkSource * 1.4 + u_glow * 0.3, 0.5);\n float light = min(rim * 0.85, 1.4);\n color.rgb += u_glow * light + spark * ember * 1.3;\n color.a = clamp(color.a + light + molten + ember, 0.0, 1.0);\n\n outColor = color;\n}`;\n\nconst shader = makeSceneShader<EmberBurnProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n patches = DEFAULTS.patches,\n edgeSoftness = DEFAULTS.edgeSoftness,\n contentBias = DEFAULTS.contentBias,\n heat = DEFAULTS.heat,\n glowColor = DEFAULTS.glowColor,\n emberAmount = DEFAULTS.emberAmount,\n } = passedProps;\n const glow = hexToRgb(glowColor);\n gl.uniform1f(uniform(\"u_patches\"), patches);\n gl.uniform1f(uniform(\"u_softness\"), edgeSoftness);\n gl.uniform1f(uniform(\"u_content\"), contentBias);\n gl.uniform1f(uniform(\"u_heat\"), heat);\n gl.uniform3f(uniform(\"u_glow\"), glow[0], glow[1], glow[2]);\n gl.uniform1f(uniform(\"u_embers\"), emberAmount);\n },\n);\n\nconst EmberBurnFallback: React.FC<\n TransitionPresentationComponentProps<EmberBurnProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { glowColor = DEFAULTS.glowColor } = passedProps;\n\n if (presentationDirection === \"exiting\") {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const p = presentationProgress;\n const reveal = Math.min(1, Math.max(0, (p - 0.25) / 0.5));\n const flash = Math.max(0, Math.sin(p * Math.PI)) ** 0.6 * 0.4;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: reveal }}>{children}</AbsoluteFill>\n <AbsoluteFill\n style={{\n background: glowColor,\n mixBlendMode: \"screen\",\n opacity: flash,\n pointerEvents: \"none\",\n }}\n />\n </AbsoluteFill>\n );\n};\n\nconst presentation = makeCanvasPresentation<EmberBurnProps>({\n shader,\n fallback: EmberBurnFallback,\n});\n\nexport function emberBurn(\n props: EmberBurnProps = {},\n): TransitionPresentation<EmberBurnProps> {\n return presentation(props);\n}\n",
"type": "registry:component",
"target": "components/remocn/ember-burn.tsx"
}
diff --git a/registry-artifacts/grid-wave.json b/registry-artifacts/grid-wave.json
new file mode 100644
index 00000000..e337d2ad
--- /dev/null
+++ b/registry-artifacts/grid-wave.json
@@ -0,0 +1,17 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "grid-wave",
+ "title": "Grid Wave",
+ "description": "A wave travels across the frame raising the picture into a grid of solid blocks with lit tops and shaded sides, which set back down carrying the next scene.",
+ "dependencies": ["remotion", "@remotion/transitions"],
+ "registryDependencies": ["@remocn/canvas-presentation"],
+ "files": [
+ {
+ "path": "registry/remocn/grid-wave/index.tsx",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n makeCanvasPresentation,\n makeSceneShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type GridWaveDirection = \"ripple\" | \"left\" | \"right\" | \"up\" | \"down\";\n\nexport type GridWaveProps = {\n tileSize?: number;\n waveWidth?: number;\n lift?: number;\n gap?: number;\n tint?: string;\n direction?: GridWaveDirection;\n};\n\nconst DEFAULTS = {\n tileSize: 90,\n waveWidth: 0.16,\n lift: 2,\n gap: 0.12,\n tint: \"#8fb4ff\",\n direction: \"ripple\" as GridWaveDirection,\n};\n\nconst AXES: Record<GridWaveDirection, [number, number]> = {\n ripple: [0, 0],\n left: [1, 0],\n right: [-1, 0],\n up: [0, -1],\n down: [0, 1],\n};\n\nfunction hexToRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) {\n return [0.56, 0.71, 1];\n }\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_from;\nuniform sampler2D u_to;\nuniform float u_progress;\nuniform float u_aspect;\nuniform vec2 u_grid;\nuniform float u_wave;\nuniform float u_lift;\nuniform float u_gap;\nuniform vec3 u_tint;\nuniform vec2 u_dir;\nuniform float u_radial;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat waveCoord(vec2 p) {\n vec2 off = (p - 0.5) * vec2(u_aspect, 1.0);\n float ring = length(off) / (0.5 * sqrt(u_aspect * u_aspect + 1.0));\n float sweep = clamp(dot(p - 0.5, u_dir) + 0.5, 0.0, 1.0);\n return mix(sweep, ring, u_radial);\n}\n\nvoid main() {\n float front = u_progress * (1.0 + 6.0 * u_wave) - 3.0 * u_wave;\n\n float selfPass =\n smoothstep(-u_wave * 0.4, u_wave * 0.4, front - waveCoord(v_uv));\n vec4 base = mix(texture(u_from, v_uv), texture(u_to, v_uv), selfPass);\n\n float edge = 0.5 - u_gap * 0.5;\n vec2 anchor = floor(v_uv * u_grid);\n\n vec4 face = vec4(0.0);\n float depth = -1.0;\n\n for (int oy = -1; oy <= 1; oy++) {\n for (int ox = -1; ox <= 1; ox++) {\n vec2 cell = anchor + vec2(float(ox), float(oy));\n vec2 centre = (cell + 0.5) / u_grid;\n\n float stagger = (hash(cell) - 0.5) * u_wave * 0.4;\n float w = front - waveCoord(centre) + stagger;\n float band = w / u_wave;\n float pulse = exp(-band * band);\n if (pulse <= depth) {\n continue;\n }\n\n float rise = pulse * u_lift;\n vec2 lean = centre - 0.5;\n lean = lean / max(length(lean), 0.0001) * rise * 0.15;\n float grow = 1.0 + rise * 0.5;\n\n vec2 q = (v_uv - centre) * u_grid;\n vec2 top = (q - lean) / grow;\n float onTop = max(abs(top.x), abs(top.y));\n float onFoot = max(abs(q.x), abs(q.y));\n bool lit = onTop <= edge;\n if (!lit && onFoot > edge) {\n continue;\n }\n depth = pulse;\n\n float pass = smoothstep(-u_wave * 0.4, u_wave * 0.4, w);\n vec2 local = lit ? top : clamp(top, -edge, edge);\n vec2 src = centre + local / u_grid;\n vec4 col = mix(texture(u_from, src), texture(u_to, src), pass);\n\n if (lit) {\n col.rgb = mix(col.rgb, u_tint, pulse * 0.12);\n col.rgb *= 1.0 + pulse * 0.06;\n } else {\n col.rgb = mix(col.rgb, u_tint, pulse * 0.06);\n col.rgb *= 1.0 - pulse * 0.24;\n }\n\n face = col;\n }\n }\n\n outColor = face + base * (1.0 - face.a);\n}`;\n\nconst shader = makeSceneShader<GridWaveProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, passedProps }) => {\n const {\n tileSize = DEFAULTS.tileSize,\n waveWidth = DEFAULTS.waveWidth,\n lift = DEFAULTS.lift,\n gap = DEFAULTS.gap,\n tint = DEFAULTS.tint,\n direction = DEFAULTS.direction,\n } = passedProps;\n const size = Math.max(tileSize, 8);\n const axis = AXES[direction] ?? AXES[DEFAULTS.direction];\n const rgb = hexToRgb(tint);\n gl.uniform2f(\n uniform(\"u_grid\"),\n Math.max(Math.round(width / size), 2),\n Math.max(Math.round(height / size), 2),\n );\n gl.uniform1f(uniform(\"u_wave\"), Math.max(waveWidth, 0.02));\n gl.uniform1f(uniform(\"u_lift\"), Math.max(lift, 0) * 0.35);\n gl.uniform1f(uniform(\"u_gap\"), Math.min(Math.max(gap, 0), 0.45));\n gl.uniform3f(uniform(\"u_tint\"), rgb[0], rgb[1], rgb[2]);\n gl.uniform2f(uniform(\"u_dir\"), axis[0], axis[1]);\n gl.uniform1f(uniform(\"u_radial\"), direction === \"ripple\" ? 1 : 0);\n },\n);\n\nconst GridWaveFallback: React.FC<\n TransitionPresentationComponentProps<GridWaveProps>\n> = ({ children, presentationProgress, presentationDirection }) => {\n const p = presentationProgress;\n\n if (presentationDirection === \"exiting\") {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const reveal = Math.min(1, Math.max(0, (p - 0.2) / 0.6));\n\n return (\n <AbsoluteFill\n style={{\n opacity: reveal,\n transform: `scale(${1.04 - reveal * 0.04})`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n};\n\nconst presentation = makeCanvasPresentation<GridWaveProps>({\n shader,\n fallback: GridWaveFallback,\n});\n\nexport function gridWave(\n props: GridWaveProps = {},\n): TransitionPresentation<GridWaveProps> {\n return presentation(props);\n}\n",
+ "type": "registry:component",
+ "target": "components/remocn/grid-wave.tsx"
+ }
+ ],
+ "type": "registry:component"
+}
diff --git a/registry-artifacts/registry.json b/registry-artifacts/registry.json
index 8b7bdd0f..0b903afe 100644
--- a/registry-artifacts/registry.json
+++ b/registry-artifacts/registry.json
@@ -1659,6 +1659,21 @@
],
"type": "registry:component"
},
+ {
+ "name": "grid-wave",
+ "title": "Grid Wave",
+ "description": "A wave travels across the frame raising the picture into a grid of solid blocks with lit tops and shaded sides, which set back down carrying the next scene.",
+ "dependencies": ["remotion", "@remotion/transitions"],
+ "registryDependencies": ["@remocn/canvas-presentation"],
+ "files": [
+ {
+ "path": "registry/remocn/grid-wave/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/grid-wave.tsx"
+ }
+ ],
+ "type": "registry:component"
+ },
{
"name": "particle-dissolve",
"title": "Particle Dissolve",
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index 6b1b8f5e..2e156ec4 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -29,6 +29,7 @@ import { glassCodeBlockConfig } from "@/registry/remocn/glass-code-block/config"
import { glassCodeWalkConfig } from "@/registry/remocn/glass-code-walk/config";
import { glitchCutConfig } from "@/registry/remocn/glitch-cut/config";
import { grainDissolveConfig } from "@/registry/remocn/grain-dissolve/config";
+import { gridWaveConfig } from "@/registry/remocn/grid-wave/config";
import { handCountConfig } from "@/registry/remocn/hand-count/config";
import { handwriteConfig } from "@/registry/remocn/handwrite/config";
import { iconScatterConfig } from "@/registry/remocn/icon-scatter/config";
@@ -1441,6 +1442,13 @@ const registry: Record<string, RegistryEntry> = {
),
config: particleDissolveConfig,
},
+ "grid-wave": {
+ load: () =>
+ import("@/components/docs/examples/grid-wave-example").then((m) => ({
+ default: m.GridWaveExampleScene,
+ })),
+ config: gridWaveConfig,
+ },
"slide-swap": {
load: () =>
import("@/components/docs/examples/slide-swap-example").then((m) => ({
diff --git a/registry/remocn/ember-burn/index.tsx b/registry/remocn/ember-burn/index.tsx
index eceaacd6..fe20a369 100644
--- a/registry/remocn/ember-burn/index.tsx
+++ b/registry/remocn/ember-burn/index.tsx
@@ -123,22 +123,27 @@ void main() {
noise(skewed * u_patches * 2.4 + vec2(0.0, u_progress * 3.1)) - 0.5,
noise(skewed * u_patches * 2.4 + vec2(5.2, 1.7 + u_progress * 4.3)) - 0.5
);
- float boil = exp(-pow(depth / (soft * 6.0), 2.0)) * alive * u_heat * 0.14;
+ float heatBand = depth / (soft * 6.0);
+ float boil = exp(-heatBand * heatBand) * alive * u_heat * 0.14;
vec4 from = texture(u_from, v_uv + shimmer * boil * intact);
vec4 to = texture(u_to, v_uv - shimmer * boil * arrived);
float ramp = depth / (soft * 2.2);
- float charred = intact * exp(-pow((ramp - 0.55) * 1.5, 2.0)) * alive;
- float molten = arrived * exp(-pow((ramp + 0.55) * 1.5, 2.0)) * alive;
- float rim = exp(-pow(depth / (soft * 1.1), 2.0));
+ float charBand = (ramp - 0.55) * 1.5;
+ float moltenBand = (ramp + 0.55) * 1.5;
+ float rimBand = depth / (soft * 1.1);
+ float charred = intact * exp(-charBand * charBand) * alive;
+ float molten = arrived * exp(-moltenBand * moltenBand) * alive;
+ float rim = exp(-rimBand * rimBand);
float since = clamp(-depth / (soft * 3.0), 0.0, 1.0);
+ float emberBand = depth / (soft * 2.6);
vec2 emberSpace = skewed + vec2(0.0, u_progress * 0.42);
float cellSeed = hash(floor(emberSpace * EMBER_GRID));
float ember =
step(1.0 - u_embers * 0.08, cellSeed) *
arrived *
- exp(-pow(depth / (soft * 2.6), 2.0)) *
+ exp(-emberBand * emberBand) *
alive;
vec3 sparkSource = texture(u_from, v_uv + vec2(0.0, since * 0.07)).rgb;
diff --git a/registry/remocn/grid-wave/config.ts b/registry/remocn/grid-wave/config.ts
new file mode 100644
index 00000000..90a153f9
--- /dev/null
+++ b/registry/remocn/grid-wave/config.ts
@@ -0,0 +1,54 @@
+import { gridWaveExampleCode } from "@/components/docs/examples/grid-wave-example";
+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";
+
+export const gridWaveConfig: ComponentConfig = {
+ componentName: "gridWave",
+ importPath: "@/components/remocn/grid-wave",
+ controls: {
+ tileSize: {
+ type: "number",
+ default: 90,
+ min: 30,
+ max: 260,
+ step: 10,
+ label: "Tile size",
+ },
+ waveWidth: {
+ type: "number",
+ default: 0.16,
+ min: 0.04,
+ max: 0.5,
+ step: 0.02,
+ label: "Wave width",
+ },
+ lift: {
+ type: "number",
+ default: 2,
+ min: 0,
+ max: 4,
+ step: 0.1,
+ label: "Lift",
+ },
+ gap: {
+ type: "number",
+ default: 0.12,
+ min: 0,
+ max: 0.45,
+ step: 0.01,
+ label: "Gap",
+ },
+ tint: { type: "color", default: "#8fb4ff", label: "Tint" },
+ direction: {
+ type: "select",
+ default: "ripple",
+ options: ["ripple", "left", "right", "up", "down"],
+ label: "Direction",
+ },
+ },
+ durationInFrames: 84,
+ fps: FPS,
+ compositionWidth: W,
+ compositionHeight: H,
+ previewBackdrop: { type: "color", value: "#0a0a0a" },
+ snippet: gridWaveExampleCode,
+};
diff --git a/registry/remocn/grid-wave/index.tsx b/registry/remocn/grid-wave/index.tsx
new file mode 100644
index 00000000..8789f4bd
--- /dev/null
+++ b/registry/remocn/grid-wave/index.tsx
@@ -0,0 +1,212 @@
+"use client";
+
+import type {
+ TransitionPresentation,
+ TransitionPresentationComponentProps,
+} from "@remotion/transitions";
+import type React from "react";
+import { AbsoluteFill } from "remotion";
+import {
+ makeCanvasPresentation,
+ makeSceneShader,
+} from "@/lib/remocn/canvas-presentation";
+
+export type GridWaveDirection = "ripple" | "left" | "right" | "up" | "down";
+
+export type GridWaveProps = {
+ tileSize?: number;
+ waveWidth?: number;
+ lift?: number;
+ gap?: number;
+ tint?: string;
+ direction?: GridWaveDirection;
+};
+
+const DEFAULTS = {
+ tileSize: 90,
+ waveWidth: 0.16,
+ lift: 2,
+ gap: 0.12,
+ tint: "#8fb4ff",
+ direction: "ripple" as GridWaveDirection,
+};
+
+const AXES: Record<GridWaveDirection, [number, number]> = {
+ ripple: [0, 0],
+ left: [1, 0],
+ right: [-1, 0],
+ up: [0, -1],
+ down: [0, 1],
+};
+
+function hexToRgb(hex: string): [number, number, number] {
+ const value = hex.replace("#", "");
+ const full =
+ value.length === 3
+ ? value
+ .split("")
+ .map((c) => c + c)
+ .join("")
+ : value;
+ const int = Number.parseInt(full, 16);
+ if (Number.isNaN(int)) {
+ return [0.56, 0.71, 1];
+ }
+ return [
+ ((int >> 16) & 255) / 255,
+ ((int >> 8) & 255) / 255,
+ (int & 255) / 255,
+ ];
+}
+
+const FRAGMENT_SHADER = `#version 300 es
+precision highp float;
+
+uniform sampler2D u_from;
+uniform sampler2D u_to;
+uniform float u_progress;
+uniform float u_aspect;
+uniform vec2 u_grid;
+uniform float u_wave;
+uniform float u_lift;
+uniform float u_gap;
+uniform vec3 u_tint;
+uniform vec2 u_dir;
+uniform float u_radial;
+
+in vec2 v_uv;
+out vec4 outColor;
+
+float hash(vec2 p) {
+ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
+}
+
+float waveCoord(vec2 p) {
+ vec2 off = (p - 0.5) * vec2(u_aspect, 1.0);
+ float ring = length(off) / (0.5 * sqrt(u_aspect * u_aspect + 1.0));
+ float sweep = clamp(dot(p - 0.5, u_dir) + 0.5, 0.0, 1.0);
+ return mix(sweep, ring, u_radial);
+}
+
+void main() {
+ float front = u_progress * (1.0 + 6.0 * u_wave) - 3.0 * u_wave;
+
+ float selfPass =
+ smoothstep(-u_wave * 0.4, u_wave * 0.4, front - waveCoord(v_uv));
+ vec4 base = mix(texture(u_from, v_uv), texture(u_to, v_uv), selfPass);
+
+ float edge = 0.5 - u_gap * 0.5;
+ vec2 anchor = floor(v_uv * u_grid);
+
+ vec4 face = vec4(0.0);
+ float depth = -1.0;
+
+ for (int oy = -1; oy <= 1; oy++) {
+ for (int ox = -1; ox <= 1; ox++) {
+ vec2 cell = anchor + vec2(float(ox), float(oy));
+ vec2 centre = (cell + 0.5) / u_grid;
+
+ float stagger = (hash(cell) - 0.5) * u_wave * 0.4;
+ float w = front - waveCoord(centre) + stagger;
+ float band = w / u_wave;
+ float pulse = exp(-band * band);
+ if (pulse <= depth) {
+ continue;
+ }
+
+ float rise = pulse * u_lift;
+ vec2 lean = centre - 0.5;
+ lean = lean / max(length(lean), 0.0001) * rise * 0.15;
+ float grow = 1.0 + rise * 0.5;
+
+ vec2 q = (v_uv - centre) * u_grid;
+ vec2 top = (q - lean) / grow;
+ float onTop = max(abs(top.x), abs(top.y));
+ float onFoot = max(abs(q.x), abs(q.y));
+ bool lit = onTop <= edge;
+ if (!lit && onFoot > edge) {
+ continue;
+ }
+ depth = pulse;
+
+ float pass = smoothstep(-u_wave * 0.4, u_wave * 0.4, w);
+ vec2 local = lit ? top : clamp(top, -edge, edge);
+ vec2 src = centre + local / u_grid;
+ vec4 col = mix(texture(u_from, src), texture(u_to, src), pass);
+
+ if (lit) {
+ col.rgb = mix(col.rgb, u_tint, pulse * 0.12);
+ col.rgb *= 1.0 + pulse * 0.06;
+ } else {
+ col.rgb = mix(col.rgb, u_tint, pulse * 0.06);
+ col.rgb *= 1.0 - pulse * 0.24;
+ }
+
+ face = col;
+ }
+ }
+
+ outColor = face + base * (1.0 - face.a);
+}`;
+
+const shader = makeSceneShader<GridWaveProps>(
+ FRAGMENT_SHADER,
+ ({ gl, uniform, width, height, passedProps }) => {
+ const {
+ tileSize = DEFAULTS.tileSize,
+ waveWidth = DEFAULTS.waveWidth,
+ lift = DEFAULTS.lift,
+ gap = DEFAULTS.gap,
+ tint = DEFAULTS.tint,
+ direction = DEFAULTS.direction,
+ } = passedProps;
+ const size = Math.max(tileSize, 8);
+ const axis = AXES[direction] ?? AXES[DEFAULTS.direction];
+ const rgb = hexToRgb(tint);
+ gl.uniform2f(
+ uniform("u_grid"),
+ Math.max(Math.round(width / size), 2),
+ Math.max(Math.round(height / size), 2),
+ );
+ gl.uniform1f(uniform("u_wave"), Math.max(waveWidth, 0.02));
+ gl.uniform1f(uniform("u_lift"), Math.max(lift, 0) * 0.35);
+ gl.uniform1f(uniform("u_gap"), Math.min(Math.max(gap, 0), 0.45));
+ gl.uniform3f(uniform("u_tint"), rgb[0], rgb[1], rgb[2]);
+ gl.uniform2f(uniform("u_dir"), axis[0], axis[1]);
+ gl.uniform1f(uniform("u_radial"), direction === "ripple" ? 1 : 0);
+ },
+);
+
+const GridWaveFallback: React.FC<
+ TransitionPresentationComponentProps<GridWaveProps>
+> = ({ children, presentationProgress, presentationDirection }) => {
+ const p = presentationProgress;
+
+ if (presentationDirection === "exiting") {
+ return <AbsoluteFill>{children}</AbsoluteFill>;
+ }
+
+ const reveal = Math.min(1, Math.max(0, (p - 0.2) / 0.6));
+
+ return (
+ <AbsoluteFill
+ style={{
+ opacity: reveal,
+ transform: `scale(${1.04 - reveal * 0.04})`,
+ }}
+ >
+ {children}
+ </AbsoluteFill>
+ );
+};
+
+const presentation = makeCanvasPresentation<GridWaveProps>({
+ shader,
+ fallback: GridWaveFallback,
+});
+
+export function gridWave(
+ props: GridWaveProps = {},
+): TransitionPresentation<GridWaveProps> {
+ return presentation(props);
+}
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index 72dd5ff3..8d1d8fdd 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -1659,6 +1659,21 @@
}
]
},
+ {
+ "name": "grid-wave",
+ "type": "registry:component",
+ "title": "Grid Wave",
+ "description": "A wave travels across the frame raising the picture into a grid of solid blocks with lit tops and shaded sides, which set back down carrying the next scene.",
+ "dependencies": ["remotion", "@remotion/transitions"],
+ "registryDependencies": ["@remocn/canvas-presentation"],
+ "files": [
+ {
+ "path": "grid-wave/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/grid-wave.tsx"
+ }
+ ]
+ },
{
"name": "particle-dissolve",
"type": "registry:component",
diff --git a/src/remotion/canvas-spike-root.tsx b/src/remotion/canvas-spike-root.tsx
index 74b5a7eb..651a3f09 100644
--- a/src/remotion/canvas-spike-root.tsx
+++ b/src/remotion/canvas-spike-root.tsx
@@ -8,10 +8,12 @@ import {
} from "remotion";
import { EmberBurnExampleScene } from "@/components/docs/examples/ember-burn-example";
import { GlitchCutExampleScene } from "@/components/docs/examples/glitch-cut-example";
+import { GridWaveExampleScene } from "@/components/docs/examples/grid-wave-example";
import { ParticleDissolveExampleScene } from "@/components/docs/examples/particle-dissolve-example";
import type { ComponentConfig } from "@/lib/customizer-config";
import { emberBurnConfig } from "@/registry/remocn/ember-burn/config";
import { glitchCutConfig } from "@/registry/remocn/glitch-cut/config";
+import { gridWaveConfig } from "@/registry/remocn/grid-wave/config";
import { particleDissolveConfig } from "@/registry/remocn/particle-dissolve/config";
const { fontFamily: GEIST } = loadFont();
@@ -33,6 +35,7 @@ const SCENES: Record<
Scene: ParticleDissolveExampleScene,
config: particleDissolveConfig,
},
+ "grid-wave": { Scene: GridWaveExampleScene, config: gridWaveConfig },
};
function makeStage(Scene: ComponentType) {