pixi-effects 0.28.2 → 0.30.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 +59 -0
- package/README.md +11 -10
- package/ai/chat-template.html +5 -5
- package/ai/tools/check.mjs +18 -3
- package/ai/tools/lookup.mjs +208 -0
- package/ai/tools/pixi-effects.mjs +16 -5
- package/ai/tools/render.mjs +14 -9
- package/ai/tools/view.mjs +6 -2
- package/dist/Base-CB1_FPZD.d.cts +60 -0
- package/dist/Base-Ne74ztNl.d.ts +60 -0
- package/dist/Composition-MUKR3FYD.cjs +16 -0
- package/dist/{Composition-K6B3APM5.cjs.map → Composition-MUKR3FYD.cjs.map} +1 -1
- package/dist/Composition-RJGA7KDU.js +7 -0
- package/dist/{Composition-H7UNR5F5.js.map → Composition-RJGA7KDU.js.map} +1 -1
- package/dist/Controller.cjs +73 -45
- package/dist/Controller.cjs.map +1 -1
- package/dist/Controller.d.cts +16 -22
- package/dist/Controller.d.ts +16 -22
- package/dist/Controller.js +74 -40
- package/dist/Controller.js.map +1 -1
- package/dist/{Movie-CHcM8HNB.d.ts → Movie-C2rZFkrO.d.ts} +227 -119
- package/dist/{Movie-Cx5ozUGb.d.cts → Movie-DdnpLpw1.d.cts} +227 -119
- package/dist/{blendModes-HDOP6R7T.cjs → blendModes-ETMYWATF.cjs} +5 -5
- package/dist/{blendModes-HDOP6R7T.cjs.map → blendModes-ETMYWATF.cjs.map} +1 -1
- package/dist/{blendModes-PAVTW3BO.js → blendModes-RIVZXL5A.js} +4 -4
- package/dist/{blendModes-PAVTW3BO.js.map → blendModes-RIVZXL5A.js.map} +1 -1
- package/dist/{chunk-P4GY3Z4G.cjs → chunk-2DXPTKQZ.cjs} +6 -6
- package/dist/chunk-2DXPTKQZ.cjs.map +1 -0
- package/dist/{chunk-TYWFKCPY.js → chunk-4KB3GUEK.js} +5 -5
- package/dist/chunk-4KB3GUEK.js.map +1 -0
- package/dist/{chunk-5MZWXVTT.js → chunk-A3Q3SDSH.js} +35 -28
- package/dist/chunk-A3Q3SDSH.js.map +1 -0
- package/dist/chunk-CRQFDY7E.js +4182 -0
- package/dist/chunk-CRQFDY7E.js.map +1 -0
- package/dist/chunk-HREBQAY4.cjs +4206 -0
- package/dist/chunk-HREBQAY4.cjs.map +1 -0
- package/dist/{chunk-ZMAD3KJU.cjs → chunk-LYOKH7KE.cjs} +22 -3
- package/dist/chunk-LYOKH7KE.cjs.map +1 -0
- package/dist/{chunk-45QKLD6M.js → chunk-RCVZX2JP.js} +22 -3
- package/dist/chunk-RCVZX2JP.js.map +1 -0
- package/dist/{chunk-KBH33IQX.cjs → chunk-WHNADXXG.cjs} +121 -114
- package/dist/chunk-WHNADXXG.cjs.map +1 -0
- package/dist/{chunk-7VN2KI3U.js → chunk-ZAXYPXKW.js} +14 -6
- package/dist/chunk-ZAXYPXKW.js.map +1 -0
- package/dist/{chunk-MJW7KILM.cjs → chunk-ZVUO325O.cjs} +32 -24
- package/dist/chunk-ZVUO325O.cjs.map +1 -0
- package/dist/index.cjs +106 -4482
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -60
- package/dist/index.d.ts +15 -60
- package/dist/index.js +6 -4457
- package/dist/index.js.map +1 -1
- package/dist/loader.css +1 -1
- package/dist/{Presenter.cjs → present.cjs} +370 -31
- package/dist/present.cjs.map +1 -0
- package/dist/present.d.cts +278 -0
- package/dist/present.d.ts +278 -0
- package/dist/{Presenter.js → present.js} +358 -32
- package/dist/present.js.map +1 -0
- package/dist/three.cjs +6 -6
- package/dist/three.d.cts +2 -2
- package/dist/three.d.ts +2 -2
- package/dist/three.js +2 -2
- package/dist/{types-DpK1vwcl.d.ts → types-BzIB65Vk.d.cts} +11 -265
- package/dist/{types-DpK1vwcl.d.cts → types-BzIB65Vk.d.ts} +11 -265
- package/docs/api.md +44 -77
- package/docs/dsl.md +16 -14
- package/llms-full.txt +121 -117
- package/llms.txt +3 -2
- package/package.json +5 -5
- package/skills/pixi-effects/SKILL.md +7 -7
- package/skills/pixi-effects/reference/cheatsheet.md +9 -9
- package/skills/pixi-effects/reference/direction.md +2 -0
- package/skills/pixi-effects/reference/pitfalls.md +6 -6
- package/skills/pixi-effects/reference/quickstart.md +29 -0
- package/skills/pixi-effects/reference/recipes.md +4 -4
- package/skills/pixi-effects/template.html +7 -7
- package/dist/Base-C6f0fE8j.d.ts +0 -109
- package/dist/Base-DI1FCGcH.d.cts +0 -109
- package/dist/Composition-H7UNR5F5.js +0 -7
- package/dist/Composition-K6B3APM5.cjs +0 -16
- package/dist/Presenter.cjs.map +0 -1
- package/dist/Presenter.d.cts +0 -122
- package/dist/Presenter.d.ts +0 -122
- package/dist/Presenter.js.map +0 -1
- package/dist/chunk-45QKLD6M.js.map +0 -1
- package/dist/chunk-5MZWXVTT.js.map +0 -1
- package/dist/chunk-7VN2KI3U.js.map +0 -1
- package/dist/chunk-KBH33IQX.cjs.map +0 -1
- package/dist/chunk-MJW7KILM.cjs.map +0 -1
- package/dist/chunk-P4GY3Z4G.cjs.map +0 -1
- package/dist/chunk-TYWFKCPY.js.map +0 -1
- package/dist/chunk-ZMAD3KJU.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkZVUO325O_cjs = require('./chunk-ZVUO325O.cjs');
|
|
4
|
+
var chunk2DXPTKQZ_cjs = require('./chunk-2DXPTKQZ.cjs');
|
|
5
|
+
var chunkLYOKH7KE_cjs = require('./chunk-LYOKH7KE.cjs');
|
|
6
6
|
var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
|
|
7
7
|
var pixi_js = require('pixi.js');
|
|
8
8
|
|
|
@@ -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" && chunkZVUO325O_cjs.LIGHT_KINDS.includes(kind)) return null;
|
|
37
|
+
const guess = typeof kind === "string" ? KIND_ALIASES[kind.toLowerCase()] ?? chunkTWZNOUM7_cjs.suggestName(kind, chunkZVUO325O_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 ${chunkZVUO325O_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 && !chunkZVUO325O_cjs.FALLOFFS.includes(raw.falloff)) {
|
|
65
|
+
const guess = typeof raw.falloff === "string" ? chunkTWZNOUM7_cjs.suggestName(raw.falloff, chunkZVUO325O_cjs.FALLOFFS) : null;
|
|
66
|
+
out.push(`falloff ${JSON.stringify(raw.falloff)} is not supported${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkZVUO325O_cjs.FALLOFFS.join(", ")}); none is used`);
|
|
67
67
|
}
|
|
68
68
|
for (const k of Object.keys(raw)) {
|
|
69
|
-
if (
|
|
69
|
+
if (chunkZVUO325O_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
|
-
for (const k of
|
|
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) && !chunkZVUO325O_cjs.LIGHT_PROPS.includes(k)) out.push(`"${k}" has no effect on a light (use ${chunkZVUO325O_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" && chunkZVUO325O_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 > chunkZVUO325O_cjs.MAX_LIGHTS) {
|
|
110
|
+
const dropped = direct.slice(chunkZVUO325O_cjs.MAX_LIGHTS).map((l) => nameOf(l, layers.indexOf(l)));
|
|
111
|
+
out.push(`${direct.length} lights, but at most ${chunkZVUO325O_cjs.MAX_LIGHTS} are used (the first ${chunkZVUO325O_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 > chunkZVUO325O_cjs.MAX_CASTERS) {
|
|
118
|
+
const dropped = casters.slice(chunkZVUO325O_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 ${chunkZVUO325O_cjs.MAX_CASTERS} (the first ${chunkZVUO325O_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 = chunkZVUO325O_cjs.MAX_LIGHTS;
|
|
305
|
+
var MC = chunkZVUO325O_cjs.MAX_CASTERS;
|
|
306
|
+
var TAPS = chunkZVUO325O_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) * chunkZVUO325O_cjs.DEG,
|
|
667
|
+
rotationY: (c.rotationY ?? 0) * chunkZVUO325O_cjs.DEG,
|
|
668
668
|
rotationZ: c.rotation,
|
|
669
669
|
scaleX: c.scale.x,
|
|
670
670
|
scaleY: c.scale.y,
|
|
@@ -727,26 +727,26 @@ 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 = chunkZVUO325O_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 = chunkZVUO325O_cjs.layerToWorld(lt, frame.x, frame.y);
|
|
735
|
+
const pu = chunkZVUO325O_cjs.layerToWorld(lt, frame.x + frame.width, frame.y);
|
|
736
|
+
const pv = chunkZVUO325O_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 > chunkZVUO325O_cjs.NEAR) {
|
|
744
744
|
console.warn(
|
|
745
|
-
`pixi-effects: ${
|
|
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
|
);
|
|
747
747
|
} else {
|
|
748
748
|
console.warn(
|
|
749
|
-
`pixi-effects: ${
|
|
749
|
+
`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(this.seq.spec)} is at or behind the camera plane (z = ${(target.z ?? 0).toFixed(0)}) and is hidden. If that is unintended, lower its z or move the camera back (the default camera sits at z = (height/2)/tan(fov/2), about 989 for 720p at fov 40).`
|
|
750
750
|
);
|
|
751
751
|
}
|
|
752
752
|
}
|
|
@@ -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 > chunkZVUO325O_cjs.MIN_BLUR ? Math.min(radius, chunkZVUO325O_cjs.MAX_BLUR) : 0;
|
|
775
775
|
this.blur = r;
|
|
776
776
|
if (r === 0) {
|
|
777
777
|
if (this.blurFilter) {
|
|
@@ -788,8 +788,8 @@ var Layer3D = class {
|
|
|
788
788
|
this.blurFilter = new DiscBlurFilter(r);
|
|
789
789
|
this.blendWas = d.blendMode ?? "normal";
|
|
790
790
|
const chain = [this.blurFilter];
|
|
791
|
-
if (
|
|
792
|
-
this.blendFilter =
|
|
791
|
+
if (chunk2DXPTKQZ_cjs.isAdvancedBlend(this.blendWas)) {
|
|
792
|
+
this.blendFilter = chunk2DXPTKQZ_cjs.blendFilterFor(this.blendWas);
|
|
793
793
|
if (this.blendFilter) {
|
|
794
794
|
chain.push(this.blendFilter);
|
|
795
795
|
d.blendMode = "normal";
|
|
@@ -813,7 +813,7 @@ var Layer3D = class {
|
|
|
813
813
|
} catch (err) {
|
|
814
814
|
if (!this.warnedLit) {
|
|
815
815
|
this.warnedLit = true;
|
|
816
|
-
console.warn(`pixi-effects: ${
|
|
816
|
+
console.warn(`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(this.seq.spec)}: the lighting shader could not be made on this renderer (${err?.message ?? err}); the layer is drawn unlit`);
|
|
817
817
|
}
|
|
818
818
|
return null;
|
|
819
819
|
}
|
|
@@ -907,8 +907,8 @@ var NEEDS_THREE_D = ["z", "rotationX", "rotationY"];
|
|
|
907
907
|
var CAMERA_ONLY = ["focus", "aperture", "fogNear", "fogFar", "fogColor", "fogAmount"];
|
|
908
908
|
var SKEW_KEYS = ["skew", "skewX", "skewY"];
|
|
909
909
|
function lintSequence(spec, warn = defaultWarn) {
|
|
910
|
-
const who =
|
|
911
|
-
const keys =
|
|
910
|
+
const who = chunkLYOKH7KE_cjs.describeLayer(spec);
|
|
911
|
+
const keys = chunkLYOKH7KE_cjs.collectPropKeys(spec);
|
|
912
912
|
const explained = /* @__PURE__ */ new Set();
|
|
913
913
|
for (const k of keys) {
|
|
914
914
|
const hint = LAYER_ALIASES[k] ?? (spec.type === "camera" ? CAMERA_ALIASES[k] : void 0);
|
|
@@ -957,8 +957,8 @@ function lintSequence(spec, warn = defaultWarn) {
|
|
|
957
957
|
}
|
|
958
958
|
function lintFocus(camera, siblings, warn = defaultWarn) {
|
|
959
959
|
if (camera.type !== "camera") return;
|
|
960
|
-
const who =
|
|
961
|
-
for (const p of
|
|
960
|
+
const who = chunkLYOKH7KE_cjs.describeLayer(camera);
|
|
961
|
+
for (const p of chunkZVUO325O_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") {
|
|
@@ -974,8 +974,30 @@ function lintFocus(camera, siblings, warn = defaultWarn) {
|
|
|
974
974
|
// src/core/matte.ts
|
|
975
975
|
var MATTE_CHANNELS = ["alpha", "luma"];
|
|
976
976
|
var isObject = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
977
|
+
var isLayerSpec = (v) => isObject(v) && typeof v.type === "string";
|
|
978
|
+
function matteOptions(r, label) {
|
|
979
|
+
const problems = [];
|
|
980
|
+
let channel = "alpha";
|
|
981
|
+
if (r.channel !== void 0) {
|
|
982
|
+
if (r.channel === "alpha" || r.channel === "luma") channel = r.channel;
|
|
983
|
+
else {
|
|
984
|
+
const guess = typeof r.channel === "string" ? chunkTWZNOUM7_cjs.suggestName(r.channel, MATTE_CHANNELS) : null;
|
|
985
|
+
const alias = typeof r.channel === "string" && ["luminance", "brightness", "grayscale", "greyscale", "gray", "grey", "value"].includes(r.channel.toLowerCase()) ? "luma" : null;
|
|
986
|
+
const meant = guess ?? alias;
|
|
987
|
+
problems.push(`${label}: channel ${JSON.stringify(r.channel)} is not a matte channel${meant ? `; did you mean "${meant}"?` : ""} (use alpha or luma); alpha is used`);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
let invert = false;
|
|
991
|
+
if (r.invert !== void 0) {
|
|
992
|
+
if (typeof r.invert === "boolean") invert = r.invert;
|
|
993
|
+
else problems.push(`${label}: invert must be true or false (got ${JSON.stringify(r.invert)}); false is used`);
|
|
994
|
+
}
|
|
995
|
+
return { channel, invert, problems };
|
|
996
|
+
}
|
|
977
997
|
function maskSourceOf(mask) {
|
|
978
|
-
if (
|
|
998
|
+
if (isLayerSpec(mask)) return { kind: "inline", spec: mask, channel: "alpha", invert: false, problems: [] };
|
|
999
|
+
if (isObject(mask) && isLayerSpec(mask.layer)) return { kind: "inline", spec: mask.layer, ...matteOptions(mask, "mask (written in place)") };
|
|
1000
|
+
if (isObject(mask) && isObject(mask.layer)) return { kind: "refs", refs: [], problems: ["mask: `layer` is an object with no `type`, so it is neither a layer written in place (it needs a `type`, such as 'shape') nor the name of another layer (a string); the layer is drawn without a mask"] };
|
|
979
1001
|
const problems = [];
|
|
980
1002
|
const refs = [];
|
|
981
1003
|
const one = (r, inList) => {
|
|
@@ -983,27 +1005,14 @@ function maskSourceOf(mask) {
|
|
|
983
1005
|
refs.push({ layer: r, channel: "alpha", invert: false });
|
|
984
1006
|
return;
|
|
985
1007
|
}
|
|
986
|
-
if (isObject(r) &&
|
|
1008
|
+
if (isLayerSpec(r) || isObject(r) && isLayerSpec(r.layer)) {
|
|
987
1009
|
if (inList) problems.push("a layer written inside a list of masks is ignored: give that layer a name and write the name");
|
|
988
1010
|
return;
|
|
989
1011
|
}
|
|
990
1012
|
if (isObject(r) && typeof r.layer === "string") {
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
else {
|
|
995
|
-
const guess = typeof r.channel === "string" ? chunkTWZNOUM7_cjs.suggestName(r.channel, MATTE_CHANNELS) : null;
|
|
996
|
-
const alias = typeof r.channel === "string" && ["luminance", "brightness", "grayscale", "greyscale", "gray", "grey", "value"].includes(r.channel.toLowerCase()) ? "luma" : null;
|
|
997
|
-
const meant = guess ?? alias;
|
|
998
|
-
problems.push(`mask "${r.layer}": channel ${JSON.stringify(r.channel)} is not a matte channel${meant ? `; did you mean "${meant}"?` : ""} (use alpha or luma); alpha is used`);
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
let invert = false;
|
|
1002
|
-
if (r.invert !== void 0) {
|
|
1003
|
-
if (typeof r.invert === "boolean") invert = r.invert;
|
|
1004
|
-
else problems.push(`mask "${r.layer}": invert must be true or false (got ${JSON.stringify(r.invert)}); false is used`);
|
|
1005
|
-
}
|
|
1006
|
-
refs.push({ layer: r.layer, channel, invert });
|
|
1013
|
+
const o = matteOptions(r, `mask "${r.layer}"`);
|
|
1014
|
+
problems.push(...o.problems);
|
|
1015
|
+
refs.push({ layer: r.layer, channel: o.channel, invert: o.invert });
|
|
1007
1016
|
}
|
|
1008
1017
|
};
|
|
1009
1018
|
if (Array.isArray(mask)) for (const r of mask) one(r, true);
|
|
@@ -1018,7 +1027,7 @@ function usesMatteRoute(spec) {
|
|
|
1018
1027
|
const s = maskSourceOf(spec.mask);
|
|
1019
1028
|
if (s.kind !== "inline") return false;
|
|
1020
1029
|
const t = s.spec.type;
|
|
1021
|
-
return
|
|
1030
|
+
return s.invert || s.channel === "luma" || t === "text" || t === "image" || t === "video" || t === "shader";
|
|
1022
1031
|
}
|
|
1023
1032
|
var MANY_MATTES = 8;
|
|
1024
1033
|
var startOf = (s) => Math.max(0, s.at ?? 0);
|
|
@@ -1029,12 +1038,10 @@ function canBeMatte(spec) {
|
|
|
1029
1038
|
}
|
|
1030
1039
|
function matteProblems(layer, siblings, span) {
|
|
1031
1040
|
const src = maskSourceOf(layer.mask);
|
|
1041
|
+
if (src.kind === "inline") return [...src.problems];
|
|
1032
1042
|
if (src.kind !== "refs") return [];
|
|
1033
1043
|
const out = [...src.problems];
|
|
1034
1044
|
const names = siblings.filter((s) => s.name && s.type !== "camera").map((s) => s.name);
|
|
1035
|
-
if (layer.maskInverted && src.refs.length) {
|
|
1036
|
-
out.push('maskInverted is for a mask written in place: with a reference write { layer: "name", invert: true } (and use a list to subtract one matte from another)');
|
|
1037
|
-
}
|
|
1038
1045
|
if (layer.parent && src.refs.length) {
|
|
1039
1046
|
out.push(`it has a parent, so it is drawn in the null layer's space and the matte is in the composition's: mask the null layer ("${layer.parent}") instead`);
|
|
1040
1047
|
}
|
|
@@ -1241,7 +1248,7 @@ var MatteSet = class {
|
|
|
1241
1248
|
};
|
|
1242
1249
|
|
|
1243
1250
|
// src/sequences/Composition.ts
|
|
1244
|
-
var CompositionSequence = class extends
|
|
1251
|
+
var CompositionSequence = class extends chunkZVUO325O_cjs.Sequence {
|
|
1245
1252
|
_innerContainer = null;
|
|
1246
1253
|
_compositionShape = null;
|
|
1247
1254
|
_children = [];
|
|
@@ -1308,26 +1315,26 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1308
1315
|
this.intrinsicWidth = width;
|
|
1309
1316
|
this.intrinsicHeight = height;
|
|
1310
1317
|
this._innerContainer = inner;
|
|
1311
|
-
const base =
|
|
1312
|
-
const span = base ?
|
|
1313
|
-
this._remap = base ?
|
|
1318
|
+
const base = chunkZVUO325O_cjs.timeRemapOf(this.spec);
|
|
1319
|
+
const span = base ? chunkZVUO325O_cjs.contentLength(base, this.duration) : this.duration;
|
|
1320
|
+
this._remap = base ? chunkZVUO325O_cjs.remapOf(this.spec, "time", span) : null;
|
|
1314
1321
|
this._contentSpan = span;
|
|
1315
1322
|
this._compositionShape = { width, height, duration: span };
|
|
1316
1323
|
const lateKeyframes = [];
|
|
1317
1324
|
for (const s of this.spec.sequences ?? []) {
|
|
1318
1325
|
lintSequence(s);
|
|
1319
1326
|
lintFocus(s, this.spec.sequences ?? []);
|
|
1320
|
-
for (const message of matteProblems(s, this.spec.sequences ?? [], span)) console.warn(`pixi-effects: ${
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1327
|
+
for (const message of matteProblems(s, this.spec.sequences ?? [], span)) console.warn(`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(s)}: ${message}`);
|
|
1328
|
+
chunkLYOKH7KE_cjs.lintTiming(s, span, (message, kind) => kind === "late-keyframe" ? lateKeyframes.push(message) : console.warn(message));
|
|
1329
|
+
chunkLYOKH7KE_cjs.lintText(s);
|
|
1330
|
+
chunkLYOKH7KE_cjs.lintKeys(s);
|
|
1324
1331
|
}
|
|
1325
|
-
for (const message of
|
|
1326
|
-
const crowd =
|
|
1327
|
-
if (crowd >=
|
|
1328
|
-
console.warn(`pixi-effects: ${
|
|
1332
|
+
for (const message of chunkLYOKH7KE_cjs.summarizeWarnings(lateKeyframes)) console.warn(message);
|
|
1333
|
+
const crowd = chunk2DXPTKQZ_cjs.maxConcurrentAdvanced(this.spec.sequences ?? [], span);
|
|
1334
|
+
if (crowd >= chunk2DXPTKQZ_cjs.MANY_ADVANCED) {
|
|
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`);
|
|
1329
1336
|
}
|
|
1330
|
-
this._children = await
|
|
1337
|
+
this._children = await chunkZVUO325O_cjs.buildSequenceTree(
|
|
1331
1338
|
this.spec.sequences ?? [],
|
|
1332
1339
|
this._compositionShape,
|
|
1333
1340
|
this.root
|
|
@@ -1338,22 +1345,22 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1338
1345
|
if (matteNames.size > 0) {
|
|
1339
1346
|
this._mattes = new MatteSet(inner, width, height);
|
|
1340
1347
|
for (const name of matteNames) {
|
|
1341
|
-
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 chunkZVUO325O_cjs.CameraSequence));
|
|
1342
1349
|
if (!source || !source.target || !canBeMatte(source.spec)) continue;
|
|
1343
1350
|
const chain = [];
|
|
1344
1351
|
for (let p = this._parentOf.get(source); p; p = this._parentOf.get(p)) chain.push(p);
|
|
1345
1352
|
this._mattes.add(name, source, chain);
|
|
1346
1353
|
}
|
|
1347
1354
|
}
|
|
1348
|
-
if (this._children.some((c) => c instanceof
|
|
1349
|
-
for (const message of lightSetProblems(this.spec.sequences ?? [])) console.warn(`pixi-effects: ${
|
|
1355
|
+
if (this._children.some((c) => c instanceof chunkZVUO325O_cjs.LightSequence)) {
|
|
1356
|
+
for (const message of lightSetProblems(this.spec.sequences ?? [])) console.warn(`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(this.spec)}: ${message}`);
|
|
1350
1357
|
}
|
|
1351
1358
|
const layerNames = new Set(this._children.map((c) => c.spec.name).filter((n) => !!n));
|
|
1352
1359
|
for (const cam of this._children) {
|
|
1353
|
-
if (!(cam instanceof
|
|
1360
|
+
if (!(cam instanceof chunkZVUO325O_cjs.CameraSequence)) continue;
|
|
1354
1361
|
cam.resolveFocusNames((name) => {
|
|
1355
1362
|
const hit = this._children.find((c) => c.spec.name === name && c.spec.threeD);
|
|
1356
|
-
return hit ?
|
|
1363
|
+
return hit ? chunkZVUO325O_cjs.layerInitialZ(hit.spec, hit.scope()) : void 0;
|
|
1357
1364
|
}, layerNames);
|
|
1358
1365
|
}
|
|
1359
1366
|
const blendSaid = /* @__PURE__ */ new Map();
|
|
@@ -1363,11 +1370,11 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1363
1370
|
else blendSaid.set(message, { spec, n: 1 });
|
|
1364
1371
|
};
|
|
1365
1372
|
for (const child of this._children) {
|
|
1366
|
-
if (child instanceof
|
|
1373
|
+
if (child instanceof chunkZVUO325O_cjs.CameraSequence) {
|
|
1367
1374
|
this._cameras.push(child);
|
|
1368
1375
|
continue;
|
|
1369
1376
|
}
|
|
1370
|
-
if (child instanceof
|
|
1377
|
+
if (child instanceof chunkZVUO325O_cjs.LightSequence) {
|
|
1371
1378
|
this._lights.push(child);
|
|
1372
1379
|
continue;
|
|
1373
1380
|
}
|
|
@@ -1381,10 +1388,10 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1381
1388
|
inner.addChild(layer.display);
|
|
1382
1389
|
this._layers3d.push(layer);
|
|
1383
1390
|
this._visual.push({ seq: child, layer });
|
|
1384
|
-
const added3d =
|
|
1391
|
+
const added3d = chunk2DXPTKQZ_cjs.applyBlendMode(child.spec, layer.display, report);
|
|
1385
1392
|
if (added3d) this._blendOwned.push(added3d);
|
|
1386
1393
|
if (maskSrc.kind !== "none") {
|
|
1387
|
-
console.warn(`pixi-effects: ${
|
|
1394
|
+
console.warn(`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(child.spec)}: mask is not supported on threeD layers yet; ignored`);
|
|
1388
1395
|
}
|
|
1389
1396
|
continue;
|
|
1390
1397
|
}
|
|
@@ -1401,7 +1408,7 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1401
1408
|
if (maskSrc.kind === "inline") {
|
|
1402
1409
|
const maskSpec = maskSrc.spec;
|
|
1403
1410
|
const lifetime = maskSpec.at === void 0 ? { at: child.at, duration: maskSpec.duration ?? child.duration } : {};
|
|
1404
|
-
const built = await
|
|
1411
|
+
const built = await chunkZVUO325O_cjs.buildSequenceTree([{ ...maskSpec, ...lifetime }], this._compositionShape, this.root);
|
|
1405
1412
|
const maskSeq = built[0];
|
|
1406
1413
|
if (maskSeq?.target) {
|
|
1407
1414
|
child.maskSequence = maskSeq;
|
|
@@ -1411,7 +1418,7 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1411
1418
|
const chain = [];
|
|
1412
1419
|
for (let p = this._parentOf.get(child); p; p = this._parentOf.get(p)) chain.push(p);
|
|
1413
1420
|
this._mattes.add(key, maskSeq, chain);
|
|
1414
|
-
const f = this._mattes.filterFor(key, { channel:
|
|
1421
|
+
const f = this._mattes.filterFor(key, { channel: maskSrc.channel, invert: maskSrc.invert });
|
|
1415
1422
|
if (f) matteFilters.push(f);
|
|
1416
1423
|
} else {
|
|
1417
1424
|
into.addChild(maskSeq.target);
|
|
@@ -1426,14 +1433,14 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1426
1433
|
t.filters = [...Array.isArray(t.filters) ? t.filters : [], ...matteFilters];
|
|
1427
1434
|
this._blendOwned.push(...matteFilters);
|
|
1428
1435
|
}
|
|
1429
|
-
const added =
|
|
1436
|
+
const added = chunk2DXPTKQZ_cjs.applyBlendMode(child.spec, child.target, report);
|
|
1430
1437
|
if (added) this._blendOwned.push(added);
|
|
1431
1438
|
}
|
|
1432
1439
|
if (this._mattes && this._mattes.size > MANY_MATTES) {
|
|
1433
|
-
console.warn(`pixi-effects: ${
|
|
1440
|
+
console.warn(`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(this.spec)}: ${this._mattes.size} mattes: each is a ${width}\xD7${height} texture (about ${Math.round(width * height * 4 / 1048576)} MiB, more with anti-aliasing). Share one matte between layers, or use fewer`);
|
|
1434
1441
|
}
|
|
1435
1442
|
for (const [message, seen] of blendSaid) {
|
|
1436
|
-
console.warn(`pixi-effects: ${
|
|
1443
|
+
console.warn(`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(seen.spec)}: ${message}${seen.n > 1 ? ` (and ${seen.n - 1} more layers have the same mistake)` : ""}`);
|
|
1437
1444
|
}
|
|
1438
1445
|
if (this._layers3d.length > 0) {
|
|
1439
1446
|
inner.sortableChildren = true;
|
|
@@ -1444,7 +1451,7 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1444
1451
|
console.warn("pixi-effects: camera has no effect: this composition has no threeD layers");
|
|
1445
1452
|
}
|
|
1446
1453
|
if (this._layers3d.length === 0 && this._lights.length > 0) {
|
|
1447
|
-
console.warn(`pixi-effects: ${
|
|
1454
|
+
console.warn(`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(this.spec)}: a light has no effect: this composition has no threeD layers (a light lights only the threeD layers of its own composition, not those of the compositions nested in it: put the light inside the composition that holds them)`);
|
|
1448
1455
|
}
|
|
1449
1456
|
this.buildFilters();
|
|
1450
1457
|
}
|
|
@@ -1457,9 +1464,9 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1457
1464
|
const remap = this._remap;
|
|
1458
1465
|
const childOffset = remap ? 0 : offset + this.at;
|
|
1459
1466
|
this._childBase = childOffset;
|
|
1460
|
-
const target = remap ?
|
|
1467
|
+
const target = remap ? chunkZVUO325O_cjs.createTimeline({ paused: true, defaults: { ease: "none" } }) : timeline;
|
|
1461
1468
|
for (const child of this._children) {
|
|
1462
|
-
const own =
|
|
1469
|
+
const own = chunkZVUO325O_cjs.createTimeline({ defaults: { ease: "none" } });
|
|
1463
1470
|
child.bindTimeline(own, childOffset);
|
|
1464
1471
|
child.maskSequence?.bindTimeline(own, childOffset);
|
|
1465
1472
|
target.add(own, 0);
|
|
@@ -1489,8 +1496,8 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1489
1496
|
this._clock = clock;
|
|
1490
1497
|
const scope = this.scope();
|
|
1491
1498
|
if (remap.start !== void 0 && remap.timeKfs.length === 0) clock.time = remap.start;
|
|
1492
|
-
|
|
1493
|
-
this._warnUnreachable(
|
|
1499
|
+
chunkZVUO325O_cjs.bindClock(timeline, clock, "time", remap, this.duration, offset + this.at, scope);
|
|
1500
|
+
this._warnUnreachable(chunkZVUO325O_cjs.clockTable(remap, "time", this.duration, offset + this.at, scope, offset + this.at + this.duration), offset + this.at, offset + this.at + this.duration);
|
|
1494
1501
|
}
|
|
1495
1502
|
/**
|
|
1496
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
|
|
@@ -1514,7 +1521,7 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1514
1521
|
}
|
|
1515
1522
|
if (dwell >= 2) continue;
|
|
1516
1523
|
console.warn(
|
|
1517
|
-
`pixi-effects: ${
|
|
1524
|
+
`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(child.spec)} starts at ${at}s of ${chunkLYOKH7KE_cjs.describeLayer(this.spec)}'s own time, but its clock only reaches ${Number(table.min.toFixed(3))}\u2013${Number(table.max.toFixed(3))}s (${how}), so it is never visible. Layers inside a remapped composition are placed in that composition's local time.`
|
|
1518
1525
|
);
|
|
1519
1526
|
}
|
|
1520
1527
|
}
|
|
@@ -1528,7 +1535,7 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1528
1535
|
for (let p = this._parentOf.get(seq); p; p = this._parentOf.get(p)) out.push(p);
|
|
1529
1536
|
return out;
|
|
1530
1537
|
};
|
|
1531
|
-
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 chunkZVUO325O_cjs.NullSequence)).map((seq) => {
|
|
1532
1539
|
const layer = this._visual.find((v) => v.seq === seq)?.layer ?? null;
|
|
1533
1540
|
return {
|
|
1534
1541
|
seq,
|
|
@@ -1537,24 +1544,24 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1537
1544
|
carriers: carriersOf(seq),
|
|
1538
1545
|
depthBlur: layer?.blur ?? 0,
|
|
1539
1546
|
// how lit it is (threeD layers that receive the lights of the last frame only); computed here, not per frame
|
|
1540
|
-
light: layer && this._lighting && layer.world && layer.spec.lit !== false ?
|
|
1547
|
+
light: layer && this._lighting && layer.world && layer.spec.lit !== false ? chunkZVUO325O_cjs.lightLevel(layer.world, this._lighting.cam, this._lighting.states) : void 0
|
|
1541
1548
|
};
|
|
1542
1549
|
});
|
|
1543
1550
|
}
|
|
1544
1551
|
/** Match every `parent: 'name'` to a null layer; anything that cannot work is said out loud and drawn unparented. */
|
|
1545
1552
|
_resolveParents() {
|
|
1546
|
-
const nulls = this._children.filter((c) => c instanceof
|
|
1553
|
+
const nulls = this._children.filter((c) => c instanceof chunkZVUO325O_cjs.NullSequence);
|
|
1547
1554
|
const nullNames = nulls.map((n) => n.spec.name).filter((n) => !!n);
|
|
1548
1555
|
const warned = /* @__PURE__ */ new Set();
|
|
1549
1556
|
for (const child of this._children) {
|
|
1550
1557
|
const want = child.spec.parent;
|
|
1551
1558
|
if (want === void 0) continue;
|
|
1552
|
-
const who =
|
|
1553
|
-
if (child instanceof
|
|
1559
|
+
const who = chunkLYOKH7KE_cjs.describeLayer(child.spec);
|
|
1560
|
+
if (child instanceof chunkZVUO325O_cjs.CameraSequence) {
|
|
1554
1561
|
console.warn(`pixi-effects: ${who}: a camera cannot have a parent; ignored`);
|
|
1555
1562
|
continue;
|
|
1556
1563
|
}
|
|
1557
|
-
if (child instanceof
|
|
1564
|
+
if (child instanceof chunkZVUO325O_cjs.LightSequence) {
|
|
1558
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)`);
|
|
1559
1566
|
continue;
|
|
1560
1567
|
}
|
|
@@ -1568,7 +1575,7 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1568
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)`);
|
|
1569
1576
|
continue;
|
|
1570
1577
|
}
|
|
1571
|
-
const holder = same.find((c) => c instanceof
|
|
1578
|
+
const holder = same.find((c) => c instanceof chunkZVUO325O_cjs.NullSequence);
|
|
1572
1579
|
if (!holder) {
|
|
1573
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)`);
|
|
1574
1581
|
continue;
|
|
@@ -1613,8 +1620,8 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1613
1620
|
childT,
|
|
1614
1621
|
compEnd
|
|
1615
1622
|
);
|
|
1616
|
-
const cam = active ? active.cam.state() :
|
|
1617
|
-
const basis =
|
|
1623
|
+
const cam = active ? active.cam.state() : chunkZVUO325O_cjs.homeCamera(width, height);
|
|
1624
|
+
const basis = chunkZVUO325O_cjs.cameraBasis(cam, width, height);
|
|
1618
1625
|
for (const layer of this._layers3d) layer.update(host, basis);
|
|
1619
1626
|
this._applyLighting(childT, compEnd, basis, active?.cam ?? null);
|
|
1620
1627
|
this._applyDepthOfField(cam, basis);
|
|
@@ -1639,7 +1646,7 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1639
1646
|
return t >= w.start && (t < w.end || w.end >= compEnd && t <= w.end);
|
|
1640
1647
|
});
|
|
1641
1648
|
const states = live.map((l) => l.state());
|
|
1642
|
-
const packed = states.length > 0 ?
|
|
1649
|
+
const packed = states.length > 0 ? chunkZVUO325O_cjs.packLights(states) : null;
|
|
1643
1650
|
this._lighting = states.length > 0 ? { states, cam: { x: basis.cx, y: basis.cy, z: basis.cz } } : null;
|
|
1644
1651
|
const shadowing = states.some((s) => s.castsShadows);
|
|
1645
1652
|
const casters = shadowing ? this._layers3d.filter((l) => l.spec.castsShadows && l.display.visible && l.world && l.source) : [];
|
|
@@ -1648,7 +1655,7 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1648
1655
|
const mat = l.setLit(true);
|
|
1649
1656
|
if (!mat || !l.world) continue;
|
|
1650
1657
|
const lit = l.spec.lit !== false;
|
|
1651
|
-
const mine = lit ? casters.filter((c) => c !== l).slice(0,
|
|
1658
|
+
const mine = lit ? casters.filter((c) => c !== l).slice(0, chunkZVUO325O_cjs.MAX_CASTERS).map((c) => ({ frame: c.world, source: c.source })) : [];
|
|
1652
1659
|
mat.update(l.world, camInfo, lit ? packed : null, fog, mine);
|
|
1653
1660
|
}
|
|
1654
1661
|
}
|
|
@@ -1659,23 +1666,23 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1659
1666
|
for (const l of this._layers3d) l.setBlur(0);
|
|
1660
1667
|
return;
|
|
1661
1668
|
}
|
|
1662
|
-
const focusDepth =
|
|
1663
|
-
if (!(focusDepth >
|
|
1669
|
+
const focusDepth = chunkZVUO325O_cjs.projectPoint(basis, { x: cam.lookAtX, y: cam.lookAtY, z: cam.focus ?? 0 }).depth;
|
|
1670
|
+
if (!(focusDepth > chunkZVUO325O_cjs.NEAR)) {
|
|
1664
1671
|
if (!this._dofSaid.behind) {
|
|
1665
1672
|
this._dofSaid.behind = true;
|
|
1666
|
-
console.warn(`pixi-effects: ${
|
|
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)`);
|
|
1667
1674
|
}
|
|
1668
1675
|
for (const l of this._layers3d) l.setBlur(0);
|
|
1669
1676
|
return;
|
|
1670
1677
|
}
|
|
1671
1678
|
let blurred = 0;
|
|
1672
1679
|
for (const l of this._layers3d) {
|
|
1673
|
-
l.setBlur(l.display.visible ?
|
|
1680
|
+
l.setBlur(l.display.visible ? chunkZVUO325O_cjs.blurRadius(aperture, basis.focal, l.depth, focusDepth) : 0);
|
|
1674
1681
|
if (l.blur > 0) blurred++;
|
|
1675
1682
|
}
|
|
1676
|
-
if (blurred >=
|
|
1683
|
+
if (blurred >= chunkZVUO325O_cjs.MANY_BLURRED && !this._dofSaid.many) {
|
|
1677
1684
|
this._dofSaid.many = true;
|
|
1678
|
-
console.warn(`pixi-effects: ${
|
|
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`);
|
|
1679
1686
|
}
|
|
1680
1687
|
}
|
|
1681
1688
|
collectAudio(out, baseTime) {
|
|
@@ -1689,7 +1696,7 @@ var CompositionSequence = class extends chunkMJW7KILM_cjs.Sequence {
|
|
|
1689
1696
|
const inner = [];
|
|
1690
1697
|
for (const child of this._children) child.collectAudio(inner, 0);
|
|
1691
1698
|
const lo = baseTime + this.at, hi = lo + this.duration;
|
|
1692
|
-
const table =
|
|
1699
|
+
const table = chunkZVUO325O_cjs.clockTable(remap, "time", this.duration, lo, this.scope(), hi);
|
|
1693
1700
|
for (const d of inner) {
|
|
1694
1701
|
const prev = d.warp;
|
|
1695
1702
|
out.push({ ...d, warp: (t) => t < lo || t > hi ? NaN : prev ? prev(table.at(t)) : table.at(t) });
|
|
@@ -1719,5 +1726,5 @@ function frameOf(child) {
|
|
|
1719
1726
|
|
|
1720
1727
|
exports.CompositionSequence = CompositionSequence;
|
|
1721
1728
|
exports.maskSourceOf = maskSourceOf;
|
|
1722
|
-
//# sourceMappingURL=chunk-
|
|
1723
|
-
//# sourceMappingURL=chunk-
|
|
1729
|
+
//# sourceMappingURL=chunk-WHNADXXG.cjs.map
|
|
1730
|
+
//# sourceMappingURL=chunk-WHNADXXG.cjs.map
|