@blueking/monitor-trace-log 1.0.0-beta.9 → 2.0.0-beta.1

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/6.js DELETED
@@ -1,4161 +0,0 @@
1
- export const __webpack_id__ = 6;
2
- export const __webpack_ids__ = [6];
3
- export const __webpack_modules__ = {
4
-
5
- /***/ 2067:
6
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
-
8
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
- /* harmony export */ localUniformBit: () => (/* binding */ localUniformBit),
10
- /* harmony export */ localUniformBitGl: () => (/* binding */ localUniformBitGl),
11
- /* harmony export */ localUniformBitGroup2: () => (/* binding */ localUniformBitGroup2)
12
- /* harmony export */ });
13
-
14
- const localUniformBit = {
15
- name: "local-uniform-bit",
16
- vertex: {
17
- header: (
18
- /* wgsl */
19
- `
20
-
21
- struct LocalUniforms {
22
- uTransformMatrix:mat3x3<f32>,
23
- uColor:vec4<f32>,
24
- uRound:f32,
25
- }
26
-
27
- @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
28
- `
29
- ),
30
- main: (
31
- /* wgsl */
32
- `
33
- vColor *= localUniforms.uColor;
34
- modelMatrix *= localUniforms.uTransformMatrix;
35
- `
36
- ),
37
- end: (
38
- /* wgsl */
39
- `
40
- if(localUniforms.uRound == 1)
41
- {
42
- vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
43
- }
44
- `
45
- )
46
- }
47
- };
48
- const localUniformBitGroup2 = {
49
- ...localUniformBit,
50
- vertex: {
51
- ...localUniformBit.vertex,
52
- // replace the group!
53
- header: localUniformBit.vertex.header.replace("group(1)", "group(2)")
54
- }
55
- };
56
- const localUniformBitGl = {
57
- name: "local-uniform-bit",
58
- vertex: {
59
- header: (
60
- /* glsl */
61
- `
62
-
63
- uniform mat3 uTransformMatrix;
64
- uniform vec4 uColor;
65
- uniform float uRound;
66
- `
67
- ),
68
- main: (
69
- /* glsl */
70
- `
71
- vColor *= uColor;
72
- modelMatrix = uTransformMatrix;
73
- `
74
- ),
75
- end: (
76
- /* glsl */
77
- `
78
- if(uRound == 1.)
79
- {
80
- gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
81
- }
82
- `
83
- )
84
- }
85
- };
86
-
87
-
88
- //# sourceMappingURL=localUniformBit.mjs.map
89
-
90
-
91
- /***/ }),
92
-
93
- /***/ 3391:
94
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
95
-
96
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
97
- /* harmony export */ textureBit: () => (/* binding */ textureBit),
98
- /* harmony export */ textureBitGl: () => (/* binding */ textureBitGl)
99
- /* harmony export */ });
100
-
101
- const textureBit = {
102
- name: "texture-bit",
103
- vertex: {
104
- header: (
105
- /* wgsl */
106
- `
107
-
108
- struct TextureUniforms {
109
- uTextureMatrix:mat3x3<f32>,
110
- }
111
-
112
- @group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;
113
- `
114
- ),
115
- main: (
116
- /* wgsl */
117
- `
118
- uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;
119
- `
120
- )
121
- },
122
- fragment: {
123
- header: (
124
- /* wgsl */
125
- `
126
- @group(2) @binding(0) var uTexture: texture_2d<f32>;
127
- @group(2) @binding(1) var uSampler: sampler;
128
-
129
-
130
- `
131
- ),
132
- main: (
133
- /* wgsl */
134
- `
135
- outColor = textureSample(uTexture, uSampler, vUV);
136
- `
137
- )
138
- }
139
- };
140
- const textureBitGl = {
141
- name: "texture-bit",
142
- vertex: {
143
- header: (
144
- /* glsl */
145
- `
146
- uniform mat3 uTextureMatrix;
147
- `
148
- ),
149
- main: (
150
- /* glsl */
151
- `
152
- uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
153
- `
154
- )
155
- },
156
- fragment: {
157
- header: (
158
- /* glsl */
159
- `
160
- uniform sampler2D uTexture;
161
-
162
-
163
- `
164
- ),
165
- main: (
166
- /* glsl */
167
- `
168
- outColor = texture(uTexture, vUV);
169
- `
170
- )
171
- }
172
- };
173
-
174
-
175
- //# sourceMappingURL=textureBit.mjs.map
176
-
177
-
178
- /***/ }),
179
-
180
- /***/ 7084:
181
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
182
-
183
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
184
- /* harmony export */ ensureAttributes: () => (/* binding */ ensureAttributes)
185
- /* harmony export */ });
186
- /* harmony import */ var _utils_logging_warn_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(268);
187
- /* harmony import */ var _shared_geometry_utils_getAttributeInfoFromFormat_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8306);
188
-
189
-
190
-
191
- "use strict";
192
- function ensureAttributes(geometry, extractedData) {
193
- for (const i in geometry.attributes) {
194
- const attribute = geometry.attributes[i];
195
- const attributeData = extractedData[i];
196
- if (attributeData) {
197
- attribute.format ?? (attribute.format = attributeData.format);
198
- attribute.offset ?? (attribute.offset = attributeData.offset);
199
- attribute.instance ?? (attribute.instance = attributeData.instance);
200
- } else {
201
- (0,_utils_logging_warn_mjs__WEBPACK_IMPORTED_MODULE_0__.warn)(`Attribute ${i} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`);
202
- }
203
- }
204
- ensureStartAndStride(geometry);
205
- }
206
- function ensureStartAndStride(geometry) {
207
- const { buffers, attributes } = geometry;
208
- const tempStride = {};
209
- const tempStart = {};
210
- for (const j in buffers) {
211
- const buffer = buffers[j];
212
- tempStride[buffer.uid] = 0;
213
- tempStart[buffer.uid] = 0;
214
- }
215
- for (const j in attributes) {
216
- const attribute = attributes[j];
217
- tempStride[attribute.buffer.uid] += (0,_shared_geometry_utils_getAttributeInfoFromFormat_mjs__WEBPACK_IMPORTED_MODULE_1__.getAttributeInfoFromFormat)(attribute.format).stride;
218
- }
219
- for (const j in attributes) {
220
- const attribute = attributes[j];
221
- attribute.stride ?? (attribute.stride = tempStride[attribute.buffer.uid]);
222
- attribute.start ?? (attribute.start = tempStart[attribute.buffer.uid]);
223
- tempStart[attribute.buffer.uid] += (0,_shared_geometry_utils_getAttributeInfoFromFormat_mjs__WEBPACK_IMPORTED_MODULE_1__.getAttributeInfoFromFormat)(attribute.format).stride;
224
- }
225
- }
226
-
227
-
228
- //# sourceMappingURL=ensureAttributes.mjs.map
229
-
230
-
231
- /***/ }),
232
-
233
- /***/ 1172:
234
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
235
-
236
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
237
- /* harmony export */ GpuStencilModesToPixi: () => (/* binding */ GpuStencilModesToPixi)
238
- /* harmony export */ });
239
- /* harmony import */ var _shared_state_const_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1957);
240
-
241
-
242
- "use strict";
243
- const GpuStencilModesToPixi = [];
244
- GpuStencilModesToPixi[_shared_state_const_mjs__WEBPACK_IMPORTED_MODULE_0__.STENCIL_MODES.NONE] = void 0;
245
- GpuStencilModesToPixi[_shared_state_const_mjs__WEBPACK_IMPORTED_MODULE_0__.STENCIL_MODES.DISABLED] = {
246
- stencilWriteMask: 0,
247
- stencilReadMask: 0
248
- };
249
- GpuStencilModesToPixi[_shared_state_const_mjs__WEBPACK_IMPORTED_MODULE_0__.STENCIL_MODES.RENDERING_MASK_ADD] = {
250
- stencilFront: {
251
- compare: "equal",
252
- passOp: "increment-clamp"
253
- },
254
- stencilBack: {
255
- compare: "equal",
256
- passOp: "increment-clamp"
257
- }
258
- };
259
- GpuStencilModesToPixi[_shared_state_const_mjs__WEBPACK_IMPORTED_MODULE_0__.STENCIL_MODES.RENDERING_MASK_REMOVE] = {
260
- stencilFront: {
261
- compare: "equal",
262
- passOp: "decrement-clamp"
263
- },
264
- stencilBack: {
265
- compare: "equal",
266
- passOp: "decrement-clamp"
267
- }
268
- };
269
- GpuStencilModesToPixi[_shared_state_const_mjs__WEBPACK_IMPORTED_MODULE_0__.STENCIL_MODES.MASK_ACTIVE] = {
270
- stencilWriteMask: 0,
271
- stencilFront: {
272
- compare: "equal",
273
- passOp: "keep"
274
- },
275
- stencilBack: {
276
- compare: "equal",
277
- passOp: "keep"
278
- }
279
- };
280
- GpuStencilModesToPixi[_shared_state_const_mjs__WEBPACK_IMPORTED_MODULE_0__.STENCIL_MODES.INVERSE_MASK_ACTIVE] = {
281
- stencilWriteMask: 0,
282
- stencilFront: {
283
- compare: "not-equal",
284
- passOp: "replace"
285
- },
286
- stencilBack: {
287
- compare: "not-equal",
288
- passOp: "replace"
289
- }
290
- };
291
-
292
-
293
- //# sourceMappingURL=GpuStencilModesToPixi.mjs.map
294
-
295
-
296
- /***/ }),
297
-
298
- /***/ 581:
299
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
300
-
301
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
302
- /* harmony export */ BufferResource: () => (/* binding */ BufferResource)
303
- /* harmony export */ });
304
- /* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4486);
305
- /* harmony import */ var _utils_data_uid_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(133);
306
-
307
-
308
-
309
- "use strict";
310
- class BufferResource extends eventemitter3__WEBPACK_IMPORTED_MODULE_0__["default"] {
311
- /**
312
- * Create a new Buffer Resource.
313
- * @param options - The options for the buffer resource
314
- * @param options.buffer - The underlying buffer that this resource is using
315
- * @param options.offset - The offset of the buffer this resource is using.
316
- * If not provided, then it will use the offset of the buffer.
317
- * @param options.size - The size of the buffer this resource is using.
318
- * If not provided, then it will use the size of the buffer.
319
- */
320
- constructor({ buffer, offset, size }) {
321
- super();
322
- /**
323
- * emits when the underlying buffer has changed shape (i.e. resized)
324
- * letting the renderer know that it needs to discard the old buffer on the GPU and create a new one
325
- * @event change
326
- */
327
- /** a unique id for this uniform group used through the renderer */
328
- this.uid = (0,_utils_data_uid_mjs__WEBPACK_IMPORTED_MODULE_1__.uid)("buffer");
329
- /**
330
- * a resource type, used to identify how to handle it when its in a bind group / shader resource
331
- * @internal
332
- * @ignore
333
- */
334
- this._resourceType = "bufferResource";
335
- /**
336
- * used internally to know if a uniform group was used in the last render pass
337
- * @internal
338
- * @ignore
339
- */
340
- this._touched = 0;
341
- /**
342
- * the resource id used internally by the renderer to build bind group keys
343
- * @internal
344
- * @ignore
345
- */
346
- this._resourceId = (0,_utils_data_uid_mjs__WEBPACK_IMPORTED_MODULE_1__.uid)("resource");
347
- /**
348
- * A cheeky hint to the GL renderer to let it know this is a BufferResource
349
- * @internal
350
- * @ignore
351
- */
352
- this._bufferResource = true;
353
- /**
354
- * Has the Buffer resource been destroyed?
355
- * @readonly
356
- */
357
- this.destroyed = false;
358
- this.buffer = buffer;
359
- this.offset = offset | 0;
360
- this.size = size;
361
- this.buffer.on("change", this.onBufferChange, this);
362
- }
363
- onBufferChange() {
364
- this._resourceId = (0,_utils_data_uid_mjs__WEBPACK_IMPORTED_MODULE_1__.uid)("resource");
365
- this.emit("change", this);
366
- }
367
- /**
368
- * Destroys this resource. Make sure the underlying buffer is not used anywhere else
369
- * if you want to destroy it as well, or code will explode
370
- * @param destroyBuffer - Should the underlying buffer be destroyed as well?
371
- */
372
- destroy(destroyBuffer = false) {
373
- this.destroyed = true;
374
- if (destroyBuffer) {
375
- this.buffer.destroy();
376
- }
377
- this.emit("change", this);
378
- this.buffer = null;
379
- }
380
- }
381
-
382
-
383
- //# sourceMappingURL=BufferResource.mjs.map
384
-
385
-
386
- /***/ }),
387
-
388
- /***/ 279:
389
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
390
-
391
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
392
- /* harmony export */ RenderTarget: () => (/* binding */ RenderTarget)
393
- /* harmony export */ });
394
- /* harmony import */ var _utils_data_uid_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(133);
395
- /* harmony import */ var _texture_sources_TextureSource_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1285);
396
- /* harmony import */ var _texture_Texture_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4492);
397
-
398
-
399
-
400
-
401
- "use strict";
402
- const _RenderTarget = class _RenderTarget {
403
- /**
404
- * @param [descriptor] - Options for creating a render target.
405
- */
406
- constructor(descriptor = {}) {
407
- /** unique id for this render target */
408
- this.uid = (0,_utils_data_uid_mjs__WEBPACK_IMPORTED_MODULE_0__.uid)("renderTarget");
409
- /**
410
- * An array of textures that can be written to by the GPU - mostly this has one texture in Pixi, but you could
411
- * write to multiple if required! (eg deferred lighting)
412
- */
413
- this.colorTextures = [];
414
- this.dirtyId = 0;
415
- this.isRoot = false;
416
- this._size = new Float32Array(2);
417
- /** if true, then when the render target is destroyed, it will destroy all the textures that were created for it. */
418
- this._managedColorTextures = false;
419
- descriptor = { ..._RenderTarget.defaultOptions, ...descriptor };
420
- this.stencil = descriptor.stencil;
421
- this.depth = descriptor.depth;
422
- this.isRoot = descriptor.isRoot;
423
- if (typeof descriptor.colorTextures === "number") {
424
- this._managedColorTextures = true;
425
- for (let i = 0; i < descriptor.colorTextures; i++) {
426
- this.colorTextures.push(
427
- new _texture_sources_TextureSource_mjs__WEBPACK_IMPORTED_MODULE_1__.TextureSource({
428
- width: descriptor.width,
429
- height: descriptor.height,
430
- resolution: descriptor.resolution,
431
- antialias: descriptor.antialias
432
- })
433
- );
434
- }
435
- } else {
436
- this.colorTextures = [...descriptor.colorTextures.map((texture) => texture.source)];
437
- const colorSource = this.colorTexture.source;
438
- this.resize(colorSource.width, colorSource.height, colorSource._resolution);
439
- }
440
- this.colorTexture.source.on("resize", this.onSourceResize, this);
441
- if (descriptor.depthStencilTexture || this.stencil) {
442
- if (descriptor.depthStencilTexture instanceof _texture_Texture_mjs__WEBPACK_IMPORTED_MODULE_2__.Texture || descriptor.depthStencilTexture instanceof _texture_sources_TextureSource_mjs__WEBPACK_IMPORTED_MODULE_1__.TextureSource) {
443
- this.depthStencilTexture = descriptor.depthStencilTexture.source;
444
- } else {
445
- this.ensureDepthStencilTexture();
446
- }
447
- }
448
- }
449
- get size() {
450
- const _size = this._size;
451
- _size[0] = this.pixelWidth;
452
- _size[1] = this.pixelHeight;
453
- return _size;
454
- }
455
- get width() {
456
- return this.colorTexture.source.width;
457
- }
458
- get height() {
459
- return this.colorTexture.source.height;
460
- }
461
- get pixelWidth() {
462
- return this.colorTexture.source.pixelWidth;
463
- }
464
- get pixelHeight() {
465
- return this.colorTexture.source.pixelHeight;
466
- }
467
- get resolution() {
468
- return this.colorTexture.source._resolution;
469
- }
470
- get colorTexture() {
471
- return this.colorTextures[0];
472
- }
473
- onSourceResize(source) {
474
- this.resize(source.width, source.height, source._resolution, true);
475
- }
476
- /**
477
- * This will ensure a depthStencil texture is created for this render target.
478
- * Most likely called by the mask system to make sure we have stencil buffer added.
479
- * @internal
480
- * @ignore
481
- */
482
- ensureDepthStencilTexture() {
483
- if (!this.depthStencilTexture) {
484
- this.depthStencilTexture = new _texture_sources_TextureSource_mjs__WEBPACK_IMPORTED_MODULE_1__.TextureSource({
485
- width: this.width,
486
- height: this.height,
487
- resolution: this.resolution,
488
- format: "depth24plus-stencil8",
489
- autoGenerateMipmaps: false,
490
- antialias: false,
491
- mipLevelCount: 1
492
- // sampleCount: handled by the render target system..
493
- });
494
- }
495
- }
496
- resize(width, height, resolution = this.resolution, skipColorTexture = false) {
497
- this.dirtyId++;
498
- this.colorTextures.forEach((colorTexture, i) => {
499
- if (skipColorTexture && i === 0)
500
- return;
501
- colorTexture.source.resize(width, height, resolution);
502
- });
503
- if (this.depthStencilTexture) {
504
- this.depthStencilTexture.source.resize(width, height, resolution);
505
- }
506
- }
507
- destroy() {
508
- this.colorTexture.source.off("resize", this.onSourceResize, this);
509
- if (this._managedColorTextures) {
510
- this.colorTextures.forEach((texture) => {
511
- texture.destroy();
512
- });
513
- }
514
- if (this.depthStencilTexture) {
515
- this.depthStencilTexture.destroy();
516
- delete this.depthStencilTexture;
517
- }
518
- }
519
- };
520
- /** The default options for a render target */
521
- _RenderTarget.defaultOptions = {
522
- /** the width of the RenderTarget */
523
- width: 0,
524
- /** the height of the RenderTarget */
525
- height: 0,
526
- /** the resolution of the RenderTarget */
527
- resolution: 1,
528
- /** an array of textures, or a number indicating how many color textures there should be */
529
- colorTextures: 1,
530
- /** should this render target have a stencil buffer? */
531
- stencil: false,
532
- /** should this render target have a depth buffer? */
533
- depth: false,
534
- /** should this render target be antialiased? */
535
- antialias: false,
536
- // save on perf by default!
537
- /** is this a root element, true if this is gl context owners render target */
538
- isRoot: false
539
- };
540
- let RenderTarget = _RenderTarget;
541
-
542
-
543
- //# sourceMappingURL=RenderTarget.mjs.map
544
-
545
-
546
- /***/ }),
547
-
548
- /***/ 7238:
549
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
550
-
551
-
552
- // EXPORTS
553
- __webpack_require__.d(__webpack_exports__, {
554
- RenderTargetSystem: () => (/* binding */ RenderTargetSystem)
555
- });
556
-
557
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/maths/matrix/Matrix.mjs
558
- var Matrix = __webpack_require__(9313);
559
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/maths/shapes/Rectangle.mjs
560
- var Rectangle = __webpack_require__(9252);
561
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/gl/const.mjs
562
- var gl_const = __webpack_require__(1257);
563
- ;// ./node_modules/pixi.js/lib/rendering/renderers/gpu/renderTarget/calculateProjection.mjs
564
-
565
- function calculateProjection(pm, x, y, width, height, flipY) {
566
- const sign = flipY ? 1 : -1;
567
- pm.identity();
568
- pm.a = 1 / width * 2;
569
- pm.d = sign * (1 / height * 2);
570
- pm.tx = -1 - x * pm.a;
571
- pm.ty = -sign - y * pm.d;
572
- return pm;
573
- }
574
-
575
-
576
- //# sourceMappingURL=calculateProjection.mjs.map
577
-
578
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.mjs
579
- var SystemRunner = __webpack_require__(7729);
580
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/sources/CanvasSource.mjs
581
- var CanvasSource = __webpack_require__(4884);
582
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/sources/TextureSource.mjs + 1 modules
583
- var TextureSource = __webpack_require__(1285);
584
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/Texture.mjs + 2 modules
585
- var Texture = __webpack_require__(4492);
586
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.mjs
587
- var getCanvasTexture = __webpack_require__(8725);
588
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/renderTarget/isRenderingToScreen.mjs
589
-
590
- function isRenderingToScreen(renderTarget) {
591
- const resource = renderTarget.colorTexture.source.resource;
592
- return globalThis.HTMLCanvasElement && resource instanceof HTMLCanvasElement && document.body.contains(resource);
593
- }
594
-
595
-
596
- //# sourceMappingURL=isRenderingToScreen.mjs.map
597
-
598
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/renderTarget/RenderTarget.mjs
599
- var RenderTarget = __webpack_require__(279);
600
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/renderTarget/RenderTargetSystem.mjs
601
-
602
-
603
-
604
-
605
-
606
-
607
-
608
-
609
-
610
-
611
-
612
-
613
- "use strict";
614
- class RenderTargetSystem {
615
- constructor(renderer) {
616
- /** This is the root viewport for the render pass*/
617
- this.rootViewPort = new Rectangle.Rectangle();
618
- /** the current viewport that the gpu is using */
619
- this.viewport = new Rectangle.Rectangle();
620
- /**
621
- * a runner that lets systems know if the active render target has changed.
622
- * Eg the Stencil System needs to know so it can manage the stencil buffer
623
- */
624
- this.onRenderTargetChange = new SystemRunner.SystemRunner("onRenderTargetChange");
625
- /** the projection matrix that is used by the shaders based on the active render target and the viewport */
626
- this.projectionMatrix = new Matrix.Matrix();
627
- /** the default clear color for render targets */
628
- this.defaultClearColor = [0, 0, 0, 0];
629
- /**
630
- * a hash that stores the render target for a given render surface. When you pass in a texture source,
631
- * a render target is created for it. This map stores and makes it easy to retrieve the render target
632
- */
633
- this._renderSurfaceToRenderTargetHash = /* @__PURE__ */ new Map();
634
- /** A hash that stores a gpu render target for a given render target. */
635
- this._gpuRenderTargetHash = /* @__PURE__ */ Object.create(null);
636
- /**
637
- * A stack that stores the render target and frame that is currently being rendered to.
638
- * When push is called, the current render target is stored in this stack.
639
- * When pop is called, the previous render target is restored.
640
- */
641
- this._renderTargetStack = [];
642
- this._renderer = renderer;
643
- renderer.renderableGC.addManagedHash(this, "_gpuRenderTargetHash");
644
- }
645
- /** called when dev wants to finish a render pass */
646
- finishRenderPass() {
647
- this.adaptor.finishRenderPass(this.renderTarget);
648
- }
649
- /**
650
- * called when the renderer starts to render a scene.
651
- * @param options
652
- * @param options.target - the render target to render to
653
- * @param options.clear - the clear mode to use. Can be true or a CLEAR number 'COLOR | DEPTH | STENCIL' 0b111
654
- * @param options.clearColor - the color to clear to
655
- * @param options.frame - the frame to render to
656
- */
657
- renderStart({
658
- target,
659
- clear,
660
- clearColor,
661
- frame
662
- }) {
663
- this._renderTargetStack.length = 0;
664
- this.push(
665
- target,
666
- clear,
667
- clearColor,
668
- frame
669
- );
670
- this.rootViewPort.copyFrom(this.viewport);
671
- this.rootRenderTarget = this.renderTarget;
672
- this.renderingToScreen = isRenderingToScreen(this.rootRenderTarget);
673
- this.adaptor.prerender?.(this.rootRenderTarget);
674
- }
675
- postrender() {
676
- this.adaptor.postrender?.(this.rootRenderTarget);
677
- }
678
- /**
679
- * Binding a render surface! This is the main function of the render target system.
680
- * It will take the RenderSurface (which can be a texture, canvas, or render target) and bind it to the renderer.
681
- * Once bound all draw calls will be rendered to the render surface.
682
- *
683
- * If a frame is not provide and the render surface is a texture, the frame of the texture will be used.
684
- * @param renderSurface - the render surface to bind
685
- * @param clear - the clear mode to use. Can be true or a CLEAR number 'COLOR | DEPTH | STENCIL' 0b111
686
- * @param clearColor - the color to clear to
687
- * @param frame - the frame to render to
688
- * @returns the render target that was bound
689
- */
690
- bind(renderSurface, clear = true, clearColor, frame) {
691
- const renderTarget = this.getRenderTarget(renderSurface);
692
- const didChange = this.renderTarget !== renderTarget;
693
- this.renderTarget = renderTarget;
694
- this.renderSurface = renderSurface;
695
- const gpuRenderTarget = this.getGpuRenderTarget(renderTarget);
696
- if (renderTarget.pixelWidth !== gpuRenderTarget.width || renderTarget.pixelHeight !== gpuRenderTarget.height) {
697
- this.adaptor.resizeGpuRenderTarget(renderTarget);
698
- gpuRenderTarget.width = renderTarget.pixelWidth;
699
- gpuRenderTarget.height = renderTarget.pixelHeight;
700
- }
701
- const source = renderTarget.colorTexture;
702
- const viewport = this.viewport;
703
- const pixelWidth = source.pixelWidth;
704
- const pixelHeight = source.pixelHeight;
705
- if (!frame && renderSurface instanceof Texture.Texture) {
706
- frame = renderSurface.frame;
707
- }
708
- if (frame) {
709
- const resolution = source._resolution;
710
- viewport.x = frame.x * resolution + 0.5 | 0;
711
- viewport.y = frame.y * resolution + 0.5 | 0;
712
- viewport.width = frame.width * resolution + 0.5 | 0;
713
- viewport.height = frame.height * resolution + 0.5 | 0;
714
- } else {
715
- viewport.x = 0;
716
- viewport.y = 0;
717
- viewport.width = pixelWidth;
718
- viewport.height = pixelHeight;
719
- }
720
- calculateProjection(
721
- this.projectionMatrix,
722
- 0,
723
- 0,
724
- viewport.width / source.resolution,
725
- viewport.height / source.resolution,
726
- !renderTarget.isRoot
727
- );
728
- this.adaptor.startRenderPass(renderTarget, clear, clearColor, viewport);
729
- if (didChange) {
730
- this.onRenderTargetChange.emit(renderTarget);
731
- }
732
- return renderTarget;
733
- }
734
- clear(target, clear = gl_const.CLEAR.ALL, clearColor) {
735
- if (!clear)
736
- return;
737
- if (target) {
738
- target = this.getRenderTarget(target);
739
- }
740
- this.adaptor.clear(
741
- target || this.renderTarget,
742
- clear,
743
- clearColor,
744
- this.viewport
745
- );
746
- }
747
- contextChange() {
748
- this._gpuRenderTargetHash = /* @__PURE__ */ Object.create(null);
749
- }
750
- /**
751
- * Push a render surface to the renderer. This will bind the render surface to the renderer,
752
- * @param renderSurface - the render surface to push
753
- * @param clear - the clear mode to use. Can be true or a CLEAR number 'COLOR | DEPTH | STENCIL' 0b111
754
- * @param clearColor - the color to clear to
755
- * @param frame - the frame to use when rendering to the render surface
756
- */
757
- push(renderSurface, clear = gl_const.CLEAR.ALL, clearColor, frame) {
758
- const renderTarget = this.bind(renderSurface, clear, clearColor, frame);
759
- this._renderTargetStack.push({
760
- renderTarget,
761
- frame
762
- });
763
- return renderTarget;
764
- }
765
- /** Pops the current render target from the renderer and restores the previous render target. */
766
- pop() {
767
- this._renderTargetStack.pop();
768
- const currentRenderTargetData = this._renderTargetStack[this._renderTargetStack.length - 1];
769
- this.bind(currentRenderTargetData.renderTarget, false, null, currentRenderTargetData.frame);
770
- }
771
- /**
772
- * Gets the render target from the provide render surface. Eg if its a texture,
773
- * it will return the render target for the texture.
774
- * If its a render target, it will return the same render target.
775
- * @param renderSurface - the render surface to get the render target for
776
- * @returns the render target for the render surface
777
- */
778
- getRenderTarget(renderSurface) {
779
- if (renderSurface.isTexture) {
780
- renderSurface = renderSurface.source;
781
- }
782
- return this._renderSurfaceToRenderTargetHash.get(renderSurface) ?? this._initRenderTarget(renderSurface);
783
- }
784
- /**
785
- * Copies a render surface to another texture
786
- * @param sourceRenderSurfaceTexture - the render surface to copy from
787
- * @param destinationTexture - the texture to copy to
788
- * @param originSrc - the origin of the copy
789
- * @param originSrc.x - the x origin of the copy
790
- * @param originSrc.y - the y origin of the copy
791
- * @param size - the size of the copy
792
- * @param size.width - the width of the copy
793
- * @param size.height - the height of the copy
794
- * @param originDest - the destination origin (top left to paste from!)
795
- * @param originDest.x - the x origin of the paste
796
- * @param originDest.y - the y origin of the paste
797
- */
798
- copyToTexture(sourceRenderSurfaceTexture, destinationTexture, originSrc, size, originDest) {
799
- if (originSrc.x < 0) {
800
- size.width += originSrc.x;
801
- originDest.x -= originSrc.x;
802
- originSrc.x = 0;
803
- }
804
- if (originSrc.y < 0) {
805
- size.height += originSrc.y;
806
- originDest.y -= originSrc.y;
807
- originSrc.y = 0;
808
- }
809
- const { pixelWidth, pixelHeight } = sourceRenderSurfaceTexture;
810
- size.width = Math.min(size.width, pixelWidth - originSrc.x);
811
- size.height = Math.min(size.height, pixelHeight - originSrc.y);
812
- return this.adaptor.copyToTexture(
813
- sourceRenderSurfaceTexture,
814
- destinationTexture,
815
- originSrc,
816
- size,
817
- originDest
818
- );
819
- }
820
- /**
821
- * ensures that we have a depth stencil buffer available to render to
822
- * This is used by the mask system to make sure we have a stencil buffer.
823
- */
824
- ensureDepthStencil() {
825
- if (!this.renderTarget.stencil) {
826
- this.renderTarget.stencil = true;
827
- this.adaptor.startRenderPass(this.renderTarget, false, null, this.viewport);
828
- }
829
- }
830
- /** nukes the render target system */
831
- destroy() {
832
- this._renderer = null;
833
- this._renderSurfaceToRenderTargetHash.forEach((renderTarget, key) => {
834
- if (renderTarget !== key) {
835
- renderTarget.destroy();
836
- }
837
- });
838
- this._renderSurfaceToRenderTargetHash.clear();
839
- this._gpuRenderTargetHash = /* @__PURE__ */ Object.create(null);
840
- }
841
- _initRenderTarget(renderSurface) {
842
- let renderTarget = null;
843
- if (CanvasSource.CanvasSource.test(renderSurface)) {
844
- renderSurface = (0,getCanvasTexture.getCanvasTexture)(renderSurface).source;
845
- }
846
- if (renderSurface instanceof RenderTarget.RenderTarget) {
847
- renderTarget = renderSurface;
848
- } else if (renderSurface instanceof TextureSource.TextureSource) {
849
- renderTarget = new RenderTarget.RenderTarget({
850
- colorTextures: [renderSurface]
851
- });
852
- if (CanvasSource.CanvasSource.test(renderSurface.source.resource)) {
853
- renderTarget.isRoot = true;
854
- }
855
- renderSurface.once("destroy", () => {
856
- renderTarget.destroy();
857
- this._renderSurfaceToRenderTargetHash.delete(renderSurface);
858
- const gpuRenderTarget = this._gpuRenderTargetHash[renderTarget.uid];
859
- if (gpuRenderTarget) {
860
- this._gpuRenderTargetHash[renderTarget.uid] = null;
861
- this.adaptor.destroyGpuRenderTarget(gpuRenderTarget);
862
- }
863
- });
864
- }
865
- this._renderSurfaceToRenderTargetHash.set(renderSurface, renderTarget);
866
- return renderTarget;
867
- }
868
- getGpuRenderTarget(renderTarget) {
869
- return this._gpuRenderTargetHash[renderTarget.uid] || (this._gpuRenderTargetHash[renderTarget.uid] = this.adaptor.initGpuRenderTarget(renderTarget));
870
- }
871
- }
872
-
873
-
874
- //# sourceMappingURL=RenderTargetSystem.mjs.map
875
-
876
-
877
- /***/ }),
878
-
879
- /***/ 7047:
880
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
881
-
882
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
883
- /* harmony export */ UboSystem: () => (/* binding */ UboSystem)
884
- /* harmony export */ });
885
- /* harmony import */ var _utils_browser_unsafeEvalSupported_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4577);
886
- /* harmony import */ var _buffer_Buffer_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(949);
887
- /* harmony import */ var _buffer_const_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1132);
888
-
889
-
890
-
891
-
892
- "use strict";
893
- class UboSystem {
894
- constructor(adaptor) {
895
- /** Cache of uniform buffer layouts and sync functions, so we don't have to re-create them */
896
- this._syncFunctionHash = /* @__PURE__ */ Object.create(null);
897
- this._adaptor = adaptor;
898
- this._systemCheck();
899
- }
900
- /**
901
- * Overridable function by `pixi.js/unsafe-eval` to silence
902
- * throwing an error if platform doesn't support unsafe-evals.
903
- * @private
904
- */
905
- _systemCheck() {
906
- if (!(0,_utils_browser_unsafeEvalSupported_mjs__WEBPACK_IMPORTED_MODULE_0__.unsafeEvalSupported)()) {
907
- throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.");
908
- }
909
- }
910
- ensureUniformGroup(uniformGroup) {
911
- const uniformData = this.getUniformGroupData(uniformGroup);
912
- uniformGroup.buffer || (uniformGroup.buffer = new _buffer_Buffer_mjs__WEBPACK_IMPORTED_MODULE_1__.Buffer({
913
- data: new Float32Array(uniformData.layout.size / 4),
914
- usage: _buffer_const_mjs__WEBPACK_IMPORTED_MODULE_2__.BufferUsage.UNIFORM | _buffer_const_mjs__WEBPACK_IMPORTED_MODULE_2__.BufferUsage.COPY_DST
915
- }));
916
- }
917
- getUniformGroupData(uniformGroup) {
918
- return this._syncFunctionHash[uniformGroup._signature] || this._initUniformGroup(uniformGroup);
919
- }
920
- _initUniformGroup(uniformGroup) {
921
- const uniformGroupSignature = uniformGroup._signature;
922
- let uniformData = this._syncFunctionHash[uniformGroupSignature];
923
- if (!uniformData) {
924
- const elements = Object.keys(uniformGroup.uniformStructures).map((i) => uniformGroup.uniformStructures[i]);
925
- const layout = this._adaptor.createUboElements(elements);
926
- const syncFunction = this._generateUboSync(layout.uboElements);
927
- uniformData = this._syncFunctionHash[uniformGroupSignature] = {
928
- layout,
929
- syncFunction
930
- };
931
- }
932
- return this._syncFunctionHash[uniformGroupSignature];
933
- }
934
- _generateUboSync(uboElements) {
935
- return this._adaptor.generateUboSync(uboElements);
936
- }
937
- syncUniformGroup(uniformGroup, data, offset) {
938
- const uniformGroupData = this.getUniformGroupData(uniformGroup);
939
- uniformGroup.buffer || (uniformGroup.buffer = new _buffer_Buffer_mjs__WEBPACK_IMPORTED_MODULE_1__.Buffer({
940
- data: new Float32Array(uniformGroupData.layout.size / 4),
941
- usage: _buffer_const_mjs__WEBPACK_IMPORTED_MODULE_2__.BufferUsage.UNIFORM | _buffer_const_mjs__WEBPACK_IMPORTED_MODULE_2__.BufferUsage.COPY_DST
942
- }));
943
- let dataInt32 = null;
944
- if (!data) {
945
- data = uniformGroup.buffer.data;
946
- dataInt32 = uniformGroup.buffer.dataInt32;
947
- }
948
- offset || (offset = 0);
949
- uniformGroupData.syncFunction(uniformGroup.uniforms, data, dataInt32, offset);
950
- return true;
951
- }
952
- updateUniformGroup(uniformGroup) {
953
- if (uniformGroup.isStatic && !uniformGroup._dirtyId)
954
- return false;
955
- uniformGroup._dirtyId = 0;
956
- const synced = this.syncUniformGroup(uniformGroup);
957
- uniformGroup.buffer.update();
958
- return synced;
959
- }
960
- destroy() {
961
- this._syncFunctionHash = null;
962
- }
963
- }
964
-
965
-
966
- //# sourceMappingURL=UboSystem.mjs.map
967
-
968
-
969
- /***/ }),
970
-
971
- /***/ 6423:
972
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
973
-
974
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
975
- /* harmony export */ createUboSyncFunction: () => (/* binding */ createUboSyncFunction)
976
- /* harmony export */ });
977
- /* harmony import */ var _uniformParsers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8166);
978
-
979
-
980
- "use strict";
981
- function createUboSyncFunction(uboElements, parserCode, arrayGenerationFunction, singleSettersMap) {
982
- const funcFragments = [`
983
- var v = null;
984
- var v2 = null;
985
- var t = 0;
986
- var index = 0;
987
- var name = null;
988
- var arrayOffset = null;
989
- `];
990
- let prev = 0;
991
- for (let i = 0; i < uboElements.length; i++) {
992
- const uboElement = uboElements[i];
993
- const name = uboElement.data.name;
994
- let parsed = false;
995
- let offset = 0;
996
- for (let j = 0; j < _uniformParsers_mjs__WEBPACK_IMPORTED_MODULE_0__.uniformParsers.length; j++) {
997
- const uniformParser = _uniformParsers_mjs__WEBPACK_IMPORTED_MODULE_0__.uniformParsers[j];
998
- if (uniformParser.test(uboElement.data)) {
999
- offset = uboElement.offset / 4;
1000
- funcFragments.push(
1001
- `name = "${name}";`,
1002
- `offset += ${offset - prev};`,
1003
- _uniformParsers_mjs__WEBPACK_IMPORTED_MODULE_0__.uniformParsers[j][parserCode] || _uniformParsers_mjs__WEBPACK_IMPORTED_MODULE_0__.uniformParsers[j].ubo
1004
- );
1005
- parsed = true;
1006
- break;
1007
- }
1008
- }
1009
- if (!parsed) {
1010
- if (uboElement.data.size > 1) {
1011
- offset = uboElement.offset / 4;
1012
- funcFragments.push(arrayGenerationFunction(uboElement, offset - prev));
1013
- } else {
1014
- const template = singleSettersMap[uboElement.data.type];
1015
- offset = uboElement.offset / 4;
1016
- funcFragments.push(
1017
- /* wgsl */
1018
- `
1019
- v = uv.${name};
1020
- offset += ${offset - prev};
1021
- ${template};
1022
- `
1023
- );
1024
- }
1025
- }
1026
- prev = offset;
1027
- }
1028
- const fragmentSrc = funcFragments.join("\n");
1029
- return new Function(
1030
- "uv",
1031
- "data",
1032
- "dataInt32",
1033
- "offset",
1034
- fragmentSrc
1035
- );
1036
- }
1037
-
1038
-
1039
- //# sourceMappingURL=createUboSyncFunction.mjs.map
1040
-
1041
-
1042
- /***/ }),
1043
-
1044
- /***/ 1266:
1045
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1046
-
1047
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1048
- /* harmony export */ uboSyncFunctionsSTD40: () => (/* binding */ uboSyncFunctionsSTD40),
1049
- /* harmony export */ uboSyncFunctionsWGSL: () => (/* binding */ uboSyncFunctionsWGSL)
1050
- /* harmony export */ });
1051
-
1052
- function loopMatrix(col, row) {
1053
- const total = col * row;
1054
- return `
1055
- for (let i = 0; i < ${total}; i++) {
1056
- data[offset + (((i / ${col})|0) * 4) + (i % ${col})] = v[i];
1057
- }
1058
- `;
1059
- }
1060
- const uboSyncFunctionsSTD40 = {
1061
- f32: `
1062
- data[offset] = v;`,
1063
- i32: `
1064
- dataInt32[offset] = v;`,
1065
- "vec2<f32>": `
1066
- data[offset] = v[0];
1067
- data[offset + 1] = v[1];`,
1068
- "vec3<f32>": `
1069
- data[offset] = v[0];
1070
- data[offset + 1] = v[1];
1071
- data[offset + 2] = v[2];`,
1072
- "vec4<f32>": `
1073
- data[offset] = v[0];
1074
- data[offset + 1] = v[1];
1075
- data[offset + 2] = v[2];
1076
- data[offset + 3] = v[3];`,
1077
- "vec2<i32>": `
1078
- dataInt32[offset] = v[0];
1079
- dataInt32[offset + 1] = v[1];`,
1080
- "vec3<i32>": `
1081
- dataInt32[offset] = v[0];
1082
- dataInt32[offset + 1] = v[1];
1083
- dataInt32[offset + 2] = v[2];`,
1084
- "vec4<i32>": `
1085
- dataInt32[offset] = v[0];
1086
- dataInt32[offset + 1] = v[1];
1087
- dataInt32[offset + 2] = v[2];
1088
- dataInt32[offset + 3] = v[3];`,
1089
- "mat2x2<f32>": `
1090
- data[offset] = v[0];
1091
- data[offset + 1] = v[1];
1092
- data[offset + 4] = v[2];
1093
- data[offset + 5] = v[3];`,
1094
- "mat3x3<f32>": `
1095
- data[offset] = v[0];
1096
- data[offset + 1] = v[1];
1097
- data[offset + 2] = v[2];
1098
- data[offset + 4] = v[3];
1099
- data[offset + 5] = v[4];
1100
- data[offset + 6] = v[5];
1101
- data[offset + 8] = v[6];
1102
- data[offset + 9] = v[7];
1103
- data[offset + 10] = v[8];`,
1104
- "mat4x4<f32>": `
1105
- for (let i = 0; i < 16; i++) {
1106
- data[offset + i] = v[i];
1107
- }`,
1108
- "mat3x2<f32>": loopMatrix(3, 2),
1109
- "mat4x2<f32>": loopMatrix(4, 2),
1110
- "mat2x3<f32>": loopMatrix(2, 3),
1111
- "mat4x3<f32>": loopMatrix(4, 3),
1112
- "mat2x4<f32>": loopMatrix(2, 4),
1113
- "mat3x4<f32>": loopMatrix(3, 4)
1114
- };
1115
- const uboSyncFunctionsWGSL = {
1116
- ...uboSyncFunctionsSTD40,
1117
- "mat2x2<f32>": `
1118
- data[offset] = v[0];
1119
- data[offset + 1] = v[1];
1120
- data[offset + 2] = v[2];
1121
- data[offset + 3] = v[3];
1122
- `
1123
- };
1124
-
1125
-
1126
- //# sourceMappingURL=uboSyncFunctions.mjs.map
1127
-
1128
-
1129
- /***/ }),
1130
-
1131
- /***/ 8166:
1132
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1133
-
1134
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1135
- /* harmony export */ uniformParsers: () => (/* binding */ uniformParsers)
1136
- /* harmony export */ });
1137
-
1138
- const uniformParsers = [
1139
- // uploading pixi matrix object to mat3
1140
- {
1141
- type: "mat3x3<f32>",
1142
- test: (data) => {
1143
- const value = data.value;
1144
- return value.a !== void 0;
1145
- },
1146
- ubo: `
1147
- var matrix = uv[name].toArray(true);
1148
- data[offset] = matrix[0];
1149
- data[offset + 1] = matrix[1];
1150
- data[offset + 2] = matrix[2];
1151
- data[offset + 4] = matrix[3];
1152
- data[offset + 5] = matrix[4];
1153
- data[offset + 6] = matrix[5];
1154
- data[offset + 8] = matrix[6];
1155
- data[offset + 9] = matrix[7];
1156
- data[offset + 10] = matrix[8];
1157
- `,
1158
- uniform: `
1159
- gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
1160
- `
1161
- },
1162
- // uploading a pixi rectangle as a vec4
1163
- {
1164
- type: "vec4<f32>",
1165
- test: (data) => data.type === "vec4<f32>" && data.size === 1 && data.value.width !== void 0,
1166
- ubo: `
1167
- v = uv[name];
1168
- data[offset] = v.x;
1169
- data[offset + 1] = v.y;
1170
- data[offset + 2] = v.width;
1171
- data[offset + 3] = v.height;
1172
- `,
1173
- uniform: `
1174
- cv = ud[name].value;
1175
- v = uv[name];
1176
- if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {
1177
- cv[0] = v.x;
1178
- cv[1] = v.y;
1179
- cv[2] = v.width;
1180
- cv[3] = v.height;
1181
- gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);
1182
- }
1183
- `
1184
- },
1185
- // uploading a pixi point as a vec2
1186
- {
1187
- type: "vec2<f32>",
1188
- test: (data) => data.type === "vec2<f32>" && data.size === 1 && data.value.x !== void 0,
1189
- ubo: `
1190
- v = uv[name];
1191
- data[offset] = v.x;
1192
- data[offset + 1] = v.y;
1193
- `,
1194
- uniform: `
1195
- cv = ud[name].value;
1196
- v = uv[name];
1197
- if (cv[0] !== v.x || cv[1] !== v.y) {
1198
- cv[0] = v.x;
1199
- cv[1] = v.y;
1200
- gl.uniform2f(ud[name].location, v.x, v.y);
1201
- }
1202
- `
1203
- },
1204
- // uploading a pixi color as a vec4
1205
- {
1206
- type: "vec4<f32>",
1207
- test: (data) => data.type === "vec4<f32>" && data.size === 1 && data.value.red !== void 0,
1208
- ubo: `
1209
- v = uv[name];
1210
- data[offset] = v.red;
1211
- data[offset + 1] = v.green;
1212
- data[offset + 2] = v.blue;
1213
- data[offset + 3] = v.alpha;
1214
- `,
1215
- uniform: `
1216
- cv = ud[name].value;
1217
- v = uv[name];
1218
- if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {
1219
- cv[0] = v.red;
1220
- cv[1] = v.green;
1221
- cv[2] = v.blue;
1222
- cv[3] = v.alpha;
1223
- gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);
1224
- }
1225
- `
1226
- },
1227
- // uploading a pixi color as a vec3
1228
- {
1229
- type: "vec3<f32>",
1230
- test: (data) => data.type === "vec3<f32>" && data.size === 1 && data.value.red !== void 0,
1231
- ubo: `
1232
- v = uv[name];
1233
- data[offset] = v.red;
1234
- data[offset + 1] = v.green;
1235
- data[offset + 2] = v.blue;
1236
- `,
1237
- uniform: `
1238
- cv = ud[name].value;
1239
- v = uv[name];
1240
- if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {
1241
- cv[0] = v.red;
1242
- cv[1] = v.green;
1243
- cv[2] = v.blue;
1244
- gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
1245
- }
1246
- `
1247
- }
1248
- ];
1249
-
1250
-
1251
- //# sourceMappingURL=uniformParsers.mjs.map
1252
-
1253
-
1254
- /***/ }),
1255
-
1256
- /***/ 7547:
1257
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1258
-
1259
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1260
- /* harmony export */ State: () => (/* binding */ State)
1261
- /* harmony export */ });
1262
-
1263
- const blendModeIds = {
1264
- normal: 0,
1265
- add: 1,
1266
- multiply: 2,
1267
- screen: 3,
1268
- overlay: 4,
1269
- erase: 5,
1270
- "normal-npm": 6,
1271
- "add-npm": 7,
1272
- "screen-npm": 8,
1273
- min: 9,
1274
- max: 10
1275
- };
1276
- const BLEND = 0;
1277
- const OFFSET = 1;
1278
- const CULLING = 2;
1279
- const DEPTH_TEST = 3;
1280
- const WINDING = 4;
1281
- const DEPTH_MASK = 5;
1282
- const _State = class _State {
1283
- constructor() {
1284
- this.data = 0;
1285
- this.blendMode = "normal";
1286
- this.polygonOffset = 0;
1287
- this.blend = true;
1288
- this.depthMask = true;
1289
- }
1290
- /**
1291
- * Activates blending of the computed fragment color values.
1292
- * @default true
1293
- */
1294
- get blend() {
1295
- return !!(this.data & 1 << BLEND);
1296
- }
1297
- set blend(value) {
1298
- if (!!(this.data & 1 << BLEND) !== value) {
1299
- this.data ^= 1 << BLEND;
1300
- }
1301
- }
1302
- /**
1303
- * Activates adding an offset to depth values of polygon's fragments
1304
- * @default false
1305
- */
1306
- get offsets() {
1307
- return !!(this.data & 1 << OFFSET);
1308
- }
1309
- set offsets(value) {
1310
- if (!!(this.data & 1 << OFFSET) !== value) {
1311
- this.data ^= 1 << OFFSET;
1312
- }
1313
- }
1314
- /** The culling settings for this state none - No culling back - Back face culling front - Front face culling */
1315
- set cullMode(value) {
1316
- if (value === "none") {
1317
- this.culling = false;
1318
- return;
1319
- }
1320
- this.culling = true;
1321
- this.clockwiseFrontFace = value === "front";
1322
- }
1323
- get cullMode() {
1324
- if (!this.culling) {
1325
- return "none";
1326
- }
1327
- return this.clockwiseFrontFace ? "front" : "back";
1328
- }
1329
- /**
1330
- * Activates culling of polygons.
1331
- * @default false
1332
- */
1333
- get culling() {
1334
- return !!(this.data & 1 << CULLING);
1335
- }
1336
- set culling(value) {
1337
- if (!!(this.data & 1 << CULLING) !== value) {
1338
- this.data ^= 1 << CULLING;
1339
- }
1340
- }
1341
- /**
1342
- * Activates depth comparisons and updates to the depth buffer.
1343
- * @default false
1344
- */
1345
- get depthTest() {
1346
- return !!(this.data & 1 << DEPTH_TEST);
1347
- }
1348
- set depthTest(value) {
1349
- if (!!(this.data & 1 << DEPTH_TEST) !== value) {
1350
- this.data ^= 1 << DEPTH_TEST;
1351
- }
1352
- }
1353
- /**
1354
- * Enables or disables writing to the depth buffer.
1355
- * @default true
1356
- */
1357
- get depthMask() {
1358
- return !!(this.data & 1 << DEPTH_MASK);
1359
- }
1360
- set depthMask(value) {
1361
- if (!!(this.data & 1 << DEPTH_MASK) !== value) {
1362
- this.data ^= 1 << DEPTH_MASK;
1363
- }
1364
- }
1365
- /**
1366
- * Specifies whether or not front or back-facing polygons can be culled.
1367
- * @default false
1368
- */
1369
- get clockwiseFrontFace() {
1370
- return !!(this.data & 1 << WINDING);
1371
- }
1372
- set clockwiseFrontFace(value) {
1373
- if (!!(this.data & 1 << WINDING) !== value) {
1374
- this.data ^= 1 << WINDING;
1375
- }
1376
- }
1377
- /**
1378
- * The blend mode to be applied when this state is set. Apply a value of `normal` to reset the blend mode.
1379
- * Setting this mode to anything other than NO_BLEND will automatically switch blending on.
1380
- * @default 'normal'
1381
- */
1382
- get blendMode() {
1383
- return this._blendMode;
1384
- }
1385
- set blendMode(value) {
1386
- this.blend = value !== "none";
1387
- this._blendMode = value;
1388
- this._blendModeId = blendModeIds[value] || 0;
1389
- }
1390
- /**
1391
- * The polygon offset. Setting this property to anything other than 0 will automatically enable polygon offset fill.
1392
- * @default 0
1393
- */
1394
- get polygonOffset() {
1395
- return this._polygonOffset;
1396
- }
1397
- set polygonOffset(value) {
1398
- this.offsets = !!value;
1399
- this._polygonOffset = value;
1400
- }
1401
- toString() {
1402
- return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`;
1403
- }
1404
- /**
1405
- * A quickly getting an instance of a State that is configured for 2d rendering.
1406
- * @returns a new State with values set for 2d rendering
1407
- */
1408
- static for2d() {
1409
- const state = new _State();
1410
- state.depthTest = false;
1411
- state.blend = true;
1412
- return state;
1413
- }
1414
- };
1415
- _State.default2d = _State.for2d();
1416
- let State = _State;
1417
-
1418
-
1419
- //# sourceMappingURL=State.mjs.map
1420
-
1421
-
1422
- /***/ }),
1423
-
1424
- /***/ 3996:
1425
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1426
-
1427
-
1428
- // EXPORTS
1429
- __webpack_require__.d(__webpack_exports__, {
1430
- SharedRenderPipes: () => (/* binding */ SharedRenderPipes),
1431
- SharedSystems: () => (/* binding */ SharedSystems)
1432
- });
1433
-
1434
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/extensions/Extensions.mjs
1435
- var Extensions = __webpack_require__(8507);
1436
- ;// ./node_modules/pixi.js/lib/scene/container/CustomRenderPipe.mjs
1437
-
1438
-
1439
- "use strict";
1440
- class CustomRenderPipe {
1441
- constructor(renderer) {
1442
- this._renderer = renderer;
1443
- }
1444
- updateRenderable() {
1445
- }
1446
- destroyRenderable() {
1447
- }
1448
- validateRenderable() {
1449
- return false;
1450
- }
1451
- addRenderable(container, instructionSet) {
1452
- this._renderer.renderPipes.batch.break(instructionSet);
1453
- instructionSet.add(container);
1454
- }
1455
- execute(container) {
1456
- if (!container.isRenderable)
1457
- return;
1458
- container.render(this._renderer);
1459
- }
1460
- destroy() {
1461
- this._renderer = null;
1462
- }
1463
- }
1464
- CustomRenderPipe.extension = {
1465
- type: [
1466
- Extensions.ExtensionType.WebGLPipes,
1467
- Extensions.ExtensionType.WebGPUPipes,
1468
- Extensions.ExtensionType.CanvasPipes
1469
- ],
1470
- name: "customRender"
1471
- };
1472
-
1473
-
1474
- //# sourceMappingURL=CustomRenderPipe.mjs.map
1475
-
1476
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/maths/matrix/Matrix.mjs
1477
- var Matrix = __webpack_require__(9313);
1478
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/utils/pool/PoolGroup.mjs
1479
- var PoolGroup = __webpack_require__(8218);
1480
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/sprite/BatchableSprite.mjs
1481
- var BatchableSprite = __webpack_require__(8422);
1482
- ;// ./node_modules/pixi.js/lib/scene/container/utils/executeInstructions.mjs
1483
-
1484
- function executeInstructions(renderGroup, renderer) {
1485
- const instructionSet = renderGroup.instructionSet;
1486
- const instructions = instructionSet.instructions;
1487
- for (let i = 0; i < instructionSet.instructionSize; i++) {
1488
- const instruction = instructions[i];
1489
- renderer[instruction.renderPipeId].execute(instruction);
1490
- }
1491
- }
1492
-
1493
-
1494
- //# sourceMappingURL=executeInstructions.mjs.map
1495
-
1496
- ;// ./node_modules/pixi.js/lib/scene/container/RenderGroupPipe.mjs
1497
-
1498
-
1499
-
1500
-
1501
-
1502
-
1503
- "use strict";
1504
- const tempMatrix = new Matrix.Matrix();
1505
- class RenderGroupPipe {
1506
- constructor(renderer) {
1507
- this._renderer = renderer;
1508
- }
1509
- addRenderGroup(renderGroup, instructionSet) {
1510
- if (renderGroup.isCachedAsTexture) {
1511
- this._addRenderableCacheAsTexture(renderGroup, instructionSet);
1512
- } else {
1513
- this._addRenderableDirect(renderGroup, instructionSet);
1514
- }
1515
- }
1516
- execute(renderGroup) {
1517
- if (!renderGroup.isRenderable)
1518
- return;
1519
- if (renderGroup.isCachedAsTexture) {
1520
- this._executeCacheAsTexture(renderGroup);
1521
- } else {
1522
- this._executeDirect(renderGroup);
1523
- }
1524
- }
1525
- destroy() {
1526
- this._renderer = null;
1527
- }
1528
- _addRenderableDirect(renderGroup, instructionSet) {
1529
- this._renderer.renderPipes.batch.break(instructionSet);
1530
- if (renderGroup._batchableRenderGroup) {
1531
- PoolGroup.BigPool.return(renderGroup._batchableRenderGroup);
1532
- renderGroup._batchableRenderGroup = null;
1533
- }
1534
- instructionSet.add(renderGroup);
1535
- }
1536
- _addRenderableCacheAsTexture(renderGroup, instructionSet) {
1537
- const batchableRenderGroup = renderGroup._batchableRenderGroup ?? (renderGroup._batchableRenderGroup = PoolGroup.BigPool.get(BatchableSprite.BatchableSprite));
1538
- batchableRenderGroup.renderable = renderGroup.root;
1539
- batchableRenderGroup.transform = renderGroup.root.relativeGroupTransform;
1540
- batchableRenderGroup.texture = renderGroup.texture;
1541
- batchableRenderGroup.bounds = renderGroup._textureBounds;
1542
- instructionSet.add(renderGroup);
1543
- this._renderer.renderPipes.batch.addToBatch(batchableRenderGroup, instructionSet);
1544
- }
1545
- _executeCacheAsTexture(renderGroup) {
1546
- if (renderGroup.textureNeedsUpdate) {
1547
- renderGroup.textureNeedsUpdate = false;
1548
- const worldTransformMatrix = tempMatrix.identity().translate(
1549
- -renderGroup._textureBounds.x,
1550
- -renderGroup._textureBounds.y
1551
- );
1552
- this._renderer.renderTarget.push(renderGroup.texture, true, null, renderGroup.texture.frame);
1553
- this._renderer.globalUniforms.push({
1554
- worldTransformMatrix,
1555
- worldColor: 4294967295
1556
- });
1557
- executeInstructions(renderGroup, this._renderer.renderPipes);
1558
- this._renderer.renderTarget.finishRenderPass();
1559
- this._renderer.renderTarget.pop();
1560
- this._renderer.globalUniforms.pop();
1561
- }
1562
- renderGroup._batchableRenderGroup._batcher.updateElement(renderGroup._batchableRenderGroup);
1563
- renderGroup._batchableRenderGroup._batcher.geometry.buffers[0].update();
1564
- }
1565
- _executeDirect(renderGroup) {
1566
- this._renderer.globalUniforms.push({
1567
- worldTransformMatrix: renderGroup.inverseParentTextureTransform,
1568
- worldColor: renderGroup.worldColorAlpha
1569
- });
1570
- executeInstructions(renderGroup, this._renderer.renderPipes);
1571
- this._renderer.globalUniforms.pop();
1572
- }
1573
- }
1574
- RenderGroupPipe.extension = {
1575
- type: [
1576
- Extensions.ExtensionType.WebGLPipes,
1577
- Extensions.ExtensionType.WebGPUPipes,
1578
- Extensions.ExtensionType.CanvasPipes
1579
- ],
1580
- name: "renderGroup"
1581
- };
1582
-
1583
-
1584
- //# sourceMappingURL=RenderGroupPipe.mjs.map
1585
-
1586
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/TexturePool.mjs
1587
- var TexturePool = __webpack_require__(2437);
1588
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/container/bounds/Bounds.mjs
1589
- var Bounds = __webpack_require__(9636);
1590
- ;// ./node_modules/pixi.js/lib/scene/container/utils/buildInstructions.mjs
1591
-
1592
- function buildInstructions(renderGroup, rendererOrPipes) {
1593
- const root = renderGroup.root;
1594
- const instructionSet = renderGroup.instructionSet;
1595
- instructionSet.reset();
1596
- const renderer = rendererOrPipes.renderPipes ? rendererOrPipes : rendererOrPipes.batch.renderer;
1597
- const renderPipes = renderer.renderPipes;
1598
- renderPipes.batch.buildStart(instructionSet);
1599
- renderPipes.blendMode.buildStart();
1600
- renderPipes.colorMask.buildStart();
1601
- if (root.sortableChildren) {
1602
- root.sortChildren();
1603
- }
1604
- collectAllRenderablesAdvanced(root, instructionSet, renderer, true);
1605
- renderPipes.batch.buildEnd(instructionSet);
1606
- renderPipes.blendMode.buildEnd(instructionSet);
1607
- }
1608
- function collectAllRenderables(container, instructionSet, rendererOrPipes) {
1609
- const renderer = rendererOrPipes.renderPipes ? rendererOrPipes : rendererOrPipes.batch.renderer;
1610
- if (container.globalDisplayStatus < 7 || !container.includeInBuild)
1611
- return;
1612
- if (container.sortableChildren) {
1613
- container.sortChildren();
1614
- }
1615
- if (container.isSimple) {
1616
- collectAllRenderablesSimple(container, instructionSet, renderer);
1617
- } else {
1618
- collectAllRenderablesAdvanced(container, instructionSet, renderer, false);
1619
- }
1620
- }
1621
- function collectAllRenderablesSimple(container, instructionSet, renderer) {
1622
- if (container.renderPipeId) {
1623
- const renderable = container;
1624
- const { renderPipes, renderableGC } = renderer;
1625
- renderPipes.blendMode.setBlendMode(renderable, container.groupBlendMode, instructionSet);
1626
- const rp = renderPipes;
1627
- rp[renderable.renderPipeId].addRenderable(renderable, instructionSet);
1628
- renderableGC.addRenderable(renderable);
1629
- renderable.didViewUpdate = false;
1630
- }
1631
- if (!container.renderGroup) {
1632
- const children = container.children;
1633
- const length = children.length;
1634
- for (let i = 0; i < length; i++) {
1635
- collectAllRenderables(children[i], instructionSet, renderer);
1636
- }
1637
- }
1638
- }
1639
- function collectAllRenderablesAdvanced(container, instructionSet, renderer, isRoot) {
1640
- const { renderPipes, renderableGC } = renderer;
1641
- if (!isRoot && container.renderGroup) {
1642
- renderPipes.renderGroup.addRenderGroup(container.renderGroup, instructionSet);
1643
- } else {
1644
- for (let i = 0; i < container.effects.length; i++) {
1645
- const effect = container.effects[i];
1646
- const pipe = renderPipes[effect.pipe];
1647
- pipe.push(effect, container, instructionSet);
1648
- }
1649
- const renderable = container;
1650
- const renderPipeId = renderable.renderPipeId;
1651
- if (renderPipeId) {
1652
- renderPipes.blendMode.setBlendMode(renderable, renderable.groupBlendMode, instructionSet);
1653
- const pipe = renderPipes[renderPipeId];
1654
- pipe.addRenderable(renderable, instructionSet);
1655
- renderableGC.addRenderable(renderable);
1656
- renderable.didViewUpdate = false;
1657
- }
1658
- const children = container.children;
1659
- if (children.length) {
1660
- for (let i = 0; i < children.length; i++) {
1661
- collectAllRenderables(children[i], instructionSet, renderer);
1662
- }
1663
- }
1664
- for (let i = container.effects.length - 1; i >= 0; i--) {
1665
- const effect = container.effects[i];
1666
- const pipe = renderPipes[effect.pipe];
1667
- pipe.pop(effect, container, instructionSet);
1668
- }
1669
- }
1670
- }
1671
-
1672
-
1673
- //# sourceMappingURL=buildInstructions.mjs.map
1674
-
1675
- ;// ./node_modules/pixi.js/lib/scene/container/utils/clearList.mjs
1676
-
1677
- function clearList(list, index) {
1678
- index || (index = 0);
1679
- for (let j = index; j < list.length; j++) {
1680
- if (list[j]) {
1681
- list[j] = null;
1682
- } else {
1683
- break;
1684
- }
1685
- }
1686
- }
1687
-
1688
-
1689
- //# sourceMappingURL=clearList.mjs.map
1690
-
1691
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/container/Container.mjs + 14 modules
1692
- var Container = __webpack_require__(5819);
1693
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/container/utils/multiplyColors.mjs
1694
- var multiplyColors = __webpack_require__(753);
1695
- ;// ./node_modules/pixi.js/lib/scene/container/utils/updateRenderGroupTransforms.mjs
1696
-
1697
-
1698
-
1699
-
1700
- "use strict";
1701
- const tempContainer = new Container.Container();
1702
- const UPDATE_BLEND_COLOR_VISIBLE = Container.UPDATE_VISIBLE | Container.UPDATE_COLOR | Container.UPDATE_BLEND;
1703
- function updateRenderGroupTransforms(renderGroup, updateChildRenderGroups = false) {
1704
- updateRenderGroupTransform(renderGroup);
1705
- const childrenToUpdate = renderGroup.childrenToUpdate;
1706
- const updateTick = renderGroup.updateTick++;
1707
- for (const j in childrenToUpdate) {
1708
- const renderGroupDepth = Number(j);
1709
- const childrenAtDepth = childrenToUpdate[j];
1710
- const list = childrenAtDepth.list;
1711
- const index = childrenAtDepth.index;
1712
- for (let i = 0; i < index; i++) {
1713
- const child = list[i];
1714
- if (child.parentRenderGroup === renderGroup && child.relativeRenderGroupDepth === renderGroupDepth) {
1715
- updateTransformAndChildren(child, updateTick, 0);
1716
- }
1717
- }
1718
- clearList(list, index);
1719
- childrenAtDepth.index = 0;
1720
- }
1721
- if (updateChildRenderGroups) {
1722
- for (let i = 0; i < renderGroup.renderGroupChildren.length; i++) {
1723
- updateRenderGroupTransforms(renderGroup.renderGroupChildren[i], updateChildRenderGroups);
1724
- }
1725
- }
1726
- }
1727
- function updateRenderGroupTransform(renderGroup) {
1728
- const root = renderGroup.root;
1729
- let worldAlpha;
1730
- if (renderGroup.renderGroupParent) {
1731
- const renderGroupParent = renderGroup.renderGroupParent;
1732
- renderGroup.worldTransform.appendFrom(
1733
- root.relativeGroupTransform,
1734
- renderGroupParent.worldTransform
1735
- );
1736
- renderGroup.worldColor = (0,multiplyColors.multiplyColors)(
1737
- root.groupColor,
1738
- renderGroupParent.worldColor
1739
- );
1740
- worldAlpha = root.groupAlpha * renderGroupParent.worldAlpha;
1741
- } else {
1742
- renderGroup.worldTransform.copyFrom(root.localTransform);
1743
- renderGroup.worldColor = root.localColor;
1744
- worldAlpha = root.localAlpha;
1745
- }
1746
- worldAlpha = worldAlpha < 0 ? 0 : worldAlpha > 1 ? 1 : worldAlpha;
1747
- renderGroup.worldAlpha = worldAlpha;
1748
- renderGroup.worldColorAlpha = renderGroup.worldColor + ((worldAlpha * 255 | 0) << 24);
1749
- }
1750
- function updateTransformAndChildren(container, updateTick, updateFlags) {
1751
- if (updateTick === container.updateTick)
1752
- return;
1753
- container.updateTick = updateTick;
1754
- container.didChange = false;
1755
- const localTransform = container.localTransform;
1756
- container.updateLocalTransform();
1757
- const parent = container.parent;
1758
- if (parent && !parent.renderGroup) {
1759
- updateFlags |= container._updateFlags;
1760
- container.relativeGroupTransform.appendFrom(
1761
- localTransform,
1762
- parent.relativeGroupTransform
1763
- );
1764
- if (updateFlags & UPDATE_BLEND_COLOR_VISIBLE) {
1765
- updateColorBlendVisibility(container, parent, updateFlags);
1766
- }
1767
- } else {
1768
- updateFlags = container._updateFlags;
1769
- container.relativeGroupTransform.copyFrom(localTransform);
1770
- if (updateFlags & UPDATE_BLEND_COLOR_VISIBLE) {
1771
- updateColorBlendVisibility(container, tempContainer, updateFlags);
1772
- }
1773
- }
1774
- if (!container.renderGroup) {
1775
- const children = container.children;
1776
- const length = children.length;
1777
- for (let i = 0; i < length; i++) {
1778
- updateTransformAndChildren(children[i], updateTick, updateFlags);
1779
- }
1780
- const renderGroup = container.parentRenderGroup;
1781
- const renderable = container;
1782
- if (renderable.renderPipeId && !renderGroup.structureDidChange) {
1783
- renderGroup.updateRenderable(renderable);
1784
- }
1785
- }
1786
- }
1787
- function updateColorBlendVisibility(container, parent, updateFlags) {
1788
- if (updateFlags & Container.UPDATE_COLOR) {
1789
- container.groupColor = (0,multiplyColors.multiplyColors)(
1790
- container.localColor,
1791
- parent.groupColor
1792
- );
1793
- let groupAlpha = container.localAlpha * parent.groupAlpha;
1794
- groupAlpha = groupAlpha < 0 ? 0 : groupAlpha > 1 ? 1 : groupAlpha;
1795
- container.groupAlpha = groupAlpha;
1796
- container.groupColorAlpha = container.groupColor + ((groupAlpha * 255 | 0) << 24);
1797
- }
1798
- if (updateFlags & Container.UPDATE_BLEND) {
1799
- container.groupBlendMode = container.localBlendMode === "inherit" ? parent.groupBlendMode : container.localBlendMode;
1800
- }
1801
- if (updateFlags & Container.UPDATE_VISIBLE) {
1802
- container.globalDisplayStatus = container.localDisplayStatus & parent.globalDisplayStatus;
1803
- }
1804
- container._updateFlags = 0;
1805
- }
1806
-
1807
-
1808
- //# sourceMappingURL=updateRenderGroupTransforms.mjs.map
1809
-
1810
- ;// ./node_modules/pixi.js/lib/scene/container/utils/validateRenderables.mjs
1811
-
1812
- function validateRenderables(renderGroup, renderPipes) {
1813
- const { list, index } = renderGroup.childrenRenderablesToUpdate;
1814
- let rebuildRequired = false;
1815
- for (let i = 0; i < index; i++) {
1816
- const container = list[i];
1817
- const renderable = container;
1818
- const pipe = renderPipes[renderable.renderPipeId];
1819
- rebuildRequired = pipe.validateRenderable(container);
1820
- if (rebuildRequired) {
1821
- break;
1822
- }
1823
- }
1824
- renderGroup.structureDidChange = rebuildRequired;
1825
- return rebuildRequired;
1826
- }
1827
-
1828
-
1829
- //# sourceMappingURL=validateRenderables.mjs.map
1830
-
1831
- ;// ./node_modules/pixi.js/lib/scene/container/RenderGroupSystem.mjs
1832
-
1833
-
1834
-
1835
-
1836
-
1837
-
1838
-
1839
-
1840
-
1841
-
1842
- "use strict";
1843
- const RenderGroupSystem_tempMatrix = new Matrix.Matrix();
1844
- class RenderGroupSystem {
1845
- constructor(renderer) {
1846
- this._renderer = renderer;
1847
- }
1848
- render({ container, transform }) {
1849
- const parent = container.parent;
1850
- const renderGroupParent = container.renderGroup.renderGroupParent;
1851
- container.parent = null;
1852
- container.renderGroup.renderGroupParent = null;
1853
- const renderer = this._renderer;
1854
- let originalLocalTransform = RenderGroupSystem_tempMatrix;
1855
- if (transform) {
1856
- originalLocalTransform = originalLocalTransform.copyFrom(container.renderGroup.localTransform);
1857
- container.renderGroup.localTransform.copyFrom(transform);
1858
- }
1859
- const renderPipes = renderer.renderPipes;
1860
- this._updateCachedRenderGroups(container.renderGroup, null);
1861
- this._updateRenderGroups(container.renderGroup);
1862
- renderer.globalUniforms.start({
1863
- worldTransformMatrix: transform ? container.renderGroup.localTransform : container.renderGroup.worldTransform,
1864
- worldColor: container.renderGroup.worldColorAlpha
1865
- });
1866
- executeInstructions(container.renderGroup, renderPipes);
1867
- if (renderPipes.uniformBatch) {
1868
- renderPipes.uniformBatch.renderEnd();
1869
- }
1870
- if (transform) {
1871
- container.renderGroup.localTransform.copyFrom(originalLocalTransform);
1872
- }
1873
- container.parent = parent;
1874
- container.renderGroup.renderGroupParent = renderGroupParent;
1875
- }
1876
- destroy() {
1877
- this._renderer = null;
1878
- }
1879
- _updateCachedRenderGroups(renderGroup, closestCacheAsTexture) {
1880
- if (renderGroup.isCachedAsTexture) {
1881
- if (!renderGroup.updateCacheTexture)
1882
- return;
1883
- closestCacheAsTexture = renderGroup;
1884
- }
1885
- renderGroup._parentCacheAsTextureRenderGroup = closestCacheAsTexture;
1886
- for (let i = renderGroup.renderGroupChildren.length - 1; i >= 0; i--) {
1887
- this._updateCachedRenderGroups(renderGroup.renderGroupChildren[i], closestCacheAsTexture);
1888
- }
1889
- renderGroup.invalidateMatrices();
1890
- if (renderGroup.isCachedAsTexture) {
1891
- if (renderGroup.textureNeedsUpdate) {
1892
- const bounds = renderGroup.root.getLocalBounds();
1893
- bounds.ceil();
1894
- const lastTexture = renderGroup.texture;
1895
- if (renderGroup.texture) {
1896
- TexturePool.TexturePool.returnTexture(renderGroup.texture);
1897
- }
1898
- const renderer = this._renderer;
1899
- const resolution = renderGroup.textureOptions.resolution || renderer.view.resolution;
1900
- const antialias = renderGroup.textureOptions.antialias ?? renderer.view.antialias;
1901
- renderGroup.texture = TexturePool.TexturePool.getOptimalTexture(
1902
- bounds.width,
1903
- bounds.height,
1904
- resolution,
1905
- antialias
1906
- );
1907
- renderGroup._textureBounds || (renderGroup._textureBounds = new Bounds.Bounds());
1908
- renderGroup._textureBounds.copyFrom(bounds);
1909
- if (lastTexture !== renderGroup.texture) {
1910
- if (renderGroup.renderGroupParent) {
1911
- renderGroup.renderGroupParent.structureDidChange = true;
1912
- }
1913
- }
1914
- }
1915
- } else if (renderGroup.texture) {
1916
- TexturePool.TexturePool.returnTexture(renderGroup.texture);
1917
- renderGroup.texture = null;
1918
- }
1919
- }
1920
- _updateRenderGroups(renderGroup) {
1921
- const renderer = this._renderer;
1922
- const renderPipes = renderer.renderPipes;
1923
- renderGroup.runOnRender();
1924
- renderGroup.instructionSet.renderPipes = renderPipes;
1925
- if (!renderGroup.structureDidChange) {
1926
- validateRenderables(renderGroup, renderPipes);
1927
- } else {
1928
- clearList(renderGroup.childrenRenderablesToUpdate.list, 0);
1929
- }
1930
- updateRenderGroupTransforms(renderGroup);
1931
- if (renderGroup.structureDidChange) {
1932
- renderGroup.structureDidChange = false;
1933
- buildInstructions(renderGroup, renderer);
1934
- } else {
1935
- this._updateRenderables(renderGroup);
1936
- }
1937
- renderGroup.childrenRenderablesToUpdate.index = 0;
1938
- renderer.renderPipes.batch.upload(renderGroup.instructionSet);
1939
- if (renderGroup.isCachedAsTexture && !renderGroup.textureNeedsUpdate)
1940
- return;
1941
- for (let i = 0; i < renderGroup.renderGroupChildren.length; i++) {
1942
- this._updateRenderGroups(renderGroup.renderGroupChildren[i]);
1943
- }
1944
- }
1945
- _updateRenderables(renderGroup) {
1946
- const { list, index } = renderGroup.childrenRenderablesToUpdate;
1947
- for (let i = 0; i < index; i++) {
1948
- const container = list[i];
1949
- if (container.didViewUpdate) {
1950
- renderGroup.updateRenderable(container);
1951
- }
1952
- }
1953
- clearList(list, index);
1954
- }
1955
- }
1956
- /** @ignore */
1957
- RenderGroupSystem.extension = {
1958
- type: [
1959
- Extensions.ExtensionType.WebGLSystem,
1960
- Extensions.ExtensionType.WebGPUSystem,
1961
- Extensions.ExtensionType.CanvasSystem
1962
- ],
1963
- name: "renderGroup"
1964
- };
1965
-
1966
-
1967
- //# sourceMappingURL=RenderGroupSystem.mjs.map
1968
-
1969
- ;// ./node_modules/pixi.js/lib/scene/sprite/SpritePipe.mjs
1970
-
1971
-
1972
-
1973
-
1974
- "use strict";
1975
- class SpritePipe {
1976
- constructor(renderer) {
1977
- this._gpuSpriteHash = /* @__PURE__ */ Object.create(null);
1978
- this._destroyRenderableBound = this.destroyRenderable.bind(this);
1979
- this._renderer = renderer;
1980
- this._renderer.renderableGC.addManagedHash(this, "_gpuSpriteHash");
1981
- }
1982
- addRenderable(sprite, instructionSet) {
1983
- const gpuSprite = this._getGpuSprite(sprite);
1984
- if (sprite.didViewUpdate)
1985
- this._updateBatchableSprite(sprite, gpuSprite);
1986
- this._renderer.renderPipes.batch.addToBatch(gpuSprite, instructionSet);
1987
- }
1988
- updateRenderable(sprite) {
1989
- const gpuSprite = this._gpuSpriteHash[sprite.uid];
1990
- if (sprite.didViewUpdate)
1991
- this._updateBatchableSprite(sprite, gpuSprite);
1992
- gpuSprite._batcher.updateElement(gpuSprite);
1993
- }
1994
- validateRenderable(sprite) {
1995
- const gpuSprite = this._getGpuSprite(sprite);
1996
- return !gpuSprite._batcher.checkAndUpdateTexture(
1997
- gpuSprite,
1998
- sprite._texture
1999
- );
2000
- }
2001
- destroyRenderable(sprite) {
2002
- const batchableSprite = this._gpuSpriteHash[sprite.uid];
2003
- PoolGroup.BigPool.return(batchableSprite);
2004
- this._gpuSpriteHash[sprite.uid] = null;
2005
- sprite.off("destroyed", this._destroyRenderableBound);
2006
- }
2007
- _updateBatchableSprite(sprite, batchableSprite) {
2008
- batchableSprite.bounds = sprite.visualBounds;
2009
- batchableSprite.texture = sprite._texture;
2010
- }
2011
- _getGpuSprite(sprite) {
2012
- return this._gpuSpriteHash[sprite.uid] || this._initGPUSprite(sprite);
2013
- }
2014
- _initGPUSprite(sprite) {
2015
- const batchableSprite = PoolGroup.BigPool.get(BatchableSprite.BatchableSprite);
2016
- batchableSprite.renderable = sprite;
2017
- batchableSprite.transform = sprite.groupTransform;
2018
- batchableSprite.texture = sprite._texture;
2019
- batchableSprite.bounds = sprite.visualBounds;
2020
- batchableSprite.roundPixels = this._renderer._roundPixels | sprite._roundPixels;
2021
- this._gpuSpriteHash[sprite.uid] = batchableSprite;
2022
- sprite.on("destroyed", this._destroyRenderableBound);
2023
- return batchableSprite;
2024
- }
2025
- destroy() {
2026
- for (const i in this._gpuSpriteHash) {
2027
- PoolGroup.BigPool.return(this._gpuSpriteHash[i]);
2028
- }
2029
- this._gpuSpriteHash = null;
2030
- this._renderer = null;
2031
- }
2032
- }
2033
- /** @ignore */
2034
- SpritePipe.extension = {
2035
- type: [
2036
- Extensions.ExtensionType.WebGLPipes,
2037
- Extensions.ExtensionType.WebGPUPipes,
2038
- Extensions.ExtensionType.CanvasPipes
2039
- ],
2040
- name: "sprite"
2041
- };
2042
-
2043
-
2044
- //# sourceMappingURL=SpritePipe.mjs.map
2045
-
2046
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/utils/global/globalHooks.mjs
2047
- var globalHooks = __webpack_require__(7073);
2048
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/state/State.mjs
2049
- var State = __webpack_require__(7547);
2050
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/batcher/shared/DefaultBatcher.mjs + 4 modules
2051
- var DefaultBatcher = __webpack_require__(1159);
2052
- ;// ./node_modules/pixi.js/lib/rendering/batcher/shared/BatcherPipe.mjs
2053
-
2054
-
2055
-
2056
-
2057
- "use strict";
2058
- const _BatcherPipe = class _BatcherPipe {
2059
- constructor(renderer, adaptor) {
2060
- this.state = State.State.for2d();
2061
- this._batchersByInstructionSet = /* @__PURE__ */ Object.create(null);
2062
- /** A record of all active batchers, keyed by their names */
2063
- this._activeBatches = /* @__PURE__ */ Object.create(null);
2064
- this.renderer = renderer;
2065
- this._adaptor = adaptor;
2066
- this._adaptor.init?.(this);
2067
- }
2068
- static getBatcher(name) {
2069
- return new this._availableBatchers[name]();
2070
- }
2071
- buildStart(instructionSet) {
2072
- let batchers = this._batchersByInstructionSet[instructionSet.uid];
2073
- if (!batchers) {
2074
- batchers = this._batchersByInstructionSet[instructionSet.uid] = /* @__PURE__ */ Object.create(null);
2075
- batchers.default || (batchers.default = new DefaultBatcher.DefaultBatcher());
2076
- }
2077
- this._activeBatches = batchers;
2078
- this._activeBatch = this._activeBatches.default;
2079
- for (const i in this._activeBatches) {
2080
- this._activeBatches[i].begin();
2081
- }
2082
- }
2083
- addToBatch(batchableObject, instructionSet) {
2084
- if (this._activeBatch.name !== batchableObject.batcherName) {
2085
- this._activeBatch.break(instructionSet);
2086
- let batch = this._activeBatches[batchableObject.batcherName];
2087
- if (!batch) {
2088
- batch = this._activeBatches[batchableObject.batcherName] = _BatcherPipe.getBatcher(batchableObject.batcherName);
2089
- batch.begin();
2090
- }
2091
- this._activeBatch = batch;
2092
- }
2093
- this._activeBatch.add(batchableObject);
2094
- }
2095
- break(instructionSet) {
2096
- this._activeBatch.break(instructionSet);
2097
- }
2098
- buildEnd(instructionSet) {
2099
- this._activeBatch.break(instructionSet);
2100
- const batches = this._activeBatches;
2101
- for (const i in batches) {
2102
- const batch = batches[i];
2103
- const geometry = batch.geometry;
2104
- geometry.indexBuffer.setDataWithSize(batch.indexBuffer, batch.indexSize, true);
2105
- geometry.buffers[0].setDataWithSize(batch.attributeBuffer.float32View, batch.attributeSize, false);
2106
- }
2107
- }
2108
- upload(instructionSet) {
2109
- const batchers = this._batchersByInstructionSet[instructionSet.uid];
2110
- for (const i in batchers) {
2111
- const batcher = batchers[i];
2112
- const geometry = batcher.geometry;
2113
- if (batcher.dirty) {
2114
- batcher.dirty = false;
2115
- geometry.buffers[0].update(batcher.attributeSize * 4);
2116
- }
2117
- }
2118
- }
2119
- execute(batch) {
2120
- if (batch.action === "startBatch") {
2121
- const batcher = batch.batcher;
2122
- const geometry = batcher.geometry;
2123
- const shader = batcher.shader;
2124
- this._adaptor.start(this, geometry, shader);
2125
- }
2126
- this._adaptor.execute(this, batch);
2127
- }
2128
- destroy() {
2129
- this.state = null;
2130
- this.renderer = null;
2131
- this._adaptor = null;
2132
- for (const i in this._activeBatches) {
2133
- this._activeBatches[i].destroy();
2134
- }
2135
- this._activeBatches = null;
2136
- }
2137
- };
2138
- /** @ignore */
2139
- _BatcherPipe.extension = {
2140
- type: [
2141
- Extensions.ExtensionType.WebGLPipes,
2142
- Extensions.ExtensionType.WebGPUPipes,
2143
- Extensions.ExtensionType.CanvasPipes
2144
- ],
2145
- name: "batch"
2146
- };
2147
- _BatcherPipe._availableBatchers = /* @__PURE__ */ Object.create(null);
2148
- let BatcherPipe = _BatcherPipe;
2149
- Extensions.extensions.handleByMap(Extensions.ExtensionType.Batcher, BatcherPipe._availableBatchers);
2150
- Extensions.extensions.add(DefaultBatcher.DefaultBatcher);
2151
-
2152
-
2153
- //# sourceMappingURL=BatcherPipe.mjs.map
2154
-
2155
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/filters/FilterEffect.mjs
2156
- var FilterEffect = __webpack_require__(9049);
2157
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/gl/shader/GlProgram.mjs + 6 modules
2158
- var GlProgram = __webpack_require__(9113);
2159
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/gpu/shader/GpuProgram.mjs + 6 modules
2160
- var GpuProgram = __webpack_require__(3012);
2161
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/shader/UniformGroup.mjs + 2 modules
2162
- var UniformGroup = __webpack_require__(5811);
2163
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/TextureMatrix.mjs
2164
- var TextureMatrix = __webpack_require__(1196);
2165
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/shader/Shader.mjs
2166
- var Shader = __webpack_require__(8475);
2167
- ;// ./node_modules/pixi.js/lib/filters/Filter.mjs
2168
-
2169
-
2170
-
2171
-
2172
-
2173
- "use strict";
2174
- const _Filter = class _Filter extends Shader.Shader {
2175
- /**
2176
- * @param options - The optional parameters of this filter.
2177
- */
2178
- constructor(options) {
2179
- options = { ..._Filter.defaultOptions, ...options };
2180
- super(options);
2181
- /** If enabled is true the filter is applied, if false it will not. */
2182
- this.enabled = true;
2183
- /**
2184
- * The gpu state the filter requires to render.
2185
- * @internal
2186
- * @ignore
2187
- */
2188
- this._state = State.State.for2d();
2189
- this.blendMode = options.blendMode;
2190
- this.padding = options.padding;
2191
- if (typeof options.antialias === "boolean") {
2192
- this.antialias = options.antialias ? "on" : "off";
2193
- } else {
2194
- this.antialias = options.antialias;
2195
- }
2196
- this.resolution = options.resolution;
2197
- this.blendRequired = options.blendRequired;
2198
- this.clipToViewport = options.clipToViewport;
2199
- this.addResource("uTexture", 0, 1);
2200
- }
2201
- /**
2202
- * Applies the filter
2203
- * @param filterManager - The renderer to retrieve the filter from
2204
- * @param input - The input render target.
2205
- * @param output - The target to output to.
2206
- * @param clearMode - Should the output be cleared before rendering to it
2207
- */
2208
- apply(filterManager, input, output, clearMode) {
2209
- filterManager.applyFilter(this, input, output, clearMode);
2210
- }
2211
- /**
2212
- * Get the blend mode of the filter.
2213
- * @default "normal"
2214
- */
2215
- get blendMode() {
2216
- return this._state.blendMode;
2217
- }
2218
- /** Sets the blend mode of the filter. */
2219
- set blendMode(value) {
2220
- this._state.blendMode = value;
2221
- }
2222
- /**
2223
- * A short hand function to create a filter based of a vertex and fragment shader src.
2224
- * @param options
2225
- * @returns A shiny new PixiJS filter!
2226
- */
2227
- static from(options) {
2228
- const { gpu, gl, ...rest } = options;
2229
- let gpuProgram;
2230
- let glProgram;
2231
- if (gpu) {
2232
- gpuProgram = GpuProgram.GpuProgram.from(gpu);
2233
- }
2234
- if (gl) {
2235
- glProgram = GlProgram.GlProgram.from(gl);
2236
- }
2237
- return new _Filter({
2238
- gpuProgram,
2239
- glProgram,
2240
- ...rest
2241
- });
2242
- }
2243
- };
2244
- /**
2245
- * The default filter settings
2246
- * @static
2247
- */
2248
- _Filter.defaultOptions = {
2249
- blendMode: "normal",
2250
- resolution: 1,
2251
- padding: 0,
2252
- antialias: "off",
2253
- blendRequired: false,
2254
- clipToViewport: true
2255
- };
2256
- let Filter = _Filter;
2257
-
2258
-
2259
- //# sourceMappingURL=Filter.mjs.map
2260
-
2261
- ;// ./node_modules/pixi.js/lib/filters/mask/mask.frag.mjs
2262
- var fragment = "in vec2 vMaskCoord;\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform sampler2D uMaskTexture;\n\nuniform float uAlpha;\nuniform vec4 uMaskClamp;\nuniform float uInverse;\n\nout vec4 finalColor;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(uMaskClamp.x, vMaskCoord.x) +\n step(uMaskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, uMaskClamp.z) +\n step(vMaskCoord.y, uMaskClamp.w));\n\n // TODO look into why this is needed\n float npmAlpha = uAlpha;\n vec4 original = texture(uTexture, vTextureCoord);\n vec4 masky = texture(uMaskTexture, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n float a = alphaMul * masky.r * npmAlpha * clip;\n\n if (uInverse == 1.0) {\n a = 1.0 - a;\n }\n\n finalColor = original * a;\n}\n";
2263
-
2264
-
2265
- //# sourceMappingURL=mask.frag.mjs.map
2266
-
2267
- ;// ./node_modules/pixi.js/lib/filters/mask/mask.vert.mjs
2268
- var vertex = "in vec2 aPosition;\n\nout vec2 vTextureCoord;\nout vec2 vMaskCoord;\n\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\nuniform mat3 uFilterMatrix;\n\nvec4 filterVertexPosition( vec2 aPosition )\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( vec2 aPosition )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvec2 getFilterCoord( vec2 aPosition )\n{\n return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n} \n\nvoid main(void)\n{\n gl_Position = filterVertexPosition(aPosition);\n vTextureCoord = filterTextureCoord(aPosition);\n vMaskCoord = getFilterCoord(aPosition);\n}\n";
2269
-
2270
-
2271
- //# sourceMappingURL=mask.vert.mjs.map
2272
-
2273
- ;// ./node_modules/pixi.js/lib/filters/mask/mask.wgsl.mjs
2274
- var source = "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\nstruct MaskUniforms {\n uFilterMatrix:mat3x3<f32>,\n uMaskClamp:vec4<f32>,\n uAlpha:f32,\n uInverse: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\n@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;\n@group(1) @binding(1) var uMaskTexture: texture_2d<f32>;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n @location(1) filterUv : 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\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);\n}\n\nfn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>\n{\n return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.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 getFilterCoord(aPosition)\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @location(1) filterUv: vec2<f32>,\n @builtin(position) position: vec4<f32>\n) -> @location(0) vec4<f32> {\n\n var maskClamp = filterUniforms.uMaskClamp;\n var uAlpha = filterUniforms.uAlpha;\n\n var clip = step(3.5,\n step(maskClamp.x, filterUv.x) +\n step(maskClamp.y, filterUv.y) +\n step(filterUv.x, maskClamp.z) +\n step(filterUv.y, maskClamp.w));\n\n var mask = textureSample(uMaskTexture, uSampler, filterUv);\n var source = textureSample(uTexture, uSampler, uv);\n var alphaMul = 1.0 - uAlpha * (1.0 - mask.a);\n\n var a: f32 = alphaMul * mask.r * uAlpha * clip;\n\n if (filterUniforms.uInverse == 1.0) {\n a = 1.0 - a;\n }\n\n return source * a;\n}\n";
2275
-
2276
-
2277
- //# sourceMappingURL=mask.wgsl.mjs.map
2278
-
2279
- ;// ./node_modules/pixi.js/lib/filters/mask/MaskFilter.mjs
2280
-
2281
-
2282
-
2283
-
2284
-
2285
-
2286
-
2287
-
2288
-
2289
-
2290
- "use strict";
2291
- class MaskFilter extends Filter {
2292
- constructor(options) {
2293
- const { sprite, ...rest } = options;
2294
- const textureMatrix = new TextureMatrix.TextureMatrix(sprite.texture);
2295
- const filterUniforms = new UniformGroup.UniformGroup({
2296
- uFilterMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" },
2297
- uMaskClamp: { value: textureMatrix.uClampFrame, type: "vec4<f32>" },
2298
- uAlpha: { value: 1, type: "f32" },
2299
- uInverse: { value: options.inverse ? 1 : 0, type: "f32" }
2300
- });
2301
- const gpuProgram = GpuProgram.GpuProgram.from({
2302
- vertex: {
2303
- source: source,
2304
- entryPoint: "mainVertex"
2305
- },
2306
- fragment: {
2307
- source: source,
2308
- entryPoint: "mainFragment"
2309
- }
2310
- });
2311
- const glProgram = GlProgram.GlProgram.from({
2312
- vertex: vertex,
2313
- fragment: fragment,
2314
- name: "mask-filter"
2315
- });
2316
- super({
2317
- ...rest,
2318
- gpuProgram,
2319
- glProgram,
2320
- resources: {
2321
- filterUniforms,
2322
- uMaskTexture: sprite.texture.source
2323
- }
2324
- });
2325
- this.sprite = sprite;
2326
- this._textureMatrix = textureMatrix;
2327
- }
2328
- set inverse(value) {
2329
- this.resources.filterUniforms.uniforms.uInverse = value ? 1 : 0;
2330
- }
2331
- get inverse() {
2332
- return this.resources.filterUniforms.uniforms.uInverse === 1;
2333
- }
2334
- apply(filterManager, input, output, clearMode) {
2335
- this._textureMatrix.texture = this.sprite.texture;
2336
- filterManager.calculateSpriteMatrix(
2337
- this.resources.filterUniforms.uniforms.uFilterMatrix,
2338
- this.sprite
2339
- ).prepend(this._textureMatrix.mapCoord);
2340
- this.resources.uMaskTexture = this.sprite.texture.source;
2341
- filterManager.applyFilter(this, input, output, clearMode);
2342
- }
2343
- }
2344
-
2345
-
2346
- //# sourceMappingURL=MaskFilter.mjs.map
2347
-
2348
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/container/bounds/getGlobalBounds.mjs
2349
- var getGlobalBounds = __webpack_require__(9443);
2350
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/sprite/Sprite.mjs
2351
- var Sprite = __webpack_require__(6844);
2352
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/Texture.mjs + 2 modules
2353
- var Texture = __webpack_require__(4492);
2354
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/types.mjs
2355
- var types = __webpack_require__(5099);
2356
- ;// ./node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.mjs
2357
-
2358
-
2359
-
2360
-
2361
-
2362
-
2363
-
2364
-
2365
-
2366
-
2367
-
2368
-
2369
- "use strict";
2370
- const tempBounds = new Bounds.Bounds();
2371
- class AlphaMaskEffect extends FilterEffect.FilterEffect {
2372
- constructor() {
2373
- super();
2374
- this.filters = [new MaskFilter({
2375
- sprite: new Sprite.Sprite(Texture.Texture.EMPTY),
2376
- inverse: false,
2377
- resolution: "inherit",
2378
- antialias: "inherit"
2379
- })];
2380
- }
2381
- get sprite() {
2382
- return this.filters[0].sprite;
2383
- }
2384
- set sprite(value) {
2385
- this.filters[0].sprite = value;
2386
- }
2387
- get inverse() {
2388
- return this.filters[0].inverse;
2389
- }
2390
- set inverse(value) {
2391
- this.filters[0].inverse = value;
2392
- }
2393
- }
2394
- class AlphaMaskPipe {
2395
- constructor(renderer) {
2396
- this._activeMaskStage = [];
2397
- this._renderer = renderer;
2398
- }
2399
- push(mask, maskedContainer, instructionSet) {
2400
- const renderer = this._renderer;
2401
- renderer.renderPipes.batch.break(instructionSet);
2402
- instructionSet.add({
2403
- renderPipeId: "alphaMask",
2404
- action: "pushMaskBegin",
2405
- mask,
2406
- inverse: maskedContainer._maskOptions.inverse,
2407
- canBundle: false,
2408
- maskedContainer
2409
- });
2410
- mask.inverse = maskedContainer._maskOptions.inverse;
2411
- if (mask.renderMaskToTexture) {
2412
- const maskContainer = mask.mask;
2413
- maskContainer.includeInBuild = true;
2414
- collectAllRenderables(
2415
- maskContainer,
2416
- instructionSet,
2417
- renderer
2418
- );
2419
- maskContainer.includeInBuild = false;
2420
- }
2421
- renderer.renderPipes.batch.break(instructionSet);
2422
- instructionSet.add({
2423
- renderPipeId: "alphaMask",
2424
- action: "pushMaskEnd",
2425
- mask,
2426
- maskedContainer,
2427
- inverse: maskedContainer._maskOptions.inverse,
2428
- canBundle: false
2429
- });
2430
- }
2431
- pop(mask, _maskedContainer, instructionSet) {
2432
- const renderer = this._renderer;
2433
- renderer.renderPipes.batch.break(instructionSet);
2434
- instructionSet.add({
2435
- renderPipeId: "alphaMask",
2436
- action: "popMaskEnd",
2437
- mask,
2438
- inverse: _maskedContainer._maskOptions.inverse,
2439
- canBundle: false
2440
- });
2441
- }
2442
- execute(instruction) {
2443
- const renderer = this._renderer;
2444
- const renderMask = instruction.mask.renderMaskToTexture;
2445
- if (instruction.action === "pushMaskBegin") {
2446
- const filterEffect = PoolGroup.BigPool.get(AlphaMaskEffect);
2447
- filterEffect.inverse = instruction.inverse;
2448
- if (renderMask) {
2449
- instruction.mask.mask.measurable = true;
2450
- const bounds = (0,getGlobalBounds.getGlobalBounds)(instruction.mask.mask, true, tempBounds);
2451
- instruction.mask.mask.measurable = false;
2452
- bounds.ceil();
2453
- const colorTextureSource = renderer.renderTarget.renderTarget.colorTexture.source;
2454
- const filterTexture = TexturePool.TexturePool.getOptimalTexture(
2455
- bounds.width,
2456
- bounds.height,
2457
- colorTextureSource._resolution,
2458
- colorTextureSource.antialias
2459
- );
2460
- renderer.renderTarget.push(filterTexture, true);
2461
- renderer.globalUniforms.push({
2462
- offset: bounds,
2463
- worldColor: 4294967295
2464
- });
2465
- const sprite = filterEffect.sprite;
2466
- sprite.texture = filterTexture;
2467
- sprite.worldTransform.tx = bounds.minX;
2468
- sprite.worldTransform.ty = bounds.minY;
2469
- this._activeMaskStage.push({
2470
- filterEffect,
2471
- maskedContainer: instruction.maskedContainer,
2472
- filterTexture
2473
- });
2474
- } else {
2475
- filterEffect.sprite = instruction.mask.mask;
2476
- this._activeMaskStage.push({
2477
- filterEffect,
2478
- maskedContainer: instruction.maskedContainer
2479
- });
2480
- }
2481
- } else if (instruction.action === "pushMaskEnd") {
2482
- const maskData = this._activeMaskStage[this._activeMaskStage.length - 1];
2483
- if (renderMask) {
2484
- if (renderer.type === types.RendererType.WEBGL) {
2485
- renderer.renderTarget.finishRenderPass();
2486
- }
2487
- renderer.renderTarget.pop();
2488
- renderer.globalUniforms.pop();
2489
- }
2490
- renderer.filter.push({
2491
- renderPipeId: "filter",
2492
- action: "pushFilter",
2493
- container: maskData.maskedContainer,
2494
- filterEffect: maskData.filterEffect,
2495
- canBundle: false
2496
- });
2497
- } else if (instruction.action === "popMaskEnd") {
2498
- renderer.filter.pop();
2499
- const maskData = this._activeMaskStage.pop();
2500
- if (renderMask) {
2501
- TexturePool.TexturePool.returnTexture(maskData.filterTexture);
2502
- }
2503
- PoolGroup.BigPool.return(maskData.filterEffect);
2504
- }
2505
- }
2506
- destroy() {
2507
- this._renderer = null;
2508
- this._activeMaskStage = null;
2509
- }
2510
- }
2511
- /** @ignore */
2512
- AlphaMaskPipe.extension = {
2513
- type: [
2514
- Extensions.ExtensionType.WebGLPipes,
2515
- Extensions.ExtensionType.WebGPUPipes,
2516
- Extensions.ExtensionType.CanvasPipes
2517
- ],
2518
- name: "alphaMask"
2519
- };
2520
-
2521
-
2522
- //# sourceMappingURL=AlphaMaskPipe.mjs.map
2523
-
2524
- ;// ./node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.mjs
2525
-
2526
-
2527
- "use strict";
2528
- class ColorMaskPipe {
2529
- constructor(renderer) {
2530
- this._colorStack = [];
2531
- this._colorStackIndex = 0;
2532
- this._currentColor = 0;
2533
- this._renderer = renderer;
2534
- }
2535
- buildStart() {
2536
- this._colorStack[0] = 15;
2537
- this._colorStackIndex = 1;
2538
- this._currentColor = 15;
2539
- }
2540
- push(mask, _container, instructionSet) {
2541
- const renderer = this._renderer;
2542
- renderer.renderPipes.batch.break(instructionSet);
2543
- const colorStack = this._colorStack;
2544
- colorStack[this._colorStackIndex] = colorStack[this._colorStackIndex - 1] & mask.mask;
2545
- const currentColor = this._colorStack[this._colorStackIndex];
2546
- if (currentColor !== this._currentColor) {
2547
- this._currentColor = currentColor;
2548
- instructionSet.add({
2549
- renderPipeId: "colorMask",
2550
- colorMask: currentColor,
2551
- canBundle: false
2552
- });
2553
- }
2554
- this._colorStackIndex++;
2555
- }
2556
- pop(_mask, _container, instructionSet) {
2557
- const renderer = this._renderer;
2558
- renderer.renderPipes.batch.break(instructionSet);
2559
- const colorStack = this._colorStack;
2560
- this._colorStackIndex--;
2561
- const currentColor = colorStack[this._colorStackIndex - 1];
2562
- if (currentColor !== this._currentColor) {
2563
- this._currentColor = currentColor;
2564
- instructionSet.add({
2565
- renderPipeId: "colorMask",
2566
- colorMask: currentColor,
2567
- canBundle: false
2568
- });
2569
- }
2570
- }
2571
- execute(instruction) {
2572
- const renderer = this._renderer;
2573
- renderer.colorMask.setMask(instruction.colorMask);
2574
- }
2575
- destroy() {
2576
- this._colorStack = null;
2577
- }
2578
- }
2579
- /** @ignore */
2580
- ColorMaskPipe.extension = {
2581
- type: [
2582
- Extensions.ExtensionType.WebGLPipes,
2583
- Extensions.ExtensionType.WebGPUPipes,
2584
- Extensions.ExtensionType.CanvasPipes
2585
- ],
2586
- name: "colorMask"
2587
- };
2588
-
2589
-
2590
- //# sourceMappingURL=ColorMaskPipe.mjs.map
2591
-
2592
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/gl/const.mjs
2593
- var gl_const = __webpack_require__(1257);
2594
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/state/const.mjs
2595
- var state_const = __webpack_require__(1957);
2596
- ;// ./node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.mjs
2597
-
2598
-
2599
-
2600
-
2601
-
2602
- "use strict";
2603
- class StencilMaskPipe {
2604
- constructor(renderer) {
2605
- // used when building and also when executing..
2606
- this._maskStackHash = {};
2607
- this._maskHash = /* @__PURE__ */ new WeakMap();
2608
- this._renderer = renderer;
2609
- }
2610
- push(mask, _container, instructionSet) {
2611
- var _a;
2612
- const effect = mask;
2613
- const renderer = this._renderer;
2614
- renderer.renderPipes.batch.break(instructionSet);
2615
- renderer.renderPipes.blendMode.setBlendMode(effect.mask, "none", instructionSet);
2616
- instructionSet.add({
2617
- renderPipeId: "stencilMask",
2618
- action: "pushMaskBegin",
2619
- mask,
2620
- inverse: _container._maskOptions.inverse,
2621
- canBundle: false
2622
- });
2623
- const maskContainer = effect.mask;
2624
- maskContainer.includeInBuild = true;
2625
- if (!this._maskHash.has(effect)) {
2626
- this._maskHash.set(effect, {
2627
- instructionsStart: 0,
2628
- instructionsLength: 0
2629
- });
2630
- }
2631
- const maskData = this._maskHash.get(effect);
2632
- maskData.instructionsStart = instructionSet.instructionSize;
2633
- collectAllRenderables(
2634
- maskContainer,
2635
- instructionSet,
2636
- renderer
2637
- );
2638
- maskContainer.includeInBuild = false;
2639
- renderer.renderPipes.batch.break(instructionSet);
2640
- instructionSet.add({
2641
- renderPipeId: "stencilMask",
2642
- action: "pushMaskEnd",
2643
- mask,
2644
- inverse: _container._maskOptions.inverse,
2645
- canBundle: false
2646
- });
2647
- const instructionsLength = instructionSet.instructionSize - maskData.instructionsStart - 1;
2648
- maskData.instructionsLength = instructionsLength;
2649
- const renderTargetUid = renderer.renderTarget.renderTarget.uid;
2650
- (_a = this._maskStackHash)[renderTargetUid] ?? (_a[renderTargetUid] = 0);
2651
- }
2652
- pop(mask, _container, instructionSet) {
2653
- const effect = mask;
2654
- const renderer = this._renderer;
2655
- renderer.renderPipes.batch.break(instructionSet);
2656
- renderer.renderPipes.blendMode.setBlendMode(effect.mask, "none", instructionSet);
2657
- instructionSet.add({
2658
- renderPipeId: "stencilMask",
2659
- action: "popMaskBegin",
2660
- inverse: _container._maskOptions.inverse,
2661
- canBundle: false
2662
- });
2663
- const maskData = this._maskHash.get(mask);
2664
- for (let i = 0; i < maskData.instructionsLength; i++) {
2665
- instructionSet.instructions[instructionSet.instructionSize++] = instructionSet.instructions[maskData.instructionsStart++];
2666
- }
2667
- instructionSet.add({
2668
- renderPipeId: "stencilMask",
2669
- action: "popMaskEnd",
2670
- canBundle: false
2671
- });
2672
- }
2673
- execute(instruction) {
2674
- var _a;
2675
- const renderer = this._renderer;
2676
- const renderTargetUid = renderer.renderTarget.renderTarget.uid;
2677
- let maskStackIndex = (_a = this._maskStackHash)[renderTargetUid] ?? (_a[renderTargetUid] = 0);
2678
- if (instruction.action === "pushMaskBegin") {
2679
- renderer.renderTarget.ensureDepthStencil();
2680
- renderer.stencil.setStencilMode(state_const.STENCIL_MODES.RENDERING_MASK_ADD, maskStackIndex);
2681
- maskStackIndex++;
2682
- renderer.colorMask.setMask(0);
2683
- } else if (instruction.action === "pushMaskEnd") {
2684
- if (instruction.inverse) {
2685
- renderer.stencil.setStencilMode(state_const.STENCIL_MODES.INVERSE_MASK_ACTIVE, maskStackIndex);
2686
- } else {
2687
- renderer.stencil.setStencilMode(state_const.STENCIL_MODES.MASK_ACTIVE, maskStackIndex);
2688
- }
2689
- renderer.colorMask.setMask(15);
2690
- } else if (instruction.action === "popMaskBegin") {
2691
- renderer.colorMask.setMask(0);
2692
- if (maskStackIndex !== 0) {
2693
- renderer.stencil.setStencilMode(state_const.STENCIL_MODES.RENDERING_MASK_REMOVE, maskStackIndex);
2694
- } else {
2695
- renderer.renderTarget.clear(null, gl_const.CLEAR.STENCIL);
2696
- renderer.stencil.setStencilMode(state_const.STENCIL_MODES.DISABLED, maskStackIndex);
2697
- }
2698
- maskStackIndex--;
2699
- } else if (instruction.action === "popMaskEnd") {
2700
- if (instruction.inverse) {
2701
- renderer.stencil.setStencilMode(state_const.STENCIL_MODES.INVERSE_MASK_ACTIVE, maskStackIndex);
2702
- } else {
2703
- renderer.stencil.setStencilMode(state_const.STENCIL_MODES.MASK_ACTIVE, maskStackIndex);
2704
- }
2705
- renderer.colorMask.setMask(15);
2706
- }
2707
- this._maskStackHash[renderTargetUid] = maskStackIndex;
2708
- }
2709
- destroy() {
2710
- this._renderer = null;
2711
- this._maskStackHash = null;
2712
- this._maskHash = null;
2713
- }
2714
- }
2715
- StencilMaskPipe.extension = {
2716
- type: [
2717
- Extensions.ExtensionType.WebGLPipes,
2718
- Extensions.ExtensionType.WebGPUPipes,
2719
- Extensions.ExtensionType.CanvasPipes
2720
- ],
2721
- name: "stencilMask"
2722
- };
2723
-
2724
-
2725
- //# sourceMappingURL=StencilMaskPipe.mjs.map
2726
-
2727
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/color/Color.mjs + 2 modules
2728
- var Color = __webpack_require__(2577);
2729
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/background/BackgroundSystem.mjs
2730
-
2731
-
2732
-
2733
- "use strict";
2734
- const _BackgroundSystem = class _BackgroundSystem {
2735
- constructor() {
2736
- this.clearBeforeRender = true;
2737
- this._backgroundColor = new Color.Color(0);
2738
- this.color = this._backgroundColor;
2739
- this.alpha = 1;
2740
- }
2741
- /**
2742
- * initiates the background system
2743
- * @param options - the options for the background colors
2744
- */
2745
- init(options) {
2746
- options = { ..._BackgroundSystem.defaultOptions, ...options };
2747
- this.clearBeforeRender = options.clearBeforeRender;
2748
- this.color = options.background || options.backgroundColor || this._backgroundColor;
2749
- this.alpha = options.backgroundAlpha;
2750
- this._backgroundColor.setAlpha(options.backgroundAlpha);
2751
- }
2752
- /** The background color to fill if not transparent */
2753
- get color() {
2754
- return this._backgroundColor;
2755
- }
2756
- set color(value) {
2757
- this._backgroundColor.setValue(value);
2758
- }
2759
- /** The background color alpha. Setting this to 0 will make the canvas transparent. */
2760
- get alpha() {
2761
- return this._backgroundColor.alpha;
2762
- }
2763
- set alpha(value) {
2764
- this._backgroundColor.setAlpha(value);
2765
- }
2766
- /** The background color as an [R, G, B, A] array. */
2767
- get colorRgba() {
2768
- return this._backgroundColor.toArray();
2769
- }
2770
- /**
2771
- * destroys the background system
2772
- * @internal
2773
- * @ignore
2774
- */
2775
- destroy() {
2776
- }
2777
- };
2778
- /** @ignore */
2779
- _BackgroundSystem.extension = {
2780
- type: [
2781
- Extensions.ExtensionType.WebGLSystem,
2782
- Extensions.ExtensionType.WebGPUSystem,
2783
- Extensions.ExtensionType.CanvasSystem
2784
- ],
2785
- name: "background",
2786
- priority: 0
2787
- };
2788
- /** default options used by the system */
2789
- _BackgroundSystem.defaultOptions = {
2790
- /**
2791
- * {@link WebGLOptions.backgroundAlpha}
2792
- * @default 1
2793
- */
2794
- backgroundAlpha: 1,
2795
- /**
2796
- * {@link WebGLOptions.backgroundColor}
2797
- * @default 0x000000
2798
- */
2799
- backgroundColor: 0,
2800
- /**
2801
- * {@link WebGLOptions.clearBeforeRender}
2802
- * @default true
2803
- */
2804
- clearBeforeRender: true
2805
- };
2806
- let BackgroundSystem = _BackgroundSystem;
2807
-
2808
-
2809
- //# sourceMappingURL=BackgroundSystem.mjs.map
2810
-
2811
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/utils/logging/warn.mjs
2812
- var warn = __webpack_require__(268);
2813
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/blendModes/BlendModePipe.mjs
2814
-
2815
-
2816
-
2817
-
2818
- "use strict";
2819
- const BLEND_MODE_FILTERS = {};
2820
- Extensions.extensions.handle(Extensions.ExtensionType.BlendMode, (value) => {
2821
- if (!value.name) {
2822
- throw new Error("BlendMode extension must have a name property");
2823
- }
2824
- BLEND_MODE_FILTERS[value.name] = value.ref;
2825
- }, (value) => {
2826
- delete BLEND_MODE_FILTERS[value.name];
2827
- });
2828
- class BlendModePipe {
2829
- constructor(renderer) {
2830
- this._isAdvanced = false;
2831
- this._filterHash = /* @__PURE__ */ Object.create(null);
2832
- this._renderer = renderer;
2833
- }
2834
- /**
2835
- * This ensures that a blendMode switch is added to the instruction set if the blend mode has changed.
2836
- * @param renderable - The renderable we are adding to the instruction set
2837
- * @param blendMode - The blend mode of the renderable
2838
- * @param instructionSet - The instruction set we are adding to
2839
- */
2840
- setBlendMode(renderable, blendMode, instructionSet) {
2841
- if (this._activeBlendMode === blendMode) {
2842
- if (this._isAdvanced)
2843
- this._renderableList.push(renderable);
2844
- return;
2845
- }
2846
- this._activeBlendMode = blendMode;
2847
- if (this._isAdvanced) {
2848
- this._endAdvancedBlendMode(instructionSet);
2849
- }
2850
- this._isAdvanced = !!BLEND_MODE_FILTERS[blendMode];
2851
- if (this._isAdvanced) {
2852
- this._beginAdvancedBlendMode(instructionSet);
2853
- this._renderableList.push(renderable);
2854
- }
2855
- }
2856
- _beginAdvancedBlendMode(instructionSet) {
2857
- this._renderer.renderPipes.batch.break(instructionSet);
2858
- const blendMode = this._activeBlendMode;
2859
- if (!BLEND_MODE_FILTERS[blendMode]) {
2860
- (0,warn.warn)(`Unable to assign BlendMode: '${blendMode}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);
2861
- return;
2862
- }
2863
- let filterEffect = this._filterHash[blendMode];
2864
- if (!filterEffect) {
2865
- filterEffect = this._filterHash[blendMode] = new FilterEffect.FilterEffect();
2866
- filterEffect.filters = [new BLEND_MODE_FILTERS[blendMode]()];
2867
- }
2868
- const instruction = {
2869
- renderPipeId: "filter",
2870
- action: "pushFilter",
2871
- renderables: [],
2872
- filterEffect,
2873
- canBundle: false
2874
- };
2875
- this._renderableList = instruction.renderables;
2876
- instructionSet.add(instruction);
2877
- }
2878
- _endAdvancedBlendMode(instructionSet) {
2879
- this._renderableList = null;
2880
- this._renderer.renderPipes.batch.break(instructionSet);
2881
- instructionSet.add({
2882
- renderPipeId: "filter",
2883
- action: "popFilter",
2884
- canBundle: false
2885
- });
2886
- }
2887
- /**
2888
- * called when the instruction build process is starting this will reset internally to the default blend mode
2889
- * @internal
2890
- * @ignore
2891
- */
2892
- buildStart() {
2893
- this._isAdvanced = false;
2894
- }
2895
- /**
2896
- * called when the instruction build process is finished, ensuring that if there is an advanced blend mode
2897
- * active, we add the final render instructions added to the instruction set
2898
- * @param instructionSet - The instruction set we are adding to
2899
- * @internal
2900
- * @ignore
2901
- */
2902
- buildEnd(instructionSet) {
2903
- if (this._isAdvanced) {
2904
- this._endAdvancedBlendMode(instructionSet);
2905
- }
2906
- }
2907
- /**
2908
- * @internal
2909
- * @ignore
2910
- */
2911
- destroy() {
2912
- this._renderer = null;
2913
- this._renderableList = null;
2914
- for (const i in this._filterHash) {
2915
- this._filterHash[i].destroy();
2916
- }
2917
- this._filterHash = null;
2918
- }
2919
- }
2920
- /** @ignore */
2921
- BlendModePipe.extension = {
2922
- type: [
2923
- Extensions.ExtensionType.WebGLPipes,
2924
- Extensions.ExtensionType.WebGPUPipes,
2925
- Extensions.ExtensionType.CanvasPipes
2926
- ],
2927
- name: "blendMode"
2928
- };
2929
-
2930
-
2931
- //# sourceMappingURL=BlendModePipe.mjs.map
2932
-
2933
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/extract/ExtractSystem.mjs
2934
-
2935
-
2936
-
2937
-
2938
- "use strict";
2939
- const imageTypes = {
2940
- png: "image/png",
2941
- jpg: "image/jpeg",
2942
- webp: "image/webp"
2943
- };
2944
- const _ExtractSystem = class _ExtractSystem {
2945
- /** @param renderer - The renderer this System works for. */
2946
- constructor(renderer) {
2947
- this._renderer = renderer;
2948
- }
2949
- _normalizeOptions(options, defaults = {}) {
2950
- if (options instanceof Container.Container || options instanceof Texture.Texture) {
2951
- return {
2952
- target: options,
2953
- ...defaults
2954
- };
2955
- }
2956
- return {
2957
- ...defaults,
2958
- ...options
2959
- };
2960
- }
2961
- /**
2962
- * Will return a HTML Image of the target
2963
- * @param options - The options for creating the image, or the target to extract
2964
- * @returns - HTML Image of the target
2965
- */
2966
- async image(options) {
2967
- const image = new Image();
2968
- image.src = await this.base64(options);
2969
- return image;
2970
- }
2971
- /**
2972
- * Will return a base64 encoded string of this target. It works by calling
2973
- * `Extract.canvas` and then running toDataURL on that.
2974
- * @param options - The options for creating the image, or the target to extract
2975
- */
2976
- async base64(options) {
2977
- options = this._normalizeOptions(
2978
- options,
2979
- _ExtractSystem.defaultImageOptions
2980
- );
2981
- const { format, quality } = options;
2982
- const canvas = this.canvas(options);
2983
- if (canvas.toBlob !== void 0) {
2984
- return new Promise((resolve, reject) => {
2985
- canvas.toBlob((blob) => {
2986
- if (!blob) {
2987
- reject(new Error("ICanvas.toBlob failed!"));
2988
- return;
2989
- }
2990
- const reader = new FileReader();
2991
- reader.onload = () => resolve(reader.result);
2992
- reader.onerror = reject;
2993
- reader.readAsDataURL(blob);
2994
- }, imageTypes[format], quality);
2995
- });
2996
- }
2997
- if (canvas.toDataURL !== void 0) {
2998
- return canvas.toDataURL(imageTypes[format], quality);
2999
- }
3000
- if (canvas.convertToBlob !== void 0) {
3001
- const blob = await canvas.convertToBlob({ type: imageTypes[format], quality });
3002
- return new Promise((resolve, reject) => {
3003
- const reader = new FileReader();
3004
- reader.onload = () => resolve(reader.result);
3005
- reader.onerror = reject;
3006
- reader.readAsDataURL(blob);
3007
- });
3008
- }
3009
- throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented");
3010
- }
3011
- /**
3012
- * Creates a Canvas element, renders this target to it and then returns it.
3013
- * @param options - The options for creating the canvas, or the target to extract
3014
- * @returns - A Canvas element with the texture rendered on.
3015
- */
3016
- canvas(options) {
3017
- options = this._normalizeOptions(options);
3018
- const target = options.target;
3019
- const renderer = this._renderer;
3020
- if (target instanceof Texture.Texture) {
3021
- return renderer.texture.generateCanvas(target);
3022
- }
3023
- const texture = renderer.textureGenerator.generateTexture(options);
3024
- const canvas = renderer.texture.generateCanvas(texture);
3025
- texture.destroy(true);
3026
- return canvas;
3027
- }
3028
- /**
3029
- * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA
3030
- * order, with integer values between 0 and 255 (included).
3031
- * @param options - The options for extracting the image, or the target to extract
3032
- * @returns - One-dimensional array containing the pixel data of the entire texture
3033
- */
3034
- pixels(options) {
3035
- options = this._normalizeOptions(options);
3036
- const target = options.target;
3037
- const renderer = this._renderer;
3038
- const texture = target instanceof Texture.Texture ? target : renderer.textureGenerator.generateTexture(options);
3039
- const pixelInfo = renderer.texture.getPixels(texture);
3040
- if (target instanceof Container.Container) {
3041
- texture.destroy(true);
3042
- }
3043
- return pixelInfo;
3044
- }
3045
- /**
3046
- * Will return a texture of the target
3047
- * @param options - The options for creating the texture, or the target to extract
3048
- * @returns - A texture of the target
3049
- */
3050
- texture(options) {
3051
- options = this._normalizeOptions(options);
3052
- if (options.target instanceof Texture.Texture)
3053
- return options.target;
3054
- return this._renderer.textureGenerator.generateTexture(options);
3055
- }
3056
- /**
3057
- * Will extract a HTMLImage of the target and download it
3058
- * @param options - The options for downloading and extracting the image, or the target to extract
3059
- */
3060
- download(options) {
3061
- options = this._normalizeOptions(options);
3062
- const canvas = this.canvas(options);
3063
- const link = document.createElement("a");
3064
- link.download = options.filename ?? "image.png";
3065
- link.href = canvas.toDataURL("image/png");
3066
- document.body.appendChild(link);
3067
- link.click();
3068
- document.body.removeChild(link);
3069
- }
3070
- /**
3071
- * Logs the target to the console as an image. This is a useful way to debug what's happening in the renderer.
3072
- * @param options - The options for logging the image, or the target to log
3073
- */
3074
- log(options) {
3075
- const width = options.width ?? 200;
3076
- options = this._normalizeOptions(options);
3077
- const canvas = this.canvas(options);
3078
- const base64 = canvas.toDataURL();
3079
- console.log(`[Pixi Texture] ${canvas.width}px ${canvas.height}px`);
3080
- const style = [
3081
- "font-size: 1px;",
3082
- `padding: ${width}px ${300}px;`,
3083
- `background: url(${base64}) no-repeat;`,
3084
- "background-size: contain;"
3085
- ].join(" ");
3086
- console.log("%c ", style);
3087
- }
3088
- destroy() {
3089
- this._renderer = null;
3090
- }
3091
- };
3092
- /** @ignore */
3093
- _ExtractSystem.extension = {
3094
- type: [
3095
- Extensions.ExtensionType.WebGLSystem,
3096
- Extensions.ExtensionType.WebGPUSystem
3097
- ],
3098
- name: "extract"
3099
- };
3100
- /** Default options for creating an image. */
3101
- _ExtractSystem.defaultImageOptions = {
3102
- /** The format of the image. */
3103
- format: "png",
3104
- /** The quality of the image. */
3105
- quality: 1
3106
- };
3107
- let ExtractSystem = _ExtractSystem;
3108
-
3109
-
3110
- //# sourceMappingURL=ExtractSystem.mjs.map
3111
-
3112
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/maths/shapes/Rectangle.mjs
3113
- var Rectangle = __webpack_require__(9252);
3114
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/container/bounds/getLocalBounds.mjs
3115
- var getLocalBounds = __webpack_require__(7269);
3116
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/sources/TextureSource.mjs + 1 modules
3117
- var TextureSource = __webpack_require__(1285);
3118
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/RenderTexture.mjs
3119
-
3120
-
3121
-
3122
- "use strict";
3123
- class RenderTexture extends Texture.Texture {
3124
- static create(options) {
3125
- return new RenderTexture({
3126
- source: new TextureSource.TextureSource(options)
3127
- });
3128
- }
3129
- /**
3130
- * Resizes the render texture.
3131
- * @param width - The new width of the render texture.
3132
- * @param height - The new height of the render texture.
3133
- * @param resolution - The new resolution of the render texture.
3134
- * @returns This texture.
3135
- */
3136
- resize(width, height, resolution) {
3137
- this.source.resize(width, height, resolution);
3138
- return this;
3139
- }
3140
- }
3141
-
3142
-
3143
- //# sourceMappingURL=RenderTexture.mjs.map
3144
-
3145
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/extract/GenerateTextureSystem.mjs
3146
-
3147
-
3148
-
3149
-
3150
-
3151
-
3152
-
3153
-
3154
-
3155
- "use strict";
3156
- const tempRect = new Rectangle.Rectangle();
3157
- const GenerateTextureSystem_tempBounds = new Bounds.Bounds();
3158
- const noColor = [0, 0, 0, 0];
3159
- class GenerateTextureSystem {
3160
- constructor(renderer) {
3161
- this._renderer = renderer;
3162
- }
3163
- /**
3164
- * A Useful function that returns a texture of the display object that can then be used to create sprites
3165
- * This can be quite useful if your container is complicated and needs to be reused multiple times.
3166
- * @param {GenerateTextureOptions | Container} options - Generate texture options.
3167
- * @param {Container} [options.container] - If not given, the renderer's resolution is used.
3168
- * @param {Rectangle} options.region - The region of the container, that shall be rendered,
3169
- * @param {number} [options.resolution] - The resolution of the texture being generated.
3170
- * if no region is specified, defaults to the local bounds of the container.
3171
- * @param {GenerateTextureSourceOptions} [options.textureSourceOptions] - Texture options for GPU.
3172
- * @returns a shiny new texture of the container passed in
3173
- */
3174
- generateTexture(options) {
3175
- if (options instanceof Container.Container) {
3176
- options = {
3177
- target: options,
3178
- frame: void 0,
3179
- textureSourceOptions: {},
3180
- resolution: void 0
3181
- };
3182
- }
3183
- const resolution = options.resolution || this._renderer.resolution;
3184
- const antialias = options.antialias || this._renderer.view.antialias;
3185
- const container = options.target;
3186
- let clearColor = options.clearColor;
3187
- if (clearColor) {
3188
- const isRGBAArray = Array.isArray(clearColor) && clearColor.length === 4;
3189
- clearColor = isRGBAArray ? clearColor : Color.Color.shared.setValue(clearColor).toArray();
3190
- } else {
3191
- clearColor = noColor;
3192
- }
3193
- const region = options.frame?.copyTo(tempRect) || (0,getLocalBounds.getLocalBounds)(container, GenerateTextureSystem_tempBounds).rectangle;
3194
- region.width = Math.max(region.width, 1 / resolution) | 0;
3195
- region.height = Math.max(region.height, 1 / resolution) | 0;
3196
- const target = RenderTexture.create({
3197
- ...options.textureSourceOptions,
3198
- width: region.width,
3199
- height: region.height,
3200
- resolution,
3201
- antialias
3202
- });
3203
- const transform = Matrix.Matrix.shared.translate(-region.x, -region.y);
3204
- this._renderer.render({
3205
- container,
3206
- transform,
3207
- target,
3208
- clearColor
3209
- });
3210
- target.source.updateMipmaps();
3211
- return target;
3212
- }
3213
- destroy() {
3214
- this._renderer = null;
3215
- }
3216
- }
3217
- /** @ignore */
3218
- GenerateTextureSystem.extension = {
3219
- type: [
3220
- Extensions.ExtensionType.WebGLSystem,
3221
- Extensions.ExtensionType.WebGPUSystem
3222
- ],
3223
- name: "textureGenerator"
3224
- };
3225
-
3226
-
3227
- //# sourceMappingURL=GenerateTextureSystem.mjs.map
3228
-
3229
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/maths/point/Point.mjs
3230
- var Point = __webpack_require__(5101);
3231
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/graphics/gpu/colorToUniform.mjs
3232
- var colorToUniform = __webpack_require__(2760);
3233
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/gpu/shader/BindGroup.mjs
3234
- var BindGroup = __webpack_require__(3513);
3235
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/renderTarget/GlobalUniformSystem.mjs
3236
-
3237
-
3238
-
3239
-
3240
-
3241
-
3242
-
3243
-
3244
- "use strict";
3245
- class GlobalUniformSystem {
3246
- constructor(renderer) {
3247
- this._stackIndex = 0;
3248
- this._globalUniformDataStack = [];
3249
- this._uniformsPool = [];
3250
- this._activeUniforms = [];
3251
- this._bindGroupPool = [];
3252
- this._activeBindGroups = [];
3253
- this._renderer = renderer;
3254
- }
3255
- reset() {
3256
- this._stackIndex = 0;
3257
- for (let i = 0; i < this._activeUniforms.length; i++) {
3258
- this._uniformsPool.push(this._activeUniforms[i]);
3259
- }
3260
- for (let i = 0; i < this._activeBindGroups.length; i++) {
3261
- this._bindGroupPool.push(this._activeBindGroups[i]);
3262
- }
3263
- this._activeUniforms.length = 0;
3264
- this._activeBindGroups.length = 0;
3265
- }
3266
- start(options) {
3267
- this.reset();
3268
- this.push(options);
3269
- }
3270
- bind({
3271
- size,
3272
- projectionMatrix,
3273
- worldTransformMatrix,
3274
- worldColor,
3275
- offset
3276
- }) {
3277
- const renderTarget = this._renderer.renderTarget.renderTarget;
3278
- const currentGlobalUniformData = this._stackIndex ? this._globalUniformDataStack[this._stackIndex - 1] : {
3279
- projectionData: renderTarget,
3280
- worldTransformMatrix: new Matrix.Matrix(),
3281
- worldColor: 4294967295,
3282
- offset: new Point.Point()
3283
- };
3284
- const globalUniformData = {
3285
- projectionMatrix: projectionMatrix || this._renderer.renderTarget.projectionMatrix,
3286
- resolution: size || renderTarget.size,
3287
- worldTransformMatrix: worldTransformMatrix || currentGlobalUniformData.worldTransformMatrix,
3288
- worldColor: worldColor || currentGlobalUniformData.worldColor,
3289
- offset: offset || currentGlobalUniformData.offset,
3290
- bindGroup: null
3291
- };
3292
- const uniformGroup = this._uniformsPool.pop() || this._createUniforms();
3293
- this._activeUniforms.push(uniformGroup);
3294
- const uniforms = uniformGroup.uniforms;
3295
- uniforms.uProjectionMatrix = globalUniformData.projectionMatrix;
3296
- uniforms.uResolution = globalUniformData.resolution;
3297
- uniforms.uWorldTransformMatrix.copyFrom(globalUniformData.worldTransformMatrix);
3298
- uniforms.uWorldTransformMatrix.tx -= globalUniformData.offset.x;
3299
- uniforms.uWorldTransformMatrix.ty -= globalUniformData.offset.y;
3300
- (0,colorToUniform.color32BitToUniform)(
3301
- globalUniformData.worldColor,
3302
- uniforms.uWorldColorAlpha,
3303
- 0
3304
- );
3305
- uniformGroup.update();
3306
- let bindGroup;
3307
- if (this._renderer.renderPipes.uniformBatch) {
3308
- bindGroup = this._renderer.renderPipes.uniformBatch.getUniformBindGroup(uniformGroup, false);
3309
- } else {
3310
- bindGroup = this._bindGroupPool.pop() || new BindGroup.BindGroup();
3311
- this._activeBindGroups.push(bindGroup);
3312
- bindGroup.setResource(uniformGroup, 0);
3313
- }
3314
- globalUniformData.bindGroup = bindGroup;
3315
- this._currentGlobalUniformData = globalUniformData;
3316
- }
3317
- push(options) {
3318
- this.bind(options);
3319
- this._globalUniformDataStack[this._stackIndex++] = this._currentGlobalUniformData;
3320
- }
3321
- pop() {
3322
- this._currentGlobalUniformData = this._globalUniformDataStack[--this._stackIndex - 1];
3323
- if (this._renderer.type === types.RendererType.WEBGL) {
3324
- this._currentGlobalUniformData.bindGroup.resources[0].update();
3325
- }
3326
- }
3327
- get bindGroup() {
3328
- return this._currentGlobalUniformData.bindGroup;
3329
- }
3330
- get globalUniformData() {
3331
- return this._currentGlobalUniformData;
3332
- }
3333
- get uniformGroup() {
3334
- return this._currentGlobalUniformData.bindGroup.resources[0];
3335
- }
3336
- _createUniforms() {
3337
- const globalUniforms = new UniformGroup.UniformGroup({
3338
- uProjectionMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" },
3339
- uWorldTransformMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" },
3340
- // TODO - someone smart - set this to be a unorm8x4 rather than a vec4<f32>
3341
- uWorldColorAlpha: { value: new Float32Array(4), type: "vec4<f32>" },
3342
- uResolution: { value: [0, 0], type: "vec2<f32>" }
3343
- }, {
3344
- isStatic: true
3345
- });
3346
- return globalUniforms;
3347
- }
3348
- destroy() {
3349
- this._renderer = null;
3350
- }
3351
- }
3352
- /** @ignore */
3353
- GlobalUniformSystem.extension = {
3354
- type: [
3355
- Extensions.ExtensionType.WebGLSystem,
3356
- Extensions.ExtensionType.WebGPUSystem,
3357
- Extensions.ExtensionType.CanvasSystem
3358
- ],
3359
- name: "globalUniforms"
3360
- };
3361
-
3362
-
3363
- //# sourceMappingURL=GlobalUniformSystem.mjs.map
3364
-
3365
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/ticker/Ticker.mjs + 1 modules
3366
- var Ticker = __webpack_require__(7309);
3367
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/SchedulerSystem.mjs
3368
-
3369
-
3370
-
3371
- "use strict";
3372
- let uid = 1;
3373
- class SchedulerSystem {
3374
- constructor() {
3375
- this._tasks = [];
3376
- /** a small off set to apply to the repeat schedules. This is just to make sure they run at slightly different times */
3377
- this._offset = 0;
3378
- }
3379
- /** Initializes the scheduler system and starts the ticker. */
3380
- init() {
3381
- Ticker.Ticker.system.add(this._update, this);
3382
- }
3383
- /**
3384
- * Schedules a repeating task.
3385
- * @param func - The function to execute.
3386
- * @param duration - The interval duration in milliseconds.
3387
- * @param useOffset - this will spread out tasks so that they do not all run at the same time
3388
- * @returns The unique identifier for the scheduled task.
3389
- */
3390
- repeat(func, duration, useOffset = true) {
3391
- const id = uid++;
3392
- let offset = 0;
3393
- if (useOffset) {
3394
- this._offset += 1e3;
3395
- offset = this._offset;
3396
- }
3397
- this._tasks.push({
3398
- func,
3399
- duration,
3400
- start: performance.now(),
3401
- offset,
3402
- last: performance.now(),
3403
- repeat: true,
3404
- id
3405
- });
3406
- return id;
3407
- }
3408
- /**
3409
- * Cancels a scheduled task.
3410
- * @param id - The unique identifier of the task to cancel.
3411
- */
3412
- cancel(id) {
3413
- for (let i = 0; i < this._tasks.length; i++) {
3414
- if (this._tasks[i].id === id) {
3415
- this._tasks.splice(i, 1);
3416
- return;
3417
- }
3418
- }
3419
- }
3420
- /**
3421
- * Updates and executes the scheduled tasks.
3422
- * @private
3423
- */
3424
- _update() {
3425
- const now = performance.now();
3426
- for (let i = 0; i < this._tasks.length; i++) {
3427
- const task = this._tasks[i];
3428
- if (now - task.offset - task.last >= task.duration) {
3429
- const elapsed = now - task.start;
3430
- task.func(elapsed);
3431
- task.last = now;
3432
- }
3433
- }
3434
- }
3435
- /**
3436
- * Destroys the scheduler system and removes all tasks.
3437
- * @internal
3438
- * @ignore
3439
- */
3440
- destroy() {
3441
- Ticker.Ticker.system.remove(this._update, this);
3442
- this._tasks.length = 0;
3443
- }
3444
- }
3445
- /** @ignore */
3446
- SchedulerSystem.extension = {
3447
- type: [
3448
- Extensions.ExtensionType.WebGLSystem,
3449
- Extensions.ExtensionType.WebGPUSystem,
3450
- Extensions.ExtensionType.CanvasSystem
3451
- ],
3452
- name: "scheduler",
3453
- priority: 0
3454
- };
3455
-
3456
-
3457
- //# sourceMappingURL=SchedulerSystem.mjs.map
3458
-
3459
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/environment/adapter.mjs + 1 modules
3460
- var adapter = __webpack_require__(1761);
3461
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/utils/const.mjs
3462
- var utils_const = __webpack_require__(2571);
3463
- ;// ./node_modules/pixi.js/lib/utils/sayHello.mjs
3464
-
3465
-
3466
-
3467
- "use strict";
3468
- let saidHello = false;
3469
- function sayHello(type) {
3470
- if (saidHello) {
3471
- return;
3472
- }
3473
- if (adapter.DOMAdapter.get().getNavigator().userAgent.toLowerCase().indexOf("chrome") > -1) {
3474
- const args = [
3475
- `%c %c %c %c %c PixiJS %c v${utils_const.VERSION} (${type}) http://www.pixijs.com/
3476
-
3477
- `,
3478
- "background: #E72264; padding:5px 0;",
3479
- "background: #6CA2EA; padding:5px 0;",
3480
- "background: #B5D33D; padding:5px 0;",
3481
- "background: #FED23F; padding:5px 0;",
3482
- "color: #FFFFFF; background: #E72264; padding:5px 0;",
3483
- "color: #E72264; background: #FFFFFF; padding:5px 0;"
3484
- ];
3485
- globalThis.console.log(...args);
3486
- } else if (globalThis.console) {
3487
- globalThis.console.log(`PixiJS ${utils_const.VERSION} - ${type} - http://www.pixijs.com/`);
3488
- }
3489
- saidHello = true;
3490
- }
3491
-
3492
-
3493
- //# sourceMappingURL=sayHello.mjs.map
3494
-
3495
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/startup/HelloSystem.mjs
3496
-
3497
-
3498
-
3499
-
3500
- "use strict";
3501
- class HelloSystem {
3502
- constructor(renderer) {
3503
- this._renderer = renderer;
3504
- }
3505
- /**
3506
- * It all starts here! This initiates every system, passing in the options for any system by name.
3507
- * @param options - the config for the renderer and all its systems
3508
- */
3509
- init(options) {
3510
- if (options.hello) {
3511
- let name = this._renderer.name;
3512
- if (this._renderer.type === types.RendererType.WEBGL) {
3513
- name += ` ${this._renderer.context.webGLVersion}`;
3514
- }
3515
- sayHello(name);
3516
- }
3517
- }
3518
- }
3519
- /** @ignore */
3520
- HelloSystem.extension = {
3521
- type: [
3522
- Extensions.ExtensionType.WebGLSystem,
3523
- Extensions.ExtensionType.WebGPUSystem,
3524
- Extensions.ExtensionType.CanvasSystem
3525
- ],
3526
- name: "hello",
3527
- priority: -2
3528
- };
3529
- /** The default options for the system. */
3530
- HelloSystem.defaultOptions = {
3531
- /** {@link WebGLOptions.hello} */
3532
- hello: false
3533
- };
3534
-
3535
-
3536
- //# sourceMappingURL=HelloSystem.mjs.map
3537
-
3538
- ;// ./node_modules/pixi.js/lib/utils/data/clean.mjs
3539
-
3540
- function cleanHash(hash) {
3541
- let clean = false;
3542
- for (const i in hash) {
3543
- if (hash[i] == void 0) {
3544
- clean = true;
3545
- break;
3546
- }
3547
- }
3548
- if (!clean)
3549
- return hash;
3550
- const cleanHash2 = /* @__PURE__ */ Object.create(null);
3551
- for (const i in hash) {
3552
- const value = hash[i];
3553
- if (value) {
3554
- cleanHash2[i] = value;
3555
- }
3556
- }
3557
- return cleanHash2;
3558
- }
3559
- function cleanArray(arr) {
3560
- let offset = 0;
3561
- for (let i = 0; i < arr.length; i++) {
3562
- if (arr[i] == void 0) {
3563
- offset++;
3564
- } else {
3565
- arr[i - offset] = arr[i];
3566
- }
3567
- }
3568
- arr.length -= offset;
3569
- return arr;
3570
- }
3571
-
3572
-
3573
- //# sourceMappingURL=clean.mjs.map
3574
-
3575
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/RenderableGCSystem.mjs
3576
-
3577
-
3578
-
3579
- "use strict";
3580
- let renderableGCTick = 0;
3581
- const _RenderableGCSystem = class _RenderableGCSystem {
3582
- /**
3583
- * Creates a new RenderableGCSystem instance.
3584
- * @param renderer - The renderer this garbage collection system works for
3585
- */
3586
- constructor(renderer) {
3587
- /** Array of renderables being tracked for garbage collection */
3588
- this._managedRenderables = [];
3589
- /** Array of hash objects being tracked for cleanup */
3590
- this._managedHashes = [];
3591
- /** Array of arrays being tracked for cleanup */
3592
- this._managedArrays = [];
3593
- this._renderer = renderer;
3594
- }
3595
- /**
3596
- * Initializes the garbage collection system with the provided options.
3597
- * @param options - Configuration options for the renderer
3598
- */
3599
- init(options) {
3600
- options = { ..._RenderableGCSystem.defaultOptions, ...options };
3601
- this.maxUnusedTime = options.renderableGCMaxUnusedTime;
3602
- this._frequency = options.renderableGCFrequency;
3603
- this.enabled = options.renderableGCActive;
3604
- }
3605
- /**
3606
- * Gets whether the garbage collection system is currently enabled.
3607
- * @returns True if GC is enabled, false otherwise
3608
- */
3609
- get enabled() {
3610
- return !!this._handler;
3611
- }
3612
- /**
3613
- * Enables or disables the garbage collection system.
3614
- * When enabled, schedules periodic cleanup of resources.
3615
- * When disabled, cancels all scheduled cleanups.
3616
- */
3617
- set enabled(value) {
3618
- if (this.enabled === value)
3619
- return;
3620
- if (value) {
3621
- this._handler = this._renderer.scheduler.repeat(
3622
- () => this.run(),
3623
- this._frequency,
3624
- false
3625
- );
3626
- this._hashHandler = this._renderer.scheduler.repeat(
3627
- () => {
3628
- for (const hash of this._managedHashes) {
3629
- hash.context[hash.hash] = cleanHash(hash.context[hash.hash]);
3630
- }
3631
- },
3632
- this._frequency
3633
- );
3634
- this._arrayHandler = this._renderer.scheduler.repeat(
3635
- () => {
3636
- for (const array of this._managedArrays) {
3637
- cleanArray(array.context[array.hash]);
3638
- }
3639
- },
3640
- this._frequency
3641
- );
3642
- } else {
3643
- this._renderer.scheduler.cancel(this._handler);
3644
- this._renderer.scheduler.cancel(this._hashHandler);
3645
- this._renderer.scheduler.cancel(this._arrayHandler);
3646
- }
3647
- }
3648
- /**
3649
- * Adds a hash table to be managed by the garbage collector.
3650
- * @param context - The object containing the hash table
3651
- * @param hash - The property name of the hash table
3652
- */
3653
- addManagedHash(context, hash) {
3654
- this._managedHashes.push({ context, hash });
3655
- }
3656
- /**
3657
- * Adds an array to be managed by the garbage collector.
3658
- * @param context - The object containing the array
3659
- * @param hash - The property name of the array
3660
- */
3661
- addManagedArray(context, hash) {
3662
- this._managedArrays.push({ context, hash });
3663
- }
3664
- /**
3665
- * Updates the GC timestamp and tracking before rendering.
3666
- * @param options - The render options
3667
- * @param options.container - The container to render
3668
- */
3669
- prerender({
3670
- container
3671
- }) {
3672
- this._now = performance.now();
3673
- container.renderGroup.gcTick = renderableGCTick++;
3674
- this._updateInstructionGCTick(container.renderGroup, container.renderGroup.gcTick);
3675
- }
3676
- /**
3677
- * Starts tracking a renderable for garbage collection.
3678
- * @param renderable - The renderable to track
3679
- */
3680
- addRenderable(renderable) {
3681
- if (!this.enabled)
3682
- return;
3683
- if (renderable._lastUsed === -1) {
3684
- this._managedRenderables.push(renderable);
3685
- renderable.once("destroyed", this._removeRenderable, this);
3686
- }
3687
- renderable._lastUsed = this._now;
3688
- }
3689
- /**
3690
- * Performs garbage collection by cleaning up unused renderables.
3691
- * Removes renderables that haven't been used for longer than maxUnusedTime.
3692
- */
3693
- run() {
3694
- const now = this._now;
3695
- const managedRenderables = this._managedRenderables;
3696
- const renderPipes = this._renderer.renderPipes;
3697
- let offset = 0;
3698
- for (let i = 0; i < managedRenderables.length; i++) {
3699
- const renderable = managedRenderables[i];
3700
- if (renderable === null) {
3701
- offset++;
3702
- continue;
3703
- }
3704
- const renderGroup = renderable.renderGroup ?? renderable.parentRenderGroup;
3705
- const currentTick = renderGroup?.instructionSet?.gcTick ?? -1;
3706
- if ((renderGroup?.gcTick ?? 0) === currentTick) {
3707
- renderable._lastUsed = now;
3708
- }
3709
- if (now - renderable._lastUsed > this.maxUnusedTime) {
3710
- if (!renderable.destroyed) {
3711
- const rp = renderPipes;
3712
- if (renderGroup)
3713
- renderGroup.structureDidChange = true;
3714
- rp[renderable.renderPipeId].destroyRenderable(renderable);
3715
- }
3716
- renderable._lastUsed = -1;
3717
- offset++;
3718
- renderable.off("destroyed", this._removeRenderable, this);
3719
- } else {
3720
- managedRenderables[i - offset] = renderable;
3721
- }
3722
- }
3723
- managedRenderables.length -= offset;
3724
- }
3725
- /** Cleans up the garbage collection system. Disables GC and removes all tracked resources. */
3726
- destroy() {
3727
- this.enabled = false;
3728
- this._renderer = null;
3729
- this._managedRenderables.length = 0;
3730
- this._managedHashes.length = 0;
3731
- this._managedArrays.length = 0;
3732
- }
3733
- /**
3734
- * Removes a renderable from being tracked when it's destroyed.
3735
- * @param renderable - The renderable to stop tracking
3736
- */
3737
- _removeRenderable(renderable) {
3738
- const index = this._managedRenderables.indexOf(renderable);
3739
- if (index >= 0) {
3740
- renderable.off("destroyed", this._removeRenderable, this);
3741
- this._managedRenderables[index] = null;
3742
- }
3743
- }
3744
- /**
3745
- * Updates the GC tick counter for a render group and its children.
3746
- * @param renderGroup - The render group to update
3747
- * @param gcTick - The new tick value
3748
- */
3749
- _updateInstructionGCTick(renderGroup, gcTick) {
3750
- renderGroup.instructionSet.gcTick = gcTick;
3751
- for (const child of renderGroup.renderGroupChildren) {
3752
- this._updateInstructionGCTick(child, gcTick);
3753
- }
3754
- }
3755
- };
3756
- /**
3757
- * Extension metadata for registering this system with the renderer.
3758
- * @ignore
3759
- */
3760
- _RenderableGCSystem.extension = {
3761
- type: [
3762
- Extensions.ExtensionType.WebGLSystem,
3763
- Extensions.ExtensionType.WebGPUSystem
3764
- ],
3765
- name: "renderableGC",
3766
- priority: 0
3767
- };
3768
- /**
3769
- * Default configuration options for the garbage collection system.
3770
- * These can be overridden when initializing the renderer.
3771
- */
3772
- _RenderableGCSystem.defaultOptions = {
3773
- /** Enable/disable the garbage collector */
3774
- renderableGCActive: true,
3775
- /** Time in ms before an unused resource is collected (default 1 minute) */
3776
- renderableGCMaxUnusedTime: 6e4,
3777
- /** How often to run garbage collection in ms (default 30 seconds) */
3778
- renderableGCFrequency: 3e4
3779
- };
3780
- let RenderableGCSystem = _RenderableGCSystem;
3781
-
3782
-
3783
- //# sourceMappingURL=RenderableGCSystem.mjs.map
3784
-
3785
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/TextureGCSystem.mjs
3786
-
3787
-
3788
- "use strict";
3789
- const _TextureGCSystem = class _TextureGCSystem {
3790
- /** @param renderer - The renderer this System works for. */
3791
- constructor(renderer) {
3792
- this._renderer = renderer;
3793
- this.count = 0;
3794
- this.checkCount = 0;
3795
- }
3796
- init(options) {
3797
- options = { ..._TextureGCSystem.defaultOptions, ...options };
3798
- this.checkCountMax = options.textureGCCheckCountMax;
3799
- this.maxIdle = options.textureGCAMaxIdle ?? options.textureGCMaxIdle;
3800
- this.active = options.textureGCActive;
3801
- }
3802
- /**
3803
- * Checks to see when the last time a texture was used.
3804
- * If the texture has not been used for a specified amount of time, it will be removed from the GPU.
3805
- */
3806
- postrender() {
3807
- if (!this._renderer.renderingToScreen) {
3808
- return;
3809
- }
3810
- this.count++;
3811
- if (!this.active)
3812
- return;
3813
- this.checkCount++;
3814
- if (this.checkCount > this.checkCountMax) {
3815
- this.checkCount = 0;
3816
- this.run();
3817
- }
3818
- }
3819
- /**
3820
- * Checks to see when the last time a texture was used.
3821
- * If the texture has not been used for a specified amount of time, it will be removed from the GPU.
3822
- */
3823
- run() {
3824
- const managedTextures = this._renderer.texture.managedTextures;
3825
- for (let i = 0; i < managedTextures.length; i++) {
3826
- const texture = managedTextures[i];
3827
- if (texture.autoGarbageCollect && texture.resource && texture._touched > -1 && this.count - texture._touched > this.maxIdle) {
3828
- texture._touched = -1;
3829
- texture.unload();
3830
- }
3831
- }
3832
- }
3833
- destroy() {
3834
- this._renderer = null;
3835
- }
3836
- };
3837
- /** @ignore */
3838
- _TextureGCSystem.extension = {
3839
- type: [
3840
- Extensions.ExtensionType.WebGLSystem,
3841
- Extensions.ExtensionType.WebGPUSystem
3842
- ],
3843
- name: "textureGC"
3844
- };
3845
- /** default options for the TextureGCSystem */
3846
- _TextureGCSystem.defaultOptions = {
3847
- /**
3848
- * If set to true, this will enable the garbage collector on the GPU.
3849
- * @default true
3850
- */
3851
- textureGCActive: true,
3852
- /**
3853
- * @deprecated since 8.3.0
3854
- * @see {@link TextureGCSystem.textureGCMaxIdle}
3855
- */
3856
- textureGCAMaxIdle: null,
3857
- /**
3858
- * The maximum idle frames before a texture is destroyed by garbage collection.
3859
- * @default 60 * 60
3860
- */
3861
- textureGCMaxIdle: 60 * 60,
3862
- /**
3863
- * Frames between two garbage collections.
3864
- * @default 600
3865
- */
3866
- textureGCCheckCountMax: 600
3867
- };
3868
- let TextureGCSystem = _TextureGCSystem;
3869
-
3870
-
3871
- //# sourceMappingURL=TextureGCSystem.mjs.map
3872
-
3873
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/utils/logging/deprecation.mjs
3874
- var deprecation = __webpack_require__(4670);
3875
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/renderTarget/RenderTarget.mjs
3876
- var RenderTarget = __webpack_require__(279);
3877
- // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/getCanvasTexture.mjs
3878
- var getCanvasTexture = __webpack_require__(8725);
3879
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.mjs
3880
-
3881
-
3882
-
3883
-
3884
-
3885
-
3886
-
3887
- "use strict";
3888
- const _ViewSystem = class _ViewSystem {
3889
- /**
3890
- * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
3891
- * @member {boolean}
3892
- */
3893
- get autoDensity() {
3894
- return this.texture.source.autoDensity;
3895
- }
3896
- set autoDensity(value) {
3897
- this.texture.source.autoDensity = value;
3898
- }
3899
- /** The resolution / device pixel ratio of the renderer. */
3900
- get resolution() {
3901
- return this.texture.source._resolution;
3902
- }
3903
- set resolution(value) {
3904
- this.texture.source.resize(
3905
- this.texture.source.width,
3906
- this.texture.source.height,
3907
- value
3908
- );
3909
- }
3910
- /**
3911
- * initiates the view system
3912
- * @param options - the options for the view
3913
- */
3914
- init(options) {
3915
- options = {
3916
- ..._ViewSystem.defaultOptions,
3917
- ...options
3918
- };
3919
- if (options.view) {
3920
- (0,deprecation.deprecation)(deprecation.v8_0_0, "ViewSystem.view has been renamed to ViewSystem.canvas");
3921
- options.canvas = options.view;
3922
- }
3923
- this.screen = new Rectangle.Rectangle(0, 0, options.width, options.height);
3924
- this.canvas = options.canvas || adapter.DOMAdapter.get().createCanvas();
3925
- this.antialias = !!options.antialias;
3926
- this.texture = (0,getCanvasTexture.getCanvasTexture)(this.canvas, options);
3927
- this.renderTarget = new RenderTarget.RenderTarget({
3928
- colorTextures: [this.texture],
3929
- depth: !!options.depth,
3930
- isRoot: true
3931
- });
3932
- this.texture.source.transparent = options.backgroundAlpha < 1;
3933
- this.resolution = options.resolution;
3934
- }
3935
- /**
3936
- * Resizes the screen and canvas to the specified dimensions.
3937
- * @param desiredScreenWidth - The new width of the screen.
3938
- * @param desiredScreenHeight - The new height of the screen.
3939
- * @param resolution
3940
- */
3941
- resize(desiredScreenWidth, desiredScreenHeight, resolution) {
3942
- this.texture.source.resize(desiredScreenWidth, desiredScreenHeight, resolution);
3943
- this.screen.width = this.texture.frame.width;
3944
- this.screen.height = this.texture.frame.height;
3945
- }
3946
- /**
3947
- * Destroys this System and optionally removes the canvas from the dom.
3948
- * @param {options | false} options - The options for destroying the view, or "false".
3949
- * @param options.removeView - Whether to remove the view element from the DOM. Defaults to `false`.
3950
- */
3951
- destroy(options = false) {
3952
- const removeView = typeof options === "boolean" ? options : !!options?.removeView;
3953
- if (removeView && this.canvas.parentNode) {
3954
- this.canvas.parentNode.removeChild(this.canvas);
3955
- }
3956
- }
3957
- };
3958
- /** @ignore */
3959
- _ViewSystem.extension = {
3960
- type: [
3961
- Extensions.ExtensionType.WebGLSystem,
3962
- Extensions.ExtensionType.WebGPUSystem,
3963
- Extensions.ExtensionType.CanvasSystem
3964
- ],
3965
- name: "view",
3966
- priority: 0
3967
- };
3968
- /** The default options for the view system. */
3969
- _ViewSystem.defaultOptions = {
3970
- /**
3971
- * {@link WebGLOptions.width}
3972
- * @default 800
3973
- */
3974
- width: 800,
3975
- /**
3976
- * {@link WebGLOptions.height}
3977
- * @default 600
3978
- */
3979
- height: 600,
3980
- /**
3981
- * {@link WebGLOptions.autoDensity}
3982
- * @default false
3983
- */
3984
- autoDensity: false,
3985
- /**
3986
- * {@link WebGLOptions.antialias}
3987
- * @default false
3988
- */
3989
- antialias: false
3990
- };
3991
- let ViewSystem = _ViewSystem;
3992
-
3993
-
3994
- //# sourceMappingURL=ViewSystem.mjs.map
3995
-
3996
- ;// ./node_modules/pixi.js/lib/rendering/renderers/shared/system/SharedSystems.mjs
3997
-
3998
-
3999
-
4000
-
4001
-
4002
-
4003
-
4004
-
4005
-
4006
-
4007
-
4008
-
4009
-
4010
-
4011
-
4012
-
4013
-
4014
-
4015
-
4016
-
4017
- "use strict";
4018
- const SharedSystems = [
4019
- BackgroundSystem,
4020
- GlobalUniformSystem,
4021
- HelloSystem,
4022
- ViewSystem,
4023
- RenderGroupSystem,
4024
- TextureGCSystem,
4025
- GenerateTextureSystem,
4026
- ExtractSystem,
4027
- globalHooks.RendererInitHook,
4028
- RenderableGCSystem,
4029
- SchedulerSystem
4030
- ];
4031
- const SharedRenderPipes = [
4032
- BlendModePipe,
4033
- BatcherPipe,
4034
- SpritePipe,
4035
- RenderGroupPipe,
4036
- AlphaMaskPipe,
4037
- StencilMaskPipe,
4038
- ColorMaskPipe,
4039
- CustomRenderPipe
4040
- ];
4041
-
4042
-
4043
- //# sourceMappingURL=SharedSystems.mjs.map
4044
-
4045
-
4046
- /***/ }),
4047
-
4048
- /***/ 8725:
4049
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
4050
-
4051
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4052
- /* harmony export */ getCanvasTexture: () => (/* binding */ getCanvasTexture)
4053
- /* harmony export */ });
4054
- /* unused harmony export hasCachedCanvasTexture */
4055
- /* harmony import */ var _sources_CanvasSource_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4884);
4056
- /* harmony import */ var _Texture_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4492);
4057
-
4058
-
4059
-
4060
- "use strict";
4061
- const canvasCache = /* @__PURE__ */ new Map();
4062
- function getCanvasTexture(canvas, options) {
4063
- if (!canvasCache.has(canvas)) {
4064
- const texture = new _Texture_mjs__WEBPACK_IMPORTED_MODULE_0__.Texture({
4065
- source: new _sources_CanvasSource_mjs__WEBPACK_IMPORTED_MODULE_1__.CanvasSource({
4066
- resource: canvas,
4067
- ...options
4068
- })
4069
- });
4070
- const onDestroy = () => {
4071
- if (canvasCache.get(canvas) === texture) {
4072
- canvasCache.delete(canvas);
4073
- }
4074
- };
4075
- texture.once("destroy", onDestroy);
4076
- texture.source.once("destroy", onDestroy);
4077
- canvasCache.set(canvas, texture);
4078
- }
4079
- return canvasCache.get(canvas);
4080
- }
4081
- function hasCachedCanvasTexture(canvas) {
4082
- return canvasCache.has(canvas);
4083
- }
4084
-
4085
-
4086
- //# sourceMappingURL=getCanvasTexture.mjs.map
4087
-
4088
-
4089
- /***/ }),
4090
-
4091
- /***/ 2760:
4092
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
4093
-
4094
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4095
- /* harmony export */ color32BitToUniform: () => (/* binding */ color32BitToUniform)
4096
- /* harmony export */ });
4097
- /* unused harmony export colorToUniform */
4098
-
4099
- function colorToUniform(rgb, alpha, out, offset) {
4100
- out[offset++] = (rgb >> 16 & 255) / 255;
4101
- out[offset++] = (rgb >> 8 & 255) / 255;
4102
- out[offset++] = (rgb & 255) / 255;
4103
- out[offset++] = alpha;
4104
- }
4105
- function color32BitToUniform(abgr, out, offset) {
4106
- const alpha = (abgr >> 24 & 255) / 255;
4107
- out[offset++] = (abgr & 255) / 255 * alpha;
4108
- out[offset++] = (abgr >> 8 & 255) / 255 * alpha;
4109
- out[offset++] = (abgr >> 16 & 255) / 255 * alpha;
4110
- out[offset++] = alpha;
4111
- }
4112
-
4113
-
4114
- //# sourceMappingURL=colorToUniform.mjs.map
4115
-
4116
-
4117
- /***/ }),
4118
-
4119
- /***/ 8422:
4120
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
4121
-
4122
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4123
- /* harmony export */ BatchableSprite: () => (/* binding */ BatchableSprite)
4124
- /* harmony export */ });
4125
-
4126
- class BatchableSprite {
4127
- constructor() {
4128
- this.batcherName = "default";
4129
- this.topology = "triangle-list";
4130
- // batch specific..
4131
- this.attributeSize = 4;
4132
- this.indexSize = 6;
4133
- this.packAsQuad = true;
4134
- this.roundPixels = 0;
4135
- this._attributeStart = 0;
4136
- // location in the buffer
4137
- this._batcher = null;
4138
- this._batch = null;
4139
- }
4140
- get blendMode() {
4141
- return this.renderable.groupBlendMode;
4142
- }
4143
- get color() {
4144
- return this.renderable.groupColorAlpha;
4145
- }
4146
- reset() {
4147
- this.renderable = null;
4148
- this.texture = null;
4149
- this._batcher = null;
4150
- this._batch = null;
4151
- this.bounds = null;
4152
- }
4153
- }
4154
-
4155
-
4156
- //# sourceMappingURL=BatchableSprite.mjs.map
4157
-
4158
-
4159
- /***/ })
4160
-
4161
- };