Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: hologram
kapishdimad62ee6658aa7
diff --git a/components/docs/examples/hologram-example.tsx b/components/docs/examples/hologram-example.tsxnew file mode 100644index 00000000..0bbfe6f2--- /dev/null+++ b/components/docs/examples/hologram-example.tsx@@ -0,0 +1,55 @@+"use client";++import { CanvasSceneA } from "@/components/docs/examples/canvas-scenes";+import { Hologram } from "@/registry/remocn/hologram";++interface HologramExampleProps {+ tint?: string;+ glow?: number;+ ghost?: number;+ flicker?: number;+ intensity?: number;+}++export function HologramExampleScene({+ tint,+ glow,+ ghost,+ flicker,+ intensity,+}: HologramExampleProps) {+ return (+ <Hologram+ tint={tint}+ glow={glow}+ ghost={ghost}+ flicker={flicker}+ intensity={intensity}+ >+ <CanvasSceneA />+ </Hologram>+ );+}++export const hologramExampleCode = (+ values: Record<string, unknown>,+): string => {+ const tint = (values.tint as string) ?? "#63e8ff";+ const glow = (values.glow as number) ?? 1;+ const ghost = (values.ghost as number) ?? 1;+ const flicker = (values.flicker as number) ?? 1;+ const intensity = (values.intensity as number) ?? 1;+ return `import { Hologram } from "@/components/remocn/hologram";++export const MyScene = () => (+ <Hologram+ tint="${tint}"+ glow={${glow}}+ ghost={${ghost}}+ flicker={${flicker}}+ intensity={${intensity}}+ >+ <Scene />+ </Hologram>+);`;+};diff --git a/components/docs/examples/hologram-recipes.tsx b/components/docs/examples/hologram-recipes.tsxnew file mode 100644index 00000000..701d6bf6--- /dev/null+++ b/components/docs/examples/hologram-recipes.tsx@@ -0,0 +1,243 @@+"use client";++import type React from "react";+import { AbsoluteFill, interpolate, useCurrentFrame } from "remotion";+import { CanvasSceneA } from "@/components/docs/examples/canvas-scenes";+import { Hologram } from "@/registry/remocn/hologram";++const MONO =+ "var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace";++const LINE = "#7ff2ff";+const SHELL = "#040a12";+const CYCLE = 90;++const OUTLINE = `polygon(+ 0% 7%, 3% 1%, 30% 1%, 33% 6%, 68% 6%, 71% 0%, 95% 0%, 100% 6%,+ 100% 66%, 96% 72%, 96% 100%, 34% 100%, 31% 94%, 3% 94%, 0% 88%+)`;++const HATCH = `repeating-linear-gradient(+ 115deg,+ ${LINE} 0px,+ ${LINE} 5px,+ transparent 5px,+ transparent 12px+)`;++const DIAL_TICKS = Array.from({ length: 24 }, (_, i) => (i / 24) * 360);++function HudDial({+ size,+ style,+}: {+ size: number;+ style: React.CSSProperties;+}) {+ return (+ <div style={{ position: "absolute", width: size, height: size, ...style }}>+ <div+ style={{+ position: "absolute",+ inset: 0,+ borderRadius: "50%",+ border: `2px solid ${LINE}`,+ }}+ />+ {DIAL_TICKS.map((angle) => (+ <div+ key={angle}+ style={{+ position: "absolute",+ left: "50%",+ top: "50%",+ width: 2,+ height: size * 0.42,+ marginLeft: -1,+ transformOrigin: "top center",+ transform: `rotate(${angle}deg)`,+ borderBottom: `${size * 0.11}px solid ${LINE}`,+ }}+ />+ ))}+ <div+ style={{+ position: "absolute",+ inset: "34%",+ borderRadius: "50%",+ border: `3px solid ${LINE}`,+ borderRightColor: "transparent",+ borderBottomColor: "transparent",+ }}+ />+ </div>+ );+}++export function HudFrame({ children }: { children: React.ReactNode }) {+ const frame = useCurrentFrame();+ const sweep = Math.floor((frame / CYCLE) * 10) % 10;++ return (+ <AbsoluteFill style={{ background: SHELL, fontFamily: MONO }}>+ <div+ style={{+ position: "absolute",+ inset: 30,+ background: LINE,+ clipPath: OUTLINE,+ }}+ >+ <div+ style={{+ position: "absolute",+ inset: 3,+ background: SHELL,+ clipPath: OUTLINE,+ }}+ />+ </div>++ <div+ style={{+ position: "absolute",+ left: "72%",+ top: 44,+ width: "18%",+ height: 22,+ background: HATCH,+ }}+ />+ <div+ style={{+ position: "absolute",+ left: "10%",+ bottom: 62,+ width: "22%",+ height: 14,+ background: HATCH,+ }}+ />+ <div+ style={{+ position: "absolute",+ left: "36%",+ bottom: 62,+ width: "26%",+ height: 6,+ background: LINE,+ opacity: 0.55,+ }}+ />++ <HudDial size={132} style={{ right: 58, bottom: 46 }} />++ <span+ style={{+ position: "absolute",+ left: "11%",+ top: 46,+ fontSize: 22,+ letterSpacing: "0.22em",+ color: LINE,+ }}+ >+ RELAY 07 · FEED LIVE+ </span>+ <span+ style={{+ position: "absolute",+ right: "24%",+ bottom: 54,+ fontSize: 20,+ letterSpacing: "0.2em",+ color: LINE,+ }}+ >+ SYNC 9{sweep}%+ </span>++ <div style={{ position: "absolute", inset: "15% 17% 20% 10%" }}>+ {children}+ </div>+ </AbsoluteFill>+ );+}++const CONSOLE_ROWS = [+ { key: "FRAMES", value: "2481 / 2481" },+ { key: "DURATION", value: "00:01:22:14" },+ { key: "OUTPUT", value: "intro-scene.mp4" },+];++function ConsoleReadout() {+ return (+ <AbsoluteFill+ style={{ fontFamily: MONO, justifyContent: "center", color: LINE }}+ >+ <span style={{ fontSize: 26, letterSpacing: "0.32em", color: LINE }}>+ INBOUND TRANSMISSION+ </span>+ <span+ style={{+ marginTop: 22,+ fontSize: 104,+ fontWeight: 500,+ letterSpacing: "0.02em",+ lineHeight: 1,+ color: "#e8fdff",+ }}+ >+ RENDER COMPLETE+ </span>+ <div+ style={{+ marginTop: 40,+ paddingTop: 32,+ borderTop: `1px solid ${LINE}`,+ display: "flex",+ gap: 72,+ }}+ >+ {CONSOLE_ROWS.map((row) => (+ <div+ key={row.key}+ style={{ display: "flex", flexDirection: "column", gap: 12 }}+ >+ <span+ style={{ fontSize: 20, letterSpacing: "0.2em", opacity: 0.65 }}+ >+ {row.key}+ </span>+ <span style={{ fontSize: 34, color: "#e8fdff" }}>{row.value}</span>+ </div>+ ))}+ </div>+ </AbsoluteFill>+ );+}++export function HologramConsoleExampleScene() {+ return (+ <Hologram>+ <HudFrame>+ <ConsoleReadout />+ </HudFrame>+ </Hologram>+ );+}++export function HologramBootExampleScene() {+ const frame = useCurrentFrame();+ const unstable = interpolate(frame, [0, 34, 76, 96], [1, 0, 0, 1]);++ return (+ <Hologram+ ghost={1 + unstable * 3.6}+ flicker={1 + unstable * 2.6}+ glow={1 + unstable * 0.8}+ >+ <CanvasSceneA />+ </Hologram>+ );+}diff --git a/components/docs/examples/index.tsx b/components/docs/examples/index.tsxindex 2ce17029..f172ec65 100644--- a/components/docs/examples/index.tsx+++ b/components/docs/examples/index.tsx@@ -50,6 +50,10 @@ import {HalftoneRegisterExampleScene,HalftoneResolveExampleScene,} from "./halftone-print-recipes";+import {+ HologramBootExampleScene,+ HologramConsoleExampleScene,+} from "./hologram-recipes";import { InputExampleScene, inputExampleCode } from "./input-example";import {MessageBubbleExampleScene,@@ -534,6 +538,25 @@ export const examples: Record<string, ExampleEntry> = {height: H,previewBackdrop: { type: "color", value: "#0a0a0a" },},+ "hologram-console-example": {+ Component: HologramConsoleExampleScene,+ code: "<Hologram><HudFrame><Scene /></HudFrame></Hologram>",+ durationInFrames: 90,+ fps: FPS,+ width: W,+ height: H,+ previewBackdrop: { type: "color", value: "#04070d" },+ },+ "hologram-boot-example": {+ Component: HologramBootExampleScene,+ code: "<Hologram ghost={ghost} flicker={flicker} />",+ // Instability settles by frame 34, holds, then returns so the loop closes.+ durationInFrames: 96,+ fps: FPS,+ width: W,+ height: H,+ previewBackdrop: { type: "color", value: "#04070d" },+ },"security-cold-open-example": {Component: SecurityColdOpenExampleScene,code: "<SecurityCam intensity={intensity} />",diff --git a/content/changelog/2026-08-02-filters-optics.mdx b/content/changelog/2026-08-02-filters-optics.mdxindex a2ef44c7..07beab3d 100644--- a/content/changelog/2026-08-02-filters-optics.mdx+++ b/content/changelog/2026-08-02-filters-optics.mdx@@ -13,6 +13,8 @@ The first seven filters were looks you put on a scene deliberately — tape, a t- [Security Cam](/docs/filters/components/security-cam) — a scene run through a cheap recorder. Macroblocks flatten where the bitrate could not keep up, colour collapses onto blocks twice the size of the brightness blocks, blacks crush, the exposure hunts and noise crawls in the shadows. The obvious build was a fisheye plus desaturation and it was a trap: bending the frame is what a tube does, and a filter whose identity is a warp reads as `crt-screen` with the scanlines missing. What makes footage look like surveillance is the codec, not the lens — so that is what this is, and `camera-lens` still has a `distortion` prop if you want the wide-angle bow feeding it.+- [Hologram](/docs/filters/components/hologram) — a scene played as projected light. Edges of shapes emit, bright areas throw a halo into what surrounds them, a doubled image shimmers off the original and individual scanlines slip sideways. Tinting a frame and adding lines gets you nowhere near it — three of the four signatures need to read what is *next to* a pixel, which is the whole reason it lives in this category. Build the console it projects from as ordinary DOM, put your scene inside it, and wrap the lot: the thin lines of a HUD are exactly what the edge emission has to work with.+### Improvements- The filters that could be mistaken for each other are now split by what they are, not by how they look. `crt-screen` is a tube you watch — uniformly sharp behind a mask. `camera-lens` is glass you shoot through — sharp in one place and losing resolution everywhere else. `vhs-filter` is the signal arriving. Each one's `avoidWhen` names the others, so an agent picking a treatment cannot stack two that tell the same story.diff --git a/content/docs/filters/components/crt-screen.mdx b/content/docs/filters/components/crt-screen.mdxindex f02fb274..b23bee2e 100644--- a/content/docs/filters/components/crt-screen.mdx+++ b/content/docs/filters/components/crt-screen.mdx@@ -11,6 +11,7 @@ useWhen:avoidWhen:- "The story is worn tape rather than a monitor — use `vhs-filter`, which degrades the signal instead of the display."- "You want the scene to read as photographed rather than displayed — use `camera-lens`, which loses resolution toward the corners and blooms highlights instead of masking the picture."+ - "The image should stand in the air as light rather than sit on a physical surface — use `hologram`."- "Content sits close to the frame edge, since the barrel warp pushes the corners past the picture and they fall into the rim."---diff --git a/content/docs/filters/components/hologram.mdx b/content/docs/filters/components/hologram.mdxnew file mode 100644index 00000000..2e82f0ef--- /dev/null+++ b/content/docs/filters/components/hologram.mdx@@ -0,0 +1,158 @@+---+title: Hologram+description: Play a scene as a projection — ghost double, emission lines, only the bright parts carrying+component: hologram+vibe: tech+length: sustained+useWhen:+ - "A feature should present as a projection rather than as a screen — a sci-fi flavoured reveal, a 'here is what is coming' beat."+ - "The scene is high contrast, since only what is bright enough carries through the volume the projection hangs in."+ - "You want the projection to materialize on entry — interpolate intensity from 0 and the scene resolves into light."+avoidWhen:+ - "The story is a physical display being watched rather than light standing in the air — use `crt-screen`."+ - "You want damage rather than projection — use `sustained-glitch`."+---++<ComponentPreview name="hologram" />++<CanvasFilterNote />++## Installation++<InstallBlock name="hologram" />++## Usage++`Hologram` is a wrapper. Put a scene inside it and it plays as projected light: a+ghost double shimmers off the image, emission lines structure it, a travelling+crest runs up the frame, and the whole thing leans toward its tint. Only what is+bright enough in the scene carries; the rest sinks into the dark volume the+projection hangs in.++```tsx+import { Hologram } from "@/components/remocn/hologram";++export const MyScene = () => (+ <Hologram>+ <Scene />+ </Hologram>+);+```++## What to reach for it for++### Put it in a console++The filter is only the light. What makes a shot read as a projection is what the+light is coming out of — so build the chrome as ordinary DOM, put your scene+inside it, and wrap the whole thing. The frame's thin lines are exactly what the+edge emission has to work with, which is why a HUD gains far more from this+filter than a flat panel does.++<ComponentExample name="hologram-console" />++```tsx+<Hologram>+ <HudFrame>+ <Scene />+ </HudFrame>+</Hologram>+```++### Boot the projection++A projector that snaps on perfectly is a screen. Let the doubling and the flicker+start wide and settle over the first second and it reads as something being+established rather than switched on.++<ComponentExample name="hologram-boot" />++```tsx+import { interpolate, useCurrentFrame } from "remotion";+import { Hologram } from "@/components/remocn/hologram";++export const Opening = () => {+ const frame = useCurrentFrame();+ const unstable = interpolate(frame, [0, 34], [1, 0], {+ extrapolateRight: "clamp",+ });++ return (+ <Hologram ghost={1 + unstable * 3.6} flicker={1 + unstable * 2.6}>+ <Scene />+ </Hologram>+ );+};+```++To hand the shot back to reality afterwards, cut `intensity` to 0 — the scene+returns exactly as it was, in one frame.++## Props++<PropsTable+ rows={[+ {+ name: "tint",+ type: "string",+ default: '"#63e8ff"',+ description:+ "Colour of the projected light. Almost everything you see is this colour driven by the scene's brightness, so it sets the whole character.",+ },+ {+ name: "glow",+ type: "number",+ default: "1",+ description:+ "Emission strength — both the light that comes off the edges of shapes and the halo bright areas throw into what surrounds them. This is what makes it read as light rather than as a tint.",+ },+ {+ name: "ghost",+ type: "number",+ default: "1",+ description:+ "How unstable the projection is: how far the doubled image sits from the original, and how far individual scanlines slip sideways. Raise it and the projection struggles to hold.",+ },+ {+ name: "flicker",+ type: "number",+ default: "1",+ description:+ "Depth of the brightness pulse, on a 15-frame cycle with a per-frame jitter on top.",+ },+ {+ name: "intensity",+ type: "number",+ default: "1",+ description:+ "Master amount. Read every frame, so cutting it to 0 hands the untouched scene back in a single frame.",+ },+ {+ name: "children",+ type: "React.ReactNode",+ description: "The scene the filter wraps and re-reads every frame.",+ },+ ]}+/>++## Notes++Put your backdrop **inside** the wrapper. A hologram wants to be translucent+light, but this filter cannot be transparent: the untouched scene sits on a layer+directly beneath the output, so anywhere the projection thinned to nothing the+original interface would show through at full strength — which reads as a bug,+not as light. Instead the projection hangs in a dark tinted volume that the filter+paints itself, and what is too dim in the scene sinks into it. Visually it is the+same picture; structurally it means the wrapper owns the background.++That also makes contrast the thing to design for. Only what is bright enough+carries, so a scene of thin bright lines on black — a HUD, a wireframe, mono type+— comes through far better than large filled panels.++The only motion is the flicker and the per-line slip, both on fixed frame cycles+of 15 and one frame respectively, so nothing drifts and parallel renders match.++In browsers without html-in-canvas the scene keeps the tint and the line+structure but loses the edge emission, the halo and the doubling. CSS can colour+a frame; it cannot read what is next to a pixel, which is where three of the four+signatures here come from.diff --git a/content/docs/filters/components/meta.json b/content/docs/filters/components/meta.jsonindex 954ffb7f..059b63eb 100644--- a/content/docs/filters/components/meta.json+++ b/content/docs/filters/components/meta.json@@ -4,6 +4,7 @@"pages": ["camera-lens","security-cam",+ "hologram","vhs-filter","crt-screen","sustained-glitch",diff --git a/content/docs/filters/components/sustained-glitch.mdx b/content/docs/filters/components/sustained-glitch.mdxindex 3fb81f94..f83d09c1 100644--- a/content/docs/filters/components/sustained-glitch.mdx+++ b/content/docs/filters/components/sustained-glitch.mdx@@ -12,6 +12,7 @@ avoidWhen:- "The tearing should happen only at the cut between two scenes — use `glitch-cut`."- "Only a headline should break up while the scene behind it stays intact — use `rgb-glitch-text`."- "You want continuous analog wear rather than intermittent digital faults — use `vhs-filter`."+ - "The instability should read as a projection struggling to hold rather than as damage — use `hologram`."---<ComponentPreview name="sustained-glitch" />diff --git a/registry-artifacts/hologram.json b/registry-artifacts/hologram.jsonnew file mode 100644index 00000000..802cd636--- /dev/null+++ b/registry-artifacts/hologram.json@@ -0,0 +1,17 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "hologram",+ "title": "Hologram",+ "description": "Play a scene as a projection: a ghost double shimmers off the image, emission lines structure it, and only what is bright enough carries through the dark volume it hangs in.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/canvas-presentation"],+ "files": [+ {+ "path": "registry/remocn/hologram/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n type CanvasFilterProps,\n makeCanvasFilter,\n makeFilterShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type HologramProps = {\n tint?: string;\n glow?: number;\n ghost?: number;\n flicker?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n tint: \"#63e8ff\",\n glow: 1,\n ghost: 1,\n flicker: 1,\n intensity: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_aspect;\nuniform float u_frame;\nuniform vec3 u_tint;\nuniform float u_glow;\nuniform float u_ghost;\nuniform float u_flicker;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float TAU = 6.28318530718;\nconst float GOLDEN = 2.39996323;\nconst int HALO_TAPS = 8;\nconst vec3 LUMA = vec3(0.299, 0.587, 0.114);\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453123);\n}\n\nfloat lumaAt(vec2 uv) {\n return dot(texture(u_scene, uv).rgb, LUMA);\n}\n\nvoid main() {\n vec4 src = texture(u_scene, v_uv);\n float amount = clamp(u_intensity, 0.0, 1.0);\n\n if (!(amount > 0.001)) {\n outColor = src;\n return;\n }\n\n float row = floor(v_uv.y * 300.0);\n float clock = floor(u_frame);\n float slip =\n (hash(vec2(row, clock)) - 0.5) * u_ghost * 0.006 * step(0.55, hash(vec2(row, clock + 3.0)));\n vec2 base = vec2(v_uv.x + slip / u_aspect, v_uv.y);\n\n vec4 held = texture(u_scene, base);\n float lit = dot(held.rgb, LUMA);\n\n vec2 apart = vec2(u_ghost * 0.0045 / u_aspect, u_ghost * 0.0035);\n vec3 twin = texture(u_scene, base + apart).rgb;\n\n float step2 = 0.0022;\n float gx =\n lumaAt(base + vec2(step2 / u_aspect, 0.0)) -\n lumaAt(base - vec2(step2 / u_aspect, 0.0));\n float gy = lumaAt(base + vec2(0.0, step2)) - lumaAt(base - vec2(0.0, step2));\n float rim = clamp(length(vec2(gx, gy)) * 7.0, 0.0, 1.0);\n\n vec3 halo = vec3(0.0);\n for (int i = 0; i < HALO_TAPS; i++) {\n float angle = float(i) * GOLDEN;\n float reach = sqrt((float(i) + 0.5) / float(HALO_TAPS)) * u_glow * 0.022;\n vec2 at = base + vec2(cos(angle) * reach / u_aspect, sin(angle) * reach);\n halo += max(texture(u_scene, at).rgb - 0.34, vec3(0.0));\n }\n halo /= float(HALO_TAPS);\n\n vec3 core = u_tint * (0.12 + lit * 1.55);\n core = mix(core, held.rgb * u_tint * 1.9, 0.12);\n core += u_tint * rim * 1.9 * u_glow;\n core += halo * u_tint * 2.4 * u_glow;\n core += twin * u_tint * 0.5 * u_ghost;\n\n float interlace = mod(row, 2.0) < 1.0 ? 1.0 : 0.58;\n core *= interlace;\n\n float blink =\n 1.0 -\n u_flicker *\n (0.04 + 0.05 * hash(vec2(clock, 7.0))) *\n (0.5 + 0.5 * sin(u_frame * TAU / 15.0));\n core *= blink;\n\n float presence = clamp(lit * 1.5 + rim * 0.8 + 0.03, 0.0, 1.0);\n vec3 painted = clamp(u_tint * 0.035 + core * presence, 0.0, 1.0);\n\n outColor = vec4(mix(src.rgb, painted, amount), src.a);\n}`;\n\nfunction toRgb(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)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst shader = makeFilterShader<HologramProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n tint = DEFAULTS.tint,\n glow = DEFAULTS.glow,\n ghost = DEFAULTS.ghost,\n flicker = DEFAULTS.flicker,\n intensity = DEFAULTS.intensity,\n } = passedProps;\n gl.uniform3fv(uniform(\"u_tint\"), toRgb(tint));\n gl.uniform1f(uniform(\"u_glow\"), glow);\n gl.uniform1f(uniform(\"u_ghost\"), ghost);\n gl.uniform1f(uniform(\"u_flicker\"), flicker);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst HologramFallback: React.FC<HologramProps & CanvasFilterProps> = ({\n children,\n tint = DEFAULTS.tint,\n intensity = DEFAULTS.intensity,\n}) => (\n <AbsoluteFill>\n <AbsoluteFill style={{ filter: `saturate(${1 - 0.5 * intensity})` }}>\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"color\",\n opacity: 0.75 * intensity,\n }}\n />\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.32) 0px, rgba(0, 0, 0, 0.32) 2px, transparent 2px, transparent 4px)\",\n opacity: intensity,\n }}\n />\n </AbsoluteFill>\n);\n\nexport const Hologram = makeCanvasFilter<HologramProps>({\n shader,\n fallback: HologramFallback,\n});\n",+ "type": "registry:component",+ "target": "components/remocn/hologram.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/registry.json b/registry-artifacts/registry.jsonindex 8417356c..c8417c64 100644--- a/registry-artifacts/registry.json+++ b/registry-artifacts/registry.json@@ -1674,6 +1674,21 @@],"type": "registry:component"},+ {+ "name": "hologram",+ "title": "Hologram",+ "description": "Play a scene as a projection: a ghost double shimmers off the image, emission lines structure it, and only what is bright enough carries through the dark volume it hangs in.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/canvas-presentation"],+ "files": [+ {+ "path": "registry/remocn/hologram/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/hologram.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "security-cam","title": "Security Cam",diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex bc07a89f..6def4adc 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -37,6 +37,7 @@ import { gridWaveConfig } from "@/registry/remocn/grid-wave/config";import { halftonePrintConfig } from "@/registry/remocn/halftone-print/config";import { handCountConfig } from "@/registry/remocn/hand-count/config";import { handwriteConfig } from "@/registry/remocn/handwrite/config";+import { hologramConfig } from "@/registry/remocn/hologram/config";import { iconScatterConfig } from "@/registry/remocn/icon-scatter/config";import { infiniteBentoPanConfig } from "@/registry/remocn/infinite-bento-pan/config";import { infiniteMarqueeConfig } from "@/registry/remocn/infinite-marquee/config";@@ -1529,6 +1530,13 @@ const registry: Record<string, RegistryEntry> = {})),config: securityCamConfig,},+ hologram: {+ load: () =>+ import("@/components/docs/examples/hologram-example").then((m) => ({+ default: m.HologramExampleScene,+ })),+ config: hologramConfig,+ },"slide-swap": {load: () =>import("@/components/docs/examples/slide-swap-example").then((m) => ({diff --git a/registry/remocn/hologram/config.ts b/registry/remocn/hologram/config.tsnew file mode 100644index 00000000..7c5c621e--- /dev/null+++ b/registry/remocn/hologram/config.ts@@ -0,0 +1,52 @@+import { hologramExampleCode } from "@/components/docs/examples/hologram-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const hologramConfig: ComponentConfig = {+ componentName: "Hologram",+ importPath: "@/components/remocn/hologram",+ controls: {+ tint: {+ type: "color",+ default: "#63e8ff",+ label: "Tint",+ },+ glow: {+ type: "number",+ default: 1,+ min: 0,+ max: 3,+ step: 0.1,+ label: "Glow",+ },+ ghost: {+ type: "number",+ default: 1,+ min: 0,+ max: 3,+ step: 0.1,+ label: "Ghost",+ },+ flicker: {+ type: "number",+ default: 1,+ min: 0,+ max: 3,+ step: 0.1,+ label: "Flicker",+ },+ intensity: {+ type: "number",+ default: 1,+ min: 0,+ max: 1,+ step: 0.05,+ label: "Intensity",+ },+ },+ durationInFrames: 90,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#04070d" },+ snippet: hologramExampleCode,+};diff --git a/registry/remocn/hologram/index.tsx b/registry/remocn/hologram/index.tsxnew file mode 100644index 00000000..b991324c--- /dev/null+++ b/registry/remocn/hologram/index.tsx@@ -0,0 +1,180 @@+"use client";++import type React from "react";+import { AbsoluteFill } from "remotion";+import {+ type CanvasFilterProps,+ makeCanvasFilter,+ makeFilterShader,+} from "@/lib/remocn/canvas-presentation";++export type HologramProps = {+ tint?: string;+ glow?: number;+ ghost?: number;+ flicker?: number;+ intensity?: number;+};++const DEFAULTS = {+ tint: "#63e8ff",+ glow: 1,+ ghost: 1,+ flicker: 1,+ intensity: 1,+};++const FRAGMENT_SHADER = `#version 300 es+precision highp float;++uniform sampler2D u_scene;+uniform float u_aspect;+uniform float u_frame;+uniform vec3 u_tint;+uniform float u_glow;+uniform float u_ghost;+uniform float u_flicker;+uniform float u_intensity;++in vec2 v_uv;+out vec4 outColor;++const float PI = 3.141592653589793;+const float TAU = 6.28318530718;+const float GOLDEN = 2.39996323;+const int HALO_TAPS = 8;+const vec3 LUMA = vec3(0.299, 0.587, 0.114);++float hash(vec2 p) {+ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453123);+}++float lumaAt(vec2 uv) {+ return dot(texture(u_scene, uv).rgb, LUMA);+}++void main() {+ vec4 src = texture(u_scene, v_uv);+ float amount = clamp(u_intensity, 0.0, 1.0);++ if (!(amount > 0.001)) {+ outColor = src;+ return;+ }++ float row = floor(v_uv.y * 300.0);+ float clock = floor(u_frame);+ float slip =+ (hash(vec2(row, clock)) - 0.5) * u_ghost * 0.006 * step(0.55, hash(vec2(row, clock + 3.0)));+ vec2 base = vec2(v_uv.x + slip / u_aspect, v_uv.y);++ vec4 held = texture(u_scene, base);+ float lit = dot(held.rgb, LUMA);++ vec2 apart = vec2(u_ghost * 0.0045 / u_aspect, u_ghost * 0.0035);+ vec3 twin = texture(u_scene, base + apart).rgb;++ float step2 = 0.0022;+ float gx =+ lumaAt(base + vec2(step2 / u_aspect, 0.0)) -+ lumaAt(base - vec2(step2 / u_aspect, 0.0));+ float gy = lumaAt(base + vec2(0.0, step2)) - lumaAt(base - vec2(0.0, step2));+ float rim = clamp(length(vec2(gx, gy)) * 7.0, 0.0, 1.0);++ vec3 halo = vec3(0.0);+ for (int i = 0; i < HALO_TAPS; i++) {+ float angle = float(i) * GOLDEN;+ float reach = sqrt((float(i) + 0.5) / float(HALO_TAPS)) * u_glow * 0.022;+ vec2 at = base + vec2(cos(angle) * reach / u_aspect, sin(angle) * reach);+ halo += max(texture(u_scene, at).rgb - 0.34, vec3(0.0));+ }+ halo /= float(HALO_TAPS);++ vec3 core = u_tint * (0.12 + lit * 1.55);+ core = mix(core, held.rgb * u_tint * 1.9, 0.12);+ core += u_tint * rim * 1.9 * u_glow;+ core += halo * u_tint * 2.4 * u_glow;+ core += twin * u_tint * 0.5 * u_ghost;++ float interlace = mod(row, 2.0) < 1.0 ? 1.0 : 0.58;+ core *= interlace;++ float blink =+ 1.0 -+ u_flicker *+ (0.04 + 0.05 * hash(vec2(clock, 7.0))) *+ (0.5 + 0.5 * sin(u_frame * TAU / 15.0));+ core *= blink;++ float presence = clamp(lit * 1.5 + rim * 0.8 + 0.03, 0.0, 1.0);+ vec3 painted = clamp(u_tint * 0.035 + core * presence, 0.0, 1.0);++ outColor = vec4(mix(src.rgb, painted, amount), src.a);+}`;++function toRgb(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 [1, 1, 1];+ return [+ ((int >> 16) & 255) / 255,+ ((int >> 8) & 255) / 255,+ (int & 255) / 255,+ ];+}++const shader = makeFilterShader<HologramProps>(+ FRAGMENT_SHADER,+ ({ gl, uniform, passedProps }) => {+ const {+ tint = DEFAULTS.tint,+ glow = DEFAULTS.glow,+ ghost = DEFAULTS.ghost,+ flicker = DEFAULTS.flicker,+ intensity = DEFAULTS.intensity,+ } = passedProps;+ gl.uniform3fv(uniform("u_tint"), toRgb(tint));+ gl.uniform1f(uniform("u_glow"), glow);+ gl.uniform1f(uniform("u_ghost"), ghost);+ gl.uniform1f(uniform("u_flicker"), flicker);+ gl.uniform1f(uniform("u_intensity"), intensity);+ },+);++const HologramFallback: React.FC<HologramProps & CanvasFilterProps> = ({+ children,+ tint = DEFAULTS.tint,+ intensity = DEFAULTS.intensity,+}) => (+ <AbsoluteFill>+ <AbsoluteFill style={{ filter: `saturate(${1 - 0.5 * intensity})` }}>+ {children}+ </AbsoluteFill>+ <AbsoluteFill+ style={{+ background: tint,+ mixBlendMode: "color",+ opacity: 0.75 * intensity,+ }}+ />+ <AbsoluteFill+ style={{+ background:+ "repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.32) 0px, rgba(0, 0, 0, 0.32) 2px, transparent 2px, transparent 4px)",+ opacity: intensity,+ }}+ />+ </AbsoluteFill>+);++export const Hologram = makeCanvasFilter<HologramProps>({+ shader,+ fallback: HologramFallback,+});diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex 5e02978e..25de1712 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -1674,6 +1674,21 @@}]},+ {+ "name": "hologram",+ "type": "registry:component",+ "title": "Hologram",+ "description": "Play a scene as a projection: a ghost double shimmers off the image, emission lines structure it, and only what is bright enough carries through the dark volume it hangs in.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/canvas-presentation"],+ "files": [+ {+ "path": "hologram/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/hologram.tsx"+ }+ ]+ },{"name": "security-cam","type": "registry:component",diff --git a/src/remotion/canvas-spike-root.tsx b/src/remotion/canvas-spike-root.tsxindex ff4acaef..a1cea43c 100644--- a/src/remotion/canvas-spike-root.tsx+++ b/src/remotion/canvas-spike-root.tsx@@ -14,6 +14,7 @@ import { EmberBurnExampleScene } from "@/components/docs/examples/ember-burn-exaimport { GlitchCutExampleScene } from "@/components/docs/examples/glitch-cut-example";import { GridWaveExampleScene } from "@/components/docs/examples/grid-wave-example";import { HalftonePrintExampleScene } from "@/components/docs/examples/halftone-print-example";+import { HologramExampleScene } from "@/components/docs/examples/hologram-example";import { ParticleDissolveExampleScene } from "@/components/docs/examples/particle-dissolve-example";import { PixelateRegionExampleScene } from "@/components/docs/examples/pixelate-region-example";import { SecurityCamExampleScene } from "@/components/docs/examples/security-cam-example";@@ -29,6 +30,7 @@ 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 { halftonePrintConfig } from "@/registry/remocn/halftone-print/config";+import { hologramConfig } from "@/registry/remocn/hologram/config";import { particleDissolveConfig } from "@/registry/remocn/particle-dissolve/config";import { pixelateRegionConfig } from "@/registry/remocn/pixelate-region/config";import { securityCamConfig } from "@/registry/remocn/security-cam/config";@@ -81,6 +83,7 @@ const SCENES: Record<},"camera-lens": { Scene: CameraLensExampleScene, config: cameraLensConfig },"security-cam": { Scene: SecurityCamExampleScene, config: securityCamConfig },+ hologram: { Scene: HologramExampleScene, config: hologramConfig },};function makeStage(Scene: ComponentType) {