Skip to content

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

feat: particle dissolve

kapishdima4bb2e1c51ae3
diff --git a/components/docs/examples/particle-dissolve-example.tsx b/components/docs/examples/particle-dissolve-example.tsx
new file mode 100644
index 00000000..4ebf85db
--- /dev/null
+++ b/components/docs/examples/particle-dissolve-example.tsx
@@ -0,0 +1,103 @@
+"use client";
+
+import { linearTiming, TransitionSeries } from "@remotion/transitions";
+import { AbsoluteFill } from "remotion";
+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;
+ shimmer?: number;
+ aberration?: number;
+ direction?: string;
+ stagger?: number;
+}
+
+export function ParticleDissolveExampleScene({
+ particleSize,
+ scatter,
+ shimmer,
+ aberration,
+ direction,
+ stagger,
+}: ParticleDissolveExampleProps) {
+ return (
+ <TransitionSeries>
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <Scene label="Scene A" background="#0a0a0a" />
+ </TransitionSeries.Sequence>
+ <TransitionSeries.Transition
+ timing={linearTiming({ durationInFrames: 36 })}
+ presentation={particleDissolve({
+ particleSize,
+ scatter,
+ shimmer,
+ aberration,
+ direction: direction as ParticleDissolveDirection | undefined,
+ stagger,
+ })}
+ />
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <Scene label="Scene B" background="#12141a" />
+ </TransitionSeries.Sequence>
+ </TransitionSeries>
+ );
+}
+
+export const particleDissolveExampleCode = (
+ values: Record<string, unknown>,
+): string => {
+ const particleSize = (values.particleSize as number) ?? 4;
+ const scatter = (values.scatter as number) ?? 0.08;
+ const shimmer = (values.shimmer as number) ?? 0.6;
+ const aberration = (values.aberration as number) ?? 0.5;
+ const direction = (values.direction as string) ?? "reveal";
+ const stagger = (values.stagger as number) ?? 0.55;
+ return `import { TransitionSeries, linearTiming } from "@remotion/transitions";
+import { particleDissolve } from "@/components/remocn/particle-dissolve";
+
+export const MyVideo = () => (
+ <TransitionSeries>
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <SceneA />
+ </TransitionSeries.Sequence>
+ <TransitionSeries.Transition
+ timing={linearTiming({ durationInFrames: 36 })}
+ presentation={particleDissolve({ particleSize: ${particleSize}, scatter: ${scatter}, shimmer: ${shimmer}, aberration: ${aberration}, direction: "${direction}", stagger: ${stagger} })}
+ />
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <SceneB />
+ </TransitionSeries.Sequence>
+ </TransitionSeries>
+);`;
+};
diff --git a/config/site.ts b/config/site.ts
index 34131c24..9da13d2e 100644
--- a/config/site.ts
+++ b/config/site.ts
@@ -85,6 +85,7 @@ export const NEW_BADGE_PATHS = new Set<string>([
"/docs/ui-blocks/reel",
"/docs/transitions/glitch-cut",
"/docs/transitions/ember-burn",
+ "/docs/transitions/particle-dissolve",
]);
export type FooterGroup = {
diff --git a/content/changelog/2026-08-02-canvas-transitions.mdx b/content/changelog/2026-08-02-canvas-transitions.mdx
index b76c8177..47b5dd0d 100644
--- a/content/changelog/2026-08-02-canvas-transitions.mdx
+++ b/content/changelog/2026-08-02-canvas-transitions.mdx
@@ -11,6 +11,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.
- 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 adcea799..f293c063 100644
--- a/content/docs/components.mdx
+++ b/content/docs/components.mdx
@@ -511,6 +511,12 @@ Scene transitions, camera moves, and stylized wipes.
status: "stable",
href: "/docs/transitions/ember-burn",
},
+ {
+ name: "ParticleDissolve",
+ description: "Grind the frame into drifting grey dust and let the next scene coalesce back out of it",
+ status: "stable",
+ href: "/docs/transitions/particle-dissolve",
+ },
]}
/>
diff --git a/content/docs/transitions/index.mdx b/content/docs/transitions/index.mdx
index 8bf626c8..77023493 100644
--- a/content/docs/transitions/index.mdx
+++ b/content/docs/transitions/index.mdx
@@ -140,6 +140,12 @@ Pixel-level transitions. These read the actual pixels of both scenes through the
status: "stable",
href: "/docs/transitions/ember-burn",
},
+ {
+ name: "ParticleDissolve",
+ description: "Grind the frame into drifting grey dust and let the next scene coalesce back out of it",
+ status: "stable",
+ href: "/docs/transitions/particle-dissolve",
+ },
]}
/>
diff --git a/content/docs/transitions/meta.json b/content/docs/transitions/meta.json
index af4157f5..fdb4bddb 100644
--- a/content/docs/transitions/meta.json
+++ b/content/docs/transitions/meta.json
@@ -21,6 +21,7 @@
"icon-scatter",
"glitch-cut",
"ember-burn",
+ "particle-dissolve",
"slide-swap",
"spring-settle"
]
diff --git a/content/docs/transitions/particle-dissolve.mdx b/content/docs/transitions/particle-dissolve.mdx
new file mode 100644
index 00000000..e0cd1519
--- /dev/null
+++ b/content/docs/transitions/particle-dissolve.mdx
@@ -0,0 +1,149 @@
+---
+title: Particle Dissolve
+description: Grind the frame into drifting grey dust and let the next scene coalesce back out of it
+component: particle-dissolve
+vibe: tech
+length: 36
+useWhen:
+ - "A scene change should read as the picture breaking down into matter and reassembling, not as one image fading through another."
+ - "The moment can afford well over a second; the dust needs time to form, drift, and gather."
+ - "The outgoing scene has bright content worth watching disintegrate — highlights throw their dust furthest, so text and logos come apart first."
+avoidWhen:
+ - "You only need texture over a plain crossfade — use `grain-dissolve`."
+ - "You want an organic flowing break-up rather than a granular one — use `perlin-dissolve`."
+---
+
+<ComponentPreview name="particle-dissolve" />
+
+<CanvasTransitionNote />
+
+## Installation
+
+<InstallBlock name="particle-dissolve" />
+
+## Usage
+
+`particleDissolve()` is a Remotion transition presentation. Pass it to a
+`TransitionSeries.Transition` between two sequences. The frame is ground into
+fine dust: each speck wanders away from the pixel it came from, colour drains
+out of it as it goes, and the specks shimmer while they hang in the air. Then
+the motion reverses — the dust gathers, colour returns, and it settles into the
+next scene.
+
+```tsx
+import { TransitionSeries, linearTiming } from "@remotion/transitions";
+import { particleDissolve } from "@/components/remocn/particle-dissolve";
+
+export const MyVideo = () => (
+ <TransitionSeries>
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <SceneA />
+ </TransitionSeries.Sequence>
+ <TransitionSeries.Transition
+ timing={linearTiming({ durationInFrames: 36 })}
+ presentation={particleDissolve()}
+ />
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <SceneB />
+ </TransitionSeries.Sequence>
+ </TransitionSeries>
+);
+```
+
+## Why this one needs the canvas
+
+- **Bright content throws its dust furthest.** How far a speck wanders is set by
+ the luminance of the pixel it came from, so highlights and text disintegrate
+ before flat background does. The scatter field is a function of the picture.
+- **Every speck carries a real fragment.** It samples the scene at the
+ coordinate it drifted in from, not an average of what sits beneath it.
+- **The dust separates colour.** Red and blue are sampled at slightly different
+ offsets while a speck is airborne, so the grain fringes as it flies and
+ resolves clean as it lands.
+- **Motes catch the light.** Each speck has its own size and its own brightness,
+ twinkling on its own phase, and the material thins between them. This is what
+ makes the effect work on flat areas: displacing a uniform colour returns the
+ same colour, so without light of their own the specks would be invisible
+ everywhere except over content, and only the text would appear to dissolve.
+
+None of that survives a mask: a CSS version could only fade a grid of squares
+tinted by whatever is underneath them.
+
+## The entrance mirrors the exit
+
+There is one continuous arc per speck rather than two effects bolted together:
+dust rises to a peak and falls away again, and the scene swap happens at the
+peak where the frame is least legible. Played backwards it reads as the same
+effect applied to the other scene — the incoming frame is assembled out of the
+same dust that the outgoing one became.
+
+`direction` sets the order the arc sweeps in. `"reveal"` starts at the centre
+and travels outward, so the next scene surfaces in the middle and grows;
+an axis sweeps the dust across the frame instead.
+
+## Determinism
+
+Each speck's heading, wander distance, shimmer phase, and stagger are seeded
+from its cell coordinate and evaluated as closed-form functions of the
+transition's progress — no per-frame 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 presentation renders a desaturating
+blur crossfade — the picture loses colour and definition on the way out and
+recovers both on the way in, which is the shape of the effect without the
+grain. The dust needs the outgoing scene's pixels, so none of the props apply
+there.
+
+## Props
+
+`particleDissolve(props)` accepts:
+
+<PropsTable
+ rows={[
+ {
+ name: "particleSize",
+ type: "number",
+ default: "4",
+ description:
+ "Grain size in pixels, measured against the composition height. Small values give true dust; above roughly 10 the frame reads as breaking into tiles instead.",
+ },
+ {
+ name: "scatter",
+ type: "number",
+ default: "0.08",
+ description:
+ "How far a speck can wander from home, as a fraction of the frame, before luminance scaling. Higher values throw the picture further apart at the peak.",
+ },
+ {
+ name: "shimmer",
+ type: "number",
+ default: "0.6",
+ description:
+ "How much the specks jitter and catch the light while airborne. This is what carries the effect over flat areas of the frame, where displacement alone shows nothing — turn it down over busy footage, up over plain backgrounds. 0 leaves a still, dark scatter.",
+ },
+ {
+ name: "aberration",
+ type: "number",
+ default: "0.5",
+ description:
+ "Colour separation on a speck in flight. 0 keeps the grain neutral; higher values fringe it red and blue at the peak of the dissolve.",
+ },
+ {
+ name: "direction",
+ type: '"reveal" | "up" | "down" | "left" | "right"',
+ default: '"reveal"',
+ description:
+ "The order the dissolve sweeps in. \"reveal\" runs outward from the centre; an axis sweeps the arc across the frame from that edge.",
+ },
+ {
+ name: "stagger",
+ type: "number",
+ default: "0.55",
+ description:
+ "How far apart specks start their arc, as a share of the transition. 0 dissolves the whole frame as one plane; high values leave a long tail of stragglers still airborne.",
+ },
+ ]}
+/>
diff --git a/registry-artifacts/particle-dissolve.json b/registry-artifacts/particle-dissolve.json
new file mode 100644
index 00000000..3ea49eea
--- /dev/null
+++ b/registry-artifacts/particle-dissolve.json
@@ -0,0 +1,17 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "particle-dissolve",
+ "title": "Particle Dissolve",
+ "description": "The frame is ground into drifting grey dust whose specks carry real fragments of the picture, and the next scene coalesces back out of the same dust.",
+ "dependencies": ["remotion", "@remotion/transitions"],
+ "registryDependencies": ["@remocn/canvas-presentation"],
+ "files": [
+ {
+ "path": "registry/remocn/particle-dissolve/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 ParticleDissolveDirection =\n | \"reveal\"\n | \"up\"\n | \"down\"\n | \"left\"\n | \"right\";\n\nexport type ParticleDissolveProps = {\n particleSize?: number;\n scatter?: number;\n shimmer?: number;\n aberration?: number;\n direction?: ParticleDissolveDirection;\n stagger?: number;\n};\n\nconst DEFAULTS = {\n particleSize: 4,\n scatter: 0.08,\n shimmer: 0.6,\n aberration: 0.5,\n direction: \"reveal\" as ParticleDissolveDirection,\n stagger: 0.55,\n};\n\nconst AXES: Record<ParticleDissolveDirection, [number, number]> = {\n reveal: [0, 0],\n up: [0, -1],\n down: [0, 1],\n left: [-1, 0],\n right: [1, 0],\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_cells;\nuniform float u_scatter;\nuniform float u_shimmer;\nuniform float u_aberration;\nuniform float u_stagger;\nuniform vec2 u_dir;\nuniform float u_radial;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\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 < 4; i++) {\n sum += noise(p) * amp;\n p *= 2.03;\n amp *= 0.5;\n }\n return sum * 1.0667;\n}\n\nfloat luma(vec3 c) {\n return dot(c, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvec4 grab(sampler2D tex, vec2 uv, vec2 dir, float amount) {\n vec4 centre = texture(tex, uv);\n float r = texture(tex, uv + dir * amount).r;\n float b = texture(tex, uv - dir * amount).b;\n return vec4(r, centre.g, b, centre.a);\n}\n\nvoid main() {\n vec2 grid = vec2(u_cells * u_aspect, u_cells);\n vec2 skewed = vec2(v_uv.x * u_aspect, v_uv.y);\n vec2 centred = skewed - vec2(0.5 * u_aspect, 0.5);\n\n float spatial = u_radial > 0.5\n ? clamp(length(centred) / 0.62, 0.0, 1.0)\n : clamp(dot(v_uv - 0.5, u_dir) + 0.5, 0.0, 1.0);\n float blob = fbm(skewed * 2.2);\n float order = mix(blob, spatial, 0.55) * u_stagger;\n float span = max(1.0 - u_stagger, 0.08);\n float phase = clamp((u_progress - order) / span, 0.0, 1.0);\n float dust = sin(phase * PI);\n\n vec2 flow = vec2(\n fbm(skewed * 3.0 + vec2(0.0, u_progress * 0.8)),\n fbm(skewed * 3.0 + vec2(5.3, 2.7 - u_progress * 0.7))\n ) - 0.5;\n vec2 aim =\n flow * 2.0 + normalize(centred + 0.0001) * 0.7 * u_radial + u_dir;\n vec2 heading = aim / max(length(aim), 0.0001);\n\n float bright = luma(texture(u_from, v_uv).rgb);\n float travel = u_scatter * dust * (0.18 + bright * 1.25);\n vec2 drift = vec2(heading.x / u_aspect, heading.y) * travel;\n\n float split = u_aberration * dust * 0.35;\n vec4 leaving = grab(u_from, v_uv - drift, drift, split);\n vec4 arriving = grab(u_to, v_uv + drift, -drift, split);\n\n vec4 base = mix(leaving, arriving, smoothstep(0.25, 0.75, phase));\n base.rgb = mix(base.rgb, vec3(luma(base.rgb)), dust);\n base.rgb *= 1.0 - dust * 0.25;\n\n vec2 g = (v_uv - drift) * grid;\n vec2 origin = floor(g);\n float cover = 0.0;\n float light = 0.0;\n for (int oy = -1; oy <= 1; oy++) {\n for (int ox = -1; ox <= 1; ox++) {\n vec2 cell = origin + vec2(float(ox), float(oy));\n vec2 jitter = vec2(hash(cell + 3.1), hash(cell + 8.7));\n float mote = hash(cell + 13.7);\n float twinkle =\n 0.5 + 0.5 * sin(u_progress * (12.0 + mote * 30.0) + mote * 6.2831);\n float radius =\n (0.36 + 0.46 * hash(cell + 21.3)) * (0.65 + 0.6 * twinkle);\n float reach = length(g - (cell + jitter));\n float hit = 1.0 - smoothstep(radius * 0.45, radius, reach);\n cover = max(cover, hit);\n light = max(light, hit * mote * twinkle);\n }\n }\n cover = mix(1.0, cover, dust);\n light *= dust;\n\n vec4 speck = vec4(\n base.rgb + vec3(0.36 * light * u_shimmer) * base.a,\n base.a\n );\n vec4 gap = vec4(base.rgb * (1.0 - dust * 0.6), base.a);\n outColor = mix(gap, speck, cover);\n}`;\n\nconst shader = makeSceneShader<ParticleDissolveProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, height, passedProps }) => {\n const {\n particleSize = DEFAULTS.particleSize,\n scatter = DEFAULTS.scatter,\n shimmer = DEFAULTS.shimmer,\n aberration = DEFAULTS.aberration,\n direction = DEFAULTS.direction,\n stagger = DEFAULTS.stagger,\n } = passedProps;\n const axis = AXES[direction] ?? AXES[DEFAULTS.direction];\n gl.uniform1f(uniform(\"u_cells\"), height / Math.max(particleSize, 1));\n gl.uniform1f(uniform(\"u_scatter\"), scatter);\n gl.uniform1f(uniform(\"u_shimmer\"), shimmer);\n gl.uniform1f(uniform(\"u_aberration\"), aberration);\n gl.uniform1f(uniform(\"u_stagger\"), Math.min(Math.max(stagger, 0), 0.92));\n gl.uniform2f(uniform(\"u_dir\"), axis[0], axis[1]);\n gl.uniform1f(uniform(\"u_radial\"), direction === \"reveal\" ? 1 : 0);\n },\n);\n\nconst ParticleDissolveFallback: React.FC<\n TransitionPresentationComponentProps<ParticleDissolveProps>\n> = ({ children, presentationProgress, presentationDirection }) => {\n const p = presentationProgress;\n const entering = presentationDirection === \"entering\";\n const t = entering ? p : 1 - p;\n const settle = Math.min(1, Math.max(0, (t - 0.2) / 0.6));\n const grain = 1 - settle;\n\n return (\n <AbsoluteFill\n style={{\n opacity: settle,\n filter:\n grain > 0.02\n ? `blur(${grain * 10}px) saturate(${1 - grain * 0.9}) contrast(${1 + grain * 0.5})`\n : undefined,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n};\n\nconst presentation = makeCanvasPresentation<ParticleDissolveProps>({\n shader,\n fallback: ParticleDissolveFallback,\n});\n\nexport function particleDissolve(\n props: ParticleDissolveProps = {},\n): TransitionPresentation<ParticleDissolveProps> {\n return presentation(props);\n}\n",
+ "type": "registry:component",
+ "target": "components/remocn/particle-dissolve.tsx"
+ }
+ ],
+ "type": "registry:component"
+}
diff --git a/registry-artifacts/registry.json b/registry-artifacts/registry.json
index 1ea6fbb6..8b7bdd0f 100644
--- a/registry-artifacts/registry.json
+++ b/registry-artifacts/registry.json
@@ -1659,6 +1659,21 @@
],
"type": "registry:component"
},
+ {
+ "name": "particle-dissolve",
+ "title": "Particle Dissolve",
+ "description": "The frame is ground into drifting grey dust whose specks carry real fragments of the picture, and the next scene coalesces back out of the same dust.",
+ "dependencies": ["remotion", "@remotion/transitions"],
+ "registryDependencies": ["@remocn/canvas-presentation"],
+ "files": [
+ {
+ "path": "registry/remocn/particle-dissolve/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/particle-dissolve.tsx"
+ }
+ ],
+ "type": "registry:component"
+ },
{
"name": "glitch-cut",
"title": "Glitch Cut",
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index 7c87d312..6b1b8f5e 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -50,6 +50,7 @@ import { opencodeConfig } from "@/registry/remocn/opencode/config";
import { pageTurnConfig } from "@/registry/remocn/page-turn/config";
import { paperStickerConfig } from "@/registry/remocn/paper-sticker/config";
import { paperWobbleConfig } from "@/registry/remocn/paper-wobble/config";
+import { particleDissolveConfig } from "@/registry/remocn/particle-dissolve/config";
import { perCharacterRiseConfig } from "@/registry/remocn/per-character-rise/config";
import { perWordCrossfadeConfig } from "@/registry/remocn/per-word-crossfade/config";
import { perlinDissolveConfig } from "@/registry/remocn/perlin-dissolve/config";
@@ -1433,6 +1434,13 @@ const registry: Record<string, RegistryEntry> = {
})),
config: emberBurnConfig,
},
+ "particle-dissolve": {
+ load: () =>
+ import("@/components/docs/examples/particle-dissolve-example").then(
+ (m) => ({ default: m.ParticleDissolveExampleScene }),
+ ),
+ config: particleDissolveConfig,
+ },
"slide-swap": {
load: () =>
import("@/components/docs/examples/slide-swap-example").then((m) => ({
diff --git a/registry/remocn/particle-dissolve/config.ts b/registry/remocn/particle-dissolve/config.ts
new file mode 100644
index 00000000..c1c233a7
--- /dev/null
+++ b/registry/remocn/particle-dissolve/config.ts
@@ -0,0 +1,61 @@
+import { particleDissolveExampleCode } from "@/components/docs/examples/particle-dissolve-example";
+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";
+
+export const particleDissolveConfig: ComponentConfig = {
+ componentName: "particleDissolve",
+ importPath: "@/components/remocn/particle-dissolve",
+ controls: {
+ particleSize: {
+ type: "number",
+ default: 4,
+ min: 1,
+ max: 16,
+ step: 1,
+ label: "Grain size",
+ },
+ scatter: {
+ type: "number",
+ default: 0.08,
+ min: 0.01,
+ max: 0.4,
+ step: 0.01,
+ label: "Scatter",
+ },
+ shimmer: {
+ type: "number",
+ default: 0.6,
+ min: 0,
+ max: 1.5,
+ step: 0.05,
+ label: "Shimmer",
+ },
+ aberration: {
+ type: "number",
+ default: 0.5,
+ min: 0,
+ max: 1.5,
+ step: 0.05,
+ label: "Aberration",
+ },
+ direction: {
+ type: "select",
+ default: "reveal",
+ options: ["reveal", "up", "down", "left", "right"],
+ label: "Direction",
+ },
+ stagger: {
+ type: "number",
+ default: 0.55,
+ min: 0,
+ max: 0.9,
+ step: 0.05,
+ label: "Stagger",
+ },
+ },
+ durationInFrames: 84,
+ fps: FPS,
+ compositionWidth: W,
+ compositionHeight: H,
+ previewBackdrop: { type: "color", value: "#0a0a0a" },
+ snippet: particleDissolveExampleCode,
+};
diff --git a/registry/remocn/particle-dissolve/index.tsx b/registry/remocn/particle-dissolve/index.tsx
new file mode 100644
index 00000000..bb77ca02
--- /dev/null
+++ b/registry/remocn/particle-dissolve/index.tsx
@@ -0,0 +1,223 @@
+"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 ParticleDissolveDirection =
+ | "reveal"
+ | "up"
+ | "down"
+ | "left"
+ | "right";
+
+export type ParticleDissolveProps = {
+ particleSize?: number;
+ scatter?: number;
+ shimmer?: number;
+ aberration?: number;
+ direction?: ParticleDissolveDirection;
+ stagger?: number;
+};
+
+const DEFAULTS = {
+ particleSize: 4,
+ scatter: 0.08,
+ shimmer: 0.6,
+ aberration: 0.5,
+ direction: "reveal" as ParticleDissolveDirection,
+ stagger: 0.55,
+};
+
+const AXES: Record<ParticleDissolveDirection, [number, number]> = {
+ reveal: [0, 0],
+ up: [0, -1],
+ down: [0, 1],
+ left: [-1, 0],
+ right: [1, 0],
+};
+
+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 float u_cells;
+uniform float u_scatter;
+uniform float u_shimmer;
+uniform float u_aberration;
+uniform float u_stagger;
+uniform vec2 u_dir;
+uniform float u_radial;
+
+in vec2 v_uv;
+out vec4 outColor;
+
+const float PI = 3.141592653589793;
+
+float hash(vec2 p) {
+ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
+}
+
+float noise(vec2 p) {
+ vec2 i = floor(p);
+ vec2 f = fract(p);
+ vec2 u = f * f * (3.0 - 2.0 * f);
+ return mix(
+ mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),
+ mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x),
+ u.y
+ );
+}
+
+float fbm(vec2 p) {
+ float sum = 0.0;
+ float amp = 0.5;
+ for (int i = 0; i < 4; i++) {
+ sum += noise(p) * amp;
+ p *= 2.03;
+ amp *= 0.5;
+ }
+ return sum * 1.0667;
+}
+
+float luma(vec3 c) {
+ return dot(c, vec3(0.2126, 0.7152, 0.0722));
+}
+
+vec4 grab(sampler2D tex, vec2 uv, vec2 dir, float amount) {
+ vec4 centre = texture(tex, uv);
+ float r = texture(tex, uv + dir * amount).r;
+ float b = texture(tex, uv - dir * amount).b;
+ return vec4(r, centre.g, b, centre.a);
+}
+
+void main() {
+ vec2 grid = vec2(u_cells * u_aspect, u_cells);
+ vec2 skewed = vec2(v_uv.x * u_aspect, v_uv.y);
+ vec2 centred = skewed - vec2(0.5 * u_aspect, 0.5);
+
+ float spatial = u_radial > 0.5
+ ? clamp(length(centred) / 0.62, 0.0, 1.0)
+ : clamp(dot(v_uv - 0.5, u_dir) + 0.5, 0.0, 1.0);
+ float blob = fbm(skewed * 2.2);
+ float order = mix(blob, spatial, 0.55) * u_stagger;
+ float span = max(1.0 - u_stagger, 0.08);
+ float phase = clamp((u_progress - order) / span, 0.0, 1.0);
+ float dust = sin(phase * PI);
+
+ vec2 flow = vec2(
+ fbm(skewed * 3.0 + vec2(0.0, u_progress * 0.8)),
+ fbm(skewed * 3.0 + vec2(5.3, 2.7 - u_progress * 0.7))
+ ) - 0.5;
+ vec2 aim =
+ flow * 2.0 + normalize(centred + 0.0001) * 0.7 * u_radial + u_dir;
+ vec2 heading = aim / max(length(aim), 0.0001);
+
+ float bright = luma(texture(u_from, v_uv).rgb);
+ float travel = u_scatter * dust * (0.18 + bright * 1.25);
+ vec2 drift = vec2(heading.x / u_aspect, heading.y) * travel;
+
+ float split = u_aberration * dust * 0.35;
+ vec4 leaving = grab(u_from, v_uv - drift, drift, split);
+ vec4 arriving = grab(u_to, v_uv + drift, -drift, split);
+
+ vec4 base = mix(leaving, arriving, smoothstep(0.25, 0.75, phase));
+ base.rgb = mix(base.rgb, vec3(luma(base.rgb)), dust);
+ base.rgb *= 1.0 - dust * 0.25;
+
+ vec2 g = (v_uv - drift) * grid;
+ vec2 origin = floor(g);
+ float cover = 0.0;
+ float light = 0.0;
+ for (int oy = -1; oy <= 1; oy++) {
+ for (int ox = -1; ox <= 1; ox++) {
+ vec2 cell = origin + vec2(float(ox), float(oy));
+ vec2 jitter = vec2(hash(cell + 3.1), hash(cell + 8.7));
+ float mote = hash(cell + 13.7);
+ float twinkle =
+ 0.5 + 0.5 * sin(u_progress * (12.0 + mote * 30.0) + mote * 6.2831);
+ float radius =
+ (0.36 + 0.46 * hash(cell + 21.3)) * (0.65 + 0.6 * twinkle);
+ float reach = length(g - (cell + jitter));
+ float hit = 1.0 - smoothstep(radius * 0.45, radius, reach);
+ cover = max(cover, hit);
+ light = max(light, hit * mote * twinkle);
+ }
+ }
+ cover = mix(1.0, cover, dust);
+ light *= dust;
+
+ vec4 speck = vec4(
+ base.rgb + vec3(0.36 * light * u_shimmer) * base.a,
+ base.a
+ );
+ vec4 gap = vec4(base.rgb * (1.0 - dust * 0.6), base.a);
+ outColor = mix(gap, speck, cover);
+}`;
+
+const shader = makeSceneShader<ParticleDissolveProps>(
+ FRAGMENT_SHADER,
+ ({ gl, uniform, height, passedProps }) => {
+ const {
+ particleSize = DEFAULTS.particleSize,
+ scatter = DEFAULTS.scatter,
+ shimmer = DEFAULTS.shimmer,
+ aberration = DEFAULTS.aberration,
+ direction = DEFAULTS.direction,
+ stagger = DEFAULTS.stagger,
+ } = passedProps;
+ const axis = AXES[direction] ?? AXES[DEFAULTS.direction];
+ gl.uniform1f(uniform("u_cells"), height / Math.max(particleSize, 1));
+ gl.uniform1f(uniform("u_scatter"), scatter);
+ gl.uniform1f(uniform("u_shimmer"), shimmer);
+ gl.uniform1f(uniform("u_aberration"), aberration);
+ gl.uniform1f(uniform("u_stagger"), Math.min(Math.max(stagger, 0), 0.92));
+ gl.uniform2f(uniform("u_dir"), axis[0], axis[1]);
+ gl.uniform1f(uniform("u_radial"), direction === "reveal" ? 1 : 0);
+ },
+);
+
+const ParticleDissolveFallback: React.FC<
+ TransitionPresentationComponentProps<ParticleDissolveProps>
+> = ({ children, presentationProgress, presentationDirection }) => {
+ const p = presentationProgress;
+ const entering = presentationDirection === "entering";
+ const t = entering ? p : 1 - p;
+ const settle = Math.min(1, Math.max(0, (t - 0.2) / 0.6));
+ const grain = 1 - settle;
+
+ return (
+ <AbsoluteFill
+ style={{
+ opacity: settle,
+ filter:
+ grain > 0.02
+ ? `blur(${grain * 10}px) saturate(${1 - grain * 0.9}) contrast(${1 + grain * 0.5})`
+ : undefined,
+ }}
+ >
+ {children}
+ </AbsoluteFill>
+ );
+};
+
+const presentation = makeCanvasPresentation<ParticleDissolveProps>({
+ shader,
+ fallback: ParticleDissolveFallback,
+});
+
+export function particleDissolve(
+ props: ParticleDissolveProps = {},
+): TransitionPresentation<ParticleDissolveProps> {
+ return presentation(props);
+}
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index 6359470d..72dd5ff3 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -1659,6 +1659,21 @@
}
]
},
+ {
+ "name": "particle-dissolve",
+ "type": "registry:component",
+ "title": "Particle Dissolve",
+ "description": "The frame is ground into drifting grey dust whose specks carry real fragments of the picture, and the next scene coalesces back out of the same dust.",
+ "dependencies": ["remotion", "@remotion/transitions"],
+ "registryDependencies": ["@remocn/canvas-presentation"],
+ "files": [
+ {
+ "path": "particle-dissolve/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/particle-dissolve.tsx"
+ }
+ ]
+ },
{
"name": "glitch-cut",
"type": "registry:component",
diff --git a/src/remotion/canvas-spike-root.tsx b/src/remotion/canvas-spike-root.tsx
index 4b9b29a1..74b5a7eb 100644
--- a/src/remotion/canvas-spike-root.tsx
+++ b/src/remotion/canvas-spike-root.tsx
@@ -8,9 +8,11 @@ import {
} from "remotion";
import { EmberBurnExampleScene } from "@/components/docs/examples/ember-burn-example";
import { GlitchCutExampleScene } from "@/components/docs/examples/glitch-cut-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 { particleDissolveConfig } from "@/registry/remocn/particle-dissolve/config";
const { fontFamily: GEIST } = loadFont();
@@ -27,6 +29,10 @@ const SCENES: Record<
> = {
"glitch-cut": { Scene: GlitchCutExampleScene, config: glitchCutConfig },
"ember-burn": { Scene: EmberBurnExampleScene, config: emberBurnConfig },
+ "particle-dissolve": {
+ Scene: ParticleDissolveExampleScene,
+ config: particleDissolveConfig,
+ },
};
function makeStage(Scene: ComponentType) {