aoi-comp 1.0.6 → 1.0.8
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/dist/{BufferResource-CVU-ZRRz.js → BufferResource-DPOGqxQ8.js} +8 -6
- package/dist/{CanvasPool-C3aVgvEX.js → CanvasPool-Btji3eOu.js} +1 -1
- package/dist/{Geometry-CN7W9DnD.js → Geometry-CmoUjYuy.js} +13 -12
- package/dist/{RenderTargetSystem-D_FiZPnb.js → RenderTargetSystem-BwBGe2Se.js} +252 -252
- package/dist/{browserAll-DqFkNC6q.js → browserAll-BIc-EcPU.js} +20 -20
- package/dist/{canvasUtils-D0KM_fKp.js → canvasUtils-BZU-qDXH.js} +1 -1
- package/dist/comps.js +20774 -3227
- package/dist/{getTextureBatchBindGroup-CLFTP_Vc.js → getTextureBatchBindGroup-B9kZnBNO.js} +1 -1
- package/dist/hooks-DVVg7e1H.js +527 -0
- package/dist/hooks.js +2 -2
- package/dist/index.js +1 -1
- package/dist/{init-DVXFVLyx.js → init-W_GeGJkn.js} +54 -47
- package/dist/{init-CIaGzij5.js → init-pj0uFHxN.js} +18 -18
- package/dist/{packages-Dd2mV9Xv.js → packages-B-izsU7O.js} +985 -718
- package/dist/style.css +1 -1
- package/dist/utils.js +2 -2
- package/dist/webworkerAll-CSNhSmU-.js +2 -0
- package/package.json +5 -4
- package/dist/CanvasRenderer-CVj7HTkL.js +0 -3460
- package/dist/WebGLRenderer-CurPxJtF.js +0 -2210
- package/dist/WebGPURenderer-CfiYFIN2.js +0 -1840
- package/dist/hooks-FYdXNEDe.js +0 -452
- package/dist/rolldown-runtime-CWhphoD1.js +0 -23
- package/dist/webworkerAll-XSXRmCFC.js +0 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { B as e, C as t, D as n, M as r, N as i, Q as a, R as o, U as s, V as c, W as l, _ as u,
|
|
2
|
-
import { r as _ } from "./canvasUtils-
|
|
1
|
+
import { B as e, C as t, D as n, M as r, N as i, Q as a, R as o, U as s, V as c, W as l, _ as u, at as d, b as f, it as p, j as m, x as h, y as g } from "./Geometry-CmoUjYuy.js";
|
|
2
|
+
import { r as _ } from "./canvasUtils-BZU-qDXH.js";
|
|
3
3
|
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.mjs
|
|
4
4
|
var v = new e();
|
|
5
5
|
function y(e, t, n) {
|
|
6
6
|
let r = v;
|
|
7
|
-
e.measurable = !0,
|
|
7
|
+
e.measurable = !0, m(e, n, r), t.addBoundsMask(r), e.measurable = !1;
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.mjs
|
|
11
11
|
function b(e, t, a) {
|
|
12
12
|
let o = r.get();
|
|
13
13
|
e.measurable = !0;
|
|
14
|
-
let s = i.get().identity();
|
|
15
|
-
n(e, o,
|
|
14
|
+
let s = i.get().identity(), c = x(e, a, s);
|
|
15
|
+
n(e, o, c), e.measurable = !1, t.addBoundsMask(o), i.return(s), r.return(o);
|
|
16
16
|
}
|
|
17
17
|
function x(e, t, n) {
|
|
18
18
|
return e ? (e !== t && (x(e.parent, t, n), e.updateLocalTransform(), n.append(e.localTransform)), n) : (o("Mask bounds, renderable is not inside the root container"), n);
|
|
@@ -46,7 +46,7 @@ var S = class {
|
|
|
46
46
|
return e instanceof h;
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
S.extension =
|
|
49
|
+
S.extension = p.MaskEffect;
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/color/ColorMask.mjs
|
|
52
52
|
var C = class {
|
|
@@ -61,7 +61,7 @@ var C = class {
|
|
|
61
61
|
return typeof e == "number";
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
C.extension =
|
|
64
|
+
C.extension = p.MaskEffect;
|
|
65
65
|
//#endregion
|
|
66
66
|
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.mjs
|
|
67
67
|
var w = class {
|
|
@@ -91,13 +91,13 @@ var w = class {
|
|
|
91
91
|
return e instanceof t;
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
w.extension =
|
|
94
|
+
w.extension = p.MaskEffect;
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.mjs
|
|
97
97
|
var T;
|
|
98
98
|
async function E() {
|
|
99
99
|
return T ??= (async () => {
|
|
100
|
-
let e =
|
|
100
|
+
let e = f.get().createCanvas(1, 1).getContext("webgl");
|
|
101
101
|
if (!e) return "premultiply-alpha-on-upload";
|
|
102
102
|
let t = await new Promise((e) => {
|
|
103
103
|
let t = document.createElement("video");
|
|
@@ -131,7 +131,7 @@ var D = class e extends l {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
_videoFrameRequestCallback() {
|
|
134
|
-
this.updateFrame(), this.
|
|
134
|
+
this.updateFrame(), this._videoFrameRequestCallbackHandle = this.destroyed ? null : this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback);
|
|
135
135
|
}
|
|
136
136
|
get isValid() {
|
|
137
137
|
return !!this.resource.videoWidth && !!this.resource.videoHeight;
|
|
@@ -201,7 +201,7 @@ var D = class e extends l {
|
|
|
201
201
|
return globalThis.HTMLVideoElement && e instanceof HTMLVideoElement;
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
|
-
D.extension =
|
|
204
|
+
D.extension = p.TextureSource, D.defaultOptions = {
|
|
205
205
|
...l.defaultOptions,
|
|
206
206
|
autoLoad: !0,
|
|
207
207
|
autoPlay: !0,
|
|
@@ -270,7 +270,7 @@ var O = D, k = (e, t, n = !1) => (Array.isArray(e) || (e = [e]), t ? e.map((e) =
|
|
|
270
270
|
return this._parsers;
|
|
271
271
|
}
|
|
272
272
|
}(), j = [];
|
|
273
|
-
|
|
273
|
+
d.handleByList(p.TextureSource, j);
|
|
274
274
|
function M(e = {}) {
|
|
275
275
|
let t = e && e.resource, n = t ? e.resource : e, r = t ? e : { resource: e };
|
|
276
276
|
for (let e = 0; e < j.length; e++) {
|
|
@@ -292,7 +292,7 @@ function P(e, t = !1) {
|
|
|
292
292
|
}
|
|
293
293
|
//#endregion
|
|
294
294
|
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/init.mjs
|
|
295
|
-
c.from = P, l.from = M,
|
|
295
|
+
c.from = P, l.from = M, d.add(S, C, w, O, _, g, s);
|
|
296
296
|
//#endregion
|
|
297
297
|
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/assets/loader/parsers/LoaderParser.mjs
|
|
298
298
|
var F = /* @__PURE__ */ ((e) => (e[e.Low = 0] = "Low", e[e.Normal = 1] = "Normal", e[e.High = 2] = "High", e))(F || {});
|
|
@@ -317,21 +317,23 @@ function B(e, t) {
|
|
|
317
317
|
else if (o === 47) break;
|
|
318
318
|
else o = 47;
|
|
319
319
|
if (o === 47) {
|
|
320
|
-
if (
|
|
321
|
-
if (
|
|
322
|
-
if (n.length
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
320
|
+
if (i !== s - 1 && a !== 1) {
|
|
321
|
+
if (i !== s - 1 && a === 2) {
|
|
322
|
+
if (n.length < 2 || r !== 2 || n.charCodeAt(n.length - 1) !== 46 || n.charCodeAt(n.length - 2) !== 46) {
|
|
323
|
+
if (n.length > 2) {
|
|
324
|
+
let e = n.lastIndexOf("/");
|
|
325
|
+
if (e !== n.length - 1) {
|
|
326
|
+
e === -1 ? (n = "", r = 0) : (n = n.slice(0, e), r = n.length - 1 - n.lastIndexOf("/")), i = s, a = 0;
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
} else if (n.length === 2 || n.length === 1) {
|
|
330
|
+
n = "", r = 0, i = s, a = 0;
|
|
326
331
|
continue;
|
|
327
332
|
}
|
|
328
|
-
} else if (n.length === 2 || n.length === 1) {
|
|
329
|
-
n = "", r = 0, i = s, a = 0;
|
|
330
|
-
continue;
|
|
331
333
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
334
|
+
t && (n.length > 0 ? n += "/.." : n = "..", r = 2);
|
|
335
|
+
} else n.length > 0 ? n += `/${e.slice(i + 1, s)}` : n = e.slice(i + 1, s), r = s - i - 1;
|
|
336
|
+
}
|
|
335
337
|
i = s, a = 0;
|
|
336
338
|
} else o === 46 && a !== -1 ? ++a : a = -1;
|
|
337
339
|
}
|
|
@@ -362,7 +364,7 @@ var V = {
|
|
|
362
364
|
},
|
|
363
365
|
toAbsolute(e, t, n) {
|
|
364
366
|
if (I(e), this.isDataUrl(e) || this.isBlobUrl(e)) return e;
|
|
365
|
-
let r = L(this.toPosix(t ??
|
|
367
|
+
let r = L(this.toPosix(t ?? f.get().getBaseUrl())), i = L(this.toPosix(n ?? this.rootname(r)));
|
|
366
368
|
return e = this.toPosix(e), e.startsWith("/") ? V.join(i, e.slice(1)) : this.isAbsolute(e) ? e : this.join(r, e);
|
|
367
369
|
},
|
|
368
370
|
normalize(e) {
|
|
@@ -382,10 +384,12 @@ var V = {
|
|
|
382
384
|
let t;
|
|
383
385
|
for (let n = 0; n < e.length; ++n) {
|
|
384
386
|
let r = e[n];
|
|
385
|
-
if (I(r), r.length > 0)
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
387
|
+
if (I(r), r.length > 0) {
|
|
388
|
+
if (t === void 0) t = r;
|
|
389
|
+
else {
|
|
390
|
+
let i = e[n - 1] ?? "";
|
|
391
|
+
this.joinExtensions.includes(this.extname(i).toLowerCase()) ? t += `/../${r}` : t += `/${r}`;
|
|
392
|
+
}
|
|
389
393
|
}
|
|
390
394
|
}
|
|
391
395
|
return t === void 0 ? "." : this.normalize(t);
|
|
@@ -477,7 +481,7 @@ var V = {
|
|
|
477
481
|
}
|
|
478
482
|
s === -1 && (c = !1, s = l + 1), n === 46 ? a === -1 ? a = l : u !== 1 && (u = 1) : a !== -1 && (u = -1);
|
|
479
483
|
}
|
|
480
|
-
return a === -1 || s === -1 || u === 0 || u === 1 && a === s - 1 && a === o + 1 ? s !== -1 && (o === 0 && r ?
|
|
484
|
+
return a === -1 || s === -1 || u === 0 || u === 1 && a === s - 1 && a === o + 1 ? s !== -1 && (t.base = t.name = o === 0 && r ? e.slice(1, s) : e.slice(o, s)) : (o === 0 && r ? (t.name = e.slice(1, a), t.base = e.slice(1, s)) : (t.name = e.slice(o, a), t.base = e.slice(o, s)), t.ext = e.slice(a, s)), t.dir = this.dirname(e), t;
|
|
481
485
|
},
|
|
482
486
|
sep: "/",
|
|
483
487
|
delimiter: ":",
|
|
@@ -646,18 +650,20 @@ var W = (e) => !Array.isArray(e), G = class {
|
|
|
646
650
|
e = k(e);
|
|
647
651
|
let n = {};
|
|
648
652
|
return e.forEach((e) => {
|
|
649
|
-
if (!this._resolverHash[e])
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
n.
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
653
|
+
if (!this._resolverHash[e]) {
|
|
654
|
+
if (this._assetMap[e]) {
|
|
655
|
+
let t = this._assetMap[e], n = this._getPreferredOrder(t);
|
|
656
|
+
n?.priority.forEach((e) => {
|
|
657
|
+
n.params[e].forEach((n) => {
|
|
658
|
+
let r = t.filter((t) => t[e] ? t[e] === n : !1);
|
|
659
|
+
r.length && (t = r);
|
|
660
|
+
});
|
|
661
|
+
}), this._resolverHash[e] = t[0];
|
|
662
|
+
} else this._resolverHash[e] = this._buildResolvedAsset({
|
|
663
|
+
alias: [e],
|
|
664
|
+
src: e
|
|
665
|
+
}, {});
|
|
666
|
+
}
|
|
661
667
|
n[e] = this._resolverHash[e];
|
|
662
668
|
}), t ? n[e[0]] : n;
|
|
663
669
|
}
|
|
@@ -794,14 +800,14 @@ function Z(e, t, n) {
|
|
|
794
800
|
return r;
|
|
795
801
|
}
|
|
796
802
|
var Q = {
|
|
797
|
-
extension:
|
|
803
|
+
extension: p.Asset,
|
|
798
804
|
cache: {
|
|
799
805
|
test: (e) => e instanceof Y,
|
|
800
806
|
getCacheableAssets: (e, t) => Z(e, t, !1)
|
|
801
807
|
},
|
|
802
808
|
resolver: {
|
|
803
809
|
extension: {
|
|
804
|
-
type:
|
|
810
|
+
type: p.ResolveParser,
|
|
805
811
|
name: "resolveSpritesheet"
|
|
806
812
|
},
|
|
807
813
|
test: (e) => {
|
|
@@ -821,7 +827,7 @@ var Q = {
|
|
|
821
827
|
name: "spritesheetLoader",
|
|
822
828
|
id: "spritesheet",
|
|
823
829
|
extension: {
|
|
824
|
-
type:
|
|
830
|
+
type: p.LoadParser,
|
|
825
831
|
priority: F.Normal,
|
|
826
832
|
name: "spritesheetLoader"
|
|
827
833
|
},
|
|
@@ -874,5 +880,6 @@ var Q = {
|
|
|
874
880
|
};
|
|
875
881
|
//#endregion
|
|
876
882
|
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/spritesheet/init.mjs
|
|
877
|
-
|
|
883
|
+
d.add(Q);
|
|
878
884
|
//#endregion
|
|
885
|
+
export { A as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { B as e, R as t, T as n, V as r,
|
|
2
|
-
import { t as m } from "./canvasUtils-
|
|
3
|
-
import { t as h } from "./CanvasPool-
|
|
1
|
+
import { B as e, R as t, T as n, V as r, at as i, d as a, et as o, f as s, i as c, it as l, l as u, m as d, t as f, u as p } from "./Geometry-CmoUjYuy.js";
|
|
2
|
+
import { t as m } from "./canvasUtils-BZU-qDXH.js";
|
|
3
|
+
import { t as h } from "./CanvasPool-Btji3eOu.js";
|
|
4
4
|
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/container/bounds/getRenderableBounds.mjs
|
|
5
|
-
var g = new
|
|
5
|
+
var g = new o();
|
|
6
6
|
function _(e, t) {
|
|
7
7
|
t.clear();
|
|
8
8
|
let n = t.matrix;
|
|
@@ -10,7 +10,7 @@ function _(e, t) {
|
|
|
10
10
|
let r = e[n];
|
|
11
11
|
if (r.globalDisplayStatus < 7) continue;
|
|
12
12
|
let i = r.renderGroup ?? r.parentRenderGroup;
|
|
13
|
-
i?.isCachedAsTexture ?
|
|
13
|
+
t.matrix = i?.isCachedAsTexture ? g.copyFrom(i.textureOffsetInverseTransform).append(r.worldTransform) : i?._parentCacheAsTextureRenderGroup ? g.copyFrom(i._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(r.groupTransform) : r.worldTransform, t.addBounds(r.bounds);
|
|
14
14
|
}
|
|
15
15
|
return t.matrix = n, t;
|
|
16
16
|
}
|
|
@@ -128,14 +128,14 @@ var x = class {
|
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
S.extension = {
|
|
131
|
-
type: [
|
|
131
|
+
type: [l.CanvasSystem],
|
|
132
132
|
name: "filter"
|
|
133
133
|
};
|
|
134
134
|
//#endregion
|
|
135
135
|
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/filters/defaults/defaultFilter.vert.mjs
|
|
136
|
-
var C = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n", w = "in vec2 vTextureCoord;\nout vec4 finalColor;\nuniform sampler2D uTexture;\nvoid main() {\n finalColor = texture(uTexture, vTextureCoord);\n}\n", T = "struct GlobalFilterUniforms {\n uInputSize: vec4<f32>,\n uInputPixel: vec4<f32>,\n uInputClamp: vec4<f32>,\n uOutputFrame: vec4<f32>,\n uGlobalFrame: vec4<f32>,\n uOutputTexture: vec4<f32>,\n};\n\n@group(0) @binding(0) var <uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler: sampler;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv: vec2<f32>\n};\n\nfn filterVertexPosition(aPosition: vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0 * gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord(aPosition: vec2<f32>) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition: vec2<f32>,\n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition)\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n) -> @location(0) vec4<f32> {\n return textureSample(uTexture, uSampler, uv);\n}\n", E = class extends
|
|
136
|
+
var C = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n", w = "in vec2 vTextureCoord;\nout vec4 finalColor;\nuniform sampler2D uTexture;\nvoid main() {\n finalColor = texture(uTexture, vTextureCoord);\n}\n", T = "struct GlobalFilterUniforms {\n uInputSize: vec4<f32>,\n uInputPixel: vec4<f32>,\n uInputClamp: vec4<f32>,\n uOutputFrame: vec4<f32>,\n uGlobalFrame: vec4<f32>,\n uOutputTexture: vec4<f32>,\n};\n\n@group(0) @binding(0) var <uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler: sampler;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv: vec2<f32>\n};\n\nfn filterVertexPosition(aPosition: vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0 * gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord(aPosition: vec2<f32>) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition: vec2<f32>,\n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition)\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n) -> @location(0) vec4<f32> {\n return textureSample(uTexture, uSampler, uv);\n}\n", E = class extends c {
|
|
137
137
|
constructor() {
|
|
138
|
-
let e =
|
|
138
|
+
let e = s.from({
|
|
139
139
|
vertex: {
|
|
140
140
|
source: T,
|
|
141
141
|
entryPoint: "mainVertex"
|
|
@@ -145,7 +145,7 @@ var C = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize;
|
|
|
145
145
|
entryPoint: "mainFragment"
|
|
146
146
|
},
|
|
147
147
|
name: "passthrough-filter"
|
|
148
|
-
}), t =
|
|
148
|
+
}), t = d.from({
|
|
149
149
|
vertex: C,
|
|
150
150
|
fragment: w,
|
|
151
151
|
name: "passthrough-filter"
|
|
@@ -184,9 +184,9 @@ var C = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize;
|
|
|
184
184
|
};
|
|
185
185
|
D.extension = {
|
|
186
186
|
type: [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
l.WebGLPipes,
|
|
188
|
+
l.WebGPUPipes,
|
|
189
|
+
l.CanvasPipes
|
|
190
190
|
],
|
|
191
191
|
name: "filter"
|
|
192
192
|
};
|
|
@@ -227,7 +227,7 @@ var O = new f({
|
|
|
227
227
|
}
|
|
228
228
|
}, A = class {
|
|
229
229
|
constructor(e) {
|
|
230
|
-
this._filterStackIndex = 0, this._filterStack = [], this._filterGlobalUniforms = new
|
|
230
|
+
this._filterStackIndex = 0, this._filterStack = [], this._filterGlobalUniforms = new a({
|
|
231
231
|
uInputSize: {
|
|
232
232
|
value: /* @__PURE__ */ new Float32Array(4),
|
|
233
233
|
type: "vec4<f32>"
|
|
@@ -312,8 +312,8 @@ var O = new f({
|
|
|
312
312
|
this._setupBindGroupsAndRender(d, t, i);
|
|
313
313
|
}
|
|
314
314
|
calculateSpriteMatrix(e, t) {
|
|
315
|
-
let n = this._activeFilterData, r = e.set(n.inputTexture._source.width, 0, 0, n.inputTexture._source.height, n.bounds.minX, n.bounds.minY), i = t.worldTransform.copyTo(
|
|
316
|
-
return
|
|
315
|
+
let n = this._activeFilterData, r = e.set(n.inputTexture._source.width, 0, 0, n.inputTexture._source.height, n.bounds.minX, n.bounds.minY), i = t.worldTransform.copyTo(o.shared), a = t.renderGroup || t.parentRenderGroup;
|
|
316
|
+
return a && a.cacheToLocalTransform && i.prepend(a.cacheToLocalTransform), i.invert(), r.prepend(i), r.scale(1 / t.texture.orig.width, 1 / t.texture.orig.height), r.translate(t.anchor.x, t.anchor.y), r;
|
|
317
317
|
}
|
|
318
318
|
destroy() {
|
|
319
319
|
this._passthroughFilter?.destroy(!0), this._passthroughFilter = null;
|
|
@@ -331,7 +331,7 @@ var O = new f({
|
|
|
331
331
|
shader: e,
|
|
332
332
|
state: e._state,
|
|
333
333
|
topology: "triangle-list"
|
|
334
|
-
}), n.type ===
|
|
334
|
+
}), n.type === u.WEBGL && n.renderTarget.finishRenderPass();
|
|
335
335
|
}
|
|
336
336
|
_setupFilterTextures(e, t, i, a) {
|
|
337
337
|
if (e.backTexture = r.EMPTY, e.inputTexture = n.getOptimalTexture(t.width, t.height, e.resolution, e.antialias), e.blendRequired) {
|
|
@@ -440,7 +440,7 @@ var O = new f({
|
|
|
440
440
|
}
|
|
441
441
|
};
|
|
442
442
|
A.extension = {
|
|
443
|
-
type: [
|
|
443
|
+
type: [l.WebGLSystem, l.WebGPUSystem],
|
|
444
444
|
name: "filter"
|
|
445
|
-
},
|
|
445
|
+
}, i.add(A, S), i.add(D);
|
|
446
446
|
//#endregion
|