pixi-effects 0.30.0 → 0.31.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.
- package/CHANGELOG.md +25 -0
- package/README.md +6 -5
- package/ai/chat-template.html +3 -3
- package/ai/tools/check.mjs +42 -2
- package/ai/tools/lookup.mjs +12 -6
- package/ai/tools/render.mjs +15 -2
- package/ai/tools/varArgs.mjs +75 -0
- package/dist/{Base-CB1_FPZD.d.cts → Base-BKagtWc0.d.cts} +1 -1
- package/dist/{Base-Ne74ztNl.d.ts → Base-jRiMHcWT.d.ts} +1 -1
- package/dist/Composition-DQCPJPFE.js +7 -0
- package/dist/{Composition-RJGA7KDU.js.map → Composition-DQCPJPFE.js.map} +1 -1
- package/dist/Composition-V2XYSW6P.cjs +16 -0
- package/dist/{Composition-MUKR3FYD.cjs.map → Composition-V2XYSW6P.cjs.map} +1 -1
- package/dist/Controller.cjs +42 -1
- package/dist/Controller.cjs.map +1 -1
- package/dist/Controller.d.cts +10 -2
- package/dist/Controller.d.ts +10 -2
- package/dist/Controller.js +42 -1
- package/dist/Controller.js.map +1 -1
- package/dist/{Movie-DdnpLpw1.d.cts → Movie-BH81stkb.d.cts} +90 -3
- package/dist/{Movie-C2rZFkrO.d.ts → Movie-CfFPItoL.d.ts} +90 -3
- package/dist/{chunk-A3Q3SDSH.js → chunk-BGMCZA36.js} +3 -3
- package/dist/{chunk-A3Q3SDSH.js.map → chunk-BGMCZA36.js.map} +1 -1
- package/dist/{chunk-ZVUO325O.cjs → chunk-DJ5B7IKT.cjs} +9 -3
- package/dist/chunk-DJ5B7IKT.cjs.map +1 -0
- package/dist/{chunk-WHNADXXG.cjs → chunk-L73KRFXI.cjs} +61 -61
- package/dist/{chunk-WHNADXXG.cjs.map → chunk-L73KRFXI.cjs.map} +1 -1
- package/dist/{chunk-ZAXYPXKW.js → chunk-MMTESMJ5.js} +9 -4
- package/dist/chunk-MMTESMJ5.js.map +1 -0
- package/dist/{chunk-CRQFDY7E.js → chunk-UTIBYMIO.js} +461 -56
- package/dist/chunk-UTIBYMIO.js.map +1 -0
- package/dist/{chunk-HREBQAY4.cjs → chunk-X3WHETQ3.cjs} +485 -80
- package/dist/chunk-X3WHETQ3.cjs.map +1 -0
- package/dist/index.cjs +31 -31
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -3
- package/dist/loader.css +1 -1
- package/dist/present.cjs +3 -3
- package/dist/present.d.cts +2 -2
- package/dist/present.d.ts +2 -2
- package/dist/present.js +3 -3
- package/dist/three.cjs +5 -5
- package/dist/three.d.cts +2 -2
- package/dist/three.d.ts +2 -2
- package/dist/three.js +1 -1
- package/dist/{types-BzIB65Vk.d.cts → types-CK_crNAI.d.cts} +2 -0
- package/dist/{types-BzIB65Vk.d.ts → types-CK_crNAI.d.ts} +2 -0
- package/docs/api.md +28 -1
- package/docs/dsl.md +32 -1
- package/llms-full.txt +145 -11
- package/package.json +83 -20
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/cheatsheet.md +3 -0
- package/skills/pixi-effects/reference/pitfalls.md +4 -0
- package/skills/pixi-effects/reference/recipes.md +79 -8
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-MUKR3FYD.cjs +0 -16
- package/dist/Composition-RJGA7KDU.js +0 -7
- package/dist/chunk-CRQFDY7E.js.map +0 -1
- package/dist/chunk-HREBQAY4.cjs.map +0 -1
- package/dist/chunk-ZAXYPXKW.js.map +0 -1
- package/dist/chunk-ZVUO325O.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDJ5B7IKT_cjs = require('./chunk-DJ5B7IKT.cjs');
|
|
4
4
|
var chunk2DXPTKQZ_cjs = require('./chunk-2DXPTKQZ.cjs');
|
|
5
5
|
var chunkLYOKH7KE_cjs = require('./chunk-LYOKH7KE.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" &&
|
|
37
|
-
const guess = typeof kind === "string" ? KIND_ALIASES[kind.toLowerCase()] ?? chunkTWZNOUM7_cjs.suggestName(kind,
|
|
36
|
+
if (kind === void 0 || typeof kind === "string" && chunkDJ5B7IKT_cjs.LIGHT_KINDS.includes(kind)) return null;
|
|
37
|
+
const guess = typeof kind === "string" ? KIND_ALIASES[kind.toLowerCase()] ?? chunkTWZNOUM7_cjs.suggestName(kind, chunkDJ5B7IKT_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 ${
|
|
39
|
+
return `kind ${shown} is not a light kind${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkDJ5B7IKT_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 && !
|
|
65
|
-
const guess = typeof raw.falloff === "string" ? chunkTWZNOUM7_cjs.suggestName(raw.falloff,
|
|
66
|
-
out.push(`falloff ${JSON.stringify(raw.falloff)} is not supported${guess ? `; did you mean "${guess}"?` : ""} (use ${
|
|
64
|
+
if (raw.falloff !== void 0 && !chunkDJ5B7IKT_cjs.FALLOFFS.includes(raw.falloff)) {
|
|
65
|
+
const guess = typeof raw.falloff === "string" ? chunkTWZNOUM7_cjs.suggestName(raw.falloff, chunkDJ5B7IKT_cjs.FALLOFFS) : null;
|
|
66
|
+
out.push(`falloff ${JSON.stringify(raw.falloff)} is not supported${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkDJ5B7IKT_cjs.FALLOFFS.join(", ")}); none is used`);
|
|
67
67
|
}
|
|
68
68
|
for (const k of Object.keys(raw)) {
|
|
69
|
-
if (
|
|
69
|
+
if (chunkDJ5B7IKT_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 chunkLYOKH7KE_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) && !
|
|
76
|
+
else if (!explained.has(k) && !chunkDJ5B7IKT_cjs.LIGHT_PROPS.includes(k)) out.push(`"${k}" has no effect on a light (use ${chunkDJ5B7IKT_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" &&
|
|
81
|
+
const kindNow = typeof raw.kind === "string" && chunkDJ5B7IKT_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,17 +106,17 @@ 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 >
|
|
110
|
-
const dropped = direct.slice(
|
|
111
|
-
out.push(`${direct.length} lights, but at most ${
|
|
109
|
+
if (direct.length > chunkDJ5B7IKT_cjs.MAX_LIGHTS) {
|
|
110
|
+
const dropped = direct.slice(chunkDJ5B7IKT_cjs.MAX_LIGHTS).map((l) => nameOf(l, layers.indexOf(l)));
|
|
111
|
+
out.push(`${direct.length} lights, but at most ${chunkDJ5B7IKT_cjs.MAX_LIGHTS} are used (the first ${chunkDJ5B7IKT_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
|
if (lightsCast && casters.length === 0) out.push("a light has castsShadows but no layer has castsShadows: add castsShadows: true to the threeD layers that should cast a shadow");
|
|
117
|
-
if (lightsCast && casters.length >
|
|
118
|
-
const dropped = casters.slice(
|
|
119
|
-
out.push(`${casters.length} layers cast shadows, but a layer receives shadows from at most ${
|
|
117
|
+
if (lightsCast && casters.length > chunkDJ5B7IKT_cjs.MAX_CASTERS) {
|
|
118
|
+
const dropped = casters.slice(chunkDJ5B7IKT_cjs.MAX_CASTERS).map((c) => nameOf(c, layers.indexOf(c)));
|
|
119
|
+
out.push(`${casters.length} layers cast shadows, but a layer receives shadows from at most ${chunkDJ5B7IKT_cjs.MAX_CASTERS} (the first ${chunkDJ5B7IKT_cjs.MAX_CASTERS}, in layer order); ${dropped.join(", ")} and later cast none`);
|
|
120
120
|
}
|
|
121
121
|
const softLights = lights.filter((l) => l.castsShadows && numbersOf(l, "shadowDiffusion").some((v) => v > 0));
|
|
122
122
|
if (softLights.length >= SOFT_LIGHTS) {
|
|
@@ -301,9 +301,9 @@ var roundPixelsBit = {
|
|
|
301
301
|
name: "round-pixels-bit",
|
|
302
302
|
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; }` }
|
|
303
303
|
};
|
|
304
|
-
var ML =
|
|
305
|
-
var MC =
|
|
306
|
-
var TAPS =
|
|
304
|
+
var ML = chunkDJ5B7IKT_cjs.MAX_LIGHTS;
|
|
305
|
+
var MC = chunkDJ5B7IKT_cjs.MAX_CASTERS;
|
|
306
|
+
var TAPS = chunkDJ5B7IKT_cjs.SHADOW_TAPS;
|
|
307
307
|
var SHADOW_KEYS = Array.from({ length: MC }, (_, j) => `uShadow${j}`);
|
|
308
308
|
var WGSL_SHADOW_DECLS = SHADOW_KEYS.map((k, j) => ` @group(2) @binding(${4 + j}) var ${k}: texture_2d<f32>;`).join("\n");
|
|
309
309
|
var WGSL_SHADOW_PICK = SHADOW_KEYS.map((k, j) => (j === 0 ? "" : "else ") + `if (j == ${j}) { a = textureSampleLevel(${k}, uSampler, uv, 0.0).a; }`).join(" ");
|
|
@@ -663,8 +663,8 @@ function readLayerTransform(target) {
|
|
|
663
663
|
x: c.x,
|
|
664
664
|
y: c.y,
|
|
665
665
|
z: c.z ?? 0,
|
|
666
|
-
rotationX: (c.rotationX ?? 0) *
|
|
667
|
-
rotationY: (c.rotationY ?? 0) *
|
|
666
|
+
rotationX: (c.rotationX ?? 0) * chunkDJ5B7IKT_cjs.DEG,
|
|
667
|
+
rotationY: (c.rotationY ?? 0) * chunkDJ5B7IKT_cjs.DEG,
|
|
668
668
|
rotationZ: c.rotation,
|
|
669
669
|
scaleX: c.scale.x,
|
|
670
670
|
scaleY: c.scale.y,
|
|
@@ -727,20 +727,20 @@ var Layer3D = class {
|
|
|
727
727
|
if (!(needW >= 1 && needH >= 1) || !Number.isFinite(bounds.x) || !Number.isFinite(bounds.y)) return this.hide();
|
|
728
728
|
const size = this.sizeFor(needW, needH);
|
|
729
729
|
const frame = { x: bounds.x - pad, y: bounds.y - pad, width: size.w, height: size.h };
|
|
730
|
-
const projected =
|
|
730
|
+
const projected = chunkDJ5B7IKT_cjs.projectLayer(readLayerTransform(target), frame, basis);
|
|
731
731
|
this.depth = projected.depth;
|
|
732
732
|
{
|
|
733
733
|
const lt = readLayerTransform(target);
|
|
734
|
-
const o =
|
|
735
|
-
const pu =
|
|
736
|
-
const pv =
|
|
734
|
+
const o = chunkDJ5B7IKT_cjs.layerToWorld(lt, frame.x, frame.y);
|
|
735
|
+
const pu = chunkDJ5B7IKT_cjs.layerToWorld(lt, frame.x + frame.width, frame.y);
|
|
736
|
+
const pv = chunkDJ5B7IKT_cjs.layerToWorld(lt, frame.x, frame.y + frame.height);
|
|
737
737
|
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 } };
|
|
738
738
|
}
|
|
739
739
|
if (!projected.visible) {
|
|
740
740
|
if (!this.warnedBehind) {
|
|
741
741
|
this.warnedBehind = true;
|
|
742
742
|
if (this.seq.spec.hideBehindCamera) return this.hide();
|
|
743
|
-
if (projected.depth >
|
|
743
|
+
if (projected.depth > chunkDJ5B7IKT_cjs.NEAR) {
|
|
744
744
|
console.warn(
|
|
745
745
|
`pixi-effects: ${chunkLYOKH7KE_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).`
|
|
746
746
|
);
|
|
@@ -771,7 +771,7 @@ var Layer3D = class {
|
|
|
771
771
|
*/
|
|
772
772
|
setBlur(radius) {
|
|
773
773
|
const d = this.display;
|
|
774
|
-
const r = radius >
|
|
774
|
+
const r = radius > chunkDJ5B7IKT_cjs.MIN_BLUR ? Math.min(radius, chunkDJ5B7IKT_cjs.MAX_BLUR) : 0;
|
|
775
775
|
this.blur = r;
|
|
776
776
|
if (r === 0) {
|
|
777
777
|
if (this.blurFilter) {
|
|
@@ -958,7 +958,7 @@ function lintSequence(spec, warn = defaultWarn) {
|
|
|
958
958
|
function lintFocus(camera, siblings, warn = defaultWarn) {
|
|
959
959
|
if (camera.type !== "camera") return;
|
|
960
960
|
const who = chunkLYOKH7KE_cjs.describeLayer(camera);
|
|
961
|
-
for (const p of
|
|
961
|
+
for (const p of chunkDJ5B7IKT_cjs.focusProblems(camera, siblings)) {
|
|
962
962
|
if (p.kind === "missing") {
|
|
963
963
|
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`);
|
|
964
964
|
} else if (p.kind === "not-threeD") {
|
|
@@ -1248,7 +1248,7 @@ var MatteSet = class {
|
|
|
1248
1248
|
};
|
|
1249
1249
|
|
|
1250
1250
|
// src/sequences/Composition.ts
|
|
1251
|
-
var CompositionSequence = class extends
|
|
1251
|
+
var CompositionSequence = class extends chunkDJ5B7IKT_cjs.Sequence {
|
|
1252
1252
|
_innerContainer = null;
|
|
1253
1253
|
_compositionShape = null;
|
|
1254
1254
|
_children = [];
|
|
@@ -1315,9 +1315,9 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1315
1315
|
this.intrinsicWidth = width;
|
|
1316
1316
|
this.intrinsicHeight = height;
|
|
1317
1317
|
this._innerContainer = inner;
|
|
1318
|
-
const base =
|
|
1319
|
-
const span = base ?
|
|
1320
|
-
this._remap = base ?
|
|
1318
|
+
const base = chunkDJ5B7IKT_cjs.timeRemapOf(this.spec);
|
|
1319
|
+
const span = base ? chunkDJ5B7IKT_cjs.contentLength(base, this.duration) : this.duration;
|
|
1320
|
+
this._remap = base ? chunkDJ5B7IKT_cjs.remapOf(this.spec, "time", span) : null;
|
|
1321
1321
|
this._contentSpan = span;
|
|
1322
1322
|
this._compositionShape = { width, height, duration: span };
|
|
1323
1323
|
const lateKeyframes = [];
|
|
@@ -1334,7 +1334,7 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1334
1334
|
if (crowd >= chunk2DXPTKQZ_cjs.MANY_ADVANCED) {
|
|
1335
1335
|
console.warn(`pixi-effects: ${chunkLYOKH7KE_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`);
|
|
1336
1336
|
}
|
|
1337
|
-
this._children = await
|
|
1337
|
+
this._children = await chunkDJ5B7IKT_cjs.buildSequenceTree(
|
|
1338
1338
|
this.spec.sequences ?? [],
|
|
1339
1339
|
this._compositionShape,
|
|
1340
1340
|
this.root
|
|
@@ -1345,22 +1345,22 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1345
1345
|
if (matteNames.size > 0) {
|
|
1346
1346
|
this._mattes = new MatteSet(inner, width, height);
|
|
1347
1347
|
for (const name of matteNames) {
|
|
1348
|
-
const source = this._children.find((c) => c.spec.name === name && !(c instanceof
|
|
1348
|
+
const source = this._children.find((c) => c.spec.name === name && !(c instanceof chunkDJ5B7IKT_cjs.CameraSequence));
|
|
1349
1349
|
if (!source || !source.target || !canBeMatte(source.spec)) continue;
|
|
1350
1350
|
const chain = [];
|
|
1351
1351
|
for (let p = this._parentOf.get(source); p; p = this._parentOf.get(p)) chain.push(p);
|
|
1352
1352
|
this._mattes.add(name, source, chain);
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
|
-
if (this._children.some((c) => c instanceof
|
|
1355
|
+
if (this._children.some((c) => c instanceof chunkDJ5B7IKT_cjs.LightSequence)) {
|
|
1356
1356
|
for (const message of lightSetProblems(this.spec.sequences ?? [])) console.warn(`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(this.spec)}: ${message}`);
|
|
1357
1357
|
}
|
|
1358
1358
|
const layerNames = new Set(this._children.map((c) => c.spec.name).filter((n) => !!n));
|
|
1359
1359
|
for (const cam of this._children) {
|
|
1360
|
-
if (!(cam instanceof
|
|
1360
|
+
if (!(cam instanceof chunkDJ5B7IKT_cjs.CameraSequence)) continue;
|
|
1361
1361
|
cam.resolveFocusNames((name) => {
|
|
1362
1362
|
const hit = this._children.find((c) => c.spec.name === name && c.spec.threeD);
|
|
1363
|
-
return hit ?
|
|
1363
|
+
return hit ? chunkDJ5B7IKT_cjs.layerInitialZ(hit.spec, hit.scope()) : void 0;
|
|
1364
1364
|
}, layerNames);
|
|
1365
1365
|
}
|
|
1366
1366
|
const blendSaid = /* @__PURE__ */ new Map();
|
|
@@ -1370,11 +1370,11 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1370
1370
|
else blendSaid.set(message, { spec, n: 1 });
|
|
1371
1371
|
};
|
|
1372
1372
|
for (const child of this._children) {
|
|
1373
|
-
if (child instanceof
|
|
1373
|
+
if (child instanceof chunkDJ5B7IKT_cjs.CameraSequence) {
|
|
1374
1374
|
this._cameras.push(child);
|
|
1375
1375
|
continue;
|
|
1376
1376
|
}
|
|
1377
|
-
if (child instanceof
|
|
1377
|
+
if (child instanceof chunkDJ5B7IKT_cjs.LightSequence) {
|
|
1378
1378
|
this._lights.push(child);
|
|
1379
1379
|
continue;
|
|
1380
1380
|
}
|
|
@@ -1408,7 +1408,7 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1408
1408
|
if (maskSrc.kind === "inline") {
|
|
1409
1409
|
const maskSpec = maskSrc.spec;
|
|
1410
1410
|
const lifetime = maskSpec.at === void 0 ? { at: child.at, duration: maskSpec.duration ?? child.duration } : {};
|
|
1411
|
-
const built = await
|
|
1411
|
+
const built = await chunkDJ5B7IKT_cjs.buildSequenceTree([{ ...maskSpec, ...lifetime }], this._compositionShape, this.root);
|
|
1412
1412
|
const maskSeq = built[0];
|
|
1413
1413
|
if (maskSeq?.target) {
|
|
1414
1414
|
child.maskSequence = maskSeq;
|
|
@@ -1464,9 +1464,9 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1464
1464
|
const remap = this._remap;
|
|
1465
1465
|
const childOffset = remap ? 0 : offset + this.at;
|
|
1466
1466
|
this._childBase = childOffset;
|
|
1467
|
-
const target = remap ?
|
|
1467
|
+
const target = remap ? chunkDJ5B7IKT_cjs.createTimeline({ paused: true, defaults: { ease: "none" } }) : timeline;
|
|
1468
1468
|
for (const child of this._children) {
|
|
1469
|
-
const own =
|
|
1469
|
+
const own = chunkDJ5B7IKT_cjs.createTimeline({ defaults: { ease: "none" } });
|
|
1470
1470
|
child.bindTimeline(own, childOffset);
|
|
1471
1471
|
child.maskSequence?.bindTimeline(own, childOffset);
|
|
1472
1472
|
target.add(own, 0);
|
|
@@ -1496,8 +1496,8 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1496
1496
|
this._clock = clock;
|
|
1497
1497
|
const scope = this.scope();
|
|
1498
1498
|
if (remap.start !== void 0 && remap.timeKfs.length === 0) clock.time = remap.start;
|
|
1499
|
-
|
|
1500
|
-
this._warnUnreachable(
|
|
1499
|
+
chunkDJ5B7IKT_cjs.bindClock(timeline, clock, "time", remap, this.duration, offset + this.at, scope);
|
|
1500
|
+
this._warnUnreachable(chunkDJ5B7IKT_cjs.clockTable(remap, "time", this.duration, offset + this.at, scope, offset + this.at + this.duration), offset + this.at, offset + this.at + this.duration);
|
|
1501
1501
|
}
|
|
1502
1502
|
/**
|
|
1503
1503
|
* 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
|
|
@@ -1535,7 +1535,7 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1535
1535
|
for (let p = this._parentOf.get(seq); p; p = this._parentOf.get(p)) out.push(p);
|
|
1536
1536
|
return out;
|
|
1537
1537
|
};
|
|
1538
|
-
return [...this._visual.map((v) => v.seq), ...this._nested].filter((seq) => !(seq instanceof
|
|
1538
|
+
return [...this._visual.map((v) => v.seq), ...this._nested].filter((seq) => !(seq instanceof chunkDJ5B7IKT_cjs.NullSequence)).map((seq) => {
|
|
1539
1539
|
const layer = this._visual.find((v) => v.seq === seq)?.layer ?? null;
|
|
1540
1540
|
return {
|
|
1541
1541
|
seq,
|
|
@@ -1544,24 +1544,24 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1544
1544
|
carriers: carriersOf(seq),
|
|
1545
1545
|
depthBlur: layer?.blur ?? 0,
|
|
1546
1546
|
// how lit it is (threeD layers that receive the lights of the last frame only); computed here, not per frame
|
|
1547
|
-
light: layer && this._lighting && layer.world && layer.spec.lit !== false ?
|
|
1547
|
+
light: layer && this._lighting && layer.world && layer.spec.lit !== false ? chunkDJ5B7IKT_cjs.lightLevel(layer.world, this._lighting.cam, this._lighting.states) : void 0
|
|
1548
1548
|
};
|
|
1549
1549
|
});
|
|
1550
1550
|
}
|
|
1551
1551
|
/** Match every `parent: 'name'` to a null layer; anything that cannot work is said out loud and drawn unparented. */
|
|
1552
1552
|
_resolveParents() {
|
|
1553
|
-
const nulls = this._children.filter((c) => c instanceof
|
|
1553
|
+
const nulls = this._children.filter((c) => c instanceof chunkDJ5B7IKT_cjs.NullSequence);
|
|
1554
1554
|
const nullNames = nulls.map((n) => n.spec.name).filter((n) => !!n);
|
|
1555
1555
|
const warned = /* @__PURE__ */ new Set();
|
|
1556
1556
|
for (const child of this._children) {
|
|
1557
1557
|
const want = child.spec.parent;
|
|
1558
1558
|
if (want === void 0) continue;
|
|
1559
1559
|
const who = chunkLYOKH7KE_cjs.describeLayer(child.spec);
|
|
1560
|
-
if (child instanceof
|
|
1560
|
+
if (child instanceof chunkDJ5B7IKT_cjs.CameraSequence) {
|
|
1561
1561
|
console.warn(`pixi-effects: ${who}: a camera cannot have a parent; ignored`);
|
|
1562
1562
|
continue;
|
|
1563
1563
|
}
|
|
1564
|
-
if (child instanceof
|
|
1564
|
+
if (child instanceof chunkDJ5B7IKT_cjs.LightSequence) {
|
|
1565
1565
|
console.warn(`pixi-effects: ${who}: a light cannot have a parent (parent "${want}" ignored: move the light with its own x / y / z keyframes)`);
|
|
1566
1566
|
continue;
|
|
1567
1567
|
}
|
|
@@ -1575,7 +1575,7 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1575
1575
|
console.warn(`pixi-effects: ${who}: parent "${want}": no layer with that name${hint ? `; did you mean "${hint}"?` : ""} (the layer is drawn without a parent)`);
|
|
1576
1576
|
continue;
|
|
1577
1577
|
}
|
|
1578
|
-
const holder = same.find((c) => c instanceof
|
|
1578
|
+
const holder = same.find((c) => c instanceof chunkDJ5B7IKT_cjs.NullSequence);
|
|
1579
1579
|
if (!holder) {
|
|
1580
1580
|
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)`);
|
|
1581
1581
|
continue;
|
|
@@ -1620,8 +1620,8 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1620
1620
|
childT,
|
|
1621
1621
|
compEnd
|
|
1622
1622
|
);
|
|
1623
|
-
const cam = active ? active.cam.state() :
|
|
1624
|
-
const basis =
|
|
1623
|
+
const cam = active ? active.cam.state() : chunkDJ5B7IKT_cjs.homeCamera(width, height);
|
|
1624
|
+
const basis = chunkDJ5B7IKT_cjs.cameraBasis(cam, width, height);
|
|
1625
1625
|
for (const layer of this._layers3d) layer.update(host, basis);
|
|
1626
1626
|
this._applyLighting(childT, compEnd, basis, active?.cam ?? null);
|
|
1627
1627
|
this._applyDepthOfField(cam, basis);
|
|
@@ -1646,7 +1646,7 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1646
1646
|
return t >= w.start && (t < w.end || w.end >= compEnd && t <= w.end);
|
|
1647
1647
|
});
|
|
1648
1648
|
const states = live.map((l) => l.state());
|
|
1649
|
-
const packed = states.length > 0 ?
|
|
1649
|
+
const packed = states.length > 0 ? chunkDJ5B7IKT_cjs.packLights(states) : null;
|
|
1650
1650
|
this._lighting = states.length > 0 ? { states, cam: { x: basis.cx, y: basis.cy, z: basis.cz } } : null;
|
|
1651
1651
|
const shadowing = states.some((s) => s.castsShadows);
|
|
1652
1652
|
const casters = shadowing ? this._layers3d.filter((l) => l.spec.castsShadows && l.display.visible && l.world && l.source) : [];
|
|
@@ -1655,7 +1655,7 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1655
1655
|
const mat = l.setLit(true);
|
|
1656
1656
|
if (!mat || !l.world) continue;
|
|
1657
1657
|
const lit = l.spec.lit !== false;
|
|
1658
|
-
const mine = lit ? casters.filter((c) => c !== l).slice(0,
|
|
1658
|
+
const mine = lit ? casters.filter((c) => c !== l).slice(0, chunkDJ5B7IKT_cjs.MAX_CASTERS).map((c) => ({ frame: c.world, source: c.source })) : [];
|
|
1659
1659
|
mat.update(l.world, camInfo, lit ? packed : null, fog, mine);
|
|
1660
1660
|
}
|
|
1661
1661
|
}
|
|
@@ -1666,8 +1666,8 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1666
1666
|
for (const l of this._layers3d) l.setBlur(0);
|
|
1667
1667
|
return;
|
|
1668
1668
|
}
|
|
1669
|
-
const focusDepth =
|
|
1670
|
-
if (!(focusDepth >
|
|
1669
|
+
const focusDepth = chunkDJ5B7IKT_cjs.projectPoint(basis, { x: cam.lookAtX, y: cam.lookAtY, z: cam.focus ?? 0 }).depth;
|
|
1670
|
+
if (!(focusDepth > chunkDJ5B7IKT_cjs.NEAR)) {
|
|
1671
1671
|
if (!this._dofSaid.behind) {
|
|
1672
1672
|
this._dofSaid.behind = true;
|
|
1673
1673
|
console.warn(`pixi-effects: ${chunkLYOKH7KE_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)`);
|
|
@@ -1677,10 +1677,10 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1677
1677
|
}
|
|
1678
1678
|
let blurred = 0;
|
|
1679
1679
|
for (const l of this._layers3d) {
|
|
1680
|
-
l.setBlur(l.display.visible ?
|
|
1680
|
+
l.setBlur(l.display.visible ? chunkDJ5B7IKT_cjs.blurRadius(aperture, basis.focal, l.depth, focusDepth) : 0);
|
|
1681
1681
|
if (l.blur > 0) blurred++;
|
|
1682
1682
|
}
|
|
1683
|
-
if (blurred >=
|
|
1683
|
+
if (blurred >= chunkDJ5B7IKT_cjs.MANY_BLURRED && !this._dofSaid.many) {
|
|
1684
1684
|
this._dofSaid.many = true;
|
|
1685
1685
|
console.warn(`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(this.spec)}: ${blurred} layers are blurred by depth of field at once; each costs a filter pass per frame (WebGPU more). Merge the far layers or lower aperture`);
|
|
1686
1686
|
}
|
|
@@ -1696,7 +1696,7 @@ var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
|
1696
1696
|
const inner = [];
|
|
1697
1697
|
for (const child of this._children) child.collectAudio(inner, 0);
|
|
1698
1698
|
const lo = baseTime + this.at, hi = lo + this.duration;
|
|
1699
|
-
const table =
|
|
1699
|
+
const table = chunkDJ5B7IKT_cjs.clockTable(remap, "time", this.duration, lo, this.scope(), hi);
|
|
1700
1700
|
for (const d of inner) {
|
|
1701
1701
|
const prev = d.warp;
|
|
1702
1702
|
out.push({ ...d, warp: (t) => t < lo || t > hi ? NaN : prev ? prev(table.at(t)) : table.at(t) });
|
|
@@ -1726,5 +1726,5 @@ function frameOf(child) {
|
|
|
1726
1726
|
|
|
1727
1727
|
exports.CompositionSequence = CompositionSequence;
|
|
1728
1728
|
exports.maskSourceOf = maskSourceOf;
|
|
1729
|
-
//# sourceMappingURL=chunk-
|
|
1730
|
-
//# sourceMappingURL=chunk-
|
|
1729
|
+
//# sourceMappingURL=chunk-L73KRFXI.cjs.map
|
|
1730
|
+
//# sourceMappingURL=chunk-L73KRFXI.cjs.map
|