@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.
@@ -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(new Error("Failed to get WebGL context. Try rendering with --gl=angle to enable WebGL."));
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
- durationInFrames: {
242
+ progress: {
241
243
  type: "number",
242
- min: 1,
243
- max: 1e5,
244
- step: 1,
245
- default: 300,
246
- description: "Duration in frames"
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
- durationInFrames: p.durationInFrames ?? 300
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.durationInFrames}`;
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 new Error("Failed to acquire WebGL2 context for light leak effect");
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, frame }) => {
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 duration = r.durationInFrames;
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 durationInFrames: {
14
+ readonly progress: {
15
15
  readonly type: "number";
16
- readonly min: 1;
17
- readonly max: 100000;
18
- readonly step: 1;
19
- readonly default: 300;
20
- readonly description: "Duration in frames";
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
- * Controls evolve/retract timing, matching `<LightLeak>` when set to the same
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 | undefined) => import("remotion").EffectDescriptor<unknown>;
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.462",
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.462",
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.462",
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
  },