pixi-effects 0.40.0 → 0.41.0

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +5 -5
  3. package/ai/chat-template.html +3 -3
  4. package/ai/tools/check.mjs +19 -2
  5. package/dist/Composition-N6BOROJ2.cjs +16 -0
  6. package/dist/{Composition-C3UEVHQG.cjs.map → Composition-N6BOROJ2.cjs.map} +1 -1
  7. package/dist/Composition-YGBQX3HZ.js +7 -0
  8. package/dist/{Composition-KRWH72MA.js.map → Composition-YGBQX3HZ.js.map} +1 -1
  9. package/dist/Controller.d.cts +1 -1
  10. package/dist/Controller.d.ts +1 -1
  11. package/dist/{Movie-CG6Jy1tx.d.ts → Movie-CwqRLOzE.d.ts} +47 -1
  12. package/dist/{Movie-CMq4KFmc.d.cts → Movie-DWtxRiJ2.d.cts} +47 -1
  13. package/dist/{Spans-TWO4VN5H.js → Spans-6L2ZVECX.js} +4 -4
  14. package/dist/{Spans-TWO4VN5H.js.map → Spans-6L2ZVECX.js.map} +1 -1
  15. package/dist/{Spans-APNJHCYO.cjs → Spans-XTIWYSNO.cjs} +9 -9
  16. package/dist/{Spans-APNJHCYO.cjs.map → Spans-XTIWYSNO.cjs.map} +1 -1
  17. package/dist/{chunk-27PYJ4JY.cjs → chunk-3HZV3UHU.cjs} +67 -63
  18. package/dist/chunk-3HZV3UHU.cjs.map +1 -0
  19. package/dist/{chunk-LMWXR5OC.js → chunk-4QVQ5UJJ.js} +4 -4
  20. package/dist/{chunk-LMWXR5OC.js.map → chunk-4QVQ5UJJ.js.map} +1 -1
  21. package/dist/{chunk-26Z544SH.js → chunk-ICI6ACHY.js} +7 -3
  22. package/dist/chunk-ICI6ACHY.js.map +1 -0
  23. package/dist/{chunk-LEL7UNYQ.cjs → chunk-RN5FWGGM.cjs} +136 -39
  24. package/dist/chunk-RN5FWGGM.cjs.map +1 -0
  25. package/dist/{chunk-7EI2N7WO.cjs → chunk-X62H3RBG.cjs} +4 -4
  26. package/dist/{chunk-7EI2N7WO.cjs.map → chunk-X62H3RBG.cjs.map} +1 -1
  27. package/dist/{chunk-CT5CZVT5.js → chunk-Y2N6U3X5.js} +101 -4
  28. package/dist/chunk-Y2N6U3X5.js.map +1 -0
  29. package/dist/index.cjs +33 -33
  30. package/dist/index.d.cts +1 -1
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.js +3 -3
  33. package/dist/loader.css +1 -1
  34. package/dist/present.cjs +3 -3
  35. package/dist/present.d.cts +1 -1
  36. package/dist/present.d.ts +1 -1
  37. package/dist/present.js +3 -3
  38. package/dist/three.cjs +52 -6
  39. package/dist/three.cjs.map +1 -1
  40. package/dist/three.d.cts +16 -1
  41. package/dist/three.d.ts +16 -1
  42. package/dist/three.js +49 -3
  43. package/dist/three.js.map +1 -1
  44. package/docs/api.md +17 -0
  45. package/docs/dsl.md +1 -1
  46. package/llms-full.txt +44 -3
  47. package/package.json +1 -1
  48. package/skills/pixi-effects/SKILL.md +2 -2
  49. package/skills/pixi-effects/reference/cheatsheet.md +1 -0
  50. package/skills/pixi-effects/reference/recipes.md +23 -0
  51. package/skills/pixi-effects/template.html +6 -6
  52. package/dist/Composition-C3UEVHQG.cjs +0 -16
  53. package/dist/Composition-KRWH72MA.js +0 -7
  54. package/dist/chunk-26Z544SH.js.map +0 -1
  55. package/dist/chunk-27PYJ4JY.cjs.map +0 -1
  56. package/dist/chunk-CT5CZVT5.js.map +0 -1
  57. package/dist/chunk-LEL7UNYQ.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk7EI2N7WO_cjs = require('./chunk-7EI2N7WO.cjs');
3
+ var chunkX62H3RBG_cjs = require('./chunk-X62H3RBG.cjs');
4
4
  var chunkJN7JHNZR_cjs = require('./chunk-JN7JHNZR.cjs');
5
5
  var chunk3SAS3ZE5_cjs = require('./chunk-3SAS3ZE5.cjs');
6
6
  var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
@@ -33,10 +33,10 @@ var KIND_ALIASES = {
33
33
  fill: "ambient"
34
34
  };
35
35
  function lightKindProblem(kind) {
36
- if (kind === void 0 || typeof kind === "string" && chunk7EI2N7WO_cjs.LIGHT_KINDS.includes(kind)) return null;
37
- const guess = typeof kind === "string" ? KIND_ALIASES[kind.toLowerCase()] ?? chunkTWZNOUM7_cjs.suggestName(kind, chunk7EI2N7WO_cjs.LIGHT_KINDS) : null;
36
+ if (kind === void 0 || typeof kind === "string" && chunkX62H3RBG_cjs.LIGHT_KINDS.includes(kind)) return null;
37
+ const guess = typeof kind === "string" ? KIND_ALIASES[kind.toLowerCase()] ?? chunkTWZNOUM7_cjs.suggestName(kind, chunkX62H3RBG_cjs.LIGHT_KINDS) : null;
38
38
  const shown = typeof kind === "string" ? `"${kind}"` : String(kind);
39
- return `kind ${shown} is not a light kind${guess ? `; did you mean "${guess}"?` : ""} (use ${chunk7EI2N7WO_cjs.LIGHT_KINDS.join(", ")}); point is used`;
39
+ return `kind ${shown} is not a light kind${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkX62H3RBG_cjs.LIGHT_KINDS.join(", ")}); point is used`;
40
40
  }
41
41
  var LIGHT_ALIASES = {
42
42
  pointOfInterest: 'did you mean "lookAtX / lookAtY / lookAtZ"?',
@@ -61,24 +61,24 @@ function lightLayerProblems(spec) {
61
61
  const raw = spec;
62
62
  const kind = lightKindProblem(raw.kind);
63
63
  if (kind) out.push(kind);
64
- if (raw.falloff !== void 0 && !chunk7EI2N7WO_cjs.FALLOFFS.includes(raw.falloff)) {
65
- const guess = typeof raw.falloff === "string" ? chunkTWZNOUM7_cjs.suggestName(raw.falloff, chunk7EI2N7WO_cjs.FALLOFFS) : null;
66
- out.push(`falloff ${JSON.stringify(raw.falloff)} is not supported${guess ? `; did you mean "${guess}"?` : ""} (use ${chunk7EI2N7WO_cjs.FALLOFFS.join(", ")}); none is used`);
64
+ if (raw.falloff !== void 0 && !chunkX62H3RBG_cjs.FALLOFFS.includes(raw.falloff)) {
65
+ const guess = typeof raw.falloff === "string" ? chunkTWZNOUM7_cjs.suggestName(raw.falloff, chunkX62H3RBG_cjs.FALLOFFS) : null;
66
+ out.push(`falloff ${JSON.stringify(raw.falloff)} is not supported${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkX62H3RBG_cjs.FALLOFFS.join(", ")}); none is used`);
67
67
  }
68
68
  for (const k of Object.keys(raw)) {
69
- if (chunk7EI2N7WO_cjs.LIGHT_PROPS.includes(k) || k === "intensity" || k === "shadowDarkness" || k === "shadowDiffusion") {
69
+ if (chunkX62H3RBG_cjs.LIGHT_PROPS.includes(k) || k === "intensity" || k === "shadowDarkness" || k === "shadowDiffusion") {
70
70
  out.push(`"${k}" must go inside initial / keyframes, not on the light itself`);
71
71
  } else if (LIGHT_ALIASES[k]) out.push(`"${k}" is not a property \u2014 ${LIGHT_ALIASES[k]}`);
72
72
  }
73
73
  const explained = new Set(Object.keys(LIGHT_ALIASES));
74
74
  for (const k of chunk3SAS3ZE5_cjs.collectPropKeys(spec)) {
75
75
  if (LIGHT_ALIASES[k]) out.push(`"${k}" is not a property \u2014 ${LIGHT_ALIASES[k]}`);
76
- else if (!explained.has(k) && !chunk7EI2N7WO_cjs.LIGHT_PROPS.includes(k)) out.push(`"${k}" has no effect on a light (use ${chunk7EI2N7WO_cjs.LIGHT_PROPS.join(", ")})`);
76
+ else if (!explained.has(k) && !chunkX62H3RBG_cjs.LIGHT_PROPS.includes(k)) out.push(`"${k}" has no effect on a light (use ${chunkX62H3RBG_cjs.LIGHT_PROPS.join(", ")})`);
77
77
  }
78
78
  if (numbersOf(spec, "coneFeather").some((v) => v > 1 || v < 0)) out.push("coneFeather is 0..1 (the soft part of the cone edge, as a fraction of the half angle); it is clamped");
79
79
  const big = numbersOf(spec, "intensity").find((v) => v > 10);
80
80
  if (big !== void 0) out.push(`intensity ${big} looks like a percentage: it is a multiplier (1 = full, 0.25 = a quarter); did you mean ${big / 100}?`);
81
- const kindNow = typeof raw.kind === "string" && chunk7EI2N7WO_cjs.LIGHT_KINDS.includes(raw.kind) ? raw.kind : "point";
81
+ const kindNow = typeof raw.kind === "string" && chunkX62H3RBG_cjs.LIGHT_KINDS.includes(raw.kind) ? raw.kind : "point";
82
82
  const has = (...keys) => keys.filter((k) => bagsOf(spec).some((b) => b[k] !== void 0));
83
83
  const falloffOn = raw.falloff === "smooth" || raw.falloff === "inverseSquare";
84
84
  if (kindNow === "ambient" && raw.castsShadows) out.push("an ambient light has no direction, so it makes no shadow: castsShadows is ignored (put it on a point, spot or parallel light)");
@@ -106,18 +106,18 @@ function lightSetProblems(layers) {
106
106
  out.push("there is no ambient light, so what no light reaches is black; add { type: 'light', kind: 'ambient', initial: { intensity: 0.25 } }");
107
107
  }
108
108
  const direct = lights.filter((l) => kindOf(l) !== "ambient");
109
- if (direct.length > chunk7EI2N7WO_cjs.MAX_LIGHTS) {
110
- const dropped = direct.slice(chunk7EI2N7WO_cjs.MAX_LIGHTS).map((l) => nameOf(l, layers.indexOf(l)));
111
- out.push(`${direct.length} lights, but at most ${chunk7EI2N7WO_cjs.MAX_LIGHTS} are used (the first ${chunk7EI2N7WO_cjs.MAX_LIGHTS}, in layer order); ${dropped.join(", ")} and later are dropped. Use fewer lights`);
109
+ if (direct.length > chunkX62H3RBG_cjs.MAX_LIGHTS) {
110
+ const dropped = direct.slice(chunkX62H3RBG_cjs.MAX_LIGHTS).map((l) => nameOf(l, layers.indexOf(l)));
111
+ out.push(`${direct.length} lights, but at most ${chunkX62H3RBG_cjs.MAX_LIGHTS} are used (the first ${chunkX62H3RBG_cjs.MAX_LIGHTS}, in layer order); ${dropped.join(", ")} and later are dropped. Use fewer lights`);
112
112
  }
113
113
  const lightsCast = lights.some((l) => kindOf(l) !== "ambient" && l.castsShadows);
114
114
  const casters = layers.filter((l) => l.type !== "light" && l.castsShadows && l.threeD);
115
115
  if (casters.length > 0 && !lightsCast) out.push(`${casters.length} layer${casters.length > 1 ? "s have" : " has"} castsShadows but no light has castsShadows: add castsShadows: true to the light that should make the shadows`);
116
116
  const hostsThree = layers.some((l) => l.type === "three" && l.followLights);
117
117
  if (lightsCast && casters.length === 0 && !hostsThree) out.push("a light has castsShadows but no layer has castsShadows: add castsShadows: true to the threeD layers that should cast a shadow");
118
- if (lightsCast && casters.length > chunk7EI2N7WO_cjs.MAX_CASTERS) {
119
- const dropped = casters.slice(chunk7EI2N7WO_cjs.MAX_CASTERS).map((c) => nameOf(c, layers.indexOf(c)));
120
- out.push(`${casters.length} layers cast shadows, but a layer receives shadows from at most ${chunk7EI2N7WO_cjs.MAX_CASTERS} (the first ${chunk7EI2N7WO_cjs.MAX_CASTERS}, in layer order); ${dropped.join(", ")} and later cast none`);
118
+ if (lightsCast && casters.length > chunkX62H3RBG_cjs.MAX_CASTERS) {
119
+ const dropped = casters.slice(chunkX62H3RBG_cjs.MAX_CASTERS).map((c) => nameOf(c, layers.indexOf(c)));
120
+ out.push(`${casters.length} layers cast shadows, but a layer receives shadows from at most ${chunkX62H3RBG_cjs.MAX_CASTERS} (the first ${chunkX62H3RBG_cjs.MAX_CASTERS}, in layer order); ${dropped.join(", ")} and later cast none`);
121
121
  }
122
122
  const softLights = lights.filter((l) => l.castsShadows && numbersOf(l, "shadowDiffusion").some((v) => v > 0));
123
123
  if (softLights.length >= SOFT_LIGHTS) {
@@ -302,9 +302,9 @@ var roundPixelsBit = {
302
302
  name: "round-pixels-bit",
303
303
  vertex: { header: `fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32> { return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; }` }
304
304
  };
305
- var ML = chunk7EI2N7WO_cjs.MAX_LIGHTS;
306
- var MC = chunk7EI2N7WO_cjs.MAX_CASTERS;
307
- var TAPS = chunk7EI2N7WO_cjs.SHADOW_TAPS;
305
+ var ML = chunkX62H3RBG_cjs.MAX_LIGHTS;
306
+ var MC = chunkX62H3RBG_cjs.MAX_CASTERS;
307
+ var TAPS = chunkX62H3RBG_cjs.SHADOW_TAPS;
308
308
  var SHADOW_KEYS = Array.from({ length: MC }, (_, j) => `uShadow${j}`);
309
309
  var WGSL_SHADOW_DECLS = SHADOW_KEYS.map((k, j) => ` @group(2) @binding(${4 + j}) var ${k}: texture_2d<f32>;`).join("\n");
310
310
  var WGSL_SHADOW_PICK = SHADOW_KEYS.map((k, j) => (j === 0 ? "" : "else ") + `if (j == ${j}) { a = textureSampleLevel(${k}, uSampler, uv, 0.0).a; }`).join(" ");
@@ -664,8 +664,8 @@ function readLayerTransform(target) {
664
664
  x: c.x,
665
665
  y: c.y,
666
666
  z: c.z ?? 0,
667
- rotationX: (c.rotationX ?? 0) * chunk7EI2N7WO_cjs.DEG,
668
- rotationY: (c.rotationY ?? 0) * chunk7EI2N7WO_cjs.DEG,
667
+ rotationX: (c.rotationX ?? 0) * chunkX62H3RBG_cjs.DEG,
668
+ rotationY: (c.rotationY ?? 0) * chunkX62H3RBG_cjs.DEG,
669
669
  rotationZ: c.rotation,
670
670
  scaleX: c.scale.x,
671
671
  scaleY: c.scale.y,
@@ -704,6 +704,8 @@ var Layer3D = class {
704
704
  blurFilter = null;
705
705
  blendWas = "normal";
706
706
  blendFilter = null;
707
+ /** The projected corners of the card (TL, TR, BR, BL as x0, y0 … x3, y3, in the space of the composition that holds it), or null while it is not drawn: what a hit test reads. */
708
+ corners = null;
707
709
  /** The plane in world space from the last update (a texture uv of 0..1 maps to `o + u·U + v·V`): what shading and shadows need. */
708
710
  world = null;
709
711
  /** The lit shader: made only when the composition has a light or fog (a composition with neither makes nothing). */
@@ -728,20 +730,20 @@ var Layer3D = class {
728
730
  if (!(needW >= 1 && needH >= 1) || !Number.isFinite(bounds.x) || !Number.isFinite(bounds.y)) return this.hide();
729
731
  const size = this.sizeFor(needW, needH);
730
732
  const frame = { x: bounds.x - pad, y: bounds.y - pad, width: size.w, height: size.h };
731
- const projected = chunk7EI2N7WO_cjs.projectLayer(readLayerTransform(target), frame, basis);
733
+ const projected = chunkX62H3RBG_cjs.projectLayer(readLayerTransform(target), frame, basis);
732
734
  this.depth = projected.depth;
733
735
  {
734
736
  const lt = readLayerTransform(target);
735
- const o = chunk7EI2N7WO_cjs.layerToWorld(lt, frame.x, frame.y);
736
- const pu = chunk7EI2N7WO_cjs.layerToWorld(lt, frame.x + frame.width, frame.y);
737
- const pv = chunk7EI2N7WO_cjs.layerToWorld(lt, frame.x, frame.y + frame.height);
737
+ const o = chunkX62H3RBG_cjs.layerToWorld(lt, frame.x, frame.y);
738
+ const pu = chunkX62H3RBG_cjs.layerToWorld(lt, frame.x + frame.width, frame.y);
739
+ const pv = chunkX62H3RBG_cjs.layerToWorld(lt, frame.x, frame.y + frame.height);
738
740
  this.world = { o, u: { x: pu.x - o.x, y: pu.y - o.y, z: pu.z - o.z }, v: { x: pv.x - o.x, y: pv.y - o.y, z: pv.z - o.z } };
739
741
  }
740
742
  if (!projected.visible) {
741
743
  if (!this.warnedBehind) {
742
744
  this.warnedBehind = true;
743
745
  if (this.seq.spec.hideBehindCamera) return this.hide();
744
- if (projected.depth > chunk7EI2N7WO_cjs.NEAR) {
746
+ if (projected.depth > chunkX62H3RBG_cjs.NEAR) {
745
747
  console.warn(
746
748
  `pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.seq.spec)}: part of it (a corner) reaches the camera plane (z = ${(target.z ?? 0).toFixed(0)}, rotationX ${(target.rotationX ?? 0).toFixed(0)}\xB0, rotationY ${(target.rotationY ?? 0).toFixed(0)}\xB0), and a layer is hidden whole when any corner is at or behind it. Tilt it less (rotationX / rotationY), make it smaller, or keep the camera further away from it (the default camera sits at z = (height/2)/tan(fov/2), about 989 for 720p at fov 40).`
747
749
  );
@@ -762,6 +764,7 @@ var Layer3D = class {
762
764
  clearColor: [0, 0, 0, 0]
763
765
  });
764
766
  this.display.geometry.setCorners(...projected.corners);
767
+ this.corners = projected.corners;
765
768
  this.material?.setTexture(this.rt.source);
766
769
  this.display.visible = true;
767
770
  }
@@ -772,7 +775,7 @@ var Layer3D = class {
772
775
  */
773
776
  setBlur(radius) {
774
777
  const d = this.display;
775
- const r = radius > chunk7EI2N7WO_cjs.MIN_BLUR ? Math.min(radius, chunk7EI2N7WO_cjs.MAX_BLUR) : 0;
778
+ const r = radius > chunkX62H3RBG_cjs.MIN_BLUR ? Math.min(radius, chunkX62H3RBG_cjs.MAX_BLUR) : 0;
776
779
  this.blur = r;
777
780
  if (r === 0) {
778
781
  if (this.blurFilter) {
@@ -959,7 +962,7 @@ function lintSequence(spec, warn = defaultWarn) {
959
962
  function lintFocus(camera, siblings, warn = defaultWarn) {
960
963
  if (camera.type !== "camera") return;
961
964
  const who = chunk3SAS3ZE5_cjs.describeLayer(camera);
962
- for (const p of chunk7EI2N7WO_cjs.focusProblems(camera, siblings)) {
965
+ for (const p of chunkX62H3RBG_cjs.focusProblems(camera, siblings)) {
963
966
  if (p.kind === "missing") {
964
967
  warn(`pixi-effects: ${who}: focus: no layer named "${p.name}"${p.hint ? `; did you mean "${p.hint}"?` : ""} (the z = 0 plane is used). Write a threeD layer's name or a z number`);
965
968
  } else if (p.kind === "not-threeD") {
@@ -1249,7 +1252,7 @@ var MatteSet = class {
1249
1252
  };
1250
1253
 
1251
1254
  // src/sequences/Composition.ts
1252
- var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1255
+ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
1253
1256
  _innerContainer = null;
1254
1257
  _compositionShape = null;
1255
1258
  _children = [];
@@ -1316,9 +1319,9 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1316
1319
  this.intrinsicWidth = width;
1317
1320
  this.intrinsicHeight = height;
1318
1321
  this._innerContainer = inner;
1319
- const base = chunk7EI2N7WO_cjs.timeRemapOf(this.spec);
1320
- const span = base ? chunk7EI2N7WO_cjs.contentLength(base, this.duration) : this.duration;
1321
- this._remap = base ? chunk7EI2N7WO_cjs.remapOf(this.spec, "time", span) : null;
1322
+ const base = chunkX62H3RBG_cjs.timeRemapOf(this.spec);
1323
+ const span = base ? chunkX62H3RBG_cjs.contentLength(base, this.duration) : this.duration;
1324
+ this._remap = base ? chunkX62H3RBG_cjs.remapOf(this.spec, "time", span) : null;
1322
1325
  this._contentSpan = span;
1323
1326
  this._compositionShape = { width, height, duration: span, spaceAt: (t) => this._spaceAt(t) };
1324
1327
  const lateKeyframes = [];
@@ -1335,7 +1338,7 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1335
1338
  if (crowd >= chunkJN7JHNZR_cjs.MANY_ADVANCED) {
1336
1339
  console.warn(`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.spec)}: ${crowd} layers with an advanced blendMode are on screen at once (a composition with one counts each layer inside it, since its children blend one by one); each is a full-frame pass (about 2 ms on WebGL). Put fewer layers in the blend (or draw the glow as one layer), or use add / screen / multiply`);
1337
1340
  }
1338
- this._children = await chunk7EI2N7WO_cjs.buildSequenceTree(
1341
+ this._children = await chunkX62H3RBG_cjs.buildSequenceTree(
1339
1342
  this.spec.sequences ?? [],
1340
1343
  this._compositionShape,
1341
1344
  this.root
@@ -1346,22 +1349,22 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1346
1349
  if (matteNames.size > 0) {
1347
1350
  this._mattes = new MatteSet(inner, width, height);
1348
1351
  for (const name of matteNames) {
1349
- const source = this._children.find((c) => c.spec.name === name && !(c instanceof chunk7EI2N7WO_cjs.CameraSequence));
1352
+ const source = this._children.find((c) => c.spec.name === name && !(c instanceof chunkX62H3RBG_cjs.CameraSequence));
1350
1353
  if (!source || !source.target || !canBeMatte(source.spec)) continue;
1351
1354
  const chain = [];
1352
1355
  for (let p = this._parentOf.get(source); p; p = this._parentOf.get(p)) chain.push(p);
1353
1356
  this._mattes.add(name, source, chain);
1354
1357
  }
1355
1358
  }
1356
- if (this._children.some((c) => c instanceof chunk7EI2N7WO_cjs.LightSequence)) {
1359
+ if (this._children.some((c) => c instanceof chunkX62H3RBG_cjs.LightSequence)) {
1357
1360
  for (const message of lightSetProblems(this.spec.sequences ?? [])) console.warn(`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.spec)}: ${message}`);
1358
1361
  }
1359
1362
  const layerNames = new Set(this._children.map((c) => c.spec.name).filter((n) => !!n));
1360
1363
  for (const cam of this._children) {
1361
- if (!(cam instanceof chunk7EI2N7WO_cjs.CameraSequence)) continue;
1364
+ if (!(cam instanceof chunkX62H3RBG_cjs.CameraSequence)) continue;
1362
1365
  cam.resolveFocusNames((name) => {
1363
1366
  const hit = this._children.find((c) => c.spec.name === name && c.spec.threeD);
1364
- return hit ? chunk7EI2N7WO_cjs.layerInitialZ(hit.spec, hit.scope()) : void 0;
1367
+ return hit ? chunkX62H3RBG_cjs.layerInitialZ(hit.spec, hit.scope()) : void 0;
1365
1368
  }, layerNames);
1366
1369
  }
1367
1370
  const blendSaid = /* @__PURE__ */ new Map();
@@ -1371,11 +1374,11 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1371
1374
  else blendSaid.set(message, { spec, n: 1 });
1372
1375
  };
1373
1376
  for (const child of this._children) {
1374
- if (child instanceof chunk7EI2N7WO_cjs.CameraSequence) {
1377
+ if (child instanceof chunkX62H3RBG_cjs.CameraSequence) {
1375
1378
  this._cameras.push(child);
1376
1379
  continue;
1377
1380
  }
1378
- if (child instanceof chunk7EI2N7WO_cjs.LightSequence) {
1381
+ if (child instanceof chunkX62H3RBG_cjs.LightSequence) {
1379
1382
  this._lights.push(child);
1380
1383
  continue;
1381
1384
  }
@@ -1409,7 +1412,7 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1409
1412
  if (maskSrc.kind === "inline") {
1410
1413
  const maskSpec = maskSrc.spec;
1411
1414
  const lifetime = maskSpec.at === void 0 ? { at: child.at, duration: maskSpec.duration ?? child.duration } : {};
1412
- const built = await chunk7EI2N7WO_cjs.buildSequenceTree([{ ...maskSpec, ...lifetime }], this._compositionShape, this.root);
1415
+ const built = await chunkX62H3RBG_cjs.buildSequenceTree([{ ...maskSpec, ...lifetime }], this._compositionShape, this.root);
1413
1416
  const maskSeq = built[0];
1414
1417
  if (maskSeq?.target) {
1415
1418
  child.maskSequence = maskSeq;
@@ -1465,9 +1468,9 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1465
1468
  const remap = this._remap;
1466
1469
  const childOffset = remap ? 0 : offset + this.at;
1467
1470
  this._childBase = childOffset;
1468
- const target = remap ? chunk7EI2N7WO_cjs.createTimeline({ paused: true, defaults: { ease: "none" } }) : timeline;
1471
+ const target = remap ? chunkX62H3RBG_cjs.createTimeline({ paused: true, defaults: { ease: "none" } }) : timeline;
1469
1472
  for (const child of this._children) {
1470
- const own = chunk7EI2N7WO_cjs.createTimeline({ defaults: { ease: "none" } });
1473
+ const own = chunkX62H3RBG_cjs.createTimeline({ defaults: { ease: "none" } });
1471
1474
  child.bindTimeline(own, childOffset);
1472
1475
  child.maskSequence?.bindTimeline(own, childOffset);
1473
1476
  target.add(own, 0);
@@ -1497,8 +1500,8 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1497
1500
  this._clock = clock;
1498
1501
  const scope = this.scope();
1499
1502
  if (remap.start !== void 0 && remap.timeKfs.length === 0) clock.time = remap.start;
1500
- chunk7EI2N7WO_cjs.bindClock(timeline, clock, "time", remap, this.duration, offset + this.at, scope);
1501
- this._warnUnreachable(chunk7EI2N7WO_cjs.clockTable(remap, "time", this.duration, offset + this.at, scope, offset + this.at + this.duration), offset + this.at, offset + this.at + this.duration);
1503
+ chunkX62H3RBG_cjs.bindClock(timeline, clock, "time", remap, this.duration, offset + this.at, scope);
1504
+ this._warnUnreachable(chunkX62H3RBG_cjs.clockTable(remap, "time", this.duration, offset + this.at, scope, offset + this.at + this.duration), offset + this.at, offset + this.at + this.duration);
1502
1505
  }
1503
1506
  /**
1504
1507
  * A child the clock never dwells in is never visible: say so. Its `at` is in THIS composition's local time, so the usual mistake is
@@ -1536,7 +1539,7 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1536
1539
  for (let p = this._parentOf.get(seq); p; p = this._parentOf.get(p)) out.push(p);
1537
1540
  return out;
1538
1541
  };
1539
- return [...this._visual.map((v) => v.seq), ...this._nested].filter((seq) => !(seq instanceof chunk7EI2N7WO_cjs.NullSequence)).map((seq) => {
1542
+ return [...this._visual.map((v) => v.seq), ...this._nested].filter((seq) => !(seq instanceof chunkX62H3RBG_cjs.NullSequence)).map((seq) => {
1540
1543
  const layer = this._visual.find((v) => v.seq === seq)?.layer ?? null;
1541
1544
  return {
1542
1545
  seq,
@@ -1544,25 +1547,26 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1544
1547
  threeD: layer !== null,
1545
1548
  carriers: carriersOf(seq),
1546
1549
  depthBlur: layer?.blur ?? 0,
1550
+ quad: layer && layer.display.visible ? layer.corners : null,
1547
1551
  // how lit it is (threeD layers that receive the lights of the last frame only); computed here, not per frame
1548
- light: layer && this._lighting && layer.world && layer.spec.lit !== false ? chunk7EI2N7WO_cjs.lightLevel(layer.world, this._lighting.cam, this._lighting.states) : void 0
1552
+ light: layer && this._lighting && layer.world && layer.spec.lit !== false ? chunkX62H3RBG_cjs.lightLevel(layer.world, this._lighting.cam, this._lighting.states) : void 0
1549
1553
  };
1550
1554
  });
1551
1555
  }
1552
1556
  /** Match every `parent: 'name'` to a null layer; anything that cannot work is said out loud and drawn unparented. */
1553
1557
  _resolveParents() {
1554
- const nulls = this._children.filter((c) => c instanceof chunk7EI2N7WO_cjs.NullSequence);
1558
+ const nulls = this._children.filter((c) => c instanceof chunkX62H3RBG_cjs.NullSequence);
1555
1559
  const nullNames = nulls.map((n) => n.spec.name).filter((n) => !!n);
1556
1560
  const warned = /* @__PURE__ */ new Set();
1557
1561
  for (const child of this._children) {
1558
1562
  const want = child.spec.parent;
1559
1563
  if (want === void 0) continue;
1560
1564
  const who = chunk3SAS3ZE5_cjs.describeLayer(child.spec);
1561
- if (child instanceof chunk7EI2N7WO_cjs.CameraSequence) {
1565
+ if (child instanceof chunkX62H3RBG_cjs.CameraSequence) {
1562
1566
  console.warn(`pixi-effects: ${who}: a camera cannot have a parent; ignored`);
1563
1567
  continue;
1564
1568
  }
1565
- if (child instanceof chunk7EI2N7WO_cjs.LightSequence) {
1569
+ if (child instanceof chunkX62H3RBG_cjs.LightSequence) {
1566
1570
  console.warn(`pixi-effects: ${who}: a light cannot have a parent (parent "${want}" ignored: move the light with its own x / y / z keyframes)`);
1567
1571
  continue;
1568
1572
  }
@@ -1576,7 +1580,7 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1576
1580
  console.warn(`pixi-effects: ${who}: parent "${want}": no layer with that name${hint ? `; did you mean "${hint}"?` : ""} (the layer is drawn without a parent)`);
1577
1581
  continue;
1578
1582
  }
1579
- const holder = same.find((c) => c instanceof chunk7EI2N7WO_cjs.NullSequence);
1583
+ const holder = same.find((c) => c instanceof chunkX62H3RBG_cjs.NullSequence);
1580
1584
  if (!holder) {
1581
1585
  console.warn(`pixi-effects: ${who}: parent "${want}" is a ${same[0].spec.type} layer; only { type: 'null' } layers can be parents (the layer is drawn without a parent)`);
1582
1586
  continue;
@@ -1621,8 +1625,8 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1621
1625
  childT,
1622
1626
  compEnd
1623
1627
  );
1624
- const cam = active ? active.cam.state() : chunk7EI2N7WO_cjs.homeCamera(width, height);
1625
- const basis = chunk7EI2N7WO_cjs.cameraBasis(cam, width, height);
1628
+ const cam = active ? active.cam.state() : chunkX62H3RBG_cjs.homeCamera(width, height);
1629
+ const basis = chunkX62H3RBG_cjs.cameraBasis(cam, width, height);
1626
1630
  for (const layer of this._layers3d) layer.update(host, basis);
1627
1631
  this._applyLighting(childT, compEnd, basis, active?.cam ?? null);
1628
1632
  this._applyDepthOfField(cam, basis);
@@ -1645,7 +1649,7 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1645
1649
  const { width, height } = this._compositionShape;
1646
1650
  const compEnd = this._childBase + (this.duration ?? 0);
1647
1651
  const active = pickActiveCamera(this._cameras.map((cam) => ({ cam, ...cam.window() })), t, compEnd);
1648
- return { camera: active ? active.cam.state() : chunk7EI2N7WO_cjs.homeCamera(width, height), lights: this._liveLights(t, compEnd).map((l) => l.state()), fog: active?.cam.fogState() ?? null };
1652
+ return { camera: active ? active.cam.state() : chunkX62H3RBG_cjs.homeCamera(width, height), lights: this._liveLights(t, compEnd).map((l) => l.state()), fog: active?.cam.fogState() ?? null };
1649
1653
  }
1650
1654
  /**
1651
1655
  * Lights and fog: when the composition has a light layer or the camera writes fog, every threeD layer draws with the lit shader, fed with
@@ -1657,7 +1661,7 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1657
1661
  const fog = cam?.fogState() ?? null;
1658
1662
  if (this._lights.length === 0 && !this._cameras.some((c) => c.fog)) return;
1659
1663
  const states = this._liveLights(t, compEnd).map((l) => l.state());
1660
- const packed = states.length > 0 ? chunk7EI2N7WO_cjs.packLights(states) : null;
1664
+ const packed = states.length > 0 ? chunkX62H3RBG_cjs.packLights(states) : null;
1661
1665
  this._lighting = states.length > 0 ? { states, cam: { x: basis.cx, y: basis.cy, z: basis.cz } } : null;
1662
1666
  const shadowing = states.some((s) => s.castsShadows);
1663
1667
  const casters = shadowing ? this._layers3d.filter((l) => l.spec.castsShadows && l.display.visible && l.world && l.source) : [];
@@ -1666,7 +1670,7 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1666
1670
  const mat = l.setLit(true);
1667
1671
  if (!mat || !l.world) continue;
1668
1672
  const lit = l.spec.lit !== false;
1669
- const mine = lit ? casters.filter((c) => c !== l).slice(0, chunk7EI2N7WO_cjs.MAX_CASTERS).map((c) => ({ frame: c.world, source: c.source })) : [];
1673
+ const mine = lit ? casters.filter((c) => c !== l).slice(0, chunkX62H3RBG_cjs.MAX_CASTERS).map((c) => ({ frame: c.world, source: c.source })) : [];
1670
1674
  mat.update(l.world, camInfo, lit ? packed : null, fog, mine);
1671
1675
  }
1672
1676
  }
@@ -1677,8 +1681,8 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1677
1681
  for (const l of this._layers3d) l.setBlur(0);
1678
1682
  return;
1679
1683
  }
1680
- const focusDepth = chunk7EI2N7WO_cjs.projectPoint(basis, { x: cam.lookAtX, y: cam.lookAtY, z: cam.focus ?? 0 }).depth;
1681
- if (!(focusDepth > chunk7EI2N7WO_cjs.NEAR)) {
1684
+ const focusDepth = chunkX62H3RBG_cjs.projectPoint(basis, { x: cam.lookAtX, y: cam.lookAtY, z: cam.focus ?? 0 }).depth;
1685
+ if (!(focusDepth > chunkX62H3RBG_cjs.NEAR)) {
1682
1686
  if (!this._dofSaid.behind) {
1683
1687
  this._dofSaid.behind = true;
1684
1688
  console.warn(`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.spec)}: the camera's focus (z = ${(cam.focus ?? 0).toFixed(0)}) is at or behind the camera, so nothing is blurred. Put focus in front of the camera (a z below the camera's z)`);
@@ -1688,12 +1692,12 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1688
1692
  }
1689
1693
  let blurred = 0;
1690
1694
  for (const l of this._layers3d) {
1691
- l.setBlur(l.display.visible ? chunk7EI2N7WO_cjs.blurRadius(aperture, basis.focal, l.depth, focusDepth) : 0);
1695
+ l.setBlur(l.display.visible ? chunkX62H3RBG_cjs.blurRadius(aperture, basis.focal, l.depth, focusDepth) : 0);
1692
1696
  if (l.blur > 0) blurred++;
1693
1697
  }
1694
- if (blurred >= chunk7EI2N7WO_cjs.MANY_BLURRED && !this._dofSaid.many) {
1698
+ if (blurred >= chunkX62H3RBG_cjs.MANY_BLURRED && !this._dofSaid.many) {
1695
1699
  this._dofSaid.many = true;
1696
- console.warn(`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.spec)}: ${blurred} layers are blurred by depth of field at once (it warns from ${chunk7EI2N7WO_cjs.MANY_BLURRED}); each costs a filter pass per frame (WebGPU more). Merge the far layers or lower aperture`);
1700
+ console.warn(`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.spec)}: ${blurred} layers are blurred by depth of field at once (it warns from ${chunkX62H3RBG_cjs.MANY_BLURRED}); each costs a filter pass per frame (WebGPU more). Merge the far layers or lower aperture`);
1697
1701
  }
1698
1702
  }
1699
1703
  collectAudio(out, baseTime) {
@@ -1707,7 +1711,7 @@ var CompositionSequence = class extends chunk7EI2N7WO_cjs.Sequence {
1707
1711
  const inner = [];
1708
1712
  for (const child of this._children) child.collectAudio(inner, 0);
1709
1713
  const lo = baseTime + this.at, hi = lo + this.duration;
1710
- const table = chunk7EI2N7WO_cjs.clockTable(remap, "time", this.duration, lo, this.scope(), hi);
1714
+ const table = chunkX62H3RBG_cjs.clockTable(remap, "time", this.duration, lo, this.scope(), hi);
1711
1715
  for (const d of inner) {
1712
1716
  const prev = d.warp;
1713
1717
  out.push({ ...d, warp: (t) => t < lo || t > hi ? NaN : prev ? prev(table.at(t)) : table.at(t) });
@@ -1737,5 +1741,5 @@ function frameOf(child) {
1737
1741
 
1738
1742
  exports.CompositionSequence = CompositionSequence;
1739
1743
  exports.maskSourceOf = maskSourceOf;
1740
- //# sourceMappingURL=chunk-27PYJ4JY.cjs.map
1741
- //# sourceMappingURL=chunk-27PYJ4JY.cjs.map
1744
+ //# sourceMappingURL=chunk-3HZV3UHU.cjs.map
1745
+ //# sourceMappingURL=chunk-3HZV3UHU.cjs.map