Skip to content

🎥 Make videos programmatically with React

`@remotion/effects`: Move shine to Generative, register example-side preview, restore Onda entry

pullfrog[bot]fa0fbfa4ee7d
diff --git a/packages/docs/docs/effects/table-of-contents.tsx b/packages/docs/docs/effects/table-of-contents.tsx
index 74e3b23a40..6c9aba4f07 100644
--- a/packages/docs/docs/effects/table-of-contents.tsx
+++ b/packages/docs/docs/effects/table-of-contents.tsx
@@ -45,13 +45,6 @@ const categories: {
name: 'glow()',
description: 'Soft halo effect',
},
- {
- link: '/docs/effects/shine',
- preview: '/img/effects-shine-preview.jpg',
- alt: 'shine effect preview',
- name: 'shine()',
- description: 'Glossy light sweep effect',
- },
{
link: '/docs/effects/grayscale',
preview: '/img/effects-grayscale-preview.jpg',
@@ -186,6 +179,13 @@ const categories: {
name: 'lightLeak()',
description: 'Light leak overlay effect',
},
+ {
+ link: '/docs/effects/shine',
+ preview: '/img/effects-shine-preview.jpg',
+ alt: 'shine effect preview',
+ name: 'shine()',
+ description: 'Glossy light sweep effect',
+ },
],
},
];
diff --git a/packages/docs/static/img/effects-shine-preview.jpg b/packages/docs/static/img/effects-shine-preview.jpg
index 256412e564..5625ca1144 100644
Binary files a/packages/docs/static/img/effects-shine-preview.jpg and b/packages/docs/static/img/effects-shine-preview.jpg differ
diff --git a/packages/effects/src/shine.ts b/packages/effects/src/shine.ts
index 51875e3cda..4d71a2288a 100644
--- a/packages/effects/src/shine.ts
+++ b/packages/effects/src/shine.ts
@@ -151,20 +151,7 @@ void main() {
}
`;
- assertEffectParamsObject(params, 'Shine');
- assertOptionalFiniteNumber(params.progress, 'progress');
- assertOptionalFiniteNumber(params.angle, 'angle');
- assertOptionalFiniteNumber(params.haloSigma, 'haloSigma');
- assertOptionalFiniteNumber(params.coreSigma, 'coreSigma');
- assertOptionalFiniteNumber(params.haloIntensity, 'haloIntensity');
- assertOptionalFiniteNumber(params.coreIntensity, 'coreIntensity');
-
- const r = resolve(params);
- validateUnitInterval(r.progress, 'progress');
- validatePositive(r.haloSigma, 'haloSigma');
- validatePositive(r.coreSigma, 'coreSigma');
- validateUnitInterval(r.haloIntensity, 'haloIntensity');
- validateUnitInterval(r.coreIntensity, 'coreIntensity');
+const SHINE_FS = /* glsl */ `#version 300 es
precision highp float;
in vec2 vUv;
diff --git a/packages/example/src/HtmlInCanvas/effects-shine-preview.tsx b/packages/example/src/HtmlInCanvas/effects-shine-preview.tsx
new file mode 100644
index 0000000000..4a41aa784a
--- /dev/null
+++ b/packages/example/src/HtmlInCanvas/effects-shine-preview.tsx
@@ -0,0 +1,27 @@
+import {shine} from '@remotion/effects/shine';
+import React from 'react';
+import {HtmlInCanvas, useVideoConfig} from 'remotion';
+import {EffectsPreviewImage} from './effects-preview-image';
+
+export const EffectsShinePreview: React.FC = () => {
+ const {width, height} = useVideoConfig();
+
+ return (
+ <HtmlInCanvas
+ width={width}
+ height={height}
+ effects={[
+ shine({
+ progress: 0.5,
+ angle: 30,
+ haloSigma: 200,
+ coreSigma: 65,
+ haloIntensity: 0.3,
+ coreIntensity: 0.4,
+ }),
+ ]}
+ >
+ <EffectsPreviewImage />
+ </HtmlInCanvas>
+ );
+};
diff --git a/packages/example/src/HtmlInCanvas/index.tsx b/packages/example/src/HtmlInCanvas/index.tsx
index a89a0eb304..b14a4e5b1d 100644
--- a/packages/example/src/HtmlInCanvas/index.tsx
+++ b/packages/example/src/HtmlInCanvas/index.tsx
@@ -33,6 +33,7 @@ export {EffectsHalftonePreview} from './effects-halftone-preview';
export {EffectsHuePreview} from './effects-hue-preview';
export {EffectsInvertPreview} from './effects-invert-preview';
export {EffectsSaturationPreview} from './effects-saturation-preview';
+export {EffectsShinePreview} from './effects-shine-preview';
export {EffectsTintPreview} from './effects-tint-preview';
export {EffectsUvTranslatePreview} from './effects-uv-translate-preview';
export {EffectsWavePreview} from './effects-wave-preview';
diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsx
index 4703b81a6b..56ca69a7fd 100644
--- a/packages/example/src/Root.tsx
+++ b/packages/example/src/Root.tsx
@@ -65,6 +65,7 @@ import {
EffectsHuePreview,
EffectsInvertPreview,
EffectsSaturationPreview,
+ EffectsShinePreview,
EffectsTintPreview,
EffectsUvTranslatePreview,
EffectsWavePreview,
@@ -1172,6 +1173,14 @@ export const Index: React.FC = () => {
width={1080}
durationInFrames={1}
/>
+ <Composition
+ id="html-in-canvas-effects-shine-preview"
+ component={EffectsShinePreview}
+ fps={30}
+ height={720}
+ width={1280}
+ durationInFrames={1}
+ />
<Composition
id="html-in-canvas-effects-tint-preview"
component={EffectsTintPreview}