Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: shader grain gradient
dev_wandry3b44847160da
diff --git a/content/docs/shaders/index.mdx b/content/docs/shaders/index.mdxindex 2168cdef..5083a931 100644--- a/content/docs/shaders/index.mdx+++ b/content/docs/shaders/index.mdx@@ -17,5 +17,11 @@ Powered by [paper-design/shaders](https://github.com/paper-design/shaders) (Apacstatus: "stable",href: "/docs/shaders/shader-mesh-gradient",},+ {+ name: "ShaderGrainGradient",+ description: "Grainy multi-stop gradient that drifts slowly with film-grain texture over the blend",+ status: "stable",+ href: "/docs/shaders/shader-grain-gradient",+ },]}/>diff --git a/content/docs/shaders/meta.json b/content/docs/shaders/meta.jsonindex 6bb1a83d..ce918565 100644--- a/content/docs/shaders/meta.json+++ b/content/docs/shaders/meta.json@@ -1,5 +1,5 @@{"title": "Shaders","collapsible": false,- "pages": ["index", "shader-mesh-gradient"]+ "pages": ["index", "shader-mesh-gradient", "shader-grain-gradient"]}diff --git a/content/docs/shaders/shader-grain-gradient.mdx b/content/docs/shaders/shader-grain-gradient.mdxnew file mode 100644index 00000000..8ed10b4c--- /dev/null+++ b/content/docs/shaders/shader-grain-gradient.mdx@@ -0,0 +1,37 @@+---+title: Shader Grain Gradient+description: Grainy multi-stop gradient that drifts slowly with film-grain texture over the blend+---++<ComponentPreview name="shader-grain-gradient" />++## Installation++<InstallBlock name="shader-grain-gradient" />++## Usage++```tsx+// src/Root.tsx+import { Composition } from "remotion";+import { ShaderGrainGradient } from "@/components/remocn/shader-grain-gradient";++const ShaderGrainGradientScene = () => (+ <ShaderGrainGradient speed={1} intensity={0.2} noise={0.15} />+);++export const RemotionRoot = () => (+ <Composition+ id="ShaderGrainGradient"+ component={ShaderGrainGradientScene}+ durationInFrames={150}+ fps={30}+ width={1280}+ height={720}+ />+);+```++## Credits++Shader by [paper-design/shaders](https://github.com/paper-design/shaders) (Apache-2.0).diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex ff347986..f69f8b76 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -81,6 +81,8 @@ import { MatrixDecode } from "@/registry/remocn/matrix-decode";import { matrixDecodeConfig } from "@/registry/remocn/matrix-decode/config";import { MeshGradientBg } from "@/registry/remocn/mesh-gradient-bg";import { meshGradientBgConfig } from "@/registry/remocn/mesh-gradient-bg/config";+import { ShaderGrainGradient } from "@/registry/remocn/shader-grain-gradient";+import { shaderGrainGradientConfig } from "@/registry/remocn/shader-grain-gradient/config";import { ShaderMeshGradient } from "@/registry/remocn/shader-mesh-gradient";import { shaderMeshGradientConfig } from "@/registry/remocn/shader-mesh-gradient/config";import { NumberWheel } from "@/registry/remocn/number-wheel";@@ -314,6 +316,10 @@ const registry: Record<string, RegistryEntry> = {Component: ShaderMeshGradient,config: shaderMeshGradientConfig,},+ "shader-grain-gradient": {+ Component: ShaderGrainGradient,+ config: shaderGrainGradientConfig,+ },"dynamic-grid": { Component: DynamicGrid, config: dynamicGridConfig },"simulated-cursor": {Component: SimulatedCursor,diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex 0e620d81..32cb70b2 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -503,6 +503,22 @@}]},+ {+ "name": "shader-grain-gradient",+ "type": "registry:component",+ "title": "Shader Grain Gradient",+ "description": "Grainy multi-stop gradient that drifts slowly with film-grain texture over the blend.",+ "dependencies": [+ "@paper-design/shaders-react"+ ],+ "files": [+ {+ "path": "shader-grain-gradient/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/shader-grain-gradient.tsx"+ }+ ]+ },{"name": "dynamic-grid","type": "registry:component",diff --git a/registry/remocn/shader-grain-gradient/config.ts b/registry/remocn/shader-grain-gradient/config.tsnew file mode 100644index 00000000..82e2c897--- /dev/null+++ b/registry/remocn/shader-grain-gradient/config.ts@@ -0,0 +1,45 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const shaderGrainGradientConfig: ComponentConfig = {+ componentName: "ShaderGrainGradient",+ importPath: "@/components/remocn/shader-grain-gradient",+ controls: {+ speed: {+ type: "number",+ default: 1,+ min: 0.1,+ max: 4,+ step: 0.1,+ label: "Speed",+ },+ softness: {+ type: "number",+ default: 0.6,+ min: 0,+ max: 1,+ step: 0.05,+ label: "Softness",+ },+ intensity: {+ type: "number",+ default: 0.2,+ min: 0,+ max: 1,+ step: 0.05,+ label: "Intensity",+ },+ noise: {+ type: "number",+ default: 0.15,+ min: 0,+ max: 1,+ step: 0.05,+ label: "Noise",+ },+ colorBack: { type: "color", default: "#12121a", label: "Background" },+ },+ durationInFrames: 150,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+};diff --git a/registry/remocn/shader-grain-gradient/index.tsx b/registry/remocn/shader-grain-gradient/index.tsxnew file mode 100644index 00000000..9ed7865d--- /dev/null+++ b/registry/remocn/shader-grain-gradient/index.tsx@@ -0,0 +1,63 @@+"use client";++import {+ GrainGradient,+ type GrainGradientProps,+} from "@paper-design/shaders-react";+import { useCallback, useState } from "react";+import {+ continueRender,+ delayRender,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++const NEUTRAL_COLORS = ["#3a3a52", "#4a4a68", "#5a5a7e"];++export interface ShaderGrainGradientProps+ extends Omit<GrainGradientProps, "frame" | "ref"> {}++export function ShaderGrainGradient({+ speed = 1,+ colors = NEUTRAL_COLORS,+ colorBack = "#12121a",+ softness = 0.6,+ intensity = 0.2,+ noise = 0.15,+ className,+ ...rest+}: ShaderGrainGradientProps) {+ const frame = useCurrentFrame();+ const { fps } = useVideoConfig();++ const [handle] = useState(() => delayRender("shader-grain-gradient"));+ const gate = useCallback(+ (element: HTMLDivElement | null) => {+ if (!element) return;+ requestAnimationFrame(() =>+ requestAnimationFrame(() => continueRender(handle)),+ );+ },+ [handle],+ );++ return (+ <div+ ref={gate}+ className={className}+ style={{ position: "absolute", inset: 0 }}+ >+ <GrainGradient+ speed={0}+ frame={(frame / fps) * speed * 1000}+ colors={colors}+ colorBack={colorBack}+ softness={softness}+ intensity={intensity}+ noise={noise}+ style={{ width: "100%", height: "100%" }}+ {...rest}+ />+ </div>+ );+}