@remotion/light-leaks 4.0.462 → 4.0.464
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.mjs +18 -16
- package/dist/light-leak-internals.d.ts +11 -12
- package/package.json +3 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
useVideoConfig
|
|
10
10
|
} from "remotion";
|
|
11
11
|
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var { createWebGLContextError } = Internals;
|
|
12
13
|
var VERTEX_SHADER = `
|
|
13
14
|
attribute vec2 position;
|
|
14
15
|
void main() {
|
|
@@ -106,7 +107,7 @@ var LightLeakCanvas = ({ seed, hueShift }) => {
|
|
|
106
107
|
alpha: true
|
|
107
108
|
});
|
|
108
109
|
if (!gl) {
|
|
109
|
-
cancelRender(
|
|
110
|
+
cancelRender(createWebGLContextError("light leak"));
|
|
110
111
|
return null;
|
|
111
112
|
}
|
|
112
113
|
gl.enable(gl.BLEND);
|
|
@@ -189,7 +190,8 @@ var lightLeakSchema = {
|
|
|
189
190
|
default: 0,
|
|
190
191
|
description: "Hue Shift"
|
|
191
192
|
},
|
|
192
|
-
...Internals.sequenceStyleSchema
|
|
193
|
+
...Internals.sequenceStyleSchema,
|
|
194
|
+
hidden: Internals.hiddenField
|
|
193
195
|
};
|
|
194
196
|
var LightLeakInner = ({
|
|
195
197
|
seed = 0,
|
|
@@ -227,7 +229,7 @@ LightLeak.displayName = "LightLeak";
|
|
|
227
229
|
Internals.addSequenceStackTraces(LightLeak);
|
|
228
230
|
// src/light-leak-internals.ts
|
|
229
231
|
import { Internals as Internals2 } from "remotion";
|
|
230
|
-
var { createEffect } = Internals2;
|
|
232
|
+
var { createEffect, createWebGL2ContextError } = Internals2;
|
|
231
233
|
var lightLeakEffectSchema = {
|
|
232
234
|
seed: { type: "number", default: 0, description: "Seed" },
|
|
233
235
|
hueShift: {
|
|
@@ -237,19 +239,19 @@ var lightLeakEffectSchema = {
|
|
|
237
239
|
default: 0,
|
|
238
240
|
description: "Hue Shift"
|
|
239
241
|
},
|
|
240
|
-
|
|
242
|
+
progress: {
|
|
241
243
|
type: "number",
|
|
242
|
-
min:
|
|
243
|
-
max:
|
|
244
|
-
step:
|
|
245
|
-
default:
|
|
246
|
-
description: "
|
|
244
|
+
min: 0,
|
|
245
|
+
max: 1,
|
|
246
|
+
step: 0.01,
|
|
247
|
+
default: 0,
|
|
248
|
+
description: "Progress"
|
|
247
249
|
}
|
|
248
250
|
};
|
|
249
251
|
var resolve = (p) => ({
|
|
250
252
|
seed: p.seed ?? 0,
|
|
251
253
|
hueShift: p.hueShift ?? 0,
|
|
252
|
-
|
|
254
|
+
progress: p.progress ?? 0
|
|
253
255
|
});
|
|
254
256
|
var LIGHT_LEAK_VS = `#version 300 es
|
|
255
257
|
in vec2 aPos;
|
|
@@ -375,7 +377,7 @@ var lightLeak = createEffect({
|
|
|
375
377
|
backend: "webgl2",
|
|
376
378
|
calculateKey: (params) => {
|
|
377
379
|
const r = resolve(params);
|
|
378
|
-
return `light-leak-${r.seed}-${r.hueShift}-${r.
|
|
380
|
+
return `light-leak-${r.seed}-${r.hueShift}-${r.progress}`;
|
|
379
381
|
},
|
|
380
382
|
setup: (target) => {
|
|
381
383
|
const gl = target.getContext("webgl2", {
|
|
@@ -384,7 +386,7 @@ var lightLeak = createEffect({
|
|
|
384
386
|
preserveDrawingBuffer: true
|
|
385
387
|
});
|
|
386
388
|
if (!gl) {
|
|
387
|
-
throw
|
|
389
|
+
throw createWebGL2ContextError("light leak effect");
|
|
388
390
|
}
|
|
389
391
|
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
|
|
390
392
|
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
|
|
@@ -452,7 +454,7 @@ var lightLeak = createEffect({
|
|
|
452
454
|
uResolution: gl.getUniformLocation(program, "resolution")
|
|
453
455
|
};
|
|
454
456
|
},
|
|
455
|
-
apply: ({ source, width, height, params, state
|
|
457
|
+
apply: ({ source, width, height, params, state }) => {
|
|
456
458
|
const r = resolve(params);
|
|
457
459
|
if (typeof r.seed !== "number" || !Number.isFinite(r.seed)) {
|
|
458
460
|
throw new TypeError(`"seed" must be a finite number, but got ${JSON.stringify(r.seed)}`);
|
|
@@ -463,8 +465,7 @@ var lightLeak = createEffect({
|
|
|
463
465
|
if (r.hueShift < 0 || r.hueShift > 360) {
|
|
464
466
|
throw new RangeError(`"hueShift" must be between 0 and 360, but got ${r.hueShift}`);
|
|
465
467
|
}
|
|
466
|
-
const
|
|
467
|
-
const normalized = duration <= 1 ? 0 : frame / (duration - 1);
|
|
468
|
+
const normalized = Math.min(1, Math.max(0, r.progress));
|
|
468
469
|
const evolveProgress = Math.min(1, normalized * 2);
|
|
469
470
|
const retractProgress = Math.max(0, normalized * 2 - 1);
|
|
470
471
|
const {
|
|
@@ -515,7 +516,8 @@ var lightLeak = createEffect({
|
|
|
515
516
|
gl.deleteVertexArray(vao);
|
|
516
517
|
gl.deleteTexture(texture);
|
|
517
518
|
},
|
|
518
|
-
schema: lightLeakEffectSchema
|
|
519
|
+
schema: lightLeakEffectSchema,
|
|
520
|
+
validateParams: () => {}
|
|
519
521
|
});
|
|
520
522
|
var LightLeakInternals = {
|
|
521
523
|
lightLeak
|
|
@@ -11,27 +11,26 @@ export declare const lightLeakEffectSchema: {
|
|
|
11
11
|
readonly default: 0;
|
|
12
12
|
readonly description: "Hue Shift";
|
|
13
13
|
};
|
|
14
|
-
readonly
|
|
14
|
+
readonly progress: {
|
|
15
15
|
readonly type: "number";
|
|
16
|
-
readonly min:
|
|
17
|
-
readonly max:
|
|
18
|
-
readonly step:
|
|
19
|
-
readonly default:
|
|
20
|
-
readonly description: "
|
|
16
|
+
readonly min: 0;
|
|
17
|
+
readonly max: 1;
|
|
18
|
+
readonly step: 0.01;
|
|
19
|
+
readonly default: 0;
|
|
20
|
+
readonly description: "Progress";
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
export type LightLeakEffectParams = {
|
|
24
24
|
readonly seed?: number;
|
|
25
25
|
readonly hueShift?: number;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
* duration as your composition or sequence.
|
|
29
|
-
*/
|
|
30
|
-
readonly durationInFrames?: number;
|
|
26
|
+
/** Evolve/retract phase from 0 (start) to 1 (end). */
|
|
27
|
+
readonly progress?: number;
|
|
31
28
|
};
|
|
32
29
|
/**
|
|
33
30
|
* Experimental internals for the light leak canvas effect pipeline.
|
|
34
31
|
*/
|
|
35
32
|
export declare const LightLeakInternals: {
|
|
36
|
-
readonly lightLeak: (params?: LightLeakEffectParams
|
|
33
|
+
readonly lightLeak: (params?: (LightLeakEffectParams & {
|
|
34
|
+
readonly disabled?: boolean | undefined;
|
|
35
|
+
}) | undefined) => import("remotion").EffectDescriptor<unknown>;
|
|
37
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/light-leaks",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.464",
|
|
4
4
|
"description": "Light leak effects for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"remotion": "4.0.
|
|
26
|
+
"remotion": "4.0.464",
|
|
27
27
|
"zod": "4.3.6"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"react": "19.2.3",
|
|
43
43
|
"react-dom": "19.2.3",
|
|
44
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
44
|
+
"@remotion/eslint-config-internal": "4.0.464",
|
|
45
45
|
"eslint": "9.19.0",
|
|
46
46
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
47
47
|
},
|