Skip to main content

<LightLeak>v4.0.415

渲染基于 WebGL 的光泄效果。 该效果在持续时间的前半段显示,在后半段收回。 在底层是一个 <Sequence> 组件,并接受它的属性。

🌐 Renders a WebGL-based light leak effect.
The effect reveals during the first half of the duration and retracts during the second half.
Is a <Sequence> component under the hood and accepts it's props.

示例

🌐 Example

MyComp.tsx
import {LightLeak} from '@remotion/light-leaks'; import {AbsoluteFill} from 'remotion'; const MyVideo = () => { return ( <AbsoluteFill style={{backgroundColor: 'black'}}> <LightLeak durationInFrames={60} seed={3} hueShift={30} /> </AbsoluteFill> ); };

应用编程接口

🌐 API

除了下面列出的 props 外,来自 <Sequence> 的所有 props 都被接受,除了 childrenlayout

🌐 Apart from the props listed below, all props from <Sequence> except children and layout are accepted.

durationInFrames?

光泄漏效果的持续时间,以帧为单位。该效果在前半部分显现,在后半部分收回。
在中点时,光泄漏会覆盖画布的大部分区域。

🌐 The duration of the light leak effect in frames. The effect reveals during the first half and retracts during the second half.
During the midpoint, the light leak will cover most of the canvas.

如果未指定,默认为作品或序列的持续时间,从useVideoConfig()读取。

🌐 If not specified, defaults to the duration of the composition or sequence, reading from useVideoConfig().

seed?

确定光泄漏图案的形状。不同的种子会产生不同的图案。默认值:0

🌐 Determines the shape of the light leak pattern. Different seeds produce different patterns. Default: 0.

hueShift?

以度数旋转光泄漏的色相(0-360)。

🌐 Rotates the hue of the light leak in degrees (0-360).

  • 0(默认)黄色到橙色
  • 120 转向绿色
  • 240 转向蓝色

兼容性

🌐 Compatibility

BrowsersEnvironments
Chrome
Firefox
Safari

另请参阅

🌐 See also