Skip to content

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

feat: shader smoke ring

dev_wandrye2d9588c33cf
diff --git a/content/docs/shaders/index.mdx b/content/docs/shaders/index.mdx
index a1735fcc..58417d41 100644
--- a/content/docs/shaders/index.mdx
+++ b/content/docs/shaders/index.mdx
@@ -136,5 +136,11 @@ Powered by [paper-design/shaders](https://github.com/paper-design/shaders) (Apac
status: "stable",
href: "/docs/shaders/shader-god-rays",
},
+ {
+ name: "ShaderSmokeRing",
+ description: "Soft smoke ring curling and dissipating in place",
+ status: "stable",
+ href: "/docs/shaders/shader-smoke-ring",
+ },
]}
/>
diff --git a/content/docs/shaders/meta.json b/content/docs/shaders/meta.json
index f67448c4..af7254fb 100644
--- a/content/docs/shaders/meta.json
+++ b/content/docs/shaders/meta.json
@@ -17,6 +17,7 @@
"shader-voronoi",
"shader-dot-orbit",
"shader-dithering",
- "shader-god-rays"
+ "shader-god-rays",
+ "shader-smoke-ring"
]
}
diff --git a/content/docs/shaders/shader-smoke-ring.mdx b/content/docs/shaders/shader-smoke-ring.mdx
new file mode 100644
index 00000000..14c70015
--- /dev/null
+++ b/content/docs/shaders/shader-smoke-ring.mdx
@@ -0,0 +1,37 @@
+---
+title: Shader Smoke Ring
+description: Soft smoke ring curling and dissipating in place
+---
+
+<ComponentPreview name="shader-smoke-ring" />
+
+## Installation
+
+<InstallBlock name="shader-smoke-ring" />
+
+## Usage
+
+```tsx
+// src/Root.tsx
+import { Composition } from "remotion";
+import { ShaderSmokeRing } from "@/components/remocn/shader-smoke-ring";
+
+const ShaderSmokeRingScene = () => (
+ <ShaderSmokeRing speed={1} radius={0.25} thickness={0.65} />
+);
+
+export const RemotionRoot = () => (
+ <Composition
+ id="ShaderSmokeRing"
+ component={ShaderSmokeRingScene}
+ 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__.tsx
index 27f95dea..e5096637 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -91,6 +91,8 @@ import { ShaderDotOrbit } from "@/registry/remocn/shader-dot-orbit";
import { shaderDotOrbitConfig } from "@/registry/remocn/shader-dot-orbit/config";
import { ShaderGodRays } from "@/registry/remocn/shader-god-rays";
import { shaderGodRaysConfig } from "@/registry/remocn/shader-god-rays/config";
+import { ShaderSmokeRing } from "@/registry/remocn/shader-smoke-ring";
+import { shaderSmokeRingConfig } from "@/registry/remocn/shader-smoke-ring/config";
import { ShaderLiquidMetal } from "@/registry/remocn/shader-liquid-metal";
import { shaderLiquidMetalConfig } from "@/registry/remocn/shader-liquid-metal/config";
import { ShaderMeshGradient } from "@/registry/remocn/shader-mesh-gradient";
@@ -398,6 +400,10 @@ const registry: Record<string, RegistryEntry> = {
Component: ShaderGodRays,
config: shaderGodRaysConfig,
},
+ "shader-smoke-ring": {
+ Component: ShaderSmokeRing,
+ config: shaderSmokeRingConfig,
+ },
"dynamic-grid": { Component: DynamicGrid, config: dynamicGridConfig },
"simulated-cursor": {
Component: SimulatedCursor,
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index e96658bc..0a93f0a6 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -727,6 +727,22 @@
}
]
},
+ {
+ "name": "shader-smoke-ring",
+ "type": "registry:component",
+ "title": "Shader Smoke Ring",
+ "description": "Soft smoke ring curling and dissipating in place.",
+ "dependencies": [
+ "@paper-design/shaders-react"
+ ],
+ "files": [
+ {
+ "path": "shader-smoke-ring/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/shader-smoke-ring.tsx"
+ }
+ ]
+ },
{
"name": "dynamic-grid",
"type": "registry:component",
diff --git a/registry/remocn/shader-smoke-ring/config.ts b/registry/remocn/shader-smoke-ring/config.ts
new file mode 100644
index 00000000..c9d0c9d4
--- /dev/null
+++ b/registry/remocn/shader-smoke-ring/config.ts
@@ -0,0 +1,45 @@
+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";
+
+export const shaderSmokeRingConfig: ComponentConfig = {
+ componentName: "ShaderSmokeRing",
+ importPath: "@/components/remocn/shader-smoke-ring",
+ controls: {
+ speed: {
+ type: "number",
+ default: 1,
+ min: 0.1,
+ max: 4,
+ step: 0.1,
+ label: "Speed",
+ },
+ radius: {
+ type: "number",
+ default: 0.25,
+ min: 0,
+ max: 1,
+ step: 0.05,
+ label: "Radius",
+ },
+ thickness: {
+ type: "number",
+ default: 0.65,
+ min: 0.1,
+ max: 1.5,
+ step: 0.05,
+ label: "Thickness",
+ },
+ scale: {
+ type: "number",
+ default: 0.8,
+ min: 0.3,
+ max: 2,
+ step: 0.05,
+ label: "Scale",
+ },
+ colorBack: { type: "color", default: "#12121a", label: "Background" },
+ },
+ durationInFrames: 150,
+ fps: FPS,
+ compositionWidth: W,
+ compositionHeight: H,
+};
diff --git a/registry/remocn/shader-smoke-ring/index.tsx b/registry/remocn/shader-smoke-ring/index.tsx
new file mode 100644
index 00000000..06442ca3
--- /dev/null
+++ b/registry/remocn/shader-smoke-ring/index.tsx
@@ -0,0 +1,62 @@
+"use client";
+
+import { SmokeRing, type SmokeRingProps } from "@paper-design/shaders-react";
+import { useCallback, useState } from "react";
+import {
+ continueRender,
+ delayRender,
+ useCurrentFrame,
+ useVideoConfig,
+} from "remotion";
+
+const NEUTRAL_COLORS = ["#c8c8d0"];
+
+export interface ShaderSmokeRingProps
+ extends Omit<SmokeRingProps, "frame" | "ref"> {}
+
+export function ShaderSmokeRing({
+ speed = 1,
+ colorBack = "#12121a",
+ colors = NEUTRAL_COLORS,
+ radius = 0.25,
+ thickness = 0.65,
+ scale = 0.8,
+ className,
+ ...rest
+}: ShaderSmokeRingProps) {
+ const frame = useCurrentFrame();
+ const { fps, width, height } = useVideoConfig();
+
+ const [handle] = useState(() => delayRender("shader-smoke-ring"));
+ 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 }}
+ >
+ <SmokeRing
+ speed={0}
+ frame={(frame / fps) * speed * 1000}
+ colorBack={colorBack}
+ colors={colors}
+ radius={radius}
+ thickness={thickness}
+ scale={scale}
+ fit="cover"
+ width={width}
+ height={height}
+ {...rest}
+ />
+ </div>
+ );
+}