pixi-effects 0.48.1 → 0.48.2
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 +7 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/dist/Composition-5FKV2IBP.js +7 -0
- package/dist/{Composition-BOLWGT2R.js.map → Composition-5FKV2IBP.js.map} +1 -1
- package/dist/Composition-TJ5D7Z63.cjs +16 -0
- package/dist/{Composition-ZZEOEETS.cjs.map → Composition-TJ5D7Z63.cjs.map} +1 -1
- package/dist/{Spans-MWYFG7RI.cjs → Spans-5ENZ3XGS.cjs} +9 -9
- package/dist/{Spans-MWYFG7RI.cjs.map → Spans-5ENZ3XGS.cjs.map} +1 -1
- package/dist/{Spans-PGXRMD6J.js → Spans-6A3VLHRH.js} +4 -4
- package/dist/{Spans-PGXRMD6J.js.map → Spans-6A3VLHRH.js.map} +1 -1
- package/dist/{chunk-L3XC464G.cjs → chunk-45ALIMAF.cjs} +76 -56
- package/dist/chunk-45ALIMAF.cjs.map +1 -0
- package/dist/{chunk-AJWUCFGM.js → chunk-6D4W2KZQ.js} +3 -3
- package/dist/{chunk-AJWUCFGM.js.map → chunk-6D4W2KZQ.js.map} +1 -1
- package/dist/{chunk-M2LFQY2E.cjs → chunk-CCPJD76D.cjs} +63 -63
- package/dist/{chunk-M2LFQY2E.cjs.map → chunk-CCPJD76D.cjs.map} +1 -1
- package/dist/{chunk-L3MEZZAV.js → chunk-IVKI6CPH.js} +10 -12
- package/dist/chunk-IVKI6CPH.js.map +1 -0
- package/dist/{chunk-IY5YTIK3.js → chunk-RCKLUCB7.js} +36 -16
- package/dist/chunk-RCKLUCB7.js.map +1 -0
- package/dist/{chunk-V3VBHSK6.cjs → chunk-Z3DM4ETD.cjs} +55 -76
- package/dist/chunk-Z3DM4ETD.cjs.map +1 -0
- package/dist/index.cjs +33 -33
- package/dist/index.js +3 -3
- package/dist/loader.css +1 -1
- package/dist/present.cjs +3 -3
- package/dist/present.js +3 -3
- package/dist/three.cjs +5 -5
- package/dist/three.js +1 -1
- package/llms-full.txt +1 -1
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-BOLWGT2R.js +0 -7
- package/dist/Composition-ZZEOEETS.cjs +0 -16
- package/dist/chunk-IY5YTIK3.js.map +0 -1
- package/dist/chunk-L3MEZZAV.js.map +0 -1
- package/dist/chunk-L3XC464G.cjs.map +0 -1
- package/dist/chunk-V3VBHSK6.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZ3DM4ETD_cjs = require('./chunk-Z3DM4ETD.cjs');
|
|
4
4
|
var chunkWYR2AU4W_cjs = require('./chunk-WYR2AU4W.cjs');
|
|
5
5
|
var chunkNGJXVJB7_cjs = require('./chunk-NGJXVJB7.cjs');
|
|
6
6
|
var chunkDOLTCXCL_cjs = require('./chunk-DOLTCXCL.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()] ?? chunkDOLTCXCL_cjs.suggestName(kind,
|
|
36
|
+
if (kind === void 0 || typeof kind === "string" && chunkZ3DM4ETD_cjs.LIGHT_KINDS.includes(kind)) return null;
|
|
37
|
+
const guess = typeof kind === "string" ? KIND_ALIASES[kind.toLowerCase()] ?? chunkDOLTCXCL_cjs.suggestName(kind, chunkZ3DM4ETD_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 ${chunkZ3DM4ETD_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" ? chunkDOLTCXCL_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 && !chunkZ3DM4ETD_cjs.FALLOFFS.includes(raw.falloff)) {
|
|
65
|
+
const guess = typeof raw.falloff === "string" ? chunkDOLTCXCL_cjs.suggestName(raw.falloff, chunkZ3DM4ETD_cjs.FALLOFFS) : null;
|
|
66
|
+
out.push(`falloff ${JSON.stringify(raw.falloff)} is not supported${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkZ3DM4ETD_cjs.FALLOFFS.join(", ")}); none is used`);
|
|
67
67
|
}
|
|
68
68
|
for (const k of Object.keys(raw)) {
|
|
69
|
-
if (
|
|
69
|
+
if (chunkZ3DM4ETD_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 chunkNGJXVJB7_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) && !chunkZ3DM4ETD_cjs.LIGHT_PROPS.includes(k)) out.push(`"${k}" has no effect on a light (use ${chunkZ3DM4ETD_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" && chunkZ3DM4ETD_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 >
|
|
110
|
-
const dropped = direct.slice(
|
|
111
|
-
out.push(`${direct.length} lights, but at most ${
|
|
109
|
+
if (direct.length > chunkZ3DM4ETD_cjs.MAX_LIGHTS) {
|
|
110
|
+
const dropped = direct.slice(chunkZ3DM4ETD_cjs.MAX_LIGHTS).map((l) => nameOf(l, layers.indexOf(l)));
|
|
111
|
+
out.push(`${direct.length} lights, but at most ${chunkZ3DM4ETD_cjs.MAX_LIGHTS} are used (the first ${chunkZ3DM4ETD_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 >
|
|
119
|
-
const dropped = casters.slice(
|
|
120
|
-
out.push(`${casters.length} layers cast shadows, but a layer receives shadows from at most ${
|
|
118
|
+
if (lightsCast && casters.length > chunkZ3DM4ETD_cjs.MAX_CASTERS) {
|
|
119
|
+
const dropped = casters.slice(chunkZ3DM4ETD_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 ${chunkZ3DM4ETD_cjs.MAX_CASTERS} (the first ${chunkZ3DM4ETD_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 =
|
|
306
|
-
var MC =
|
|
307
|
-
var TAPS =
|
|
305
|
+
var ML = chunkZ3DM4ETD_cjs.MAX_LIGHTS;
|
|
306
|
+
var MC = chunkZ3DM4ETD_cjs.MAX_CASTERS;
|
|
307
|
+
var TAPS = chunkZ3DM4ETD_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) *
|
|
668
|
-
rotationY: (c.rotationY ?? 0) *
|
|
667
|
+
rotationX: (c.rotationX ?? 0) * chunkZ3DM4ETD_cjs.DEG,
|
|
668
|
+
rotationY: (c.rotationY ?? 0) * chunkZ3DM4ETD_cjs.DEG,
|
|
669
669
|
rotationZ: c.rotation,
|
|
670
670
|
scaleX: c.scale.x,
|
|
671
671
|
scaleY: c.scale.y,
|
|
@@ -730,20 +730,20 @@ var Layer3D = class {
|
|
|
730
730
|
if (!(needW >= 1 && needH >= 1) || !Number.isFinite(bounds.x) || !Number.isFinite(bounds.y)) return this.hide();
|
|
731
731
|
const size = this.sizeFor(needW, needH);
|
|
732
732
|
const frame = { x: bounds.x - pad, y: bounds.y - pad, width: size.w, height: size.h };
|
|
733
|
-
const projected =
|
|
733
|
+
const projected = chunkZ3DM4ETD_cjs.projectLayer(readLayerTransform(target), frame, basis);
|
|
734
734
|
this.depth = projected.depth;
|
|
735
735
|
{
|
|
736
736
|
const lt = readLayerTransform(target);
|
|
737
|
-
const o =
|
|
738
|
-
const pu =
|
|
739
|
-
const pv =
|
|
737
|
+
const o = chunkZ3DM4ETD_cjs.layerToWorld(lt, frame.x, frame.y);
|
|
738
|
+
const pu = chunkZ3DM4ETD_cjs.layerToWorld(lt, frame.x + frame.width, frame.y);
|
|
739
|
+
const pv = chunkZ3DM4ETD_cjs.layerToWorld(lt, frame.x, frame.y + frame.height);
|
|
740
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 } };
|
|
741
741
|
}
|
|
742
742
|
if (!projected.visible) {
|
|
743
743
|
if (!this.warnedBehind) {
|
|
744
744
|
this.warnedBehind = true;
|
|
745
745
|
if (this.seq.spec.hideBehindCamera) return this.hide();
|
|
746
|
-
if (projected.depth >
|
|
746
|
+
if (projected.depth > chunkZ3DM4ETD_cjs.NEAR) {
|
|
747
747
|
console.warn(
|
|
748
748
|
`pixi-effects: ${chunkNGJXVJB7_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).`
|
|
749
749
|
);
|
|
@@ -775,7 +775,7 @@ var Layer3D = class {
|
|
|
775
775
|
*/
|
|
776
776
|
setBlur(radius) {
|
|
777
777
|
const d = this.display;
|
|
778
|
-
const r = radius >
|
|
778
|
+
const r = radius > chunkZ3DM4ETD_cjs.MIN_BLUR ? Math.min(radius, chunkZ3DM4ETD_cjs.MAX_BLUR) : 0;
|
|
779
779
|
this.blur = r;
|
|
780
780
|
if (r === 0) {
|
|
781
781
|
if (this.blurFilter) {
|
|
@@ -962,7 +962,7 @@ function lintSequence(spec, warn = defaultWarn) {
|
|
|
962
962
|
function lintFocus(camera, siblings, warn = defaultWarn) {
|
|
963
963
|
if (camera.type !== "camera") return;
|
|
964
964
|
const who = chunkNGJXVJB7_cjs.describeLayer(camera);
|
|
965
|
-
for (const p of
|
|
965
|
+
for (const p of chunkZ3DM4ETD_cjs.focusProblems(camera, siblings)) {
|
|
966
966
|
if (p.kind === "missing") {
|
|
967
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`);
|
|
968
968
|
} else if (p.kind === "not-threeD") {
|
|
@@ -1252,7 +1252,7 @@ var MatteSet = class {
|
|
|
1252
1252
|
};
|
|
1253
1253
|
|
|
1254
1254
|
// src/sequences/Composition.ts
|
|
1255
|
-
var CompositionSequence = class extends
|
|
1255
|
+
var CompositionSequence = class extends chunkZ3DM4ETD_cjs.Sequence {
|
|
1256
1256
|
_innerContainer = null;
|
|
1257
1257
|
_compositionShape = null;
|
|
1258
1258
|
_children = [];
|
|
@@ -1319,9 +1319,9 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1319
1319
|
this.intrinsicWidth = width;
|
|
1320
1320
|
this.intrinsicHeight = height;
|
|
1321
1321
|
this._innerContainer = inner;
|
|
1322
|
-
const base =
|
|
1323
|
-
const span = base ?
|
|
1324
|
-
this._remap = base ?
|
|
1322
|
+
const base = chunkZ3DM4ETD_cjs.timeRemapOf(this.spec);
|
|
1323
|
+
const span = base ? chunkZ3DM4ETD_cjs.contentLength(base, this.duration) : this.duration;
|
|
1324
|
+
this._remap = base ? chunkZ3DM4ETD_cjs.remapOf(this.spec, "time", span) : null;
|
|
1325
1325
|
this._contentSpan = span;
|
|
1326
1326
|
this._compositionShape = { width, height, duration: span, spaceAt: (t) => this._spaceAt(t), findLayer: (name) => this._children.find((c) => c.spec.name === name) ?? null, layerNames: () => this._children.map((c) => c.spec.name).filter((n) => !!n) };
|
|
1327
1327
|
const lateKeyframes = [];
|
|
@@ -1339,7 +1339,7 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1339
1339
|
console.warn(`pixi-effects: ${chunkNGJXVJB7_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`);
|
|
1340
1340
|
}
|
|
1341
1341
|
this._children = [];
|
|
1342
|
-
await
|
|
1342
|
+
await chunkZ3DM4ETD_cjs.buildSequenceTree(
|
|
1343
1343
|
this.spec.sequences ?? [],
|
|
1344
1344
|
this._compositionShape,
|
|
1345
1345
|
this.root,
|
|
@@ -1351,22 +1351,22 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1351
1351
|
if (matteNames.size > 0) {
|
|
1352
1352
|
this._mattes = new MatteSet(inner, width, height);
|
|
1353
1353
|
for (const name of matteNames) {
|
|
1354
|
-
const source = this._children.find((c) => c.spec.name === name && !(c instanceof
|
|
1354
|
+
const source = this._children.find((c) => c.spec.name === name && !(c instanceof chunkZ3DM4ETD_cjs.CameraSequence));
|
|
1355
1355
|
if (!source || !source.target || !canBeMatte(source.spec)) continue;
|
|
1356
1356
|
const chain = [];
|
|
1357
1357
|
for (let p = this._parentOf.get(source); p; p = this._parentOf.get(p)) chain.push(p);
|
|
1358
1358
|
this._mattes.add(name, source, chain);
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
|
-
if (this._children.some((c) => c instanceof
|
|
1361
|
+
if (this._children.some((c) => c instanceof chunkZ3DM4ETD_cjs.LightSequence)) {
|
|
1362
1362
|
for (const message of lightSetProblems(this.spec.sequences ?? [])) console.warn(`pixi-effects: ${chunkNGJXVJB7_cjs.describeLayer(this.spec)}: ${message}`);
|
|
1363
1363
|
}
|
|
1364
1364
|
const layerNames = new Set(this._children.map((c) => c.spec.name).filter((n) => !!n));
|
|
1365
1365
|
for (const cam of this._children) {
|
|
1366
|
-
if (!(cam instanceof
|
|
1366
|
+
if (!(cam instanceof chunkZ3DM4ETD_cjs.CameraSequence)) continue;
|
|
1367
1367
|
cam.resolveFocusNames((name) => {
|
|
1368
1368
|
const hit = this._children.find((c) => c.spec.name === name && c.spec.threeD);
|
|
1369
|
-
return hit ?
|
|
1369
|
+
return hit ? chunkZ3DM4ETD_cjs.layerInitialZ(hit.spec, hit.scope()) : void 0;
|
|
1370
1370
|
}, layerNames);
|
|
1371
1371
|
}
|
|
1372
1372
|
const blendSaid = /* @__PURE__ */ new Map();
|
|
@@ -1376,11 +1376,11 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1376
1376
|
else blendSaid.set(message, { spec, n: 1 });
|
|
1377
1377
|
};
|
|
1378
1378
|
for (const child of this._children) {
|
|
1379
|
-
if (child instanceof
|
|
1379
|
+
if (child instanceof chunkZ3DM4ETD_cjs.CameraSequence) {
|
|
1380
1380
|
this._cameras.push(child);
|
|
1381
1381
|
continue;
|
|
1382
1382
|
}
|
|
1383
|
-
if (child instanceof
|
|
1383
|
+
if (child instanceof chunkZ3DM4ETD_cjs.LightSequence) {
|
|
1384
1384
|
this._lights.push(child);
|
|
1385
1385
|
continue;
|
|
1386
1386
|
}
|
|
@@ -1414,7 +1414,7 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1414
1414
|
if (maskSrc.kind === "inline") {
|
|
1415
1415
|
const maskSpec = maskSrc.spec;
|
|
1416
1416
|
const lifetime = maskSpec.at === void 0 ? { at: child.at, duration: maskSpec.duration ?? child.duration } : {};
|
|
1417
|
-
const built = await
|
|
1417
|
+
const built = await chunkZ3DM4ETD_cjs.buildSequenceTree([{ ...maskSpec, ...lifetime }], this._compositionShape, this.root);
|
|
1418
1418
|
const maskSeq = built[0];
|
|
1419
1419
|
if (maskSeq?.target) {
|
|
1420
1420
|
child.maskSequence = maskSeq;
|
|
@@ -1470,9 +1470,9 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1470
1470
|
const remap = this._remap;
|
|
1471
1471
|
const childOffset = remap ? 0 : offset + this.at;
|
|
1472
1472
|
this._childBase = childOffset;
|
|
1473
|
-
const target = remap ?
|
|
1473
|
+
const target = remap ? chunkZ3DM4ETD_cjs.createTimeline({ paused: true, defaults: { ease: "none" } }) : timeline;
|
|
1474
1474
|
for (const child of this._children) {
|
|
1475
|
-
const own =
|
|
1475
|
+
const own = chunkZ3DM4ETD_cjs.createTimeline({ defaults: { ease: "none" } });
|
|
1476
1476
|
child.bindTimeline(own, childOffset);
|
|
1477
1477
|
child.maskSequence?.bindTimeline(own, childOffset);
|
|
1478
1478
|
target.add(own, 0);
|
|
@@ -1502,8 +1502,8 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1502
1502
|
this._clock = clock;
|
|
1503
1503
|
const scope = this.scope();
|
|
1504
1504
|
if (remap.start !== void 0 && remap.timeKfs.length === 0) clock.time = remap.start;
|
|
1505
|
-
|
|
1506
|
-
this._warnUnreachable(
|
|
1505
|
+
chunkZ3DM4ETD_cjs.bindClock(timeline, clock, "time", remap, this.duration, offset + this.at, scope);
|
|
1506
|
+
this._warnUnreachable(chunkZ3DM4ETD_cjs.clockTable(remap, "time", this.duration, offset + this.at, scope, offset + this.at + this.duration), offset + this.at, offset + this.at + this.duration);
|
|
1507
1507
|
}
|
|
1508
1508
|
/**
|
|
1509
1509
|
* 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
|
|
@@ -1541,7 +1541,7 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1541
1541
|
for (let p = this._parentOf.get(seq); p; p = this._parentOf.get(p)) out.push(p);
|
|
1542
1542
|
return out;
|
|
1543
1543
|
};
|
|
1544
|
-
return [...this._visual.map((v) => v.seq), ...this._nested].filter((seq) => !(seq instanceof
|
|
1544
|
+
return [...this._visual.map((v) => v.seq), ...this._nested].filter((seq) => !(seq instanceof chunkZ3DM4ETD_cjs.NullSequence)).map((seq) => {
|
|
1545
1545
|
const layer = this._visual.find((v) => v.seq === seq)?.layer ?? null;
|
|
1546
1546
|
return {
|
|
1547
1547
|
seq,
|
|
@@ -1551,24 +1551,24 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1551
1551
|
depthBlur: layer?.blur ?? 0,
|
|
1552
1552
|
quad: layer && layer.display.visible ? layer.corners : null,
|
|
1553
1553
|
// how lit it is (threeD layers that receive the lights of the last frame only); computed here, not per frame
|
|
1554
|
-
light: layer && this._lighting && layer.world && layer.spec.lit !== false ?
|
|
1554
|
+
light: layer && this._lighting && layer.world && layer.spec.lit !== false ? chunkZ3DM4ETD_cjs.lightLevel(layer.world, this._lighting.cam, this._lighting.states) : void 0
|
|
1555
1555
|
};
|
|
1556
1556
|
});
|
|
1557
1557
|
}
|
|
1558
1558
|
/** Match every `parent: 'name'` to a null layer; anything that cannot work is said out loud and drawn unparented. */
|
|
1559
1559
|
_resolveParents() {
|
|
1560
|
-
const nulls = this._children.filter((c) => c instanceof
|
|
1560
|
+
const nulls = this._children.filter((c) => c instanceof chunkZ3DM4ETD_cjs.NullSequence);
|
|
1561
1561
|
const nullNames = nulls.map((n) => n.spec.name).filter((n) => !!n);
|
|
1562
1562
|
const warned = /* @__PURE__ */ new Set();
|
|
1563
1563
|
for (const child of this._children) {
|
|
1564
1564
|
const want = child.spec.parent;
|
|
1565
1565
|
if (want === void 0) continue;
|
|
1566
1566
|
const who = chunkNGJXVJB7_cjs.describeLayer(child.spec);
|
|
1567
|
-
if (child instanceof
|
|
1567
|
+
if (child instanceof chunkZ3DM4ETD_cjs.CameraSequence) {
|
|
1568
1568
|
console.warn(`pixi-effects: ${who}: a camera cannot have a parent; ignored`);
|
|
1569
1569
|
continue;
|
|
1570
1570
|
}
|
|
1571
|
-
if (child instanceof
|
|
1571
|
+
if (child instanceof chunkZ3DM4ETD_cjs.LightSequence) {
|
|
1572
1572
|
console.warn(`pixi-effects: ${who}: a light cannot have a parent (parent "${want}" ignored: move the light with its own x / y / z keyframes)`);
|
|
1573
1573
|
continue;
|
|
1574
1574
|
}
|
|
@@ -1582,7 +1582,7 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1582
1582
|
console.warn(`pixi-effects: ${who}: parent "${want}": no layer with that name${hint ? `; did you mean "${hint}"?` : ""} (the layer is drawn without a parent)`);
|
|
1583
1583
|
continue;
|
|
1584
1584
|
}
|
|
1585
|
-
const holder = same.find((c) => c instanceof
|
|
1585
|
+
const holder = same.find((c) => c instanceof chunkZ3DM4ETD_cjs.NullSequence);
|
|
1586
1586
|
if (!holder) {
|
|
1587
1587
|
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)`);
|
|
1588
1588
|
continue;
|
|
@@ -1627,8 +1627,8 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1627
1627
|
childT,
|
|
1628
1628
|
compEnd
|
|
1629
1629
|
);
|
|
1630
|
-
const cam = active ? active.cam.state() :
|
|
1631
|
-
const basis =
|
|
1630
|
+
const cam = active ? active.cam.state() : chunkZ3DM4ETD_cjs.homeCamera(width, height);
|
|
1631
|
+
const basis = chunkZ3DM4ETD_cjs.cameraBasis(cam, width, height);
|
|
1632
1632
|
for (const layer of this._layers3d) layer.update(host, basis);
|
|
1633
1633
|
this._applyLighting(childT, compEnd, basis, active?.cam ?? null);
|
|
1634
1634
|
this._applyDepthOfField(cam, basis);
|
|
@@ -1651,7 +1651,7 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1651
1651
|
const { width, height } = this._compositionShape;
|
|
1652
1652
|
const compEnd = this._childBase + (this.duration ?? 0);
|
|
1653
1653
|
const active = pickActiveCamera(this._cameras.map((cam) => ({ cam, ...cam.window() })), t, compEnd);
|
|
1654
|
-
return { camera: active ? active.cam.state() :
|
|
1654
|
+
return { camera: active ? active.cam.state() : chunkZ3DM4ETD_cjs.homeCamera(width, height), lights: this._liveLights(t, compEnd).map((l) => l.state()), fog: active?.cam.fogState() ?? null };
|
|
1655
1655
|
}
|
|
1656
1656
|
/**
|
|
1657
1657
|
* 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
|
|
@@ -1663,7 +1663,7 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1663
1663
|
const fog = cam?.fogState() ?? null;
|
|
1664
1664
|
if (this._lights.length === 0 && !this._cameras.some((c) => c.fog)) return;
|
|
1665
1665
|
const states = this._liveLights(t, compEnd).map((l) => l.state());
|
|
1666
|
-
const packed = states.length > 0 ?
|
|
1666
|
+
const packed = states.length > 0 ? chunkZ3DM4ETD_cjs.packLights(states) : null;
|
|
1667
1667
|
this._lighting = states.length > 0 ? { states, cam: { x: basis.cx, y: basis.cy, z: basis.cz } } : null;
|
|
1668
1668
|
const shadowing = states.some((s) => s.castsShadows);
|
|
1669
1669
|
const casters = shadowing ? this._layers3d.filter((l) => l.spec.castsShadows && l.display.visible && l.world && l.source) : [];
|
|
@@ -1672,7 +1672,7 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1672
1672
|
const mat = l.setLit(true);
|
|
1673
1673
|
if (!mat || !l.world) continue;
|
|
1674
1674
|
const lit = l.spec.lit !== false;
|
|
1675
|
-
const mine = lit ? casters.filter((c) => c !== l).slice(0,
|
|
1675
|
+
const mine = lit ? casters.filter((c) => c !== l).slice(0, chunkZ3DM4ETD_cjs.MAX_CASTERS).map((c) => ({ frame: c.world, source: c.source })) : [];
|
|
1676
1676
|
mat.update(l.world, camInfo, lit ? packed : null, fog, mine);
|
|
1677
1677
|
}
|
|
1678
1678
|
}
|
|
@@ -1683,8 +1683,8 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1683
1683
|
for (const l of this._layers3d) l.setBlur(0);
|
|
1684
1684
|
return;
|
|
1685
1685
|
}
|
|
1686
|
-
const focusDepth =
|
|
1687
|
-
if (!(focusDepth >
|
|
1686
|
+
const focusDepth = chunkZ3DM4ETD_cjs.projectPoint(basis, { x: cam.lookAtX, y: cam.lookAtY, z: cam.focus ?? 0 }).depth;
|
|
1687
|
+
if (!(focusDepth > chunkZ3DM4ETD_cjs.NEAR)) {
|
|
1688
1688
|
if (!this._dofSaid.behind) {
|
|
1689
1689
|
this._dofSaid.behind = true;
|
|
1690
1690
|
console.warn(`pixi-effects: ${chunkNGJXVJB7_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)`);
|
|
@@ -1694,12 +1694,12 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1694
1694
|
}
|
|
1695
1695
|
let blurred = 0;
|
|
1696
1696
|
for (const l of this._layers3d) {
|
|
1697
|
-
l.setBlur(l.display.visible ?
|
|
1697
|
+
l.setBlur(l.display.visible ? chunkZ3DM4ETD_cjs.blurRadius(aperture, basis.focal, l.depth, focusDepth) : 0);
|
|
1698
1698
|
if (l.blur > 0) blurred++;
|
|
1699
1699
|
}
|
|
1700
|
-
if (blurred >=
|
|
1700
|
+
if (blurred >= chunkZ3DM4ETD_cjs.MANY_BLURRED && !this._dofSaid.many) {
|
|
1701
1701
|
this._dofSaid.many = true;
|
|
1702
|
-
console.warn(`pixi-effects: ${chunkNGJXVJB7_cjs.describeLayer(this.spec)}: ${blurred} layers are blurred by depth of field at once (it warns from ${
|
|
1702
|
+
console.warn(`pixi-effects: ${chunkNGJXVJB7_cjs.describeLayer(this.spec)}: ${blurred} layers are blurred by depth of field at once (it warns from ${chunkZ3DM4ETD_cjs.MANY_BLURRED}); each costs a filter pass per frame (WebGPU more). Merge the far layers or lower aperture`);
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
1705
1705
|
collectAudio(out, baseTime) {
|
|
@@ -1713,7 +1713,7 @@ var CompositionSequence = class extends chunkV3VBHSK6_cjs.Sequence {
|
|
|
1713
1713
|
const inner = [];
|
|
1714
1714
|
for (const child of this._children) child.collectAudio(inner, 0);
|
|
1715
1715
|
const lo = baseTime + this.at, hi = lo + this.duration;
|
|
1716
|
-
const table =
|
|
1716
|
+
const table = chunkZ3DM4ETD_cjs.clockTable(remap, "time", this.duration, lo, this.scope(), hi);
|
|
1717
1717
|
for (const d of inner) {
|
|
1718
1718
|
const prev = d.warp;
|
|
1719
1719
|
out.push({ ...d, warp: (t) => t < lo || t > hi ? NaN : prev ? prev(table.at(t)) : table.at(t) });
|
|
@@ -1743,5 +1743,5 @@ function frameOf(child) {
|
|
|
1743
1743
|
|
|
1744
1744
|
exports.CompositionSequence = CompositionSequence;
|
|
1745
1745
|
exports.maskSourceOf = maskSourceOf;
|
|
1746
|
-
//# sourceMappingURL=chunk-
|
|
1747
|
-
//# sourceMappingURL=chunk-
|
|
1746
|
+
//# sourceMappingURL=chunk-CCPJD76D.cjs.map
|
|
1747
|
+
//# sourceMappingURL=chunk-CCPJD76D.cjs.map
|