Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: shader simplex noise
dev_wandrybcca34fd7d6f
diff --git a/content/docs/shaders/index.mdx b/content/docs/shaders/index.mdxindex 1cf46d18..d4697e54 100644--- a/content/docs/shaders/index.mdx+++ b/content/docs/shaders/index.mdx@@ -85,5 +85,11 @@ Powered by [paper-design/shaders](https://github.com/paper-design/shaders) (Apacstatus: "stable",href: "/docs/shaders/shader-perlin-noise",},+ {+ name: "ShaderSimplexNoise",+ description: "Simplex noise flow field, smoother than Perlin",+ status: "stable",+ href: "/docs/shaders/shader-simplex-noise",+ },]}/>diff --git a/content/docs/shaders/meta.json b/content/docs/shaders/meta.jsonindex cfab00d6..e9de188c 100644--- a/content/docs/shaders/meta.json+++ b/content/docs/shaders/meta.json@@ -12,6 +12,7 @@"shader-liquid-metal","shader-color-panels","shader-neuro-noise",- "shader-perlin-noise"+ "shader-perlin-noise",+ "shader-simplex-noise"]}diff --git a/content/docs/shaders/shader-simplex-noise.mdx b/content/docs/shaders/shader-simplex-noise.mdxnew file mode 100644index 00000000..f7aad0e7--- /dev/null+++ b/content/docs/shaders/shader-simplex-noise.mdx@@ -0,0 +1,37 @@+---+title: Shader Simplex Noise+description: Simplex noise flow field, smoother than Perlin+---++<ComponentPreview name="shader-simplex-noise" />++## Installation++<InstallBlock name="shader-simplex-noise" />++## Usage++```tsx+// src/Root.tsx+import { Composition } from "remotion";+import { ShaderSimplexNoise } from "@/components/remocn/shader-simplex-noise";++const ShaderSimplexNoiseScene = () => (+ <ShaderSimplexNoise speed={1} stepsPerColor={2} softness={0.1} />+);++export const RemotionRoot = () => (+ <Composition+ id="ShaderSimplexNoise"+ component={ShaderSimplexNoiseScene}+ 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 ec5325b5..15c8311c 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -93,6 +93,8 @@ import { ShaderNeuroNoise } from "@/registry/remocn/shader-neuro-noise";import { shaderNeuroNoiseConfig } from "@/registry/remocn/shader-neuro-noise/config";import { ShaderPerlinNoise } from "@/registry/remocn/shader-perlin-noise";import { shaderPerlinNoiseConfig } from "@/registry/remocn/shader-perlin-noise/config";+import { ShaderSimplexNoise } from "@/registry/remocn/shader-simplex-noise";+import { shaderSimplexNoiseConfig } from "@/registry/remocn/shader-simplex-noise/config";import { ShaderSpiral } from "@/registry/remocn/shader-spiral";import { shaderSpiralConfig } from "@/registry/remocn/shader-spiral/config";import { ShaderSwirl } from "@/registry/remocn/shader-swirl";@@ -368,6 +370,10 @@ const registry: Record<string, RegistryEntry> = {Component: ShaderPerlinNoise,config: shaderPerlinNoiseConfig,},+ "shader-simplex-noise": {+ Component: ShaderSimplexNoise,+ config: shaderSimplexNoiseConfig,+ },"dynamic-grid": { Component: DynamicGrid, config: dynamicGridConfig },"simulated-cursor": {Component: SimulatedCursor,diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex 52892927..e903f1b6 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -647,6 +647,22 @@}]},+ {+ "name": "shader-simplex-noise",+ "type": "registry:component",+ "title": "Shader Simplex Noise",+ "description": "Simplex noise flow field, smoother than Perlin.",+ "dependencies": [+ "@paper-design/shaders-react"+ ],+ "files": [+ {+ "path": "shader-simplex-noise/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/shader-simplex-noise.tsx"+ }+ ]+ },{"name": "dynamic-grid","type": "registry:component",diff --git a/registry/remocn/shader-simplex-noise/config.ts b/registry/remocn/shader-simplex-noise/config.tsnew file mode 100644index 00000000..ed873162--- /dev/null+++ b/registry/remocn/shader-simplex-noise/config.ts@@ -0,0 +1,36 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const shaderSimplexNoiseConfig: ComponentConfig = {+ componentName: "ShaderSimplexNoise",+ importPath: "@/components/remocn/shader-simplex-noise",+ controls: {+ speed: {+ type: "number",+ default: 1,+ min: 0.1,+ max: 4,+ step: 0.1,+ label: "Speed",+ },+ stepsPerColor: {+ type: "number",+ default: 2,+ min: 1,+ max: 6,+ step: 1,+ label: "Steps",+ },+ softness: {+ type: "number",+ default: 0.1,+ min: 0,+ max: 1,+ step: 0.05,+ label: "Softness",+ },+ },+ durationInFrames: 150,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+};diff --git a/registry/remocn/shader-simplex-noise/index.tsx b/registry/remocn/shader-simplex-noise/index.tsxnew file mode 100644index 00000000..10c1fabd--- /dev/null+++ b/registry/remocn/shader-simplex-noise/index.tsx@@ -0,0 +1,61 @@+"use client";++import {+ SimplexNoise,+ type SimplexNoiseProps,+} from "@paper-design/shaders-react";+import { useCallback, useState } from "react";+import {+ continueRender,+ delayRender,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++const NEUTRAL_COLORS = ["#12121a", "#3a3a5c", "#52527a", "#8a8a95"];++export interface ShaderSimplexNoiseProps+ extends Omit<SimplexNoiseProps, "frame" | "ref"> {}++export function ShaderSimplexNoise({+ speed = 1,+ colors = NEUTRAL_COLORS,+ stepsPerColor = 2,+ softness = 0.1,+ className,+ ...rest+}: ShaderSimplexNoiseProps) {+ const frame = useCurrentFrame();+ const { fps, width, height } = useVideoConfig();++ const [handle] = useState(() => delayRender("shader-simplex-noise"));+ 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 }}+ >+ <SimplexNoise+ speed={0}+ frame={(frame / fps) * speed * 1000}+ colors={colors}+ stepsPerColor={stepsPerColor}+ softness={softness}+ fit="cover"+ width={width}+ height={height}+ {...rest}+ />+ </div>+ );+}