modern-canvas 0.4.20 → 0.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1807 -1418
- package/dist/index.d.cts +183 -30
- package/dist/index.d.mts +183 -30
- package/dist/index.d.ts +183 -30
- package/dist/index.js +333 -246
- package/dist/index.mjs +1806 -1419
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2149,13 +2149,13 @@ class Vector3 extends Vector {
|
|
|
2149
2149
|
}
|
|
2150
2150
|
}
|
|
2151
2151
|
|
|
2152
|
-
var __defProp$
|
|
2153
|
-
var __decorateClass$
|
|
2152
|
+
var __defProp$L = Object.defineProperty;
|
|
2153
|
+
var __decorateClass$T = (decorators, target, key, kind) => {
|
|
2154
2154
|
var result = void 0 ;
|
|
2155
2155
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2156
2156
|
if (decorator = decorators[i])
|
|
2157
2157
|
result = (decorator(target, key, result) ) || result;
|
|
2158
|
-
if (result) __defProp$
|
|
2158
|
+
if (result) __defProp$L(target, key, result);
|
|
2159
2159
|
return result;
|
|
2160
2160
|
};
|
|
2161
2161
|
class MainLoop extends CoreObject {
|
|
@@ -2198,10 +2198,10 @@ class MainLoop extends CoreObject {
|
|
|
2198
2198
|
this.stop();
|
|
2199
2199
|
}
|
|
2200
2200
|
}
|
|
2201
|
-
__decorateClass$
|
|
2201
|
+
__decorateClass$T([
|
|
2202
2202
|
property({ default: 24 })
|
|
2203
2203
|
], MainLoop.prototype, "fps");
|
|
2204
|
-
__decorateClass$
|
|
2204
|
+
__decorateClass$T([
|
|
2205
2205
|
property({ default: 1 })
|
|
2206
2206
|
], MainLoop.prototype, "speed");
|
|
2207
2207
|
|
|
@@ -4503,13 +4503,13 @@ class Geometry extends Resource {
|
|
|
4503
4503
|
}
|
|
4504
4504
|
}
|
|
4505
4505
|
|
|
4506
|
-
var __defProp$
|
|
4507
|
-
var __decorateClass$
|
|
4506
|
+
var __defProp$K = Object.defineProperty;
|
|
4507
|
+
var __decorateClass$S = (decorators, target, key, kind) => {
|
|
4508
4508
|
var result = void 0 ;
|
|
4509
4509
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4510
4510
|
if (decorator = decorators[i])
|
|
4511
4511
|
result = (decorator(target, key, result) ) || result;
|
|
4512
|
-
if (result) __defProp$
|
|
4512
|
+
if (result) __defProp$K(target, key, result);
|
|
4513
4513
|
return result;
|
|
4514
4514
|
};
|
|
4515
4515
|
class IndexBuffer extends Resource {
|
|
@@ -4553,20 +4553,20 @@ class IndexBuffer extends Resource {
|
|
|
4553
4553
|
return result;
|
|
4554
4554
|
}
|
|
4555
4555
|
}
|
|
4556
|
-
__decorateClass$
|
|
4556
|
+
__decorateClass$S([
|
|
4557
4557
|
protectedProperty({ default: null })
|
|
4558
4558
|
], IndexBuffer.prototype, "data");
|
|
4559
|
-
__decorateClass$
|
|
4559
|
+
__decorateClass$S([
|
|
4560
4560
|
protectedProperty({ default: false })
|
|
4561
4561
|
], IndexBuffer.prototype, "dynamic");
|
|
4562
4562
|
|
|
4563
|
-
var __defProp$
|
|
4564
|
-
var __decorateClass$
|
|
4563
|
+
var __defProp$J = Object.defineProperty;
|
|
4564
|
+
var __decorateClass$R = (decorators, target, key, kind) => {
|
|
4565
4565
|
var result = void 0 ;
|
|
4566
4566
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4567
4567
|
if (decorator = decorators[i])
|
|
4568
4568
|
result = (decorator(target, key, result) ) || result;
|
|
4569
|
-
if (result) __defProp$
|
|
4569
|
+
if (result) __defProp$J(target, key, result);
|
|
4570
4570
|
return result;
|
|
4571
4571
|
};
|
|
4572
4572
|
class VertexBuffer extends Resource {
|
|
@@ -4610,20 +4610,20 @@ class VertexBuffer extends Resource {
|
|
|
4610
4610
|
return result;
|
|
4611
4611
|
}
|
|
4612
4612
|
}
|
|
4613
|
-
__decorateClass$
|
|
4613
|
+
__decorateClass$R([
|
|
4614
4614
|
protectedProperty({ default: null })
|
|
4615
4615
|
], VertexBuffer.prototype, "data");
|
|
4616
|
-
__decorateClass$
|
|
4616
|
+
__decorateClass$R([
|
|
4617
4617
|
protectedProperty({ default: false })
|
|
4618
4618
|
], VertexBuffer.prototype, "dynamic");
|
|
4619
4619
|
|
|
4620
|
-
var __defProp$
|
|
4621
|
-
var __decorateClass$
|
|
4620
|
+
var __defProp$I = Object.defineProperty;
|
|
4621
|
+
var __decorateClass$Q = (decorators, target, key, kind) => {
|
|
4622
4622
|
var result = void 0 ;
|
|
4623
4623
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4624
4624
|
if (decorator = decorators[i])
|
|
4625
4625
|
result = (decorator(target, key, result) ) || result;
|
|
4626
|
-
if (result) __defProp$
|
|
4626
|
+
if (result) __defProp$I(target, key, result);
|
|
4627
4627
|
return result;
|
|
4628
4628
|
};
|
|
4629
4629
|
class VertexAttribute extends Resource {
|
|
@@ -4660,25 +4660,25 @@ class VertexAttribute extends Resource {
|
|
|
4660
4660
|
return result;
|
|
4661
4661
|
}
|
|
4662
4662
|
}
|
|
4663
|
-
__decorateClass$
|
|
4663
|
+
__decorateClass$Q([
|
|
4664
4664
|
protectedProperty()
|
|
4665
4665
|
], VertexAttribute.prototype, "buffer");
|
|
4666
|
-
__decorateClass$
|
|
4666
|
+
__decorateClass$Q([
|
|
4667
4667
|
protectedProperty({ default: 0 })
|
|
4668
4668
|
], VertexAttribute.prototype, "size");
|
|
4669
|
-
__decorateClass$
|
|
4669
|
+
__decorateClass$Q([
|
|
4670
4670
|
protectedProperty({ default: false })
|
|
4671
4671
|
], VertexAttribute.prototype, "normalized");
|
|
4672
|
-
__decorateClass$
|
|
4672
|
+
__decorateClass$Q([
|
|
4673
4673
|
protectedProperty({ default: "float" })
|
|
4674
4674
|
], VertexAttribute.prototype, "type");
|
|
4675
|
-
__decorateClass$
|
|
4675
|
+
__decorateClass$Q([
|
|
4676
4676
|
protectedProperty()
|
|
4677
4677
|
], VertexAttribute.prototype, "stride");
|
|
4678
|
-
__decorateClass$
|
|
4678
|
+
__decorateClass$Q([
|
|
4679
4679
|
protectedProperty()
|
|
4680
4680
|
], VertexAttribute.prototype, "offset");
|
|
4681
|
-
__decorateClass$
|
|
4681
|
+
__decorateClass$Q([
|
|
4682
4682
|
protectedProperty()
|
|
4683
4683
|
], VertexAttribute.prototype, "divisor");
|
|
4684
4684
|
|
|
@@ -4922,13 +4922,13 @@ class UvGeometry extends Geometry {
|
|
|
4922
4922
|
}
|
|
4923
4923
|
}
|
|
4924
4924
|
|
|
4925
|
-
var __defProp$
|
|
4926
|
-
var __decorateClass$
|
|
4925
|
+
var __defProp$H = Object.defineProperty;
|
|
4926
|
+
var __decorateClass$P = (decorators, target, key, kind) => {
|
|
4927
4927
|
var result = void 0 ;
|
|
4928
4928
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4929
4929
|
if (decorator = decorators[i])
|
|
4930
4930
|
result = (decorator(target, key, result) ) || result;
|
|
4931
|
-
if (result) __defProp$
|
|
4931
|
+
if (result) __defProp$H(target, key, result);
|
|
4932
4932
|
return result;
|
|
4933
4933
|
};
|
|
4934
4934
|
class Texture2D extends Resource {
|
|
@@ -5054,22 +5054,22 @@ class Texture2D extends Resource {
|
|
|
5054
5054
|
}
|
|
5055
5055
|
}
|
|
5056
5056
|
}
|
|
5057
|
-
__decorateClass$
|
|
5057
|
+
__decorateClass$P([
|
|
5058
5058
|
protectedProperty()
|
|
5059
5059
|
], Texture2D.prototype, "source");
|
|
5060
|
-
__decorateClass$
|
|
5060
|
+
__decorateClass$P([
|
|
5061
5061
|
property({ default: 0 })
|
|
5062
5062
|
], Texture2D.prototype, "width");
|
|
5063
|
-
__decorateClass$
|
|
5063
|
+
__decorateClass$P([
|
|
5064
5064
|
property({ default: 0 })
|
|
5065
5065
|
], Texture2D.prototype, "height");
|
|
5066
|
-
__decorateClass$
|
|
5066
|
+
__decorateClass$P([
|
|
5067
5067
|
property({ default: "linear" })
|
|
5068
5068
|
], Texture2D.prototype, "filterMode");
|
|
5069
|
-
__decorateClass$
|
|
5069
|
+
__decorateClass$P([
|
|
5070
5070
|
property({ default: "clamp_to_edge" })
|
|
5071
5071
|
], Texture2D.prototype, "wrapMode");
|
|
5072
|
-
__decorateClass$
|
|
5072
|
+
__decorateClass$P([
|
|
5073
5073
|
property({ default: 1 })
|
|
5074
5074
|
], Texture2D.prototype, "pixelRatio");
|
|
5075
5075
|
|
|
@@ -5099,13 +5099,13 @@ class AnimatedTexture extends Resource {
|
|
|
5099
5099
|
}
|
|
5100
5100
|
}
|
|
5101
5101
|
|
|
5102
|
-
var __defProp$
|
|
5103
|
-
var __decorateClass$
|
|
5102
|
+
var __defProp$G = Object.defineProperty;
|
|
5103
|
+
var __decorateClass$O = (decorators, target, key, kind) => {
|
|
5104
5104
|
var result = void 0 ;
|
|
5105
5105
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
5106
5106
|
if (decorator = decorators[i])
|
|
5107
5107
|
result = (decorator(target, key, result) ) || result;
|
|
5108
|
-
if (result) __defProp$
|
|
5108
|
+
if (result) __defProp$G(target, key, result);
|
|
5109
5109
|
return result;
|
|
5110
5110
|
};
|
|
5111
5111
|
class CanvasTexture extends Texture2D {
|
|
@@ -5124,7 +5124,7 @@ class CanvasTexture extends Texture2D {
|
|
|
5124
5124
|
super._updateProperty(key, value, oldValue, declaration);
|
|
5125
5125
|
}
|
|
5126
5126
|
}
|
|
5127
|
-
__decorateClass$
|
|
5127
|
+
__decorateClass$O([
|
|
5128
5128
|
property({ default: 2 })
|
|
5129
5129
|
], CanvasTexture.prototype, "pixelRatio");
|
|
5130
5130
|
|
|
@@ -5286,13 +5286,13 @@ class PixelsTexture extends Texture2D {
|
|
|
5286
5286
|
}
|
|
5287
5287
|
}
|
|
5288
5288
|
|
|
5289
|
-
var __defProp$
|
|
5290
|
-
var __decorateClass$
|
|
5289
|
+
var __defProp$F = Object.defineProperty;
|
|
5290
|
+
var __decorateClass$N = (decorators, target, key, kind) => {
|
|
5291
5291
|
var result = void 0 ;
|
|
5292
5292
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
5293
5293
|
if (decorator = decorators[i])
|
|
5294
5294
|
result = (decorator(target, key, result) ) || result;
|
|
5295
|
-
if (result) __defProp$
|
|
5295
|
+
if (result) __defProp$F(target, key, result);
|
|
5296
5296
|
return result;
|
|
5297
5297
|
};
|
|
5298
5298
|
function resolveOptions(options) {
|
|
@@ -5536,10 +5536,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
|
|
|
5536
5536
|
}
|
|
5537
5537
|
}
|
|
5538
5538
|
};
|
|
5539
|
-
__decorateClass$
|
|
5539
|
+
__decorateClass$N([
|
|
5540
5540
|
protectedProperty({ default: true })
|
|
5541
5541
|
], _VideoTexture.prototype, "autoUpdate");
|
|
5542
|
-
__decorateClass$
|
|
5542
|
+
__decorateClass$N([
|
|
5543
5543
|
protectedProperty({ default: 0 })
|
|
5544
5544
|
], _VideoTexture.prototype, "fps");
|
|
5545
5545
|
let VideoTexture = _VideoTexture;
|
|
@@ -5548,14 +5548,14 @@ class ViewportTexture extends PixelsTexture {
|
|
|
5548
5548
|
//
|
|
5549
5549
|
}
|
|
5550
5550
|
|
|
5551
|
-
var __defProp$
|
|
5552
|
-
var __getOwnPropDesc$
|
|
5553
|
-
var __decorateClass$
|
|
5554
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5551
|
+
var __defProp$E = Object.defineProperty;
|
|
5552
|
+
var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
|
|
5553
|
+
var __decorateClass$M = (decorators, target, key, kind) => {
|
|
5554
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target;
|
|
5555
5555
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
5556
5556
|
if (decorator = decorators[i])
|
|
5557
5557
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5558
|
-
if (kind && result) __defProp$
|
|
5558
|
+
if (kind && result) __defProp$E(target, key, result);
|
|
5559
5559
|
return result;
|
|
5560
5560
|
};
|
|
5561
5561
|
const tagUidMap = {};
|
|
@@ -6060,36 +6060,36 @@ let Node = class extends CoreObject {
|
|
|
6060
6060
|
return node;
|
|
6061
6061
|
}
|
|
6062
6062
|
};
|
|
6063
|
-
__decorateClass$
|
|
6063
|
+
__decorateClass$M([
|
|
6064
6064
|
protectedProperty()
|
|
6065
6065
|
], Node.prototype, "name", 2);
|
|
6066
|
-
__decorateClass$
|
|
6066
|
+
__decorateClass$M([
|
|
6067
6067
|
property()
|
|
6068
6068
|
], Node.prototype, "mask", 2);
|
|
6069
|
-
__decorateClass$
|
|
6069
|
+
__decorateClass$M([
|
|
6070
6070
|
property({ default: "inherit" })
|
|
6071
6071
|
], Node.prototype, "processMode", 2);
|
|
6072
|
-
__decorateClass$
|
|
6072
|
+
__decorateClass$M([
|
|
6073
6073
|
property({ default: "default" })
|
|
6074
6074
|
], Node.prototype, "processSortMode", 2);
|
|
6075
|
-
__decorateClass$
|
|
6075
|
+
__decorateClass$M([
|
|
6076
6076
|
property({ default: "inherit" })
|
|
6077
6077
|
], Node.prototype, "renderMode", 2);
|
|
6078
|
-
__decorateClass$
|
|
6078
|
+
__decorateClass$M([
|
|
6079
6079
|
property({ default: "default" })
|
|
6080
6080
|
], Node.prototype, "internalMode", 2);
|
|
6081
|
-
Node = __decorateClass$
|
|
6081
|
+
Node = __decorateClass$M([
|
|
6082
6082
|
customNode("Node")
|
|
6083
6083
|
], Node);
|
|
6084
6084
|
|
|
6085
|
-
var __defProp$
|
|
6086
|
-
var __getOwnPropDesc$
|
|
6087
|
-
var __decorateClass$
|
|
6088
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6085
|
+
var __defProp$D = Object.defineProperty;
|
|
6086
|
+
var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
|
|
6087
|
+
var __decorateClass$L = (decorators, target, key, kind) => {
|
|
6088
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target;
|
|
6089
6089
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6090
6090
|
if (decorator = decorators[i])
|
|
6091
6091
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6092
|
-
if (kind && result) __defProp$
|
|
6092
|
+
if (kind && result) __defProp$D(target, key, result);
|
|
6093
6093
|
return result;
|
|
6094
6094
|
};
|
|
6095
6095
|
let TimelineNode = class extends Node {
|
|
@@ -6149,30 +6149,30 @@ let TimelineNode = class extends Node {
|
|
|
6149
6149
|
this._updateCurrentTime();
|
|
6150
6150
|
}
|
|
6151
6151
|
};
|
|
6152
|
-
__decorateClass$
|
|
6152
|
+
__decorateClass$L([
|
|
6153
6153
|
property({ default: 0 })
|
|
6154
6154
|
], TimelineNode.prototype, "delay", 2);
|
|
6155
|
-
__decorateClass$
|
|
6155
|
+
__decorateClass$L([
|
|
6156
6156
|
property({ default: 0 })
|
|
6157
6157
|
], TimelineNode.prototype, "duration", 2);
|
|
6158
|
-
__decorateClass$
|
|
6158
|
+
__decorateClass$L([
|
|
6159
6159
|
property({ default: false })
|
|
6160
6160
|
], TimelineNode.prototype, "paused", 2);
|
|
6161
|
-
__decorateClass$
|
|
6161
|
+
__decorateClass$L([
|
|
6162
6162
|
protectedProperty()
|
|
6163
6163
|
], TimelineNode.prototype, "insideTimeRange", 2);
|
|
6164
|
-
TimelineNode = __decorateClass$
|
|
6164
|
+
TimelineNode = __decorateClass$L([
|
|
6165
6165
|
customNode("TimelineNode")
|
|
6166
6166
|
], TimelineNode);
|
|
6167
6167
|
|
|
6168
|
-
var __defProp$
|
|
6169
|
-
var __getOwnPropDesc$
|
|
6170
|
-
var __decorateClass$
|
|
6171
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6168
|
+
var __defProp$C = Object.defineProperty;
|
|
6169
|
+
var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor;
|
|
6170
|
+
var __decorateClass$K = (decorators, target, key, kind) => {
|
|
6171
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target;
|
|
6172
6172
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6173
6173
|
if (decorator = decorators[i])
|
|
6174
6174
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6175
|
-
if (kind && result) __defProp$
|
|
6175
|
+
if (kind && result) __defProp$C(target, key, result);
|
|
6176
6176
|
return result;
|
|
6177
6177
|
};
|
|
6178
6178
|
let Viewport = class extends Node {
|
|
@@ -6310,30 +6310,30 @@ let Viewport = class extends Node {
|
|
|
6310
6310
|
return this._projection.toArray(transpose);
|
|
6311
6311
|
}
|
|
6312
6312
|
};
|
|
6313
|
-
__decorateClass$
|
|
6313
|
+
__decorateClass$K([
|
|
6314
6314
|
property({ default: 0 })
|
|
6315
6315
|
], Viewport.prototype, "x", 2);
|
|
6316
|
-
__decorateClass$
|
|
6316
|
+
__decorateClass$K([
|
|
6317
6317
|
property({ default: 0 })
|
|
6318
6318
|
], Viewport.prototype, "y", 2);
|
|
6319
|
-
__decorateClass$
|
|
6319
|
+
__decorateClass$K([
|
|
6320
6320
|
property({ default: 0 })
|
|
6321
6321
|
], Viewport.prototype, "width", 2);
|
|
6322
|
-
__decorateClass$
|
|
6322
|
+
__decorateClass$K([
|
|
6323
6323
|
property({ default: 0 })
|
|
6324
6324
|
], Viewport.prototype, "height", 2);
|
|
6325
|
-
Viewport = __decorateClass$
|
|
6325
|
+
Viewport = __decorateClass$K([
|
|
6326
6326
|
customNode("Viewport")
|
|
6327
6327
|
], Viewport);
|
|
6328
6328
|
|
|
6329
|
-
var __defProp$
|
|
6330
|
-
var __getOwnPropDesc$
|
|
6331
|
-
var __decorateClass$
|
|
6332
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6329
|
+
var __defProp$B = Object.defineProperty;
|
|
6330
|
+
var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor;
|
|
6331
|
+
var __decorateClass$J = (decorators, target, key, kind) => {
|
|
6332
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target;
|
|
6333
6333
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6334
6334
|
if (decorator = decorators[i])
|
|
6335
6335
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6336
|
-
if (kind && result) __defProp$
|
|
6336
|
+
if (kind && result) __defProp$B(target, key, result);
|
|
6337
6337
|
return result;
|
|
6338
6338
|
};
|
|
6339
6339
|
let Effect = class extends TimelineNode {
|
|
@@ -6574,158 +6574,39 @@ let Effect = class extends TimelineNode {
|
|
|
6574
6574
|
}
|
|
6575
6575
|
}
|
|
6576
6576
|
};
|
|
6577
|
-
__decorateClass$
|
|
6577
|
+
__decorateClass$J([
|
|
6578
6578
|
protectedProperty()
|
|
6579
6579
|
], Effect.prototype, "material", 2);
|
|
6580
|
-
__decorateClass$
|
|
6580
|
+
__decorateClass$J([
|
|
6581
6581
|
property()
|
|
6582
6582
|
], Effect.prototype, "effectMode", 2);
|
|
6583
|
-
__decorateClass$
|
|
6583
|
+
__decorateClass$J([
|
|
6584
6584
|
property({ default: "" })
|
|
6585
6585
|
], Effect.prototype, "glsl", 2);
|
|
6586
|
-
__decorateClass$
|
|
6586
|
+
__decorateClass$J([
|
|
6587
6587
|
property({ default: "" })
|
|
6588
6588
|
], Effect.prototype, "glslSrc", 2);
|
|
6589
|
-
Effect = __decorateClass$
|
|
6589
|
+
Effect = __decorateClass$J([
|
|
6590
6590
|
customNode("Effect")
|
|
6591
6591
|
], Effect);
|
|
6592
6592
|
|
|
6593
|
-
var __defProp$
|
|
6594
|
-
var __getOwnPropDesc$
|
|
6595
|
-
var __defNormalProp$
|
|
6596
|
-
var __decorateClass$
|
|
6597
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6598
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6599
|
-
if (decorator = decorators[i])
|
|
6600
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6601
|
-
if (kind && result) __defProp$w(target, key, result);
|
|
6602
|
-
return result;
|
|
6603
|
-
};
|
|
6604
|
-
var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6605
|
-
const vertX = `attribute vec2 position;
|
|
6606
|
-
attribute vec2 uv;
|
|
6607
|
-
varying vec2 vUv[9];
|
|
6608
|
-
uniform float strength;
|
|
6609
|
-
|
|
6610
|
-
void main(void) {
|
|
6611
|
-
gl_Position = vec4(position, 0, 1);
|
|
6612
|
-
vUv[0] = uv + vec2(-4.0 * strength, 0.0);
|
|
6613
|
-
vUv[1] = uv + vec2(-3.0 * strength, 0.0);
|
|
6614
|
-
vUv[2] = uv + vec2(-2.0 * strength, 0.0);
|
|
6615
|
-
vUv[3] = uv + vec2(-1.0 * strength, 0.0);
|
|
6616
|
-
vUv[4] = uv + vec2(0.0 * strength, 0.0);
|
|
6617
|
-
vUv[5] = uv + vec2(1.0 * strength, 0.0);
|
|
6618
|
-
vUv[6] = uv + vec2(2.0 * strength, 0.0);
|
|
6619
|
-
vUv[7] = uv + vec2(3.0 * strength, 0.0);
|
|
6620
|
-
vUv[8] = uv + vec2(4.0 * strength, 0.0);
|
|
6621
|
-
}`;
|
|
6622
|
-
const vertY = `attribute vec2 position;
|
|
6623
|
-
attribute vec2 uv;
|
|
6624
|
-
uniform float strength;
|
|
6625
|
-
varying vec2 vUv[9];
|
|
6626
|
-
|
|
6627
|
-
void main(void) {
|
|
6628
|
-
gl_Position = vec4(position, 0, 1);
|
|
6629
|
-
vUv[0] = uv + vec2(0.0, -4.0 * strength);
|
|
6630
|
-
vUv[1] = uv + vec2(0.0, -3.0 * strength);
|
|
6631
|
-
vUv[2] = uv + vec2(0.0, -2.0 * strength);
|
|
6632
|
-
vUv[3] = uv + vec2(0.0, -1.0 * strength);
|
|
6633
|
-
vUv[4] = uv + vec2(0.0, 0.0 * strength);
|
|
6634
|
-
vUv[5] = uv + vec2(0.0, 1.0 * strength);
|
|
6635
|
-
vUv[6] = uv + vec2(0.0, 2.0 * strength);
|
|
6636
|
-
vUv[7] = uv + vec2(0.0, 3.0 * strength);
|
|
6637
|
-
vUv[8] = uv + vec2(0.0, 4.0 * strength);
|
|
6638
|
-
}`;
|
|
6639
|
-
const frag = `varying vec2 vUv[9];
|
|
6640
|
-
uniform sampler2D sampler;
|
|
6641
|
-
|
|
6642
|
-
void main(void) {
|
|
6643
|
-
gl_FragColor = vec4(0.0);
|
|
6644
|
-
float flag = 0.0;
|
|
6645
|
-
for (int i = 0; i < 9; i++) {
|
|
6646
|
-
vec2 uv = vUv[i];
|
|
6647
|
-
if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {
|
|
6648
|
-
flag = 1.0;
|
|
6649
|
-
break;
|
|
6650
|
-
}
|
|
6651
|
-
}
|
|
6652
|
-
if (flag == 1.0) {
|
|
6653
|
-
gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;
|
|
6654
|
-
gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;
|
|
6655
|
-
gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;
|
|
6656
|
-
gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;
|
|
6657
|
-
gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;
|
|
6658
|
-
gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;
|
|
6659
|
-
gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;
|
|
6660
|
-
gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;
|
|
6661
|
-
gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;
|
|
6662
|
-
} else {
|
|
6663
|
-
gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;
|
|
6664
|
-
gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;
|
|
6665
|
-
gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;
|
|
6666
|
-
gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;
|
|
6667
|
-
gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;
|
|
6668
|
-
gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;
|
|
6669
|
-
gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;
|
|
6670
|
-
gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;
|
|
6671
|
-
gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;
|
|
6672
|
-
}
|
|
6673
|
-
}`;
|
|
6674
|
-
let BlurEffect = class extends Effect {
|
|
6675
|
-
apply(renderer, source) {
|
|
6676
|
-
source.redraw(renderer, () => {
|
|
6677
|
-
QuadUvGeometry.draw(renderer, BlurEffect.materialX, {
|
|
6678
|
-
sampler: 0,
|
|
6679
|
-
strength: 1 / source.width * this.strength / this.quality
|
|
6680
|
-
});
|
|
6681
|
-
});
|
|
6682
|
-
source.redraw(renderer, () => {
|
|
6683
|
-
QuadUvGeometry.draw(renderer, BlurEffect.materialY, {
|
|
6684
|
-
sampler: 0,
|
|
6685
|
-
strength: 1 / source.height * this.strength / this.quality
|
|
6686
|
-
});
|
|
6687
|
-
});
|
|
6688
|
-
}
|
|
6689
|
-
};
|
|
6690
|
-
__publicField$h(BlurEffect, "materialX", new Material({
|
|
6691
|
-
vert: vertX,
|
|
6692
|
-
frag
|
|
6693
|
-
}));
|
|
6694
|
-
__publicField$h(BlurEffect, "materialY", new Material({
|
|
6695
|
-
vert: vertY,
|
|
6696
|
-
frag
|
|
6697
|
-
}));
|
|
6698
|
-
__decorateClass$E([
|
|
6699
|
-
property({ default: 8 })
|
|
6700
|
-
], BlurEffect.prototype, "strength", 2);
|
|
6701
|
-
__decorateClass$E([
|
|
6702
|
-
property({ default: 4 })
|
|
6703
|
-
], BlurEffect.prototype, "quality", 2);
|
|
6704
|
-
BlurEffect = __decorateClass$E([
|
|
6705
|
-
customNode("BlurEffect")
|
|
6706
|
-
], BlurEffect);
|
|
6707
|
-
|
|
6708
|
-
var __defProp$v = Object.defineProperty;
|
|
6709
|
-
var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
|
|
6710
|
-
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6711
|
-
var __decorateClass$D = (decorators, target, key, kind) => {
|
|
6712
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
|
|
6593
|
+
var __defProp$A = Object.defineProperty;
|
|
6594
|
+
var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
|
|
6595
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6596
|
+
var __decorateClass$I = (decorators, target, key, kind) => {
|
|
6597
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target;
|
|
6713
6598
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6714
6599
|
if (decorator = decorators[i])
|
|
6715
6600
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6716
|
-
if (kind && result) __defProp$
|
|
6601
|
+
if (kind && result) __defProp$A(target, key, result);
|
|
6717
6602
|
return result;
|
|
6718
6603
|
};
|
|
6719
|
-
var __publicField$
|
|
6604
|
+
var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, key + "" , value);
|
|
6720
6605
|
let ColorAdjustEffect = class extends Effect {
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
green = 1;
|
|
6726
|
-
blue = 1;
|
|
6727
|
-
alpha = 1;
|
|
6728
|
-
gamma = 1;
|
|
6606
|
+
constructor(properties, children = []) {
|
|
6607
|
+
super();
|
|
6608
|
+
this.setProperties(properties).append(children);
|
|
6609
|
+
}
|
|
6729
6610
|
apply(renderer, source) {
|
|
6730
6611
|
source.redraw(renderer, () => {
|
|
6731
6612
|
QuadUvGeometry.draw(renderer, ColorAdjustEffect.material, {
|
|
@@ -6742,7 +6623,7 @@ let ColorAdjustEffect = class extends Effect {
|
|
|
6742
6623
|
});
|
|
6743
6624
|
}
|
|
6744
6625
|
};
|
|
6745
|
-
__publicField$
|
|
6626
|
+
__publicField$i(ColorAdjustEffect, "material", new Material({
|
|
6746
6627
|
vert: `precision mediump float;
|
|
6747
6628
|
attribute vec2 position;
|
|
6748
6629
|
attribute vec2 uv;
|
|
@@ -6777,51 +6658,51 @@ void main(void) {
|
|
|
6777
6658
|
gl_FragColor = c * alpha;
|
|
6778
6659
|
}`
|
|
6779
6660
|
}));
|
|
6780
|
-
__decorateClass$
|
|
6781
|
-
property()
|
|
6661
|
+
__decorateClass$I([
|
|
6662
|
+
property({ default: 1 })
|
|
6782
6663
|
], ColorAdjustEffect.prototype, "saturation", 2);
|
|
6783
|
-
__decorateClass$
|
|
6784
|
-
property()
|
|
6664
|
+
__decorateClass$I([
|
|
6665
|
+
property({ default: 1 })
|
|
6785
6666
|
], ColorAdjustEffect.prototype, "contrast", 2);
|
|
6786
|
-
__decorateClass$
|
|
6787
|
-
property()
|
|
6667
|
+
__decorateClass$I([
|
|
6668
|
+
property({ default: 1 })
|
|
6788
6669
|
], ColorAdjustEffect.prototype, "brightness", 2);
|
|
6789
|
-
__decorateClass$
|
|
6790
|
-
property()
|
|
6670
|
+
__decorateClass$I([
|
|
6671
|
+
property({ default: 1 })
|
|
6791
6672
|
], ColorAdjustEffect.prototype, "red", 2);
|
|
6792
|
-
__decorateClass$
|
|
6793
|
-
property()
|
|
6673
|
+
__decorateClass$I([
|
|
6674
|
+
property({ default: 1 })
|
|
6794
6675
|
], ColorAdjustEffect.prototype, "green", 2);
|
|
6795
|
-
__decorateClass$
|
|
6796
|
-
property()
|
|
6676
|
+
__decorateClass$I([
|
|
6677
|
+
property({ default: 1 })
|
|
6797
6678
|
], ColorAdjustEffect.prototype, "blue", 2);
|
|
6798
|
-
__decorateClass$
|
|
6799
|
-
property()
|
|
6679
|
+
__decorateClass$I([
|
|
6680
|
+
property({ default: 1 })
|
|
6800
6681
|
], ColorAdjustEffect.prototype, "alpha", 2);
|
|
6801
|
-
__decorateClass$
|
|
6802
|
-
property()
|
|
6682
|
+
__decorateClass$I([
|
|
6683
|
+
property({ default: 1 })
|
|
6803
6684
|
], ColorAdjustEffect.prototype, "gamma", 2);
|
|
6804
|
-
ColorAdjustEffect = __decorateClass$
|
|
6685
|
+
ColorAdjustEffect = __decorateClass$I([
|
|
6805
6686
|
customNode("ColorAdjustEffect")
|
|
6806
6687
|
], ColorAdjustEffect);
|
|
6807
6688
|
|
|
6808
|
-
var __defProp$
|
|
6809
|
-
var __getOwnPropDesc$
|
|
6810
|
-
var __defNormalProp$
|
|
6811
|
-
var __decorateClass$
|
|
6812
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6689
|
+
var __defProp$z = Object.defineProperty;
|
|
6690
|
+
var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
|
|
6691
|
+
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6692
|
+
var __decorateClass$H = (decorators, target, key, kind) => {
|
|
6693
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
|
|
6813
6694
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6814
6695
|
if (decorator = decorators[i])
|
|
6815
6696
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6816
|
-
if (kind && result) __defProp$
|
|
6697
|
+
if (kind && result) __defProp$z(target, key, result);
|
|
6817
6698
|
return result;
|
|
6818
6699
|
};
|
|
6819
|
-
var __publicField$
|
|
6700
|
+
var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
|
|
6820
6701
|
let ColorFilterEffect = class extends Effect {
|
|
6821
6702
|
_colorMatrix = new ColorMatrix();
|
|
6822
|
-
constructor(properties) {
|
|
6703
|
+
constructor(properties, children = []) {
|
|
6823
6704
|
super();
|
|
6824
|
-
this.setProperties(properties);
|
|
6705
|
+
this.setProperties(properties).append(children);
|
|
6825
6706
|
}
|
|
6826
6707
|
apply(renderer, source) {
|
|
6827
6708
|
if (!this.filter)
|
|
@@ -6866,7 +6747,7 @@ let ColorFilterEffect = class extends Effect {
|
|
|
6866
6747
|
});
|
|
6867
6748
|
}
|
|
6868
6749
|
};
|
|
6869
|
-
__publicField$
|
|
6750
|
+
__publicField$h(ColorFilterEffect, "material", new Material({
|
|
6870
6751
|
vert: `precision mediump float;
|
|
6871
6752
|
attribute vec2 position;
|
|
6872
6753
|
attribute vec2 uv;
|
|
@@ -6893,30 +6774,32 @@ void main(void) {
|
|
|
6893
6774
|
);
|
|
6894
6775
|
}`
|
|
6895
6776
|
}));
|
|
6896
|
-
__decorateClass$
|
|
6897
|
-
property(
|
|
6777
|
+
__decorateClass$H([
|
|
6778
|
+
property()
|
|
6898
6779
|
], ColorFilterEffect.prototype, "filter", 2);
|
|
6899
|
-
ColorFilterEffect = __decorateClass$
|
|
6780
|
+
ColorFilterEffect = __decorateClass$H([
|
|
6900
6781
|
customNode("ColorFilterEffect")
|
|
6901
6782
|
], ColorFilterEffect);
|
|
6902
6783
|
|
|
6903
|
-
var __defProp$
|
|
6904
|
-
var __getOwnPropDesc$
|
|
6905
|
-
var __defNormalProp$
|
|
6906
|
-
var __decorateClass$
|
|
6907
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6784
|
+
var __defProp$y = Object.defineProperty;
|
|
6785
|
+
var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
|
|
6786
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6787
|
+
var __decorateClass$G = (decorators, target, key, kind) => {
|
|
6788
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
|
|
6908
6789
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6909
6790
|
if (decorator = decorators[i])
|
|
6910
6791
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6911
|
-
if (kind && result) __defProp$
|
|
6792
|
+
if (kind && result) __defProp$y(target, key, result);
|
|
6912
6793
|
return result;
|
|
6913
6794
|
};
|
|
6914
|
-
var __publicField$
|
|
6795
|
+
var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
|
|
6915
6796
|
const MAX_COLORS$1 = 50;
|
|
6916
6797
|
let ColorOverlayEffect = class extends Effect {
|
|
6917
|
-
colors = [];
|
|
6918
|
-
alpha = 0.5;
|
|
6919
6798
|
_color = new Color();
|
|
6799
|
+
constructor(properties, children = []) {
|
|
6800
|
+
super();
|
|
6801
|
+
this.setProperties(properties).append(children);
|
|
6802
|
+
}
|
|
6920
6803
|
apply(renderer, source) {
|
|
6921
6804
|
source.redraw(renderer, () => {
|
|
6922
6805
|
const colors = this.colors.map((val) => {
|
|
@@ -6935,7 +6818,7 @@ let ColorOverlayEffect = class extends Effect {
|
|
|
6935
6818
|
});
|
|
6936
6819
|
}
|
|
6937
6820
|
};
|
|
6938
|
-
__publicField$
|
|
6821
|
+
__publicField$g(ColorOverlayEffect, "material", new Material({
|
|
6939
6822
|
vert: `precision mediump float;
|
|
6940
6823
|
attribute vec2 position;
|
|
6941
6824
|
attribute vec2 uv;
|
|
@@ -6982,32 +6865,34 @@ void main(void) {
|
|
|
6982
6865
|
gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
|
|
6983
6866
|
}`
|
|
6984
6867
|
}));
|
|
6985
|
-
__decorateClass$
|
|
6986
|
-
property()
|
|
6868
|
+
__decorateClass$G([
|
|
6869
|
+
property({ default: [] })
|
|
6987
6870
|
], ColorOverlayEffect.prototype, "colors", 2);
|
|
6988
|
-
__decorateClass$
|
|
6989
|
-
property()
|
|
6871
|
+
__decorateClass$G([
|
|
6872
|
+
property({ default: 0.5 })
|
|
6990
6873
|
], ColorOverlayEffect.prototype, "alpha", 2);
|
|
6991
|
-
ColorOverlayEffect = __decorateClass$
|
|
6874
|
+
ColorOverlayEffect = __decorateClass$G([
|
|
6992
6875
|
customNode("ColorOverlayEffect")
|
|
6993
6876
|
], ColorOverlayEffect);
|
|
6994
6877
|
|
|
6995
|
-
var __defProp$
|
|
6996
|
-
var __getOwnPropDesc$
|
|
6997
|
-
var __defNormalProp$
|
|
6998
|
-
var __decorateClass$
|
|
6999
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6878
|
+
var __defProp$x = Object.defineProperty;
|
|
6879
|
+
var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
|
|
6880
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6881
|
+
var __decorateClass$F = (decorators, target, key, kind) => {
|
|
6882
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
|
|
7000
6883
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7001
6884
|
if (decorator = decorators[i])
|
|
7002
6885
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7003
|
-
if (kind && result) __defProp$
|
|
6886
|
+
if (kind && result) __defProp$x(target, key, result);
|
|
7004
6887
|
return result;
|
|
7005
6888
|
};
|
|
7006
|
-
var __publicField$
|
|
6889
|
+
var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
|
|
7007
6890
|
let ColorRemoveEffect = class extends Effect {
|
|
7008
|
-
colors = [];
|
|
7009
|
-
epsilon = 0.5;
|
|
7010
6891
|
_color = new Color();
|
|
6892
|
+
constructor(properties, children = []) {
|
|
6893
|
+
super();
|
|
6894
|
+
this.setProperties(properties).append(children);
|
|
6895
|
+
}
|
|
7011
6896
|
apply(renderer, source) {
|
|
7012
6897
|
const maxColors = 50;
|
|
7013
6898
|
const originalColors = new Float32Array(maxColors * 3);
|
|
@@ -7032,7 +6917,7 @@ let ColorRemoveEffect = class extends Effect {
|
|
|
7032
6917
|
});
|
|
7033
6918
|
}
|
|
7034
6919
|
};
|
|
7035
|
-
__publicField$
|
|
6920
|
+
__publicField$f(ColorRemoveEffect, "material", new Material({
|
|
7036
6921
|
vert: `precision mediump float;
|
|
7037
6922
|
attribute vec2 position;
|
|
7038
6923
|
attribute vec2 uv;
|
|
@@ -7065,33 +6950,35 @@ void main(void) {
|
|
|
7065
6950
|
gl_FragColor = color;
|
|
7066
6951
|
}`
|
|
7067
6952
|
}));
|
|
7068
|
-
__decorateClass$
|
|
7069
|
-
property()
|
|
6953
|
+
__decorateClass$F([
|
|
6954
|
+
property({ default: [] })
|
|
7070
6955
|
], ColorRemoveEffect.prototype, "colors", 2);
|
|
7071
|
-
__decorateClass$
|
|
7072
|
-
property()
|
|
6956
|
+
__decorateClass$F([
|
|
6957
|
+
property({ default: 0.5 })
|
|
7073
6958
|
], ColorRemoveEffect.prototype, "epsilon", 2);
|
|
7074
|
-
ColorRemoveEffect = __decorateClass$
|
|
6959
|
+
ColorRemoveEffect = __decorateClass$F([
|
|
7075
6960
|
customNode("ColorRemoveEffect")
|
|
7076
6961
|
], ColorRemoveEffect);
|
|
7077
6962
|
|
|
7078
|
-
var __defProp$
|
|
7079
|
-
var __getOwnPropDesc$
|
|
7080
|
-
var __defNormalProp$
|
|
7081
|
-
var __decorateClass$
|
|
7082
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6963
|
+
var __defProp$w = Object.defineProperty;
|
|
6964
|
+
var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
|
|
6965
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6966
|
+
var __decorateClass$E = (decorators, target, key, kind) => {
|
|
6967
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
|
|
7083
6968
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7084
6969
|
if (decorator = decorators[i])
|
|
7085
6970
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7086
|
-
if (kind && result) __defProp$
|
|
6971
|
+
if (kind && result) __defProp$w(target, key, result);
|
|
7087
6972
|
return result;
|
|
7088
6973
|
};
|
|
7089
|
-
var __publicField$
|
|
6974
|
+
var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
|
|
7090
6975
|
const MAX_COLORS = 50;
|
|
7091
6976
|
let ColorReplaceEffect = class extends Effect {
|
|
7092
|
-
colors = [];
|
|
7093
|
-
epsilon = 0.05;
|
|
7094
6977
|
_color = new Color();
|
|
6978
|
+
constructor(properties, children = []) {
|
|
6979
|
+
super();
|
|
6980
|
+
this.setProperties(properties).append(children);
|
|
6981
|
+
}
|
|
7095
6982
|
apply(renderer, source) {
|
|
7096
6983
|
const colors = this.colors.map((val) => {
|
|
7097
6984
|
this._color.value = val[0];
|
|
@@ -7130,7 +7017,7 @@ let ColorReplaceEffect = class extends Effect {
|
|
|
7130
7017
|
});
|
|
7131
7018
|
}
|
|
7132
7019
|
};
|
|
7133
|
-
__publicField$
|
|
7020
|
+
__publicField$e(ColorReplaceEffect, "material", new Material({
|
|
7134
7021
|
vert: `precision mediump float;
|
|
7135
7022
|
attribute vec2 position;
|
|
7136
7023
|
attribute vec2 uv;
|
|
@@ -7170,335 +7057,742 @@ void main(void) {
|
|
|
7170
7057
|
}
|
|
7171
7058
|
}`
|
|
7172
7059
|
}));
|
|
7173
|
-
__decorateClass$
|
|
7174
|
-
property()
|
|
7060
|
+
__decorateClass$E([
|
|
7061
|
+
property({ default: [] })
|
|
7175
7062
|
], ColorReplaceEffect.prototype, "colors", 2);
|
|
7176
|
-
__decorateClass$
|
|
7177
|
-
property()
|
|
7063
|
+
__decorateClass$E([
|
|
7064
|
+
property({ default: 0.05 })
|
|
7178
7065
|
], ColorReplaceEffect.prototype, "epsilon", 2);
|
|
7179
|
-
ColorReplaceEffect = __decorateClass$
|
|
7066
|
+
ColorReplaceEffect = __decorateClass$E([
|
|
7180
7067
|
customNode("ColorReplaceEffect")
|
|
7181
7068
|
], ColorReplaceEffect);
|
|
7182
7069
|
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7070
|
+
class CanvasContext extends Path2D {
|
|
7071
|
+
textureTransform;
|
|
7072
|
+
fillStyle;
|
|
7073
|
+
strokeStyle;
|
|
7074
|
+
lineCap;
|
|
7075
|
+
lineJoin;
|
|
7076
|
+
lineWidth;
|
|
7077
|
+
miterLimit;
|
|
7078
|
+
_defaultStyle = Texture2D.EMPTY;
|
|
7079
|
+
_draws = [];
|
|
7080
|
+
stroke() {
|
|
7081
|
+
let texture = this._defaultStyle;
|
|
7082
|
+
if (this.strokeStyle) {
|
|
7083
|
+
if (this.strokeStyle instanceof Texture2D) {
|
|
7084
|
+
texture = this.strokeStyle;
|
|
7085
|
+
} else {
|
|
7086
|
+
texture = new ColorTexture(this.strokeStyle);
|
|
7087
|
+
}
|
|
7088
|
+
}
|
|
7089
|
+
if (this.curves.length) {
|
|
7090
|
+
this._draws.push({
|
|
7091
|
+
type: "stroke",
|
|
7092
|
+
path: new Path2D(this),
|
|
7093
|
+
texture,
|
|
7094
|
+
textureTransform: this.textureTransform,
|
|
7095
|
+
style: {
|
|
7096
|
+
alignment: 0.5,
|
|
7097
|
+
cap: this.lineCap ?? "butt",
|
|
7098
|
+
join: this.lineJoin ?? "miter",
|
|
7099
|
+
width: this.lineWidth ?? 1,
|
|
7100
|
+
miterLimit: this.miterLimit ?? 10
|
|
7101
|
+
}
|
|
7207
7102
|
});
|
|
7208
|
-
|
|
7103
|
+
super.reset();
|
|
7104
|
+
}
|
|
7209
7105
|
}
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
vert: `precision mediump float;
|
|
7213
|
-
attribute vec2 position;
|
|
7214
|
-
attribute vec2 uv;
|
|
7215
|
-
varying vec2 vUv;
|
|
7216
|
-
void main() {
|
|
7217
|
-
gl_Position = vec4(position, 0.0, 1.0);
|
|
7218
|
-
vUv = uv;
|
|
7219
|
-
}`,
|
|
7220
|
-
frag: `precision mediump float;
|
|
7221
|
-
uniform sampler2D sampler;
|
|
7222
|
-
uniform vec4 inputSize;
|
|
7223
|
-
uniform float strength;
|
|
7224
|
-
varying vec2 vUv;
|
|
7225
|
-
|
|
7226
|
-
void main(void) {
|
|
7227
|
-
vec2 onePixel = inputSize.zw;
|
|
7228
|
-
vec4 color;
|
|
7229
|
-
color.rgb = vec3(0.5);
|
|
7230
|
-
color -= texture2D(sampler, vUv - onePixel) * strength;
|
|
7231
|
-
color += texture2D(sampler, vUv + onePixel) * strength;
|
|
7232
|
-
color.rgb = vec3((color.r + color.g + color.b) / 3.0);
|
|
7233
|
-
float alpha = texture2D(sampler, vUv).a;
|
|
7234
|
-
gl_FragColor = vec4(color.rgb * alpha, alpha);
|
|
7235
|
-
}`
|
|
7236
|
-
}));
|
|
7237
|
-
__decorateClass$y([
|
|
7238
|
-
property()
|
|
7239
|
-
], EmbossEffect.prototype, "strength", 2);
|
|
7240
|
-
EmbossEffect = __decorateClass$y([
|
|
7241
|
-
customNode("EmbossEffect")
|
|
7242
|
-
], EmbossEffect);
|
|
7243
|
-
|
|
7244
|
-
var __defProp$p = Object.defineProperty;
|
|
7245
|
-
var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
|
|
7246
|
-
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7247
|
-
var __decorateClass$x = (decorators, target, key, kind) => {
|
|
7248
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
|
|
7249
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7250
|
-
if (decorator = decorators[i])
|
|
7251
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7252
|
-
if (kind && result) __defProp$p(target, key, result);
|
|
7253
|
-
return result;
|
|
7254
|
-
};
|
|
7255
|
-
var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
|
|
7256
|
-
let GlitchEffect = class extends Effect {
|
|
7257
|
-
_canvas;
|
|
7258
|
-
_texture;
|
|
7259
|
-
_sizes;
|
|
7260
|
-
_offsets;
|
|
7261
|
-
_needsRedraw = false;
|
|
7262
|
-
slices = 10;
|
|
7263
|
-
sampleSize = 512;
|
|
7264
|
-
offset = 100;
|
|
7265
|
-
direction = 0;
|
|
7266
|
-
fillMode = 2;
|
|
7267
|
-
seed = 0;
|
|
7268
|
-
red = [2, 2];
|
|
7269
|
-
green = [-10, 4];
|
|
7270
|
-
blue = [10, -4];
|
|
7271
|
-
constructor() {
|
|
7272
|
-
super();
|
|
7273
|
-
this._canvas = document.createElement("canvas");
|
|
7274
|
-
this._canvas.width = 4;
|
|
7275
|
-
this._canvas.height = this.sampleSize;
|
|
7276
|
-
this._texture = new Texture2D(this._canvas);
|
|
7277
|
-
this._sizes = new Float32Array(this.slices);
|
|
7278
|
-
this._offsets = new Float32Array(this.slices);
|
|
7106
|
+
fillRect(x, y, width, height) {
|
|
7107
|
+
this.rect(x, y, width, height).fill();
|
|
7279
7108
|
}
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
const texture = this._texture;
|
|
7283
|
-
const ctx = this._canvas.getContext("2d");
|
|
7284
|
-
ctx.clearRect(0, 0, 8, size);
|
|
7285
|
-
let offset;
|
|
7286
|
-
let y = 0;
|
|
7287
|
-
for (let i = 0; i < this.slices; i++) {
|
|
7288
|
-
offset = Math.floor(this._offsets[i] * 256);
|
|
7289
|
-
const height = this._sizes[i] * size;
|
|
7290
|
-
const red = offset > 0 ? offset : 0;
|
|
7291
|
-
const green = offset < 0 ? -offset : 0;
|
|
7292
|
-
ctx.fillStyle = `rgba(${red}, ${green}, 0, 1)`;
|
|
7293
|
-
ctx.fillRect(0, y >> 0, size, height + 1 >> 0);
|
|
7294
|
-
y += height;
|
|
7295
|
-
}
|
|
7296
|
-
texture.requestUpload();
|
|
7109
|
+
strokeRect(x, y, width, height) {
|
|
7110
|
+
this.rect(x, y, width, height).stroke();
|
|
7297
7111
|
}
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
this.
|
|
7112
|
+
fill() {
|
|
7113
|
+
let texture = this._defaultStyle;
|
|
7114
|
+
if (this.fillStyle) {
|
|
7115
|
+
if (this.fillStyle instanceof Texture2D) {
|
|
7116
|
+
texture = this.fillStyle;
|
|
7117
|
+
} else {
|
|
7118
|
+
texture = new ColorTexture(this.fillStyle);
|
|
7119
|
+
}
|
|
7302
7120
|
}
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
source.redraw(renderer, () => {
|
|
7309
|
-
this._texture.activate(renderer, 1);
|
|
7310
|
-
QuadUvGeometry.draw(renderer, GlitchEffect.material, {
|
|
7311
|
-
sampler: 0,
|
|
7312
|
-
filterClamp: [0, 0, 1, 1],
|
|
7313
|
-
filterArea: [width, height, 0, 0],
|
|
7314
|
-
dimensions: [width, height],
|
|
7315
|
-
aspect: height / width,
|
|
7316
|
-
displacementMap: 1,
|
|
7317
|
-
offset: this.offset,
|
|
7318
|
-
sinDir,
|
|
7319
|
-
cosDir,
|
|
7320
|
-
fillMode: this.fillMode,
|
|
7321
|
-
seed: this.seed,
|
|
7322
|
-
red: this.red,
|
|
7323
|
-
green: this.green,
|
|
7324
|
-
blue: this.blue
|
|
7325
|
-
});
|
|
7121
|
+
this._draws.push({
|
|
7122
|
+
type: "fill",
|
|
7123
|
+
path: new Path2D(this),
|
|
7124
|
+
texture,
|
|
7125
|
+
textureTransform: this.textureTransform
|
|
7326
7126
|
});
|
|
7127
|
+
super.reset();
|
|
7327
7128
|
}
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7129
|
+
copy(source) {
|
|
7130
|
+
super.copy(source);
|
|
7131
|
+
this.strokeStyle = source.strokeStyle;
|
|
7132
|
+
this.fillStyle = source.fillStyle;
|
|
7133
|
+
this.textureTransform = source.textureTransform;
|
|
7134
|
+
this.lineCap = source.lineCap;
|
|
7135
|
+
this.lineJoin = source.lineJoin;
|
|
7136
|
+
this.lineWidth = source.lineWidth;
|
|
7137
|
+
this.miterLimit = source.miterLimit;
|
|
7138
|
+
this._draws = source._draws.slice();
|
|
7139
|
+
return this;
|
|
7140
|
+
}
|
|
7141
|
+
reset() {
|
|
7142
|
+
super.reset();
|
|
7143
|
+
this.strokeStyle = void 0;
|
|
7144
|
+
this.fillStyle = void 0;
|
|
7145
|
+
this.textureTransform = void 0;
|
|
7146
|
+
this.lineCap = void 0;
|
|
7147
|
+
this.lineJoin = void 0;
|
|
7148
|
+
this.lineWidth = void 0;
|
|
7149
|
+
this.miterLimit = void 0;
|
|
7150
|
+
this._draws.length = 0;
|
|
7151
|
+
return this;
|
|
7152
|
+
}
|
|
7153
|
+
buildUvs(start, vertices, uvs, texture, textureTransform) {
|
|
7154
|
+
if (texture) {
|
|
7155
|
+
const w = texture.width;
|
|
7156
|
+
const h = texture.height;
|
|
7157
|
+
for (let len = vertices.length, i = start; i < len; i += 2) {
|
|
7158
|
+
const x = vertices[i];
|
|
7159
|
+
const y = vertices[i + 1];
|
|
7160
|
+
let uvX;
|
|
7161
|
+
let uvY;
|
|
7162
|
+
if (textureTransform) {
|
|
7163
|
+
[uvX, uvY] = textureTransform?.applyToPoint(x, y);
|
|
7164
|
+
} else {
|
|
7165
|
+
[uvX, uvY] = [x / w, y / h];
|
|
7166
|
+
}
|
|
7167
|
+
uvs.push(uvX, uvY);
|
|
7168
|
+
}
|
|
7169
|
+
} else {
|
|
7170
|
+
for (let len = vertices.length, i = start; i < len; i += 2) {
|
|
7171
|
+
uvs.push(0, 0);
|
|
7172
|
+
}
|
|
7173
|
+
}
|
|
7174
|
+
}
|
|
7175
|
+
toBatchables() {
|
|
7176
|
+
const batchables = [];
|
|
7177
|
+
let vertices = [];
|
|
7178
|
+
let indices = [];
|
|
7179
|
+
let uvs = [];
|
|
7180
|
+
let texture;
|
|
7181
|
+
const push = (type) => {
|
|
7182
|
+
batchables.push({
|
|
7183
|
+
type,
|
|
7184
|
+
vertices,
|
|
7185
|
+
indices,
|
|
7186
|
+
uvs,
|
|
7187
|
+
texture
|
|
7188
|
+
});
|
|
7189
|
+
vertices = [];
|
|
7190
|
+
indices = [];
|
|
7191
|
+
uvs = [];
|
|
7192
|
+
texture = void 0;
|
|
7193
|
+
};
|
|
7194
|
+
for (let len = this._draws.length, i = 0; i < len; i++) {
|
|
7195
|
+
const draw = this._draws[i];
|
|
7196
|
+
const prev = this._draws[i - 1];
|
|
7197
|
+
if (vertices.length && prev && prev?.type !== draw.type) {
|
|
7198
|
+
push(prev.type);
|
|
7199
|
+
}
|
|
7200
|
+
const oldTexture = texture;
|
|
7201
|
+
if (!oldTexture) {
|
|
7202
|
+
texture = draw.texture;
|
|
7203
|
+
}
|
|
7204
|
+
if (vertices.length && oldTexture !== draw.texture && !oldTexture?.is(draw.texture)) {
|
|
7205
|
+
push(draw.type);
|
|
7206
|
+
}
|
|
7207
|
+
const start = vertices.length;
|
|
7208
|
+
if (draw.type === "fill") {
|
|
7209
|
+
draw.path.fillTriangulate({
|
|
7210
|
+
vertices,
|
|
7211
|
+
indices
|
|
7212
|
+
});
|
|
7213
|
+
this.buildUvs(start, vertices, uvs, draw.texture, draw.textureTransform);
|
|
7214
|
+
} else {
|
|
7215
|
+
draw.path.strokeTriangulate({
|
|
7216
|
+
vertices,
|
|
7217
|
+
indices,
|
|
7218
|
+
lineStyle: draw.style,
|
|
7219
|
+
flipAlignment: false,
|
|
7220
|
+
closed: true
|
|
7221
|
+
});
|
|
7222
|
+
this.buildUvs(start, vertices, uvs, draw.texture, draw.textureTransform);
|
|
7223
|
+
}
|
|
7224
|
+
}
|
|
7225
|
+
const last = this._draws[this._draws.length - 1];
|
|
7226
|
+
if (last && vertices.length) {
|
|
7227
|
+
push(last.type);
|
|
7228
|
+
}
|
|
7229
|
+
return batchables;
|
|
7230
|
+
}
|
|
7231
|
+
}
|
|
7339
7232
|
|
|
7340
|
-
|
|
7341
|
-
|
|
7233
|
+
var __defProp$v = Object.defineProperty;
|
|
7234
|
+
var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
|
|
7235
|
+
var __decorateClass$D = (decorators, target, key, kind) => {
|
|
7236
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
|
|
7237
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7238
|
+
if (decorator = decorators[i])
|
|
7239
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7240
|
+
if (kind && result) __defProp$v(target, key, result);
|
|
7241
|
+
return result;
|
|
7242
|
+
};
|
|
7243
|
+
let CanvasItem = class extends TimelineNode {
|
|
7244
|
+
_parentGlobalVisible;
|
|
7245
|
+
_globalVisible;
|
|
7246
|
+
get globalVisible() {
|
|
7247
|
+
return this._globalVisible ?? true;
|
|
7248
|
+
}
|
|
7249
|
+
_parentGlobalOpacity;
|
|
7250
|
+
_globalOpacity;
|
|
7251
|
+
get globalOpacity() {
|
|
7252
|
+
return this._globalOpacity ?? 1;
|
|
7253
|
+
}
|
|
7254
|
+
_modulate = new Color(4294967295);
|
|
7255
|
+
_backgroundImage;
|
|
7256
|
+
// Batch render
|
|
7257
|
+
context = new CanvasContext();
|
|
7258
|
+
_resetContext = true;
|
|
7259
|
+
_redrawing = false;
|
|
7260
|
+
_relayouting = false;
|
|
7261
|
+
_repainting = false;
|
|
7262
|
+
_originalBatchables = [];
|
|
7263
|
+
_layoutedBatchables = [];
|
|
7264
|
+
_batchables = [];
|
|
7265
|
+
constructor(properties, nodes = []) {
|
|
7266
|
+
super();
|
|
7267
|
+
this.setProperties(properties).append(nodes);
|
|
7268
|
+
}
|
|
7269
|
+
_updateProperty(key, value, oldValue, declaration) {
|
|
7270
|
+
super._updateProperty(key, value, oldValue, declaration);
|
|
7271
|
+
switch (key) {
|
|
7272
|
+
case "modulate":
|
|
7273
|
+
this._modulate.value = value;
|
|
7274
|
+
this.requestRepaint();
|
|
7275
|
+
break;
|
|
7276
|
+
case "blendMode":
|
|
7277
|
+
this.requestRepaint();
|
|
7278
|
+
break;
|
|
7279
|
+
case "opacity":
|
|
7280
|
+
this._updateGlobalOpacity();
|
|
7281
|
+
break;
|
|
7282
|
+
case "visible":
|
|
7283
|
+
case "insideTimeRange":
|
|
7284
|
+
this._updateGlobalVisible();
|
|
7285
|
+
break;
|
|
7286
|
+
}
|
|
7287
|
+
}
|
|
7288
|
+
show() {
|
|
7289
|
+
this.visible = true;
|
|
7290
|
+
}
|
|
7291
|
+
hide() {
|
|
7292
|
+
this.visible = false;
|
|
7293
|
+
}
|
|
7294
|
+
isVisibleInTree() {
|
|
7295
|
+
return this.globalOpacity > 0 && this.globalVisible;
|
|
7296
|
+
}
|
|
7297
|
+
canRender() {
|
|
7298
|
+
return super.canRender() && this.isVisibleInTree();
|
|
7299
|
+
}
|
|
7300
|
+
requestRedraw() {
|
|
7301
|
+
this._redrawing = true;
|
|
7302
|
+
this.requestUpdate();
|
|
7303
|
+
}
|
|
7304
|
+
requestRelayout() {
|
|
7305
|
+
this._relayouting = true;
|
|
7306
|
+
this.requestUpdate();
|
|
7307
|
+
}
|
|
7308
|
+
requestRepaint() {
|
|
7309
|
+
this._repainting = true;
|
|
7310
|
+
this.requestUpdate();
|
|
7311
|
+
}
|
|
7312
|
+
_updateGlobalVisible() {
|
|
7313
|
+
this._parentGlobalVisible = this.getParent()?.globalVisible;
|
|
7314
|
+
this._globalVisible = (this._parentGlobalVisible ?? true) && this.visible && this.insideTimeRange;
|
|
7315
|
+
}
|
|
7316
|
+
_updateGlobalOpacity() {
|
|
7317
|
+
this._parentGlobalOpacity = this.getParent()?.opacity;
|
|
7318
|
+
const globalOpacity = clamp(0, this.opacity, 1) * (this._parentGlobalOpacity ?? 1);
|
|
7319
|
+
if (this._globalOpacity !== globalOpacity) {
|
|
7320
|
+
this._globalOpacity = globalOpacity;
|
|
7321
|
+
this.requestRepaint();
|
|
7322
|
+
}
|
|
7323
|
+
}
|
|
7324
|
+
_draw() {
|
|
7325
|
+
this.emit("draw");
|
|
7326
|
+
}
|
|
7327
|
+
_redraw() {
|
|
7328
|
+
this._tree?.log(this.name, "redrawing");
|
|
7329
|
+
this._draw();
|
|
7330
|
+
return this.context.toBatchables();
|
|
7331
|
+
}
|
|
7332
|
+
_relayout(batchables) {
|
|
7333
|
+
this._tree?.log(this.name, "relayouting");
|
|
7334
|
+
return batchables;
|
|
7335
|
+
}
|
|
7336
|
+
_repaint(batchables) {
|
|
7337
|
+
this._tree?.log(this.name, "repainting");
|
|
7338
|
+
return batchables.map((batchable) => {
|
|
7339
|
+
return {
|
|
7340
|
+
...batchable,
|
|
7341
|
+
modulate: this._modulate.toArgb(this.globalOpacity, true),
|
|
7342
|
+
blendMode: this.blendMode
|
|
7343
|
+
};
|
|
7344
|
+
});
|
|
7345
|
+
}
|
|
7346
|
+
_process(delta) {
|
|
7347
|
+
super._process(delta);
|
|
7348
|
+
const parent = this.getParent();
|
|
7349
|
+
if (this._parentGlobalVisible !== parent?.globalVisible) {
|
|
7350
|
+
this.requestUpdate();
|
|
7351
|
+
}
|
|
7352
|
+
if (this._parentGlobalOpacity !== parent?.globalOpacity) {
|
|
7353
|
+
this.requestUpdate();
|
|
7354
|
+
}
|
|
7355
|
+
}
|
|
7356
|
+
_update() {
|
|
7357
|
+
const parent = this.getParent();
|
|
7358
|
+
if (this._parentGlobalVisible !== parent?.globalVisible) {
|
|
7359
|
+
this._updateGlobalVisible();
|
|
7360
|
+
}
|
|
7361
|
+
if (this._parentGlobalOpacity !== parent?.globalOpacity) {
|
|
7362
|
+
this._updateGlobalOpacity();
|
|
7363
|
+
}
|
|
7364
|
+
const redrawing = this._redrawing;
|
|
7365
|
+
let relayouting = this._relayouting;
|
|
7366
|
+
let repainting = this._repainting;
|
|
7367
|
+
let batchables;
|
|
7368
|
+
if (redrawing) {
|
|
7369
|
+
this._originalBatchables = this._redraw();
|
|
7370
|
+
relayouting = true;
|
|
7371
|
+
}
|
|
7372
|
+
if (relayouting) {
|
|
7373
|
+
this._layoutedBatchables = this._relayout(this._originalBatchables);
|
|
7374
|
+
repainting = true;
|
|
7375
|
+
}
|
|
7376
|
+
if (repainting) {
|
|
7377
|
+
batchables = this._repaint(this._layoutedBatchables);
|
|
7378
|
+
}
|
|
7379
|
+
if (redrawing) {
|
|
7380
|
+
if (this._resetContext) {
|
|
7381
|
+
this.context.reset();
|
|
7382
|
+
}
|
|
7383
|
+
}
|
|
7384
|
+
if (batchables) {
|
|
7385
|
+
this._batchables = batchables;
|
|
7386
|
+
this._redrawing = false;
|
|
7387
|
+
this._relayouting = false;
|
|
7388
|
+
this._repainting = false;
|
|
7389
|
+
}
|
|
7390
|
+
}
|
|
7391
|
+
_render(renderer) {
|
|
7392
|
+
this._batchables.forEach((batchable) => {
|
|
7393
|
+
batchable.texture?.upload(renderer);
|
|
7394
|
+
renderer.batch2D.render({
|
|
7395
|
+
...batchable,
|
|
7396
|
+
texture: batchable.texture?._glTexture(renderer)
|
|
7397
|
+
});
|
|
7398
|
+
});
|
|
7399
|
+
super._render(renderer);
|
|
7400
|
+
}
|
|
7401
|
+
};
|
|
7402
|
+
__decorateClass$D([
|
|
7403
|
+
property()
|
|
7404
|
+
], CanvasItem.prototype, "modulate", 2);
|
|
7405
|
+
__decorateClass$D([
|
|
7406
|
+
property()
|
|
7407
|
+
], CanvasItem.prototype, "blendMode", 2);
|
|
7408
|
+
__decorateClass$D([
|
|
7409
|
+
protectedProperty({ default: true })
|
|
7410
|
+
], CanvasItem.prototype, "visible", 2);
|
|
7411
|
+
__decorateClass$D([
|
|
7412
|
+
protectedProperty({ default: 1 })
|
|
7413
|
+
], CanvasItem.prototype, "opacity", 2);
|
|
7414
|
+
CanvasItem = __decorateClass$D([
|
|
7415
|
+
customNode("CanvasItem")
|
|
7416
|
+
], CanvasItem);
|
|
7342
7417
|
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7418
|
+
class RenderStack {
|
|
7419
|
+
currentCall;
|
|
7420
|
+
calls = [];
|
|
7421
|
+
createCall(renderable) {
|
|
7422
|
+
return {
|
|
7423
|
+
renderable,
|
|
7424
|
+
parentCall: this.currentCall,
|
|
7425
|
+
fn: renderable.render.bind(renderable),
|
|
7426
|
+
calls: []
|
|
7427
|
+
};
|
|
7428
|
+
}
|
|
7429
|
+
push(renderable) {
|
|
7430
|
+
const call = this.createCall(renderable);
|
|
7431
|
+
(this.currentCall?.calls ?? this.calls).push(call);
|
|
7432
|
+
return call;
|
|
7433
|
+
}
|
|
7434
|
+
render(renderer) {
|
|
7435
|
+
this.calls.forEach(function render(call) {
|
|
7436
|
+
call.fn(renderer, () => {
|
|
7437
|
+
call.calls.forEach(render);
|
|
7438
|
+
});
|
|
7439
|
+
});
|
|
7440
|
+
this.calls = [];
|
|
7441
|
+
}
|
|
7442
|
+
}
|
|
7347
7443
|
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7444
|
+
var __defProp$u = Object.defineProperty;
|
|
7445
|
+
var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
|
|
7446
|
+
var __decorateClass$C = (decorators, target, key, kind) => {
|
|
7447
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
|
|
7448
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7449
|
+
if (decorator = decorators[i])
|
|
7450
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7451
|
+
if (kind && result) __defProp$u(target, key, result);
|
|
7452
|
+
return result;
|
|
7453
|
+
};
|
|
7454
|
+
let Timeline = class extends Node {
|
|
7455
|
+
static from(range, loop = false) {
|
|
7456
|
+
const [startTime, endTime] = range ? Array.isArray(range) ? range : [0, range] : [];
|
|
7457
|
+
return new Timeline({
|
|
7458
|
+
startTime,
|
|
7459
|
+
endTime,
|
|
7460
|
+
loop
|
|
7461
|
+
});
|
|
7462
|
+
}
|
|
7463
|
+
constructor(properties) {
|
|
7464
|
+
super();
|
|
7465
|
+
this.setProperties(properties);
|
|
7466
|
+
}
|
|
7467
|
+
_updateProperty(key, value, oldValue) {
|
|
7468
|
+
super._updateProperty(key, value, oldValue);
|
|
7469
|
+
switch (key) {
|
|
7470
|
+
case "startTime":
|
|
7471
|
+
this.startTime = Math.min(value, this.endTime);
|
|
7472
|
+
break;
|
|
7473
|
+
case "endTime":
|
|
7474
|
+
this.endTime = value || Number.MAX_SAFE_INTEGER;
|
|
7475
|
+
break;
|
|
7476
|
+
}
|
|
7477
|
+
}
|
|
7478
|
+
addTime(delta) {
|
|
7479
|
+
const start = this.startTime;
|
|
7480
|
+
const end = this.endTime;
|
|
7481
|
+
let current = this.currentTime;
|
|
7482
|
+
current = current + delta;
|
|
7483
|
+
if (this.loop && current > end) {
|
|
7484
|
+
current = start + current % end;
|
|
7485
|
+
}
|
|
7486
|
+
current = clamp(start, current, end);
|
|
7487
|
+
this.currentTime = current;
|
|
7488
|
+
this.emit("updateCurrentTime", current, delta);
|
|
7489
|
+
return this;
|
|
7490
|
+
}
|
|
7491
|
+
_process(delta) {
|
|
7492
|
+
super._process(delta);
|
|
7493
|
+
this.addTime(delta);
|
|
7494
|
+
}
|
|
7495
|
+
};
|
|
7496
|
+
__decorateClass$C([
|
|
7497
|
+
property({ default: 0 })
|
|
7498
|
+
], Timeline.prototype, "startTime", 2);
|
|
7499
|
+
__decorateClass$C([
|
|
7500
|
+
property({ default: 0 })
|
|
7501
|
+
], Timeline.prototype, "currentTime", 2);
|
|
7502
|
+
__decorateClass$C([
|
|
7503
|
+
property({ default: Number.MAX_SAFE_INTEGER })
|
|
7504
|
+
], Timeline.prototype, "endTime", 2);
|
|
7505
|
+
__decorateClass$C([
|
|
7506
|
+
property({ default: false })
|
|
7507
|
+
], Timeline.prototype, "loop", 2);
|
|
7508
|
+
Timeline = __decorateClass$C([
|
|
7509
|
+
customNode("Timeline")
|
|
7510
|
+
], Timeline);
|
|
7511
|
+
|
|
7512
|
+
var __defProp$t = Object.defineProperty;
|
|
7513
|
+
var __decorateClass$B = (decorators, target, key, kind) => {
|
|
7514
|
+
var result = void 0 ;
|
|
7515
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7516
|
+
if (decorator = decorators[i])
|
|
7517
|
+
result = (decorator(target, key, result) ) || result;
|
|
7518
|
+
if (result) __defProp$t(target, key, result);
|
|
7519
|
+
return result;
|
|
7520
|
+
};
|
|
7521
|
+
class SceneTree extends MainLoop {
|
|
7522
|
+
input = new Input();
|
|
7523
|
+
renderStack = new RenderStack();
|
|
7524
|
+
root = new Viewport(true).setTree(this);
|
|
7525
|
+
timeline;
|
|
7526
|
+
_backgroundColor = new Color();
|
|
7527
|
+
_currentViewport;
|
|
7528
|
+
getCurrentViewport() {
|
|
7529
|
+
return this._currentViewport;
|
|
7530
|
+
}
|
|
7531
|
+
setCurrentViewport(viewport) {
|
|
7532
|
+
this._currentViewport = viewport;
|
|
7533
|
+
}
|
|
7534
|
+
constructor(timeline = new Timeline()) {
|
|
7535
|
+
super();
|
|
7536
|
+
this.timeline = timeline.setTree(this);
|
|
7537
|
+
}
|
|
7538
|
+
_updateProperty(key, value, oldValue, declaration) {
|
|
7539
|
+
super._updateProperty(key, value, oldValue, declaration);
|
|
7540
|
+
switch (key) {
|
|
7541
|
+
case "backgroundColor":
|
|
7542
|
+
this._backgroundColor.value = value;
|
|
7543
|
+
break;
|
|
7544
|
+
}
|
|
7545
|
+
}
|
|
7546
|
+
log(...args) {
|
|
7547
|
+
if (this.debug) {
|
|
7548
|
+
console.log(`[modern-canvas]`, ...args);
|
|
7549
|
+
}
|
|
7550
|
+
}
|
|
7551
|
+
_process(delta = 0) {
|
|
7552
|
+
this.timeline.emit("process", delta);
|
|
7553
|
+
this.emit("processing");
|
|
7554
|
+
this.root.emit("process", delta);
|
|
7555
|
+
this.emit("processed");
|
|
7556
|
+
}
|
|
7557
|
+
_render(renderer) {
|
|
7558
|
+
this.emit("rendering");
|
|
7559
|
+
renderer.program.uniforms.projectionMatrix = this.root.toProjectionArray(true);
|
|
7560
|
+
this.renderStack.render(renderer);
|
|
7561
|
+
this._renderScreen(renderer);
|
|
7562
|
+
this.emit("rendered");
|
|
7563
|
+
}
|
|
7564
|
+
_renderScreen(renderer) {
|
|
7565
|
+
renderer.state.reset();
|
|
7566
|
+
renderer.framebuffer.bind(null);
|
|
7567
|
+
renderer.viewport.bind({
|
|
7568
|
+
x: 0,
|
|
7569
|
+
y: 0,
|
|
7570
|
+
width: this.root.width * renderer.pixelRatio,
|
|
7571
|
+
height: this.root.height * renderer.pixelRatio
|
|
7572
|
+
});
|
|
7573
|
+
if (this.backgroundColor) {
|
|
7574
|
+
renderer.gl.clearColor(...this._backgroundColor.toArray());
|
|
7575
|
+
}
|
|
7576
|
+
renderer.clear();
|
|
7577
|
+
if (this.backgroundColor) {
|
|
7578
|
+
renderer.gl.clearColor(0, 0, 0, 0);
|
|
7579
|
+
}
|
|
7580
|
+
const texture = this.root.texture;
|
|
7581
|
+
texture.activate(renderer, 0);
|
|
7582
|
+
QuadUvGeometry.draw(renderer);
|
|
7583
|
+
renderer.texture.unbind(texture);
|
|
7584
|
+
}
|
|
7585
|
+
free() {
|
|
7586
|
+
super.free();
|
|
7587
|
+
this.root.getChildren(true).forEach((node) => this.root.removeChild(node));
|
|
7588
|
+
this.input.removeEventListeners();
|
|
7589
|
+
}
|
|
7590
|
+
}
|
|
7591
|
+
__decorateClass$B([
|
|
7592
|
+
property({ default: false })
|
|
7593
|
+
], SceneTree.prototype, "processPaused");
|
|
7594
|
+
__decorateClass$B([
|
|
7595
|
+
property()
|
|
7596
|
+
], SceneTree.prototype, "backgroundColor");
|
|
7597
|
+
__decorateClass$B([
|
|
7598
|
+
protectedProperty({ default: false })
|
|
7599
|
+
], SceneTree.prototype, "debug");
|
|
7353
7600
|
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7601
|
+
var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
|
|
7602
|
+
var __decorateClass$A = (decorators, target, key, kind) => {
|
|
7603
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
|
|
7604
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7605
|
+
if (decorator = decorators[i])
|
|
7606
|
+
result = (decorator(result)) || result;
|
|
7607
|
+
return result;
|
|
7608
|
+
};
|
|
7609
|
+
let Transition = class extends Effect {
|
|
7610
|
+
constructor(properties, children = []) {
|
|
7611
|
+
super();
|
|
7612
|
+
this.setProperties(properties).append(children);
|
|
7613
|
+
}
|
|
7614
|
+
};
|
|
7615
|
+
Transition = __decorateClass$A([
|
|
7616
|
+
customNode("Transition", {
|
|
7617
|
+
effectMode: "transition",
|
|
7618
|
+
processMode: "pausable",
|
|
7619
|
+
duration: 2e3
|
|
7620
|
+
})
|
|
7621
|
+
], Transition);
|
|
7358
7622
|
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7623
|
+
var __defProp$s = Object.defineProperty;
|
|
7624
|
+
var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
|
|
7625
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7626
|
+
var __decorateClass$z = (decorators, target, key, kind) => {
|
|
7627
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
|
|
7628
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7629
|
+
if (decorator = decorators[i])
|
|
7630
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7631
|
+
if (kind && result) __defProp$s(target, key, result);
|
|
7632
|
+
return result;
|
|
7633
|
+
};
|
|
7634
|
+
var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7635
|
+
const frag$2 = `varying vec2 vUv[9];
|
|
7636
|
+
uniform sampler2D sampler;
|
|
7364
7637
|
|
|
7365
7638
|
void main(void) {
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7639
|
+
gl_FragColor = vec4(0.0);
|
|
7640
|
+
float flag = 0.0;
|
|
7641
|
+
for (int i = 0; i < 9; i++) {
|
|
7642
|
+
vec2 uv = vUv[i];
|
|
7643
|
+
if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {
|
|
7644
|
+
flag = 1.0;
|
|
7645
|
+
break;
|
|
7646
|
+
}
|
|
7370
7647
|
}
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
vec4 dc = texture2D(displacementMap, vec2(0.5, ny));
|
|
7383
|
-
|
|
7384
|
-
float displacement = (dc.r - dc.g) * (offset / filterArea.x);
|
|
7385
|
-
|
|
7386
|
-
coord = vUv + vec2(cosDir * displacement, sinDir * displacement * aspect);
|
|
7387
|
-
|
|
7388
|
-
if (fillMode == CLAMP) {
|
|
7389
|
-
coord = clamp(coord, filterClamp.xy, filterClamp.zw);
|
|
7648
|
+
if (flag == 1.0) {
|
|
7649
|
+
gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;
|
|
7650
|
+
gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;
|
|
7651
|
+
gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;
|
|
7652
|
+
gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;
|
|
7653
|
+
gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;
|
|
7654
|
+
gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;
|
|
7655
|
+
gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;
|
|
7656
|
+
gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;
|
|
7657
|
+
gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;
|
|
7390
7658
|
} else {
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7659
|
+
gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;
|
|
7660
|
+
gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;
|
|
7661
|
+
gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;
|
|
7662
|
+
gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;
|
|
7663
|
+
gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;
|
|
7664
|
+
gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;
|
|
7665
|
+
gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;
|
|
7666
|
+
gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;
|
|
7667
|
+
gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;
|
|
7668
|
+
}
|
|
7669
|
+
}`;
|
|
7670
|
+
let GaussianBlurEffect = class extends Effect {
|
|
7671
|
+
constructor(properties, children = []) {
|
|
7672
|
+
super();
|
|
7673
|
+
this.setProperties(properties).append(children);
|
|
7674
|
+
}
|
|
7675
|
+
apply(renderer, source) {
|
|
7676
|
+
const sx = 1 / source.width;
|
|
7677
|
+
const sy = 1 / source.height;
|
|
7678
|
+
const quality = Math.max(this.quality, 1);
|
|
7679
|
+
for (let i = 0; i < quality; i++) {
|
|
7680
|
+
source.redraw(renderer, () => {
|
|
7681
|
+
QuadUvGeometry.draw(renderer, GaussianBlurEffect.materialX, {
|
|
7682
|
+
sampler: 0,
|
|
7683
|
+
uStrength: sx * (this.strength / quality)
|
|
7684
|
+
});
|
|
7685
|
+
});
|
|
7407
7686
|
}
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
}
|
|
7415
|
-
coord.y = filterClamp.w * 2.0 - coord.y;
|
|
7416
|
-
}
|
|
7417
|
-
} else if (coord.y < filterClamp.y) {
|
|
7418
|
-
if (fillMode == TRANSPARENT) {
|
|
7419
|
-
discard;
|
|
7420
|
-
} else if (fillMode == LOOP) {
|
|
7421
|
-
coord.y += filterClamp.w;
|
|
7422
|
-
} else if (fillMode == MIRROR) {
|
|
7423
|
-
coord.y *= -filterClamp.w;
|
|
7424
|
-
}
|
|
7687
|
+
for (let i = 0; i < quality; i++) {
|
|
7688
|
+
source.redraw(renderer, () => {
|
|
7689
|
+
QuadUvGeometry.draw(renderer, GaussianBlurEffect.materialY, {
|
|
7690
|
+
sampler: 0,
|
|
7691
|
+
uStrength: sy * (this.strength / quality)
|
|
7692
|
+
});
|
|
7693
|
+
});
|
|
7425
7694
|
}
|
|
7426
7695
|
}
|
|
7696
|
+
};
|
|
7697
|
+
__publicField$d(GaussianBlurEffect, "materialX", new Material({
|
|
7698
|
+
vert: `attribute vec2 position;
|
|
7699
|
+
attribute vec2 uv;
|
|
7700
|
+
uniform float uStrength;
|
|
7701
|
+
varying vec2 vUv[9];
|
|
7427
7702
|
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7703
|
+
void main(void) {
|
|
7704
|
+
gl_Position = vec4(position, 0, 1);
|
|
7705
|
+
vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);
|
|
7706
|
+
vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);
|
|
7707
|
+
vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);
|
|
7708
|
+
vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);
|
|
7709
|
+
vUv[4] = uv + vec2(0.0 * uStrength, 0.0);
|
|
7710
|
+
vUv[5] = uv + vec2(1.0 * uStrength, 0.0);
|
|
7711
|
+
vUv[6] = uv + vec2(2.0 * uStrength, 0.0);
|
|
7712
|
+
vUv[7] = uv + vec2(3.0 * uStrength, 0.0);
|
|
7713
|
+
vUv[8] = uv + vec2(4.0 * uStrength, 0.0);
|
|
7714
|
+
}`,
|
|
7715
|
+
frag: frag$2
|
|
7433
7716
|
}));
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
], GlitchEffect.prototype, "sampleSize", 2);
|
|
7440
|
-
__decorateClass$x([
|
|
7441
|
-
property()
|
|
7442
|
-
], GlitchEffect.prototype, "offset", 2);
|
|
7443
|
-
__decorateClass$x([
|
|
7444
|
-
property()
|
|
7445
|
-
], GlitchEffect.prototype, "direction", 2);
|
|
7446
|
-
__decorateClass$x([
|
|
7447
|
-
property()
|
|
7448
|
-
], GlitchEffect.prototype, "fillMode", 2);
|
|
7449
|
-
__decorateClass$x([
|
|
7450
|
-
property()
|
|
7451
|
-
], GlitchEffect.prototype, "seed", 2);
|
|
7452
|
-
__decorateClass$x([
|
|
7453
|
-
property()
|
|
7454
|
-
], GlitchEffect.prototype, "red", 2);
|
|
7455
|
-
__decorateClass$x([
|
|
7456
|
-
property()
|
|
7457
|
-
], GlitchEffect.prototype, "green", 2);
|
|
7458
|
-
__decorateClass$x([
|
|
7459
|
-
property()
|
|
7460
|
-
], GlitchEffect.prototype, "blue", 2);
|
|
7461
|
-
GlitchEffect = __decorateClass$x([
|
|
7462
|
-
customNode("GlitchEffect")
|
|
7463
|
-
], GlitchEffect);
|
|
7717
|
+
__publicField$d(GaussianBlurEffect, "materialY", new Material({
|
|
7718
|
+
vert: `attribute vec2 position;
|
|
7719
|
+
attribute vec2 uv;
|
|
7720
|
+
uniform float uStrength;
|
|
7721
|
+
varying vec2 vUv[9];
|
|
7464
7722
|
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7723
|
+
void main(void) {
|
|
7724
|
+
gl_Position = vec4(position, 0, 1);
|
|
7725
|
+
vUv[0] = uv + vec2(0.0, -4.0 * uStrength);
|
|
7726
|
+
vUv[1] = uv + vec2(0.0, -3.0 * uStrength);
|
|
7727
|
+
vUv[2] = uv + vec2(0.0, -2.0 * uStrength);
|
|
7728
|
+
vUv[3] = uv + vec2(0.0, -1.0 * uStrength);
|
|
7729
|
+
vUv[4] = uv + vec2(0.0, 0.0 * uStrength);
|
|
7730
|
+
vUv[5] = uv + vec2(0.0, 1.0 * uStrength);
|
|
7731
|
+
vUv[6] = uv + vec2(0.0, 2.0 * uStrength);
|
|
7732
|
+
vUv[7] = uv + vec2(0.0, 3.0 * uStrength);
|
|
7733
|
+
vUv[8] = uv + vec2(0.0, 4.0 * uStrength);
|
|
7734
|
+
}`,
|
|
7735
|
+
frag: frag$2
|
|
7736
|
+
}));
|
|
7737
|
+
__decorateClass$z([
|
|
7738
|
+
property({ default: 4 })
|
|
7739
|
+
], GaussianBlurEffect.prototype, "strength", 2);
|
|
7740
|
+
__decorateClass$z([
|
|
7741
|
+
property({ default: 3 })
|
|
7742
|
+
], GaussianBlurEffect.prototype, "quality", 2);
|
|
7743
|
+
GaussianBlurEffect = __decorateClass$z([
|
|
7744
|
+
customNode("GaussianBlurEffect")
|
|
7745
|
+
], GaussianBlurEffect);
|
|
7746
|
+
|
|
7747
|
+
var __defProp$r = Object.defineProperty;
|
|
7748
|
+
var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
|
|
7749
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7750
|
+
var __decorateClass$y = (decorators, target, key, kind) => {
|
|
7751
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
|
|
7470
7752
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7471
7753
|
if (decorator = decorators[i])
|
|
7472
7754
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7473
|
-
if (kind && result) __defProp$
|
|
7755
|
+
if (kind && result) __defProp$r(target, key, result);
|
|
7474
7756
|
return result;
|
|
7475
7757
|
};
|
|
7476
|
-
var __publicField$
|
|
7477
|
-
let
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7758
|
+
var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
|
|
7759
|
+
let DropShadowEffect = class extends Effect {
|
|
7760
|
+
blurEffect = new GaussianBlurEffect();
|
|
7761
|
+
viewport3 = new Viewport();
|
|
7762
|
+
_color = new Color();
|
|
7763
|
+
constructor(properties, children = []) {
|
|
7764
|
+
super();
|
|
7765
|
+
this.setProperties(properties).append(children);
|
|
7766
|
+
}
|
|
7484
7767
|
apply(renderer, source) {
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
QuadUvGeometry.draw(renderer,
|
|
7768
|
+
this.viewport3.activateWithCopy(renderer, source);
|
|
7769
|
+
this.viewport3.redraw(renderer, () => {
|
|
7770
|
+
this._color.value = this.color;
|
|
7771
|
+
QuadUvGeometry.draw(renderer, DropShadowEffect.material, {
|
|
7489
7772
|
sampler: 0,
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7773
|
+
uAlpha: this._color.a,
|
|
7774
|
+
uColor: this._color.toArray().slice(0, 3),
|
|
7775
|
+
uOffset: [-this.offsetX, this.offsetY],
|
|
7776
|
+
uInputSize: [source.width, source.height, 1 / source.width, 1 / source.height]
|
|
7777
|
+
});
|
|
7778
|
+
});
|
|
7779
|
+
this.blurEffect.strength = this.blur;
|
|
7780
|
+
this.blurEffect.apply(renderer, this.viewport3);
|
|
7781
|
+
source.redraw(renderer, () => {
|
|
7782
|
+
this.viewport3.texture.activate(renderer, 1);
|
|
7783
|
+
QuadUvGeometry.draw(renderer, UvMaterial.instance, {
|
|
7784
|
+
sampler: 1
|
|
7497
7785
|
});
|
|
7786
|
+
if (!this.shadowOnly) {
|
|
7787
|
+
QuadUvGeometry.draw(renderer, UvMaterial.instance, {
|
|
7788
|
+
sampler: 0
|
|
7789
|
+
});
|
|
7790
|
+
}
|
|
7791
|
+
renderer.texture.unbind(1);
|
|
7498
7792
|
});
|
|
7499
7793
|
}
|
|
7500
7794
|
};
|
|
7501
|
-
__publicField$
|
|
7795
|
+
__publicField$c(DropShadowEffect, "material", new Material({
|
|
7502
7796
|
vert: `precision mediump float;
|
|
7503
7797
|
attribute vec2 position;
|
|
7504
7798
|
attribute vec2 uv;
|
|
@@ -7507,204 +7801,68 @@ void main() {
|
|
|
7507
7801
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
7508
7802
|
vUv = uv;
|
|
7509
7803
|
}`,
|
|
7510
|
-
frag: `
|
|
7804
|
+
frag: `precision highp float;
|
|
7805
|
+
varying vec2 vUv;
|
|
7511
7806
|
uniform sampler2D sampler;
|
|
7512
|
-
uniform
|
|
7513
|
-
uniform
|
|
7514
|
-
uniform
|
|
7515
|
-
uniform
|
|
7516
|
-
uniform float gain;
|
|
7517
|
-
uniform float lacunarity;
|
|
7518
|
-
uniform float uTime;
|
|
7519
|
-
uniform float alpha;
|
|
7520
|
-
|
|
7521
|
-
vec3 mod289(vec3 x) {
|
|
7522
|
-
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
|
7523
|
-
}
|
|
7524
|
-
|
|
7525
|
-
vec4 mod289(vec4 x) {
|
|
7526
|
-
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
|
7527
|
-
}
|
|
7528
|
-
|
|
7529
|
-
vec4 permute(vec4 x) {
|
|
7530
|
-
return mod289(((x * 34.0) + 1.0) * x);
|
|
7531
|
-
}
|
|
7532
|
-
|
|
7533
|
-
vec4 taylorInvSqrt(vec4 r) {
|
|
7534
|
-
return 1.79284291400159 - 0.85373472095314 * r;
|
|
7535
|
-
}
|
|
7536
|
-
|
|
7537
|
-
vec3 fade(vec3 t) {
|
|
7538
|
-
return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
|
|
7539
|
-
}
|
|
7540
|
-
|
|
7541
|
-
float pnoise(vec3 P, vec3 rep) {
|
|
7542
|
-
vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period
|
|
7543
|
-
vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period
|
|
7544
|
-
Pi0 = mod289(Pi0);
|
|
7545
|
-
Pi1 = mod289(Pi1);
|
|
7546
|
-
vec3 Pf0 = fract(P); // Fractional part for interpolation
|
|
7547
|
-
vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0
|
|
7548
|
-
vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);
|
|
7549
|
-
vec4 iy = vec4(Pi0.yy, Pi1.yy);
|
|
7550
|
-
vec4 iz0 = Pi0.zzzz;
|
|
7551
|
-
vec4 iz1 = Pi1.zzzz;
|
|
7552
|
-
vec4 ixy = permute(permute(ix) + iy);
|
|
7553
|
-
vec4 ixy0 = permute(ixy + iz0);
|
|
7554
|
-
vec4 ixy1 = permute(ixy + iz1);
|
|
7555
|
-
vec4 gx0 = ixy0 * (1.0 / 7.0);
|
|
7556
|
-
vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;
|
|
7557
|
-
gx0 = fract(gx0);
|
|
7558
|
-
vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);
|
|
7559
|
-
vec4 sz0 = step(gz0, vec4(0.0));
|
|
7560
|
-
gx0 -= sz0 * (step(0.0, gx0) - 0.5);
|
|
7561
|
-
gy0 -= sz0 * (step(0.0, gy0) - 0.5);
|
|
7562
|
-
vec4 gx1 = ixy1 * (1.0 / 7.0);
|
|
7563
|
-
vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;
|
|
7564
|
-
gx1 = fract(gx1);
|
|
7565
|
-
vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);
|
|
7566
|
-
vec4 sz1 = step(gz1, vec4(0.0));
|
|
7567
|
-
gx1 -= sz1 * (step(0.0, gx1) - 0.5);
|
|
7568
|
-
gy1 -= sz1 * (step(0.0, gy1) - 0.5);
|
|
7569
|
-
vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);
|
|
7570
|
-
vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);
|
|
7571
|
-
vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);
|
|
7572
|
-
vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);
|
|
7573
|
-
vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);
|
|
7574
|
-
vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);
|
|
7575
|
-
vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);
|
|
7576
|
-
vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);
|
|
7577
|
-
vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));
|
|
7578
|
-
g000 *= norm0.x;
|
|
7579
|
-
g010 *= norm0.y;
|
|
7580
|
-
g100 *= norm0.z;
|
|
7581
|
-
g110 *= norm0.w;
|
|
7582
|
-
vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));
|
|
7583
|
-
g001 *= norm1.x;
|
|
7584
|
-
g011 *= norm1.y;
|
|
7585
|
-
g101 *= norm1.z;
|
|
7586
|
-
g111 *= norm1.w;
|
|
7587
|
-
float n000 = dot(g000, Pf0);
|
|
7588
|
-
float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));
|
|
7589
|
-
float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));
|
|
7590
|
-
float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));
|
|
7591
|
-
float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));
|
|
7592
|
-
float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));
|
|
7593
|
-
float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));
|
|
7594
|
-
float n111 = dot(g111, Pf1);
|
|
7595
|
-
vec3 fade_xyz = fade(Pf0);
|
|
7596
|
-
vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);
|
|
7597
|
-
vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);
|
|
7598
|
-
float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);
|
|
7599
|
-
return 2.2 * n_xyz;
|
|
7600
|
-
}
|
|
7601
|
-
float turb(vec3 P, vec3 rep, float lacunarity, float gain) {
|
|
7602
|
-
float sum = 0.0;
|
|
7603
|
-
float sc = 1.0;
|
|
7604
|
-
float totalgain = 1.0;
|
|
7605
|
-
for (float i = 0.0; i < 6.0; i++)
|
|
7606
|
-
{
|
|
7607
|
-
sum += totalgain * pnoise(P * sc, rep);
|
|
7608
|
-
sc *= lacunarity;
|
|
7609
|
-
totalgain *= gain;
|
|
7610
|
-
}
|
|
7611
|
-
return abs(sum);
|
|
7612
|
-
}
|
|
7807
|
+
uniform float uAlpha;
|
|
7808
|
+
uniform vec3 uColor;
|
|
7809
|
+
uniform vec2 uOffset;
|
|
7810
|
+
uniform vec4 uInputSize;
|
|
7613
7811
|
|
|
7614
7812
|
void main(void) {
|
|
7615
|
-
vec4
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
d = (light.x * coord.x) + (light.y * coord.y * aspect);
|
|
7620
|
-
} else {
|
|
7621
|
-
float dx = coord.x - light.x / inputSize.x;
|
|
7622
|
-
float dy = (coord.y - light.y / inputSize.y) * aspect;
|
|
7623
|
-
float dis = sqrt(dx * dx + dy * dy) + 0.00001;
|
|
7624
|
-
d = dy / dis;
|
|
7625
|
-
}
|
|
7626
|
-
vec3 dir = vec3(d, d, 0.0);
|
|
7627
|
-
float noise = turb(dir + vec3(uTime, 0.0, 62.1 + uTime) * 0.05, vec3(480.0, 320.0, 480.0), lacunarity, gain);
|
|
7628
|
-
noise = mix(noise, 0.0, 0.3);
|
|
7629
|
-
vec4 mist = vec4(noise, noise, noise, 1.0) * (1.0 - coord.y);
|
|
7630
|
-
mist.a = 1.0;
|
|
7631
|
-
mist *= alpha;
|
|
7632
|
-
gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
|
|
7813
|
+
vec4 sample = texture2D(sampler, vUv + uOffset * uInputSize.zw);
|
|
7814
|
+
sample.rgb = uColor.rgb * sample.a;
|
|
7815
|
+
sample *= uAlpha;
|
|
7816
|
+
gl_FragColor = sample;
|
|
7633
7817
|
}`
|
|
7634
7818
|
}));
|
|
7635
|
-
__decorateClass$
|
|
7636
|
-
property()
|
|
7637
|
-
],
|
|
7638
|
-
__decorateClass$
|
|
7639
|
-
property()
|
|
7640
|
-
],
|
|
7641
|
-
__decorateClass$
|
|
7642
|
-
property()
|
|
7643
|
-
],
|
|
7644
|
-
__decorateClass$
|
|
7645
|
-
property()
|
|
7646
|
-
],
|
|
7647
|
-
__decorateClass$
|
|
7648
|
-
property()
|
|
7649
|
-
],
|
|
7650
|
-
__decorateClass$
|
|
7651
|
-
|
|
7652
|
-
],
|
|
7653
|
-
GodrayEffect = __decorateClass$w([
|
|
7654
|
-
customNode("GodrayEffect")
|
|
7655
|
-
], GodrayEffect);
|
|
7819
|
+
__decorateClass$y([
|
|
7820
|
+
property({ default: 0 })
|
|
7821
|
+
], DropShadowEffect.prototype, "color", 2);
|
|
7822
|
+
__decorateClass$y([
|
|
7823
|
+
property({ default: 4 })
|
|
7824
|
+
], DropShadowEffect.prototype, "blur", 2);
|
|
7825
|
+
__decorateClass$y([
|
|
7826
|
+
property({ default: 4 })
|
|
7827
|
+
], DropShadowEffect.prototype, "offsetX", 2);
|
|
7828
|
+
__decorateClass$y([
|
|
7829
|
+
property({ default: 4 })
|
|
7830
|
+
], DropShadowEffect.prototype, "offsetY", 2);
|
|
7831
|
+
__decorateClass$y([
|
|
7832
|
+
property({ default: false })
|
|
7833
|
+
], DropShadowEffect.prototype, "shadowOnly", 2);
|
|
7834
|
+
DropShadowEffect = __decorateClass$y([
|
|
7835
|
+
customNode("DropShadowEffect")
|
|
7836
|
+
], DropShadowEffect);
|
|
7656
7837
|
|
|
7657
|
-
var __defProp$
|
|
7658
|
-
var __getOwnPropDesc$
|
|
7659
|
-
var __defNormalProp$
|
|
7660
|
-
var __decorateClass$
|
|
7661
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7838
|
+
var __defProp$q = Object.defineProperty;
|
|
7839
|
+
var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
|
|
7840
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7841
|
+
var __decorateClass$x = (decorators, target, key, kind) => {
|
|
7842
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
|
|
7662
7843
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7663
7844
|
if (decorator = decorators[i])
|
|
7664
7845
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7665
|
-
if (kind && result) __defProp$
|
|
7846
|
+
if (kind && result) __defProp$q(target, key, result);
|
|
7666
7847
|
return result;
|
|
7667
7848
|
};
|
|
7668
|
-
var __publicField$
|
|
7669
|
-
let
|
|
7670
|
-
texture;
|
|
7849
|
+
var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
|
|
7850
|
+
let EmbossEffect = class extends Effect {
|
|
7671
7851
|
constructor(properties, children = []) {
|
|
7672
7852
|
super();
|
|
7673
7853
|
this.setProperties(properties).append(children);
|
|
7674
7854
|
}
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
_updateProperty(key, value, oldValue, declaration) {
|
|
7682
|
-
super._updateProperty(key, value, oldValue, declaration);
|
|
7683
|
-
switch (key) {
|
|
7684
|
-
case "src":
|
|
7685
|
-
this.load();
|
|
7686
|
-
break;
|
|
7687
|
-
case "texture":
|
|
7688
|
-
oldValue?.free?.();
|
|
7689
|
-
break;
|
|
7690
|
-
}
|
|
7691
|
-
}
|
|
7692
|
-
apply(renderer, source, context) {
|
|
7693
|
-
if (this.texture && context.targetArea) {
|
|
7694
|
-
source.redraw(renderer, () => {
|
|
7695
|
-
this.texture.activate(renderer, 1);
|
|
7696
|
-
QuadUvGeometry.draw(renderer, MaskEffect.material, {
|
|
7697
|
-
sampler: 0,
|
|
7698
|
-
mask: 1,
|
|
7699
|
-
area: context.targetArea,
|
|
7700
|
-
rotation: context.target?.globalRotation ?? 0
|
|
7701
|
-
});
|
|
7702
|
-
renderer.texture.unbind(1);
|
|
7855
|
+
apply(renderer, source) {
|
|
7856
|
+
source.redraw(renderer, () => {
|
|
7857
|
+
QuadUvGeometry.draw(renderer, EmbossEffect.material, {
|
|
7858
|
+
sampler: 0,
|
|
7859
|
+
strength: this.strength,
|
|
7860
|
+
inputSize: [source.width, source.height, 1 / source.width, 1 / source.height]
|
|
7703
7861
|
});
|
|
7704
|
-
}
|
|
7862
|
+
});
|
|
7705
7863
|
}
|
|
7706
7864
|
};
|
|
7707
|
-
__publicField$
|
|
7865
|
+
__publicField$b(EmbossEffect, "material", new Material({
|
|
7708
7866
|
vert: `precision mediump float;
|
|
7709
7867
|
attribute vec2 position;
|
|
7710
7868
|
attribute vec2 uv;
|
|
@@ -7713,83 +7871,108 @@ void main() {
|
|
|
7713
7871
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
7714
7872
|
vUv = uv;
|
|
7715
7873
|
}`,
|
|
7716
|
-
frag: `
|
|
7874
|
+
frag: `precision mediump float;
|
|
7717
7875
|
uniform sampler2D sampler;
|
|
7718
|
-
uniform
|
|
7719
|
-
uniform float
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
vec2 rotateUV(vec2 uv, float angle) {
|
|
7723
|
-
uv -= 0.5;
|
|
7724
|
-
float cosAngle = cos(angle);
|
|
7725
|
-
float sinAngle = sin(angle);
|
|
7726
|
-
mat2 rotationMatrix = mat2(
|
|
7727
|
-
cosAngle, -sinAngle,
|
|
7728
|
-
sinAngle, cosAngle
|
|
7729
|
-
);
|
|
7730
|
-
uv = rotationMatrix * uv;
|
|
7731
|
-
uv += 0.5;
|
|
7732
|
-
return uv;
|
|
7733
|
-
}
|
|
7876
|
+
uniform vec4 inputSize;
|
|
7877
|
+
uniform float strength;
|
|
7878
|
+
varying vec2 vUv;
|
|
7734
7879
|
|
|
7735
7880
|
void main(void) {
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
(vUv.x - area[0]) / area[2],
|
|
7745
|
-
((1.0 - vUv.y) - area[1]) / area[3]
|
|
7746
|
-
);
|
|
7747
|
-
vec4 maskColor = texture2D(mask, rotateUV(uv, rotation));
|
|
7748
|
-
gl_FragColor = mix(vec4(0.), color, maskColor.a);
|
|
7749
|
-
} else {
|
|
7750
|
-
gl_FragColor = vec4(0.);
|
|
7751
|
-
}
|
|
7881
|
+
vec2 onePixel = inputSize.zw;
|
|
7882
|
+
vec4 color;
|
|
7883
|
+
color.rgb = vec3(0.5);
|
|
7884
|
+
color -= texture2D(sampler, vUv - onePixel) * strength;
|
|
7885
|
+
color += texture2D(sampler, vUv + onePixel) * strength;
|
|
7886
|
+
color.rgb = vec3((color.r + color.g + color.b) / 3.0);
|
|
7887
|
+
float alpha = texture2D(sampler, vUv).a;
|
|
7888
|
+
gl_FragColor = vec4(color.rgb * alpha, alpha);
|
|
7752
7889
|
}`
|
|
7753
7890
|
}));
|
|
7754
|
-
__decorateClass$
|
|
7755
|
-
|
|
7756
|
-
],
|
|
7757
|
-
__decorateClass$
|
|
7758
|
-
|
|
7759
|
-
],
|
|
7760
|
-
MaskEffect = __decorateClass$v([
|
|
7761
|
-
customNode("MaskEffect")
|
|
7762
|
-
], MaskEffect);
|
|
7891
|
+
__decorateClass$x([
|
|
7892
|
+
property({ default: 5 })
|
|
7893
|
+
], EmbossEffect.prototype, "strength", 2);
|
|
7894
|
+
EmbossEffect = __decorateClass$x([
|
|
7895
|
+
customNode("EmbossEffect")
|
|
7896
|
+
], EmbossEffect);
|
|
7763
7897
|
|
|
7764
|
-
var __defProp$
|
|
7765
|
-
var __getOwnPropDesc$
|
|
7766
|
-
var __defNormalProp$
|
|
7767
|
-
var __decorateClass$
|
|
7768
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7898
|
+
var __defProp$p = Object.defineProperty;
|
|
7899
|
+
var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
|
|
7900
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7901
|
+
var __decorateClass$w = (decorators, target, key, kind) => {
|
|
7902
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
|
|
7769
7903
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7770
7904
|
if (decorator = decorators[i])
|
|
7771
7905
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7772
|
-
if (kind && result) __defProp$
|
|
7906
|
+
if (kind && result) __defProp$p(target, key, result);
|
|
7773
7907
|
return result;
|
|
7774
7908
|
};
|
|
7775
|
-
var __publicField$
|
|
7776
|
-
let
|
|
7777
|
-
|
|
7778
|
-
|
|
7909
|
+
var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
|
|
7910
|
+
let GlitchEffect = class extends Effect {
|
|
7911
|
+
_canvas;
|
|
7912
|
+
_texture;
|
|
7913
|
+
_sizes;
|
|
7914
|
+
_offsets;
|
|
7915
|
+
_needsRedraw = false;
|
|
7916
|
+
constructor(properties, children = []) {
|
|
7779
7917
|
super();
|
|
7780
|
-
this.
|
|
7918
|
+
this.setProperties(properties).append(children);
|
|
7919
|
+
this._canvas = document.createElement("canvas");
|
|
7920
|
+
this._canvas.width = 4;
|
|
7921
|
+
this._canvas.height = this.sampleSize;
|
|
7922
|
+
this._texture = new Texture2D(this._canvas);
|
|
7923
|
+
this._sizes = new Float32Array(this.slices);
|
|
7924
|
+
this._offsets = new Float32Array(this.slices);
|
|
7925
|
+
}
|
|
7926
|
+
redraw() {
|
|
7927
|
+
const size = this.sampleSize;
|
|
7928
|
+
const texture = this._texture;
|
|
7929
|
+
const ctx = this._canvas.getContext("2d");
|
|
7930
|
+
ctx.clearRect(0, 0, 8, size);
|
|
7931
|
+
let offset;
|
|
7932
|
+
let y = 0;
|
|
7933
|
+
for (let i = 0; i < this.slices; i++) {
|
|
7934
|
+
offset = Math.floor(this._offsets[i] * 256);
|
|
7935
|
+
const height = this._sizes[i] * size;
|
|
7936
|
+
const red = offset > 0 ? offset : 0;
|
|
7937
|
+
const green = offset < 0 ? -offset : 0;
|
|
7938
|
+
ctx.fillStyle = `rgba(${red}, ${green}, 0, 1)`;
|
|
7939
|
+
ctx.fillRect(0, y >> 0, size, height + 1 >> 0);
|
|
7940
|
+
y += height;
|
|
7941
|
+
}
|
|
7942
|
+
texture.requestUpload();
|
|
7781
7943
|
}
|
|
7782
7944
|
apply(renderer, source) {
|
|
7945
|
+
if (!this._needsRedraw) {
|
|
7946
|
+
this._needsRedraw = true;
|
|
7947
|
+
this.redraw();
|
|
7948
|
+
}
|
|
7949
|
+
const width = source.width;
|
|
7950
|
+
const height = source.height;
|
|
7951
|
+
const radians = this.direction * (Math.PI / 180);
|
|
7952
|
+
const sinDir = Math.sin(radians);
|
|
7953
|
+
const cosDir = Math.cos(radians);
|
|
7783
7954
|
source.redraw(renderer, () => {
|
|
7784
|
-
|
|
7955
|
+
this._texture.activate(renderer, 1);
|
|
7956
|
+
QuadUvGeometry.draw(renderer, GlitchEffect.material, {
|
|
7785
7957
|
sampler: 0,
|
|
7786
|
-
|
|
7787
|
-
filterArea: [
|
|
7958
|
+
filterClamp: [0, 0, 1, 1],
|
|
7959
|
+
filterArea: [width, height, 0, 0],
|
|
7960
|
+
dimensions: [width, height],
|
|
7961
|
+
aspect: height / width,
|
|
7962
|
+
displacementMap: 1,
|
|
7963
|
+
offset: this.offset,
|
|
7964
|
+
sinDir,
|
|
7965
|
+
cosDir,
|
|
7966
|
+
fillMode: this.fillMode,
|
|
7967
|
+
seed: this.seed,
|
|
7968
|
+
red: this.red,
|
|
7969
|
+
green: this.green,
|
|
7970
|
+
blue: this.blue
|
|
7788
7971
|
});
|
|
7789
7972
|
});
|
|
7790
7973
|
}
|
|
7791
7974
|
};
|
|
7792
|
-
__publicField$
|
|
7975
|
+
__publicField$a(GlitchEffect, "material", new Material({
|
|
7793
7976
|
vert: `precision mediump float;
|
|
7794
7977
|
attribute vec2 position;
|
|
7795
7978
|
attribute vec2 uv;
|
|
@@ -7798,632 +7981,711 @@ void main() {
|
|
|
7798
7981
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
7799
7982
|
vUv = uv;
|
|
7800
7983
|
}`,
|
|
7801
|
-
frag: `
|
|
7802
|
-
|
|
7984
|
+
frag: `precision mediump float;
|
|
7985
|
+
|
|
7986
|
+
varying vec2 vUv;
|
|
7803
7987
|
uniform sampler2D sampler;
|
|
7988
|
+
|
|
7804
7989
|
uniform vec4 filterArea;
|
|
7990
|
+
uniform vec4 filterClamp;
|
|
7991
|
+
uniform vec2 dimensions;
|
|
7992
|
+
uniform float aspect;
|
|
7805
7993
|
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7994
|
+
uniform sampler2D displacementMap;
|
|
7995
|
+
uniform float offset;
|
|
7996
|
+
uniform float sinDir;
|
|
7997
|
+
uniform float cosDir;
|
|
7998
|
+
uniform int fillMode;
|
|
7811
7999
|
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
}
|
|
8000
|
+
uniform float seed;
|
|
8001
|
+
uniform vec2 red;
|
|
8002
|
+
uniform vec2 green;
|
|
8003
|
+
uniform vec2 blue;
|
|
7817
8004
|
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
8005
|
+
const int TRANSPARENT = 0;
|
|
8006
|
+
const int ORIGINAL = 1;
|
|
8007
|
+
const int LOOP = 2;
|
|
8008
|
+
const int CLAMP = 3;
|
|
8009
|
+
const int MIRROR = 4;
|
|
7821
8010
|
|
|
7822
8011
|
void main(void) {
|
|
7823
|
-
vec2 coord =
|
|
7824
|
-
coord = pixelate(coord, size);
|
|
7825
|
-
coord = unmapCoord(coord);
|
|
7826
|
-
gl_FragColor = texture2D(sampler, coord);
|
|
7827
|
-
}`
|
|
7828
|
-
}));
|
|
7829
|
-
__decorateClass$u([
|
|
7830
|
-
property()
|
|
7831
|
-
], PixelateEffect.prototype, "size", 2);
|
|
7832
|
-
PixelateEffect = __decorateClass$u([
|
|
7833
|
-
customNode("PixelateEffect")
|
|
7834
|
-
], PixelateEffect);
|
|
8012
|
+
vec2 coord = (vUv * filterArea.xy) / dimensions;
|
|
7835
8013
|
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
fillStyle;
|
|
7839
|
-
strokeStyle;
|
|
7840
|
-
lineCap;
|
|
7841
|
-
lineJoin;
|
|
7842
|
-
lineWidth;
|
|
7843
|
-
miterLimit;
|
|
7844
|
-
_defaultStyle = Texture2D.EMPTY;
|
|
7845
|
-
_draws = [];
|
|
7846
|
-
stroke() {
|
|
7847
|
-
let texture = this._defaultStyle;
|
|
7848
|
-
if (this.strokeStyle) {
|
|
7849
|
-
if (this.strokeStyle instanceof Texture2D) {
|
|
7850
|
-
texture = this.strokeStyle;
|
|
7851
|
-
} else {
|
|
7852
|
-
texture = new ColorTexture(this.strokeStyle);
|
|
7853
|
-
}
|
|
7854
|
-
}
|
|
7855
|
-
if (this.curves.length) {
|
|
7856
|
-
this._draws.push({
|
|
7857
|
-
type: "stroke",
|
|
7858
|
-
path: new Path2D(this),
|
|
7859
|
-
texture,
|
|
7860
|
-
textureTransform: this.textureTransform,
|
|
7861
|
-
style: {
|
|
7862
|
-
alignment: 0.5,
|
|
7863
|
-
cap: this.lineCap ?? "butt",
|
|
7864
|
-
join: this.lineJoin ?? "miter",
|
|
7865
|
-
width: this.lineWidth ?? 1,
|
|
7866
|
-
miterLimit: this.miterLimit ?? 10
|
|
7867
|
-
}
|
|
7868
|
-
});
|
|
7869
|
-
super.reset();
|
|
7870
|
-
}
|
|
7871
|
-
}
|
|
7872
|
-
fillRect(x, y, width, height) {
|
|
7873
|
-
this.rect(x, y, width, height).fill();
|
|
7874
|
-
}
|
|
7875
|
-
strokeRect(x, y, width, height) {
|
|
7876
|
-
this.rect(x, y, width, height).stroke();
|
|
7877
|
-
}
|
|
7878
|
-
fill() {
|
|
7879
|
-
let texture = this._defaultStyle;
|
|
7880
|
-
if (this.fillStyle) {
|
|
7881
|
-
if (this.fillStyle instanceof Texture2D) {
|
|
7882
|
-
texture = this.fillStyle;
|
|
7883
|
-
} else {
|
|
7884
|
-
texture = new ColorTexture(this.fillStyle);
|
|
7885
|
-
}
|
|
7886
|
-
}
|
|
7887
|
-
this._draws.push({
|
|
7888
|
-
type: "fill",
|
|
7889
|
-
path: new Path2D(this),
|
|
7890
|
-
texture,
|
|
7891
|
-
textureTransform: this.textureTransform
|
|
7892
|
-
});
|
|
7893
|
-
super.reset();
|
|
7894
|
-
}
|
|
7895
|
-
copy(source) {
|
|
7896
|
-
super.copy(source);
|
|
7897
|
-
this.strokeStyle = source.strokeStyle;
|
|
7898
|
-
this.fillStyle = source.fillStyle;
|
|
7899
|
-
this.textureTransform = source.textureTransform;
|
|
7900
|
-
this.lineCap = source.lineCap;
|
|
7901
|
-
this.lineJoin = source.lineJoin;
|
|
7902
|
-
this.lineWidth = source.lineWidth;
|
|
7903
|
-
this.miterLimit = source.miterLimit;
|
|
7904
|
-
this._draws = source._draws.slice();
|
|
7905
|
-
return this;
|
|
7906
|
-
}
|
|
7907
|
-
reset() {
|
|
7908
|
-
super.reset();
|
|
7909
|
-
this.strokeStyle = void 0;
|
|
7910
|
-
this.fillStyle = void 0;
|
|
7911
|
-
this.textureTransform = void 0;
|
|
7912
|
-
this.lineCap = void 0;
|
|
7913
|
-
this.lineJoin = void 0;
|
|
7914
|
-
this.lineWidth = void 0;
|
|
7915
|
-
this.miterLimit = void 0;
|
|
7916
|
-
this._draws.length = 0;
|
|
7917
|
-
return this;
|
|
8014
|
+
if (coord.x > 1.0 || coord.y > 1.0) {
|
|
8015
|
+
return;
|
|
7918
8016
|
}
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
8017
|
+
|
|
8018
|
+
float cx = coord.x - 0.5;
|
|
8019
|
+
float cy = (coord.y - 0.5) * aspect;
|
|
8020
|
+
float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;
|
|
8021
|
+
|
|
8022
|
+
// displacementMap: repeat
|
|
8023
|
+
// ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);
|
|
8024
|
+
|
|
8025
|
+
// displacementMap: mirror
|
|
8026
|
+
ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);
|
|
8027
|
+
|
|
8028
|
+
vec4 dc = texture2D(displacementMap, vec2(0.5, ny));
|
|
8029
|
+
|
|
8030
|
+
float displacement = (dc.r - dc.g) * (offset / filterArea.x);
|
|
8031
|
+
|
|
8032
|
+
coord = vUv + vec2(cosDir * displacement, sinDir * displacement * aspect);
|
|
8033
|
+
|
|
8034
|
+
if (fillMode == CLAMP) {
|
|
8035
|
+
coord = clamp(coord, filterClamp.xy, filterClamp.zw);
|
|
8036
|
+
} else {
|
|
8037
|
+
if (coord.x > filterClamp.z) {
|
|
8038
|
+
if (fillMode == TRANSPARENT) {
|
|
8039
|
+
discard;
|
|
8040
|
+
} else if (fillMode == LOOP) {
|
|
8041
|
+
coord.x -= filterClamp.z;
|
|
8042
|
+
} else if (fillMode == MIRROR) {
|
|
8043
|
+
coord.x = filterClamp.z * 2.0 - coord.x;
|
|
7934
8044
|
}
|
|
7935
|
-
} else {
|
|
7936
|
-
|
|
7937
|
-
|
|
8045
|
+
} else if (coord.x < filterClamp.x) {
|
|
8046
|
+
if (fillMode == TRANSPARENT) {
|
|
8047
|
+
discard;
|
|
8048
|
+
} else if (fillMode == LOOP) {
|
|
8049
|
+
coord.x += filterClamp.z;
|
|
8050
|
+
} else if (fillMode == MIRROR) {
|
|
8051
|
+
coord.x *= -filterClamp.z;
|
|
7938
8052
|
}
|
|
7939
8053
|
}
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
batchables.push({
|
|
7949
|
-
type,
|
|
7950
|
-
vertices,
|
|
7951
|
-
indices,
|
|
7952
|
-
uvs,
|
|
7953
|
-
texture
|
|
7954
|
-
});
|
|
7955
|
-
vertices = [];
|
|
7956
|
-
indices = [];
|
|
7957
|
-
uvs = [];
|
|
7958
|
-
texture = void 0;
|
|
7959
|
-
};
|
|
7960
|
-
for (let len = this._draws.length, i = 0; i < len; i++) {
|
|
7961
|
-
const draw = this._draws[i];
|
|
7962
|
-
const prev = this._draws[i - 1];
|
|
7963
|
-
if (vertices.length && prev && prev?.type !== draw.type) {
|
|
7964
|
-
push(prev.type);
|
|
7965
|
-
}
|
|
7966
|
-
const oldTexture = texture;
|
|
7967
|
-
if (!oldTexture) {
|
|
7968
|
-
texture = draw.texture;
|
|
7969
|
-
}
|
|
7970
|
-
if (vertices.length && oldTexture !== draw.texture && !oldTexture?.is(draw.texture)) {
|
|
7971
|
-
push(draw.type);
|
|
8054
|
+
|
|
8055
|
+
if (coord.y > filterClamp.w) {
|
|
8056
|
+
if (fillMode == TRANSPARENT) {
|
|
8057
|
+
discard;
|
|
8058
|
+
} else if (fillMode == LOOP) {
|
|
8059
|
+
coord.y -= filterClamp.w;
|
|
8060
|
+
} else if (fillMode == MIRROR) {
|
|
8061
|
+
coord.y = filterClamp.w * 2.0 - coord.y;
|
|
7972
8062
|
}
|
|
7973
|
-
|
|
7974
|
-
if (
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
} else {
|
|
7981
|
-
draw.path.strokeTriangulate({
|
|
7982
|
-
vertices,
|
|
7983
|
-
indices,
|
|
7984
|
-
lineStyle: draw.style,
|
|
7985
|
-
flipAlignment: false,
|
|
7986
|
-
closed: true
|
|
7987
|
-
});
|
|
7988
|
-
this.buildUvs(start, vertices, uvs, draw.texture, draw.textureTransform);
|
|
8063
|
+
} else if (coord.y < filterClamp.y) {
|
|
8064
|
+
if (fillMode == TRANSPARENT) {
|
|
8065
|
+
discard;
|
|
8066
|
+
} else if (fillMode == LOOP) {
|
|
8067
|
+
coord.y += filterClamp.w;
|
|
8068
|
+
} else if (fillMode == MIRROR) {
|
|
8069
|
+
coord.y *= -filterClamp.w;
|
|
7989
8070
|
}
|
|
7990
8071
|
}
|
|
7991
|
-
const last = this._draws[this._draws.length - 1];
|
|
7992
|
-
if (last && vertices.length) {
|
|
7993
|
-
push(last.type);
|
|
7994
|
-
}
|
|
7995
|
-
return batchables;
|
|
7996
8072
|
}
|
|
7997
|
-
}
|
|
7998
8073
|
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8074
|
+
gl_FragColor.r = texture2D(sampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;
|
|
8075
|
+
gl_FragColor.g = texture2D(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;
|
|
8076
|
+
gl_FragColor.b = texture2D(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;
|
|
8077
|
+
gl_FragColor.a = texture2D(sampler, coord).a;
|
|
8078
|
+
}`
|
|
8079
|
+
}));
|
|
8080
|
+
__decorateClass$w([
|
|
8081
|
+
property({ default: 10 })
|
|
8082
|
+
], GlitchEffect.prototype, "slices", 2);
|
|
8083
|
+
__decorateClass$w([
|
|
8084
|
+
property({ default: 512 })
|
|
8085
|
+
], GlitchEffect.prototype, "sampleSize", 2);
|
|
8086
|
+
__decorateClass$w([
|
|
8087
|
+
property({ default: 100 })
|
|
8088
|
+
], GlitchEffect.prototype, "offset", 2);
|
|
8089
|
+
__decorateClass$w([
|
|
8090
|
+
property({ default: 0 })
|
|
8091
|
+
], GlitchEffect.prototype, "direction", 2);
|
|
8092
|
+
__decorateClass$w([
|
|
8093
|
+
property({ default: 2 })
|
|
8094
|
+
], GlitchEffect.prototype, "fillMode", 2);
|
|
8095
|
+
__decorateClass$w([
|
|
8096
|
+
property({ default: 0 })
|
|
8097
|
+
], GlitchEffect.prototype, "seed", 2);
|
|
8098
|
+
__decorateClass$w([
|
|
8099
|
+
property({ default: [2, 2] })
|
|
8100
|
+
], GlitchEffect.prototype, "red", 2);
|
|
8101
|
+
__decorateClass$w([
|
|
8102
|
+
property({ default: [-10, 4] })
|
|
8103
|
+
], GlitchEffect.prototype, "green", 2);
|
|
8104
|
+
__decorateClass$w([
|
|
8105
|
+
property({ default: [10, -4] })
|
|
8106
|
+
], GlitchEffect.prototype, "blue", 2);
|
|
8107
|
+
GlitchEffect = __decorateClass$w([
|
|
8108
|
+
customNode("GlitchEffect")
|
|
8109
|
+
], GlitchEffect);
|
|
8110
|
+
|
|
8111
|
+
var __defProp$o = Object.defineProperty;
|
|
8112
|
+
var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
|
|
8113
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8114
|
+
var __decorateClass$v = (decorators, target, key, kind) => {
|
|
8115
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
|
|
8003
8116
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8004
8117
|
if (decorator = decorators[i])
|
|
8005
8118
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8006
|
-
if (kind && result) __defProp$
|
|
8119
|
+
if (kind && result) __defProp$o(target, key, result);
|
|
8007
8120
|
return result;
|
|
8008
8121
|
};
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8122
|
+
var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
|
|
8123
|
+
const perlin = `vec3 mod289(vec3 x)
|
|
8124
|
+
{
|
|
8125
|
+
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
|
8126
|
+
}
|
|
8127
|
+
vec4 mod289(vec4 x)
|
|
8128
|
+
{
|
|
8129
|
+
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
|
8130
|
+
}
|
|
8131
|
+
vec4 permute(vec4 x)
|
|
8132
|
+
{
|
|
8133
|
+
return mod289(((x * 34.0) + 1.0) * x);
|
|
8134
|
+
}
|
|
8135
|
+
vec4 taylorInvSqrt(vec4 r)
|
|
8136
|
+
{
|
|
8137
|
+
return 1.79284291400159 - 0.85373472095314 * r;
|
|
8138
|
+
}
|
|
8139
|
+
vec3 fade(vec3 t)
|
|
8140
|
+
{
|
|
8141
|
+
return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
|
|
8142
|
+
}
|
|
8143
|
+
// Classic Perlin noise, periodic variant
|
|
8144
|
+
float pnoise(vec3 P, vec3 rep)
|
|
8145
|
+
{
|
|
8146
|
+
vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period
|
|
8147
|
+
vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period
|
|
8148
|
+
Pi0 = mod289(Pi0);
|
|
8149
|
+
Pi1 = mod289(Pi1);
|
|
8150
|
+
vec3 Pf0 = fract(P); // Fractional part for interpolation
|
|
8151
|
+
vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0
|
|
8152
|
+
vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);
|
|
8153
|
+
vec4 iy = vec4(Pi0.yy, Pi1.yy);
|
|
8154
|
+
vec4 iz0 = Pi0.zzzz;
|
|
8155
|
+
vec4 iz1 = Pi1.zzzz;
|
|
8156
|
+
vec4 ixy = permute(permute(ix) + iy);
|
|
8157
|
+
vec4 ixy0 = permute(ixy + iz0);
|
|
8158
|
+
vec4 ixy1 = permute(ixy + iz1);
|
|
8159
|
+
vec4 gx0 = ixy0 * (1.0 / 7.0);
|
|
8160
|
+
vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;
|
|
8161
|
+
gx0 = fract(gx0);
|
|
8162
|
+
vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);
|
|
8163
|
+
vec4 sz0 = step(gz0, vec4(0.0));
|
|
8164
|
+
gx0 -= sz0 * (step(0.0, gx0) - 0.5);
|
|
8165
|
+
gy0 -= sz0 * (step(0.0, gy0) - 0.5);
|
|
8166
|
+
vec4 gx1 = ixy1 * (1.0 / 7.0);
|
|
8167
|
+
vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;
|
|
8168
|
+
gx1 = fract(gx1);
|
|
8169
|
+
vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);
|
|
8170
|
+
vec4 sz1 = step(gz1, vec4(0.0));
|
|
8171
|
+
gx1 -= sz1 * (step(0.0, gx1) - 0.5);
|
|
8172
|
+
gy1 -= sz1 * (step(0.0, gy1) - 0.5);
|
|
8173
|
+
vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);
|
|
8174
|
+
vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);
|
|
8175
|
+
vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);
|
|
8176
|
+
vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);
|
|
8177
|
+
vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);
|
|
8178
|
+
vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);
|
|
8179
|
+
vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);
|
|
8180
|
+
vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);
|
|
8181
|
+
vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));
|
|
8182
|
+
g000 *= norm0.x;
|
|
8183
|
+
g010 *= norm0.y;
|
|
8184
|
+
g100 *= norm0.z;
|
|
8185
|
+
g110 *= norm0.w;
|
|
8186
|
+
vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));
|
|
8187
|
+
g001 *= norm1.x;
|
|
8188
|
+
g011 *= norm1.y;
|
|
8189
|
+
g101 *= norm1.z;
|
|
8190
|
+
g111 *= norm1.w;
|
|
8191
|
+
float n000 = dot(g000, Pf0);
|
|
8192
|
+
float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));
|
|
8193
|
+
float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));
|
|
8194
|
+
float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));
|
|
8195
|
+
float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));
|
|
8196
|
+
float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));
|
|
8197
|
+
float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));
|
|
8198
|
+
float n111 = dot(g111, Pf1);
|
|
8199
|
+
vec3 fade_xyz = fade(Pf0);
|
|
8200
|
+
vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);
|
|
8201
|
+
vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);
|
|
8202
|
+
float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);
|
|
8203
|
+
return 2.2 * n_xyz;
|
|
8204
|
+
}
|
|
8205
|
+
float turb(vec3 P, vec3 rep, float lacunarity, float gain)
|
|
8206
|
+
{
|
|
8207
|
+
float sum = 0.0;
|
|
8208
|
+
float sc = 1.0;
|
|
8209
|
+
float totalgain = 1.0;
|
|
8210
|
+
for (float i = 0.0; i < 6.0; i++)
|
|
8211
|
+
{
|
|
8212
|
+
sum += totalgain * pnoise(P * sc, rep);
|
|
8213
|
+
sc *= lacunarity;
|
|
8214
|
+
totalgain *= gain;
|
|
8215
|
+
}
|
|
8216
|
+
return abs(sum);
|
|
8217
|
+
}`;
|
|
8218
|
+
let GodrayEffect = class extends Effect {
|
|
8219
|
+
constructor(properties, children = []) {
|
|
8032
8220
|
super();
|
|
8033
|
-
this.setProperties(properties).append(
|
|
8034
|
-
}
|
|
8035
|
-
_updateProperty(key, value, oldValue, declaration) {
|
|
8036
|
-
super._updateProperty(key, value, oldValue, declaration);
|
|
8037
|
-
switch (key) {
|
|
8038
|
-
case "modulate":
|
|
8039
|
-
this._modulate.value = value;
|
|
8040
|
-
this.requestRepaint();
|
|
8041
|
-
break;
|
|
8042
|
-
case "blendMode":
|
|
8043
|
-
this.requestRepaint();
|
|
8044
|
-
break;
|
|
8045
|
-
case "opacity":
|
|
8046
|
-
this._updateGlobalOpacity();
|
|
8047
|
-
break;
|
|
8048
|
-
case "visible":
|
|
8049
|
-
case "insideTimeRange":
|
|
8050
|
-
this._updateGlobalVisible();
|
|
8051
|
-
break;
|
|
8052
|
-
}
|
|
8053
|
-
}
|
|
8054
|
-
show() {
|
|
8055
|
-
this.visible = true;
|
|
8056
|
-
}
|
|
8057
|
-
hide() {
|
|
8058
|
-
this.visible = false;
|
|
8059
|
-
}
|
|
8060
|
-
isVisibleInTree() {
|
|
8061
|
-
return this.globalOpacity > 0 && this.globalVisible;
|
|
8062
|
-
}
|
|
8063
|
-
canRender() {
|
|
8064
|
-
return super.canRender() && this.isVisibleInTree();
|
|
8065
|
-
}
|
|
8066
|
-
requestRedraw() {
|
|
8067
|
-
this._redrawing = true;
|
|
8068
|
-
this.requestUpdate();
|
|
8069
|
-
}
|
|
8070
|
-
requestRelayout() {
|
|
8071
|
-
this._relayouting = true;
|
|
8072
|
-
this.requestUpdate();
|
|
8073
|
-
}
|
|
8074
|
-
requestRepaint() {
|
|
8075
|
-
this._repainting = true;
|
|
8076
|
-
this.requestUpdate();
|
|
8077
|
-
}
|
|
8078
|
-
_updateGlobalVisible() {
|
|
8079
|
-
this._parentGlobalVisible = this.getParent()?.globalVisible;
|
|
8080
|
-
this._globalVisible = (this._parentGlobalVisible ?? true) && this.visible && this.insideTimeRange;
|
|
8081
|
-
}
|
|
8082
|
-
_updateGlobalOpacity() {
|
|
8083
|
-
this._parentGlobalOpacity = this.getParent()?.opacity;
|
|
8084
|
-
const globalOpacity = clamp(0, this.opacity, 1) * (this._parentGlobalOpacity ?? 1);
|
|
8085
|
-
if (this._globalOpacity !== globalOpacity) {
|
|
8086
|
-
this._globalOpacity = globalOpacity;
|
|
8087
|
-
this.requestRepaint();
|
|
8088
|
-
}
|
|
8089
|
-
}
|
|
8090
|
-
_draw() {
|
|
8091
|
-
this.emit("draw");
|
|
8092
|
-
}
|
|
8093
|
-
_redraw() {
|
|
8094
|
-
this._tree?.log(this.name, "redrawing");
|
|
8095
|
-
this._draw();
|
|
8096
|
-
return this.context.toBatchables();
|
|
8097
|
-
}
|
|
8098
|
-
_relayout(batchables) {
|
|
8099
|
-
this._tree?.log(this.name, "relayouting");
|
|
8100
|
-
return batchables;
|
|
8101
|
-
}
|
|
8102
|
-
_repaint(batchables) {
|
|
8103
|
-
this._tree?.log(this.name, "repainting");
|
|
8104
|
-
return batchables.map((batchable) => {
|
|
8105
|
-
return {
|
|
8106
|
-
...batchable,
|
|
8107
|
-
modulate: this._modulate.toArgb(this.globalOpacity, true),
|
|
8108
|
-
blendMode: this.blendMode
|
|
8109
|
-
};
|
|
8110
|
-
});
|
|
8111
|
-
}
|
|
8112
|
-
_process(delta) {
|
|
8113
|
-
super._process(delta);
|
|
8114
|
-
const parent = this.getParent();
|
|
8115
|
-
if (this._parentGlobalVisible !== parent?.globalVisible) {
|
|
8116
|
-
this.requestUpdate();
|
|
8117
|
-
}
|
|
8118
|
-
if (this._parentGlobalOpacity !== parent?.globalOpacity) {
|
|
8119
|
-
this.requestUpdate();
|
|
8120
|
-
}
|
|
8121
|
-
}
|
|
8122
|
-
_update() {
|
|
8123
|
-
const parent = this.getParent();
|
|
8124
|
-
if (this._parentGlobalVisible !== parent?.globalVisible) {
|
|
8125
|
-
this._updateGlobalVisible();
|
|
8126
|
-
}
|
|
8127
|
-
if (this._parentGlobalOpacity !== parent?.globalOpacity) {
|
|
8128
|
-
this._updateGlobalOpacity();
|
|
8129
|
-
}
|
|
8130
|
-
const redrawing = this._redrawing;
|
|
8131
|
-
let relayouting = this._relayouting;
|
|
8132
|
-
let repainting = this._repainting;
|
|
8133
|
-
let batchables;
|
|
8134
|
-
if (redrawing) {
|
|
8135
|
-
this._originalBatchables = this._redraw();
|
|
8136
|
-
relayouting = true;
|
|
8137
|
-
}
|
|
8138
|
-
if (relayouting) {
|
|
8139
|
-
this._layoutedBatchables = this._relayout(this._originalBatchables);
|
|
8140
|
-
repainting = true;
|
|
8141
|
-
}
|
|
8142
|
-
if (repainting) {
|
|
8143
|
-
batchables = this._repaint(this._layoutedBatchables);
|
|
8144
|
-
}
|
|
8145
|
-
if (redrawing) {
|
|
8146
|
-
if (this._resetContext) {
|
|
8147
|
-
this.context.reset();
|
|
8148
|
-
}
|
|
8149
|
-
}
|
|
8150
|
-
if (batchables) {
|
|
8151
|
-
this._batchables = batchables;
|
|
8152
|
-
this._redrawing = false;
|
|
8153
|
-
this._relayouting = false;
|
|
8154
|
-
this._repainting = false;
|
|
8155
|
-
}
|
|
8221
|
+
this.setProperties(properties).append(children);
|
|
8156
8222
|
}
|
|
8157
|
-
|
|
8158
|
-
this.
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
8223
|
+
apply(renderer, source) {
|
|
8224
|
+
const radians = this.angle * (Math.PI / 180);
|
|
8225
|
+
const uLight = this.parallel ? [Math.cos(radians), Math.sin(radians)] : this.center;
|
|
8226
|
+
source.redraw(renderer, () => {
|
|
8227
|
+
QuadUvGeometry.draw(renderer, GodrayEffect.material, {
|
|
8228
|
+
sampler: 0,
|
|
8229
|
+
uDimensions: [source.width, source.height],
|
|
8230
|
+
uParallel: this.parallel ? 1 : 0,
|
|
8231
|
+
uLight,
|
|
8232
|
+
uAspect: source.height / source.width,
|
|
8233
|
+
uTime: this.time,
|
|
8234
|
+
uRay: [
|
|
8235
|
+
this.gain,
|
|
8236
|
+
this.lacunarity,
|
|
8237
|
+
this.alpha
|
|
8238
|
+
],
|
|
8239
|
+
uInputSize: [source.width, source.height, 0, 0]
|
|
8163
8240
|
});
|
|
8164
8241
|
});
|
|
8165
|
-
super._render(renderer);
|
|
8166
8242
|
}
|
|
8167
8243
|
};
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
}
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
});
|
|
8205
|
-
});
|
|
8206
|
-
this.calls = [];
|
|
8244
|
+
__publicField$9(GodrayEffect, "material", new Material({
|
|
8245
|
+
vert: `precision mediump float;
|
|
8246
|
+
attribute vec2 position;
|
|
8247
|
+
attribute vec2 uv;
|
|
8248
|
+
varying vec2 vUv;
|
|
8249
|
+
void main() {
|
|
8250
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
8251
|
+
vUv = uv;
|
|
8252
|
+
}`,
|
|
8253
|
+
frag: `precision highp float;
|
|
8254
|
+
varying vec2 vUv;
|
|
8255
|
+
uniform sampler2D sampler;
|
|
8256
|
+
uniform vec2 uDimensions;
|
|
8257
|
+
uniform float uParallel;
|
|
8258
|
+
uniform vec2 uLight;
|
|
8259
|
+
uniform float uAspect;
|
|
8260
|
+
uniform float uTime;
|
|
8261
|
+
uniform vec3 uRay;
|
|
8262
|
+
uniform vec4 uInputSize;
|
|
8263
|
+
|
|
8264
|
+
${perlin}
|
|
8265
|
+
|
|
8266
|
+
void main(void) {
|
|
8267
|
+
bool uParallel = uParallel > 0.5;
|
|
8268
|
+
vec2 coord = vUv * uInputSize.xy / uDimensions;
|
|
8269
|
+
|
|
8270
|
+
float d;
|
|
8271
|
+
if (uParallel) {
|
|
8272
|
+
float _cos = uLight.x;
|
|
8273
|
+
float _sin = uLight.y;
|
|
8274
|
+
d = (_cos * coord.x) + (_sin * coord.y * uAspect);
|
|
8275
|
+
} else {
|
|
8276
|
+
float dx = coord.x - uLight.x / uInputSize.x;
|
|
8277
|
+
float dy = (coord.y - uLight.y / uInputSize.y) * uAspect;
|
|
8278
|
+
float dis = sqrt(dx * dx + dy * dy) + 0.00001;
|
|
8279
|
+
d = dy / dis;
|
|
8207
8280
|
}
|
|
8208
|
-
}
|
|
8209
8281
|
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8282
|
+
float gain = uRay[0];
|
|
8283
|
+
float lacunarity = uRay[1];
|
|
8284
|
+
float alpha = uRay[2];
|
|
8285
|
+
|
|
8286
|
+
vec3 dir = vec3(d, d, 0.0);
|
|
8287
|
+
float noise = turb(dir + vec3(uTime, 0.0, 62.1 + uTime) * 0.05, vec3(480.0, 320.0, 480.0), lacunarity, gain);
|
|
8288
|
+
noise = mix(noise, 0.0, 0.3);
|
|
8289
|
+
vec4 mist = vec4(vec3(noise), 1.0) * (1.0 - coord.y);
|
|
8290
|
+
mist.a = 1.0;
|
|
8291
|
+
mist *= alpha;
|
|
8292
|
+
|
|
8293
|
+
vec4 color = texture2D(sampler, vUv);
|
|
8294
|
+
gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
|
|
8295
|
+
}`
|
|
8296
|
+
}));
|
|
8297
|
+
__decorateClass$v([
|
|
8298
|
+
property({ default: 0 })
|
|
8299
|
+
], GodrayEffect.prototype, "time", 2);
|
|
8300
|
+
__decorateClass$v([
|
|
8301
|
+
property({ default: 30 })
|
|
8302
|
+
], GodrayEffect.prototype, "angle", 2);
|
|
8303
|
+
__decorateClass$v([
|
|
8304
|
+
property({ default: 0.5 })
|
|
8305
|
+
], GodrayEffect.prototype, "gain", 2);
|
|
8306
|
+
__decorateClass$v([
|
|
8307
|
+
property({ default: 2.5 })
|
|
8308
|
+
], GodrayEffect.prototype, "lacunarity", 2);
|
|
8309
|
+
__decorateClass$v([
|
|
8310
|
+
property({ default: true })
|
|
8311
|
+
], GodrayEffect.prototype, "parallel", 2);
|
|
8312
|
+
__decorateClass$v([
|
|
8313
|
+
property({ default: [0, 0] })
|
|
8314
|
+
], GodrayEffect.prototype, "center", 2);
|
|
8315
|
+
__decorateClass$v([
|
|
8316
|
+
property({ default: 1 })
|
|
8317
|
+
], GodrayEffect.prototype, "alpha", 2);
|
|
8318
|
+
GodrayEffect = __decorateClass$v([
|
|
8319
|
+
customNode("GodrayEffect")
|
|
8320
|
+
], GodrayEffect);
|
|
8321
|
+
|
|
8322
|
+
var __defProp$n = Object.defineProperty;
|
|
8323
|
+
var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
|
|
8324
|
+
var __decorateClass$u = (decorators, target, key, kind) => {
|
|
8325
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
|
|
8214
8326
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8215
8327
|
if (decorator = decorators[i])
|
|
8216
8328
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8217
|
-
if (kind && result) __defProp$
|
|
8329
|
+
if (kind && result) __defProp$n(target, key, result);
|
|
8218
8330
|
return result;
|
|
8219
8331
|
};
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8332
|
+
const frag$1 = `varying vec2 vUv;
|
|
8333
|
+
uniform sampler2D sampler;
|
|
8334
|
+
uniform vec2 uOffset;
|
|
8335
|
+
|
|
8336
|
+
void main(void) {
|
|
8337
|
+
vec4 color = vec4(0.0);
|
|
8338
|
+
color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));
|
|
8339
|
+
color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));
|
|
8340
|
+
color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));
|
|
8341
|
+
color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));
|
|
8342
|
+
color *= 0.25;
|
|
8343
|
+
gl_FragColor = color;
|
|
8344
|
+
}`;
|
|
8345
|
+
const clampFrag = `precision highp float;
|
|
8346
|
+
varying vec2 vUv;
|
|
8347
|
+
uniform sampler2D sampler;
|
|
8348
|
+
uniform vec2 uOffset;
|
|
8349
|
+
uniform vec4 uInputClamp;
|
|
8350
|
+
void main(void) {
|
|
8351
|
+
vec4 color = vec4(0.0);
|
|
8352
|
+
color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));
|
|
8353
|
+
color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));
|
|
8354
|
+
color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));
|
|
8355
|
+
color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));
|
|
8356
|
+
color *= 0.25;
|
|
8357
|
+
gl_FragColor = color;
|
|
8358
|
+
}`;
|
|
8359
|
+
let KawaseBlurEffect = class extends Effect {
|
|
8360
|
+
material;
|
|
8361
|
+
_kernels = [0];
|
|
8362
|
+
constructor(properties, children = []) {
|
|
8230
8363
|
super();
|
|
8231
|
-
this.
|
|
8364
|
+
this.material = new Material({
|
|
8365
|
+
vert: `precision mediump float;
|
|
8366
|
+
attribute vec2 position;
|
|
8367
|
+
attribute vec2 uv;
|
|
8368
|
+
varying vec2 vUv;
|
|
8369
|
+
void main() {
|
|
8370
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
8371
|
+
vUv = uv;
|
|
8372
|
+
}`,
|
|
8373
|
+
frag: properties?.clamp ? clampFrag : frag$1
|
|
8374
|
+
});
|
|
8375
|
+
this.setProperties(properties).append(children);
|
|
8376
|
+
this._generateKernels();
|
|
8232
8377
|
}
|
|
8233
|
-
_updateProperty(key, value, oldValue) {
|
|
8234
|
-
super._updateProperty(key, value, oldValue);
|
|
8378
|
+
_updateProperty(key, value, oldValue, declaration) {
|
|
8379
|
+
super._updateProperty(key, value, oldValue, declaration);
|
|
8235
8380
|
switch (key) {
|
|
8236
|
-
case "
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
case "endTime":
|
|
8240
|
-
this.endTime = value || Number.MAX_SAFE_INTEGER;
|
|
8381
|
+
case "quality":
|
|
8382
|
+
case "strength":
|
|
8383
|
+
this._generateKernels();
|
|
8241
8384
|
break;
|
|
8242
8385
|
}
|
|
8243
8386
|
}
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
const
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
if (
|
|
8250
|
-
|
|
8387
|
+
/** Auto generate kernels by blur & quality */
|
|
8388
|
+
_generateKernels() {
|
|
8389
|
+
const blur = Math.max(1, Math.round(this.strength));
|
|
8390
|
+
const quality = Math.max(1, Math.round(this.quality));
|
|
8391
|
+
const kernels = [blur];
|
|
8392
|
+
if (blur > 0) {
|
|
8393
|
+
let k = blur;
|
|
8394
|
+
const step = blur / quality;
|
|
8395
|
+
for (let i = 1; i < quality; i++) {
|
|
8396
|
+
k -= step;
|
|
8397
|
+
kernels.push(k);
|
|
8398
|
+
}
|
|
8251
8399
|
}
|
|
8252
|
-
|
|
8253
|
-
this.currentTime = current;
|
|
8254
|
-
this.emit("updateCurrentTime", current, delta);
|
|
8255
|
-
return this;
|
|
8400
|
+
this._kernels = kernels;
|
|
8256
8401
|
}
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
this.
|
|
8402
|
+
apply(renderer, source) {
|
|
8403
|
+
const uvX = this.pixelSize[0] / source.width;
|
|
8404
|
+
const uvY = this.pixelSize[1] / source.height;
|
|
8405
|
+
this._kernels.forEach((kernel) => {
|
|
8406
|
+
const offset = kernel + 0.5;
|
|
8407
|
+
source.redraw(renderer, () => {
|
|
8408
|
+
QuadUvGeometry.draw(renderer, this.material, {
|
|
8409
|
+
sampler: 0,
|
|
8410
|
+
uOffset: [
|
|
8411
|
+
offset * uvX,
|
|
8412
|
+
offset * uvY
|
|
8413
|
+
],
|
|
8414
|
+
uInputClamp: [0, 0, 1, 1]
|
|
8415
|
+
});
|
|
8416
|
+
});
|
|
8417
|
+
});
|
|
8260
8418
|
}
|
|
8261
8419
|
};
|
|
8262
|
-
__decorateClass$
|
|
8263
|
-
property({ default:
|
|
8264
|
-
],
|
|
8265
|
-
__decorateClass$
|
|
8266
|
-
property({ default:
|
|
8267
|
-
],
|
|
8268
|
-
__decorateClass$
|
|
8269
|
-
property({ default:
|
|
8270
|
-
],
|
|
8271
|
-
__decorateClass$
|
|
8272
|
-
|
|
8273
|
-
],
|
|
8274
|
-
Timeline = __decorateClass$s([
|
|
8275
|
-
customNode("Timeline")
|
|
8276
|
-
], Timeline);
|
|
8420
|
+
__decorateClass$u([
|
|
8421
|
+
property({ default: 4 })
|
|
8422
|
+
], KawaseBlurEffect.prototype, "strength", 2);
|
|
8423
|
+
__decorateClass$u([
|
|
8424
|
+
property({ default: 3 })
|
|
8425
|
+
], KawaseBlurEffect.prototype, "quality", 2);
|
|
8426
|
+
__decorateClass$u([
|
|
8427
|
+
property({ default: [1, 1] })
|
|
8428
|
+
], KawaseBlurEffect.prototype, "pixelSize", 2);
|
|
8429
|
+
KawaseBlurEffect = __decorateClass$u([
|
|
8430
|
+
customNode("KawaseBlurEffect")
|
|
8431
|
+
], KawaseBlurEffect);
|
|
8277
8432
|
|
|
8278
|
-
var __defProp$
|
|
8279
|
-
var
|
|
8280
|
-
|
|
8433
|
+
var __defProp$m = Object.defineProperty;
|
|
8434
|
+
var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
|
|
8435
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8436
|
+
var __decorateClass$t = (decorators, target, key, kind) => {
|
|
8437
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
|
|
8281
8438
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8282
8439
|
if (decorator = decorators[i])
|
|
8283
|
-
result = (decorator(target, key, result) ) || result;
|
|
8284
|
-
if (result) __defProp$
|
|
8440
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8441
|
+
if (kind && result) __defProp$m(target, key, result);
|
|
8285
8442
|
return result;
|
|
8286
8443
|
};
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
timeline;
|
|
8292
|
-
_backgroundColor = new Color();
|
|
8293
|
-
_currentViewport;
|
|
8294
|
-
getCurrentViewport() {
|
|
8295
|
-
return this._currentViewport;
|
|
8296
|
-
}
|
|
8297
|
-
setCurrentViewport(viewport) {
|
|
8298
|
-
this._currentViewport = viewport;
|
|
8299
|
-
}
|
|
8300
|
-
constructor(timeline = new Timeline()) {
|
|
8444
|
+
var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
|
|
8445
|
+
let MaskEffect = class extends Effect {
|
|
8446
|
+
texture;
|
|
8447
|
+
constructor(properties, children = []) {
|
|
8301
8448
|
super();
|
|
8302
|
-
this.
|
|
8449
|
+
this.setProperties(properties).append(children);
|
|
8450
|
+
}
|
|
8451
|
+
async load() {
|
|
8452
|
+
this.texture = void 0;
|
|
8453
|
+
if (this.src) {
|
|
8454
|
+
this.texture = await assets.texture.load(this.src);
|
|
8455
|
+
}
|
|
8303
8456
|
}
|
|
8304
8457
|
_updateProperty(key, value, oldValue, declaration) {
|
|
8305
8458
|
super._updateProperty(key, value, oldValue, declaration);
|
|
8306
8459
|
switch (key) {
|
|
8307
|
-
case "
|
|
8308
|
-
this.
|
|
8460
|
+
case "src":
|
|
8461
|
+
this.load();
|
|
8462
|
+
break;
|
|
8463
|
+
case "texture":
|
|
8464
|
+
oldValue?.free?.();
|
|
8309
8465
|
break;
|
|
8310
8466
|
}
|
|
8311
8467
|
}
|
|
8312
|
-
|
|
8313
|
-
if (this.
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
this.emit("rendering");
|
|
8325
|
-
renderer.program.uniforms.projectionMatrix = this.root.toProjectionArray(true);
|
|
8326
|
-
this.renderStack.render(renderer);
|
|
8327
|
-
this._renderScreen(renderer);
|
|
8328
|
-
this.emit("rendered");
|
|
8329
|
-
}
|
|
8330
|
-
_renderScreen(renderer) {
|
|
8331
|
-
renderer.state.reset();
|
|
8332
|
-
renderer.framebuffer.bind(null);
|
|
8333
|
-
renderer.viewport.bind({
|
|
8334
|
-
x: 0,
|
|
8335
|
-
y: 0,
|
|
8336
|
-
width: this.root.width * renderer.pixelRatio,
|
|
8337
|
-
height: this.root.height * renderer.pixelRatio
|
|
8338
|
-
});
|
|
8339
|
-
if (this.backgroundColor) {
|
|
8340
|
-
renderer.gl.clearColor(...this._backgroundColor.toArray());
|
|
8341
|
-
}
|
|
8342
|
-
renderer.clear();
|
|
8343
|
-
if (this.backgroundColor) {
|
|
8344
|
-
renderer.gl.clearColor(0, 0, 0, 0);
|
|
8468
|
+
apply(renderer, source, context) {
|
|
8469
|
+
if (this.texture && context.targetArea) {
|
|
8470
|
+
source.redraw(renderer, () => {
|
|
8471
|
+
this.texture.activate(renderer, 1);
|
|
8472
|
+
QuadUvGeometry.draw(renderer, MaskEffect.material, {
|
|
8473
|
+
sampler: 0,
|
|
8474
|
+
mask: 1,
|
|
8475
|
+
area: context.targetArea,
|
|
8476
|
+
rotation: context.target?.globalRotation ?? 0
|
|
8477
|
+
});
|
|
8478
|
+
renderer.texture.unbind(1);
|
|
8479
|
+
});
|
|
8345
8480
|
}
|
|
8346
|
-
const texture = this.root.texture;
|
|
8347
|
-
texture.activate(renderer, 0);
|
|
8348
|
-
QuadUvGeometry.draw(renderer);
|
|
8349
|
-
renderer.texture.unbind(texture);
|
|
8350
|
-
}
|
|
8351
|
-
free() {
|
|
8352
|
-
super.free();
|
|
8353
|
-
this.root.getChildren(true).forEach((node) => this.root.removeChild(node));
|
|
8354
|
-
this.input.removeEventListeners();
|
|
8355
8481
|
}
|
|
8482
|
+
};
|
|
8483
|
+
__publicField$8(MaskEffect, "material", new Material({
|
|
8484
|
+
vert: `precision mediump float;
|
|
8485
|
+
attribute vec2 position;
|
|
8486
|
+
attribute vec2 uv;
|
|
8487
|
+
varying vec2 vUv;
|
|
8488
|
+
void main() {
|
|
8489
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
8490
|
+
vUv = uv;
|
|
8491
|
+
}`,
|
|
8492
|
+
frag: `varying vec2 vUv;
|
|
8493
|
+
uniform sampler2D sampler;
|
|
8494
|
+
uniform sampler2D mask;
|
|
8495
|
+
uniform float area[4];
|
|
8496
|
+
uniform float rotation;
|
|
8497
|
+
|
|
8498
|
+
vec2 rotateUV(vec2 uv, float angle) {
|
|
8499
|
+
uv -= 0.5;
|
|
8500
|
+
float cosAngle = cos(angle);
|
|
8501
|
+
float sinAngle = sin(angle);
|
|
8502
|
+
mat2 rotationMatrix = mat2(
|
|
8503
|
+
cosAngle, -sinAngle,
|
|
8504
|
+
sinAngle, cosAngle
|
|
8505
|
+
);
|
|
8506
|
+
uv = rotationMatrix * uv;
|
|
8507
|
+
uv += 0.5;
|
|
8508
|
+
return uv;
|
|
8356
8509
|
}
|
|
8357
|
-
__decorateClass$r([
|
|
8358
|
-
property({ default: false })
|
|
8359
|
-
], SceneTree.prototype, "processPaused");
|
|
8360
|
-
__decorateClass$r([
|
|
8361
|
-
property()
|
|
8362
|
-
], SceneTree.prototype, "backgroundColor");
|
|
8363
|
-
__decorateClass$r([
|
|
8364
|
-
protectedProperty({ default: false })
|
|
8365
|
-
], SceneTree.prototype, "debug");
|
|
8366
8510
|
|
|
8511
|
+
void main(void) {
|
|
8512
|
+
if (
|
|
8513
|
+
vUv.x > area[0]
|
|
8514
|
+
&& vUv.x < (area[0] + area[2])
|
|
8515
|
+
&& (1.0 - vUv.y) > area[1]
|
|
8516
|
+
&& (1.0 - vUv.y) < (area[1] + area[3])
|
|
8517
|
+
) {
|
|
8518
|
+
vec4 color = texture2D(sampler, vUv);
|
|
8519
|
+
vec2 uv = vec2(
|
|
8520
|
+
(vUv.x - area[0]) / area[2],
|
|
8521
|
+
((1.0 - vUv.y) - area[1]) / area[3]
|
|
8522
|
+
);
|
|
8523
|
+
vec4 maskColor = texture2D(mask, rotateUV(uv, rotation));
|
|
8524
|
+
gl_FragColor = mix(vec4(0.), color, maskColor.a);
|
|
8525
|
+
} else {
|
|
8526
|
+
gl_FragColor = vec4(0.);
|
|
8527
|
+
}
|
|
8528
|
+
}`
|
|
8529
|
+
}));
|
|
8530
|
+
__decorateClass$t([
|
|
8531
|
+
protectedProperty()
|
|
8532
|
+
], MaskEffect.prototype, "texture", 2);
|
|
8533
|
+
__decorateClass$t([
|
|
8534
|
+
property({ default: "" })
|
|
8535
|
+
], MaskEffect.prototype, "src", 2);
|
|
8536
|
+
MaskEffect = __decorateClass$t([
|
|
8537
|
+
customNode("MaskEffect")
|
|
8538
|
+
], MaskEffect);
|
|
8539
|
+
|
|
8540
|
+
var __defProp$l = Object.defineProperty;
|
|
8367
8541
|
var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
|
|
8368
|
-
var
|
|
8542
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8543
|
+
var __decorateClass$s = (decorators, target, key, kind) => {
|
|
8369
8544
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
|
|
8370
8545
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8371
8546
|
if (decorator = decorators[i])
|
|
8372
|
-
result = (decorator(result)) || result;
|
|
8547
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8548
|
+
if (kind && result) __defProp$l(target, key, result);
|
|
8373
8549
|
return result;
|
|
8374
8550
|
};
|
|
8375
|
-
|
|
8551
|
+
var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8552
|
+
const frag = `precision highp float;
|
|
8553
|
+
varying vec2 vUv;
|
|
8554
|
+
uniform sampler2D sampler;
|
|
8555
|
+
uniform vec2 uThickness;
|
|
8556
|
+
uniform vec3 uColor;
|
|
8557
|
+
uniform float uAlpha;
|
|
8558
|
+
uniform float uKnockout;
|
|
8559
|
+
uniform vec4 uInputClamp;
|
|
8560
|
+
|
|
8561
|
+
const float DOUBLE_PI = 2. * 3.14159265358979323846264;
|
|
8562
|
+
const float ANGLE_STEP = {ANGLE_STEP};
|
|
8563
|
+
|
|
8564
|
+
float outlineMaxAlphaAtPos(vec2 pos) {
|
|
8565
|
+
if (uThickness.x == 0. || uThickness.y == 0.) {
|
|
8566
|
+
return 0.;
|
|
8567
|
+
}
|
|
8568
|
+
vec4 displacedColor;
|
|
8569
|
+
vec2 displacedPos;
|
|
8570
|
+
float maxAlpha = 0.;
|
|
8571
|
+
for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {
|
|
8572
|
+
displacedPos.x = vUv.x + uThickness.x * cos(angle);
|
|
8573
|
+
displacedPos.y = vUv.y + uThickness.y * sin(angle);
|
|
8574
|
+
displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));
|
|
8575
|
+
maxAlpha = max(maxAlpha, displacedColor.a);
|
|
8576
|
+
}
|
|
8577
|
+
return maxAlpha;
|
|
8578
|
+
}
|
|
8579
|
+
|
|
8580
|
+
void main(void) {
|
|
8581
|
+
vec4 sourceColor = texture2D(sampler, vUv);
|
|
8582
|
+
vec4 contentColor = sourceColor * float(uKnockout < 0.5);
|
|
8583
|
+
float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);
|
|
8584
|
+
vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);
|
|
8585
|
+
gl_FragColor = contentColor + outlineColor;
|
|
8586
|
+
}`;
|
|
8587
|
+
let OutlineEffect = class extends Effect {
|
|
8588
|
+
material;
|
|
8589
|
+
static getAngleStep(quality) {
|
|
8590
|
+
return Number.parseFloat(
|
|
8591
|
+
(Math.PI * 2 / Math.max(
|
|
8592
|
+
quality * OutlineEffect.MAX_SAMPLES,
|
|
8593
|
+
OutlineEffect.MIN_SAMPLES
|
|
8594
|
+
)).toFixed(7)
|
|
8595
|
+
);
|
|
8596
|
+
}
|
|
8597
|
+
_color = new Color();
|
|
8376
8598
|
constructor(properties, children = []) {
|
|
8377
8599
|
super();
|
|
8378
8600
|
this.setProperties(properties).append(children);
|
|
8601
|
+
this.material = new Material({
|
|
8602
|
+
vert: `precision mediump float;
|
|
8603
|
+
attribute vec2 position;
|
|
8604
|
+
attribute vec2 uv;
|
|
8605
|
+
varying vec2 vUv;
|
|
8606
|
+
void main() {
|
|
8607
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
8608
|
+
vUv = uv;
|
|
8609
|
+
}`,
|
|
8610
|
+
frag: frag.replace(
|
|
8611
|
+
/\{ANGLE_STEP\}/,
|
|
8612
|
+
OutlineEffect.getAngleStep(this.quality).toFixed(7)
|
|
8613
|
+
)
|
|
8614
|
+
});
|
|
8615
|
+
}
|
|
8616
|
+
apply(renderer, source) {
|
|
8617
|
+
source.redraw(renderer, () => {
|
|
8618
|
+
this._color.value = this.color;
|
|
8619
|
+
QuadUvGeometry.draw(renderer, this.material, {
|
|
8620
|
+
sampler: 0,
|
|
8621
|
+
uThickness: [
|
|
8622
|
+
this.width / source.width,
|
|
8623
|
+
this.width / source.height
|
|
8624
|
+
],
|
|
8625
|
+
uColor: this._color.toArray().slice(0, 3),
|
|
8626
|
+
uAlpha: this.opacity !== 1 ? this.opacity : this._color.a,
|
|
8627
|
+
uAngleStep: OutlineEffect.getAngleStep(this.quality),
|
|
8628
|
+
uKnockout: this.knockout ? 1 : 0,
|
|
8629
|
+
uInputClamp: [0, 0, 1, 1]
|
|
8630
|
+
});
|
|
8631
|
+
});
|
|
8379
8632
|
}
|
|
8380
8633
|
};
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8634
|
+
__publicField$7(OutlineEffect, "MIN_SAMPLES", 1);
|
|
8635
|
+
__publicField$7(OutlineEffect, "MAX_SAMPLES", 100);
|
|
8636
|
+
__decorateClass$s([
|
|
8637
|
+
property({ default: 0 })
|
|
8638
|
+
], OutlineEffect.prototype, "color", 2);
|
|
8639
|
+
__decorateClass$s([
|
|
8640
|
+
property({ default: 1 })
|
|
8641
|
+
], OutlineEffect.prototype, "width", 2);
|
|
8642
|
+
__decorateClass$s([
|
|
8643
|
+
property({ default: "solid" })
|
|
8644
|
+
], OutlineEffect.prototype, "style", 2);
|
|
8645
|
+
__decorateClass$s([
|
|
8646
|
+
property()
|
|
8647
|
+
], OutlineEffect.prototype, "image", 2);
|
|
8648
|
+
__decorateClass$s([
|
|
8649
|
+
property({ default: 1 })
|
|
8650
|
+
], OutlineEffect.prototype, "opacity", 2);
|
|
8651
|
+
__decorateClass$s([
|
|
8652
|
+
property({ default: 0.1 })
|
|
8653
|
+
], OutlineEffect.prototype, "quality", 2);
|
|
8654
|
+
__decorateClass$s([
|
|
8655
|
+
property({ default: false })
|
|
8656
|
+
], OutlineEffect.prototype, "knockout", 2);
|
|
8657
|
+
OutlineEffect = __decorateClass$s([
|
|
8658
|
+
customNode("OutlineEffect")
|
|
8659
|
+
], OutlineEffect);
|
|
8388
8660
|
|
|
8389
|
-
var __defProp$
|
|
8661
|
+
var __defProp$k = Object.defineProperty;
|
|
8390
8662
|
var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
|
|
8391
|
-
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$
|
|
8392
|
-
var __decorateClass$
|
|
8663
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8664
|
+
var __decorateClass$r = (decorators, target, key, kind) => {
|
|
8393
8665
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
|
|
8394
8666
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8395
8667
|
if (decorator = decorators[i])
|
|
8396
|
-
result = (decorator(result)) || result;
|
|
8668
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8669
|
+
if (kind && result) __defProp$k(target, key, result);
|
|
8397
8670
|
return result;
|
|
8398
8671
|
};
|
|
8399
8672
|
var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
|
|
8400
|
-
let
|
|
8401
|
-
|
|
8402
|
-
|
|
8673
|
+
let PixelateEffect = class extends Effect {
|
|
8674
|
+
constructor(properties, children = []) {
|
|
8675
|
+
super();
|
|
8676
|
+
this.setProperties(properties).append(children);
|
|
8677
|
+
}
|
|
8403
8678
|
apply(renderer, source) {
|
|
8404
|
-
this.viewport3.activateWithCopy(renderer, source);
|
|
8405
|
-
this.viewport3.redraw(renderer, () => {
|
|
8406
|
-
QuadUvGeometry.draw(renderer, ShadowEffect.material, {
|
|
8407
|
-
sampler: 0,
|
|
8408
|
-
offset: [1e-3, 1e-3],
|
|
8409
|
-
color: [0, 0, 0],
|
|
8410
|
-
alpha: 0.5
|
|
8411
|
-
});
|
|
8412
|
-
});
|
|
8413
|
-
this.blur.apply(renderer, this.viewport3);
|
|
8414
8679
|
source.redraw(renderer, () => {
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
QuadUvGeometry.draw(renderer, UvMaterial.instance, {
|
|
8420
|
-
sampler: 0
|
|
8680
|
+
QuadUvGeometry.draw(renderer, PixelateEffect.material, {
|
|
8681
|
+
sampler: 0,
|
|
8682
|
+
uSize: [this.strength, this.strength],
|
|
8683
|
+
uInputSize: [source.width, source.height, 1 / source.width, 1 / source.height]
|
|
8421
8684
|
});
|
|
8422
|
-
renderer.texture.unbind(1);
|
|
8423
8685
|
});
|
|
8424
8686
|
}
|
|
8425
8687
|
};
|
|
8426
|
-
__publicField$6(
|
|
8688
|
+
__publicField$6(PixelateEffect, "material", new Material({
|
|
8427
8689
|
vert: `precision mediump float;
|
|
8428
8690
|
attribute vec2 position;
|
|
8429
8691
|
attribute vec2 uv;
|
|
@@ -8432,50 +8694,74 @@ void main() {
|
|
|
8432
8694
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
8433
8695
|
vUv = uv;
|
|
8434
8696
|
}`,
|
|
8435
|
-
frag: `
|
|
8436
|
-
varying vec2 vUv;
|
|
8697
|
+
frag: `varying vec2 vUv;
|
|
8437
8698
|
uniform sampler2D sampler;
|
|
8438
|
-
uniform
|
|
8439
|
-
uniform
|
|
8440
|
-
|
|
8699
|
+
uniform vec2 uSize;
|
|
8700
|
+
uniform vec4 uInputSize;
|
|
8701
|
+
|
|
8702
|
+
vec2 mapCoord(vec2 coord) {
|
|
8703
|
+
coord *= uInputSize.xy;
|
|
8704
|
+
coord += uInputSize.zw;
|
|
8705
|
+
return coord;
|
|
8706
|
+
}
|
|
8707
|
+
|
|
8708
|
+
vec2 unmapCoord(vec2 coord) {
|
|
8709
|
+
coord -= uInputSize.zw;
|
|
8710
|
+
coord /= uInputSize.xy;
|
|
8711
|
+
return coord;
|
|
8712
|
+
}
|
|
8713
|
+
|
|
8714
|
+
vec2 pixelate(vec2 coord, vec2 size) {
|
|
8715
|
+
return floor(coord / size) * size;
|
|
8716
|
+
}
|
|
8441
8717
|
|
|
8442
8718
|
void main(void) {
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
gl_FragColor =
|
|
8719
|
+
vec2 coord = mapCoord(vUv);
|
|
8720
|
+
coord = pixelate(coord, uSize);
|
|
8721
|
+
coord = unmapCoord(coord);
|
|
8722
|
+
gl_FragColor = texture2D(sampler, coord);
|
|
8447
8723
|
}`
|
|
8448
8724
|
}));
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
],
|
|
8725
|
+
__decorateClass$r([
|
|
8726
|
+
property({ default: 10 })
|
|
8727
|
+
], PixelateEffect.prototype, "strength", 2);
|
|
8728
|
+
PixelateEffect = __decorateClass$r([
|
|
8729
|
+
customNode("PixelateEffect")
|
|
8730
|
+
], PixelateEffect);
|
|
8452
8731
|
|
|
8453
|
-
var __defProp$
|
|
8732
|
+
var __defProp$j = Object.defineProperty;
|
|
8454
8733
|
var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
|
|
8455
|
-
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$
|
|
8456
|
-
var __decorateClass$
|
|
8734
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8735
|
+
var __decorateClass$q = (decorators, target, key, kind) => {
|
|
8457
8736
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
|
|
8458
8737
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8459
8738
|
if (decorator = decorators[i])
|
|
8460
8739
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8461
|
-
if (kind && result) __defProp$
|
|
8740
|
+
if (kind && result) __defProp$j(target, key, result);
|
|
8462
8741
|
return result;
|
|
8463
8742
|
};
|
|
8464
8743
|
var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
|
|
8465
8744
|
let ZoomBlurEffect = class extends Effect {
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
apply(renderer, source) {
|
|
8745
|
+
constructor(properties, children = []) {
|
|
8746
|
+
super();
|
|
8747
|
+
this.setProperties(properties).append(children);
|
|
8748
|
+
}
|
|
8749
|
+
apply(renderer, source, context) {
|
|
8750
|
+
let center = this.center;
|
|
8751
|
+
if (context.targetArea) {
|
|
8752
|
+
center = [
|
|
8753
|
+
(context.targetArea[0] + context.targetArea[2] / 2) * source.width,
|
|
8754
|
+
(context.targetArea[1] + context.targetArea[3] / 2) * source.height
|
|
8755
|
+
];
|
|
8756
|
+
}
|
|
8471
8757
|
source.redraw(renderer, () => {
|
|
8472
8758
|
QuadUvGeometry.draw(renderer, ZoomBlurEffect.material, {
|
|
8473
8759
|
sampler: 0,
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8760
|
+
uCenter: center ?? [source.width / 2, source.height / 2],
|
|
8761
|
+
uInnerRadius: this.innerRadius,
|
|
8762
|
+
uRadius: this.radius,
|
|
8763
|
+
uStrength: this.strength,
|
|
8764
|
+
uInputSize: [source.width, source.height, 1 / source.width, 1 / source.height]
|
|
8479
8765
|
});
|
|
8480
8766
|
});
|
|
8481
8767
|
}
|
|
@@ -8490,12 +8776,12 @@ void main() {
|
|
|
8490
8776
|
}`,
|
|
8491
8777
|
frag: `varying vec2 vUv;
|
|
8492
8778
|
uniform sampler2D sampler;
|
|
8493
|
-
uniform vec4
|
|
8779
|
+
uniform vec4 uInputSize;
|
|
8494
8780
|
|
|
8495
|
-
uniform vec2
|
|
8496
|
-
uniform float
|
|
8497
|
-
uniform float
|
|
8498
|
-
uniform float
|
|
8781
|
+
uniform vec2 uCenter;
|
|
8782
|
+
uniform float uStrength;
|
|
8783
|
+
uniform float uInnerRadius;
|
|
8784
|
+
uniform float uRadius;
|
|
8499
8785
|
|
|
8500
8786
|
const float MAX_KERNEL_SIZE = 32.0;
|
|
8501
8787
|
|
|
@@ -8506,18 +8792,18 @@ highp float rand(vec2 co, float seed) {
|
|
|
8506
8792
|
}
|
|
8507
8793
|
|
|
8508
8794
|
void main() {
|
|
8509
|
-
float minGradient =
|
|
8510
|
-
float innerRadius1 = (
|
|
8795
|
+
float minGradient = uInnerRadius * 0.3;
|
|
8796
|
+
float innerRadius1 = (uInnerRadius + minGradient * 0.5) / uInputSize.x;
|
|
8511
8797
|
|
|
8512
|
-
float gradient =
|
|
8513
|
-
float radius1 = (
|
|
8798
|
+
float gradient = uRadius * 0.3;
|
|
8799
|
+
float radius1 = (uRadius - gradient * 0.5) / uInputSize.x;
|
|
8514
8800
|
|
|
8515
8801
|
float countLimit = MAX_KERNEL_SIZE;
|
|
8516
8802
|
|
|
8517
|
-
vec2 dir = vec2(
|
|
8518
|
-
float dist = length(vec2(dir.x, dir.y *
|
|
8803
|
+
vec2 dir = vec2(uCenter.xy / uInputSize.xy - vUv);
|
|
8804
|
+
float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x));
|
|
8519
8805
|
|
|
8520
|
-
float strength1 =
|
|
8806
|
+
float strength1 = uStrength;
|
|
8521
8807
|
|
|
8522
8808
|
float delta = 0.0;
|
|
8523
8809
|
float gap;
|
|
@@ -8530,7 +8816,7 @@ void main() {
|
|
|
8530
8816
|
}
|
|
8531
8817
|
|
|
8532
8818
|
if (delta > 0.0) {
|
|
8533
|
-
float normalCount = gap /
|
|
8819
|
+
float normalCount = gap / uInputSize.x;
|
|
8534
8820
|
delta = (normalCount - delta) / normalCount;
|
|
8535
8821
|
countLimit *= delta;
|
|
8536
8822
|
strength1 *= delta;
|
|
@@ -8564,22 +8850,134 @@ void main() {
|
|
|
8564
8850
|
gl_FragColor = color;
|
|
8565
8851
|
}`
|
|
8566
8852
|
}));
|
|
8567
|
-
__decorateClass$
|
|
8853
|
+
__decorateClass$q([
|
|
8568
8854
|
property()
|
|
8569
8855
|
], ZoomBlurEffect.prototype, "center", 2);
|
|
8570
|
-
__decorateClass$
|
|
8571
|
-
property()
|
|
8856
|
+
__decorateClass$q([
|
|
8857
|
+
property({ default: 20 })
|
|
8572
8858
|
], ZoomBlurEffect.prototype, "innerRadius", 2);
|
|
8573
|
-
__decorateClass$
|
|
8574
|
-
property()
|
|
8859
|
+
__decorateClass$q([
|
|
8860
|
+
property({ default: -1 })
|
|
8575
8861
|
], ZoomBlurEffect.prototype, "radius", 2);
|
|
8576
|
-
__decorateClass$
|
|
8577
|
-
property()
|
|
8862
|
+
__decorateClass$q([
|
|
8863
|
+
property({ default: 0.1 })
|
|
8578
8864
|
], ZoomBlurEffect.prototype, "strength", 2);
|
|
8579
|
-
ZoomBlurEffect = __decorateClass$
|
|
8865
|
+
ZoomBlurEffect = __decorateClass$q([
|
|
8580
8866
|
customNode("ZoomBlurEffect")
|
|
8581
8867
|
], ZoomBlurEffect);
|
|
8582
8868
|
|
|
8869
|
+
var __defProp$i = Object.defineProperty;
|
|
8870
|
+
var __decorateClass$p = (decorators, target, key, kind) => {
|
|
8871
|
+
var result = void 0 ;
|
|
8872
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8873
|
+
if (decorator = decorators[i])
|
|
8874
|
+
result = (decorator(target, key, result) ) || result;
|
|
8875
|
+
if (result) __defProp$i(target, key, result);
|
|
8876
|
+
return result;
|
|
8877
|
+
};
|
|
8878
|
+
class BaseElement2DOutline extends CoreObject {
|
|
8879
|
+
constructor(parent) {
|
|
8880
|
+
super();
|
|
8881
|
+
this.parent = parent;
|
|
8882
|
+
}
|
|
8883
|
+
_updateProperty(key, value, oldValue, declaration) {
|
|
8884
|
+
super._updateProperty(key, value, oldValue, declaration);
|
|
8885
|
+
switch (key) {
|
|
8886
|
+
case "color":
|
|
8887
|
+
case "width":
|
|
8888
|
+
case "style":
|
|
8889
|
+
case "image":
|
|
8890
|
+
case "opacity":
|
|
8891
|
+
this.updateEffect();
|
|
8892
|
+
break;
|
|
8893
|
+
}
|
|
8894
|
+
}
|
|
8895
|
+
updateEffect() {
|
|
8896
|
+
const name = "__$outline";
|
|
8897
|
+
let effect = this.parent.getNode(name);
|
|
8898
|
+
if (this.width) {
|
|
8899
|
+
if (!effect) {
|
|
8900
|
+
effect = new OutlineEffect({ name });
|
|
8901
|
+
this.parent.appendChild(effect, "back");
|
|
8902
|
+
}
|
|
8903
|
+
effect.setProperties(this.getProperties());
|
|
8904
|
+
} else {
|
|
8905
|
+
if (effect) {
|
|
8906
|
+
this.parent.removeChild(effect);
|
|
8907
|
+
}
|
|
8908
|
+
}
|
|
8909
|
+
}
|
|
8910
|
+
}
|
|
8911
|
+
__decorateClass$p([
|
|
8912
|
+
property({ default: "#000000" })
|
|
8913
|
+
], BaseElement2DOutline.prototype, "color");
|
|
8914
|
+
__decorateClass$p([
|
|
8915
|
+
property({ default: 0 })
|
|
8916
|
+
], BaseElement2DOutline.prototype, "width");
|
|
8917
|
+
__decorateClass$p([
|
|
8918
|
+
property({ default: "solid" })
|
|
8919
|
+
], BaseElement2DOutline.prototype, "style");
|
|
8920
|
+
__decorateClass$p([
|
|
8921
|
+
property()
|
|
8922
|
+
], BaseElement2DOutline.prototype, "image");
|
|
8923
|
+
__decorateClass$p([
|
|
8924
|
+
property({ default: 1 })
|
|
8925
|
+
], BaseElement2DOutline.prototype, "opacity");
|
|
8926
|
+
|
|
8927
|
+
var __defProp$h = Object.defineProperty;
|
|
8928
|
+
var __decorateClass$o = (decorators, target, key, kind) => {
|
|
8929
|
+
var result = void 0 ;
|
|
8930
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8931
|
+
if (decorator = decorators[i])
|
|
8932
|
+
result = (decorator(target, key, result) ) || result;
|
|
8933
|
+
if (result) __defProp$h(target, key, result);
|
|
8934
|
+
return result;
|
|
8935
|
+
};
|
|
8936
|
+
class BaseElement2DShadow extends CoreObject {
|
|
8937
|
+
constructor(parent) {
|
|
8938
|
+
super();
|
|
8939
|
+
this.parent = parent;
|
|
8940
|
+
}
|
|
8941
|
+
_updateProperty(key, value, oldValue, declaration) {
|
|
8942
|
+
super._updateProperty(key, value, oldValue, declaration);
|
|
8943
|
+
switch (key) {
|
|
8944
|
+
case "color":
|
|
8945
|
+
case "blur":
|
|
8946
|
+
case "offsetX":
|
|
8947
|
+
case "offsetY":
|
|
8948
|
+
this.updateEffect();
|
|
8949
|
+
break;
|
|
8950
|
+
}
|
|
8951
|
+
}
|
|
8952
|
+
updateEffect() {
|
|
8953
|
+
const name = "__$shadow";
|
|
8954
|
+
let effect = this.parent.getNode(name);
|
|
8955
|
+
if (this.blur || this.offsetX || this.offsetY) {
|
|
8956
|
+
if (!effect) {
|
|
8957
|
+
effect = new DropShadowEffect({ name });
|
|
8958
|
+
this.parent.appendChild(effect, "back");
|
|
8959
|
+
}
|
|
8960
|
+
effect.setProperties(this.getProperties());
|
|
8961
|
+
} else {
|
|
8962
|
+
if (effect) {
|
|
8963
|
+
this.parent.removeChild(effect);
|
|
8964
|
+
}
|
|
8965
|
+
}
|
|
8966
|
+
}
|
|
8967
|
+
}
|
|
8968
|
+
__decorateClass$o([
|
|
8969
|
+
property({ default: "#000000" })
|
|
8970
|
+
], BaseElement2DShadow.prototype, "color");
|
|
8971
|
+
__decorateClass$o([
|
|
8972
|
+
property({ default: 0 })
|
|
8973
|
+
], BaseElement2DShadow.prototype, "blur");
|
|
8974
|
+
__decorateClass$o([
|
|
8975
|
+
property({ default: 0 })
|
|
8976
|
+
], BaseElement2DShadow.prototype, "offsetY");
|
|
8977
|
+
__decorateClass$o([
|
|
8978
|
+
property({ default: 0 })
|
|
8979
|
+
], BaseElement2DShadow.prototype, "offsetX");
|
|
8980
|
+
|
|
8583
8981
|
class BaseElement2DStyle extends Resource {
|
|
8584
8982
|
_backgroundColor = new Color();
|
|
8585
8983
|
constructor(properties) {
|
|
@@ -8721,6 +9119,8 @@ let BaseElement2D = class extends Node2D {
|
|
|
8721
9119
|
this._style?.off("updateProperty", cb);
|
|
8722
9120
|
this._style = style;
|
|
8723
9121
|
}
|
|
9122
|
+
shadow = new BaseElement2DShadow(this);
|
|
9123
|
+
outline = new BaseElement2DOutline(this);
|
|
8724
9124
|
constructor(properties, nodes = []) {
|
|
8725
9125
|
super();
|
|
8726
9126
|
this._updateStyleProperty = this._updateStyleProperty.bind(this);
|
|
@@ -8729,8 +9129,10 @@ let BaseElement2D = class extends Node2D {
|
|
|
8729
9129
|
}
|
|
8730
9130
|
setProperties(properties) {
|
|
8731
9131
|
if (properties) {
|
|
8732
|
-
const { style, ...restProperties } = properties;
|
|
9132
|
+
const { style, shadow, outline, ...restProperties } = properties;
|
|
8733
9133
|
style && this.style.setProperties(style);
|
|
9134
|
+
shadow && this.shadow.setProperties(shadow);
|
|
9135
|
+
outline && this.outline.setProperties(outline);
|
|
8734
9136
|
super.setProperties(restProperties);
|
|
8735
9137
|
}
|
|
8736
9138
|
return this;
|
|
@@ -8787,9 +9189,6 @@ let BaseElement2D = class extends Node2D {
|
|
|
8787
9189
|
case "filter":
|
|
8788
9190
|
this.requestRepaint();
|
|
8789
9191
|
break;
|
|
8790
|
-
case "boxShadow":
|
|
8791
|
-
this._updateBoxShadow();
|
|
8792
|
-
break;
|
|
8793
9192
|
case "maskImage":
|
|
8794
9193
|
this._updateMaskImage();
|
|
8795
9194
|
break;
|
|
@@ -8798,20 +9197,6 @@ let BaseElement2D = class extends Node2D {
|
|
|
8798
9197
|
break;
|
|
8799
9198
|
}
|
|
8800
9199
|
}
|
|
8801
|
-
_updateBoxShadow() {
|
|
8802
|
-
const nodePath = "__$style.shadow";
|
|
8803
|
-
if (this.style.boxShadow !== "none") {
|
|
8804
|
-
const node = this.getNode(nodePath);
|
|
8805
|
-
if (node) ; else {
|
|
8806
|
-
this.appendChild(new ShadowEffect({ name: nodePath }), "back");
|
|
8807
|
-
}
|
|
8808
|
-
} else {
|
|
8809
|
-
const node = this.getNode(nodePath);
|
|
8810
|
-
if (node) {
|
|
8811
|
-
this.removeChild(node);
|
|
8812
|
-
}
|
|
8813
|
-
}
|
|
8814
|
-
}
|
|
8815
9200
|
_updateMaskImage() {
|
|
8816
9201
|
const nodePath = "__$style.maskImage";
|
|
8817
9202
|
const maskImage = this.style.maskImage;
|
|
@@ -9014,6 +9399,8 @@ let BaseElement2D = class extends Node2D {
|
|
|
9014
9399
|
...json,
|
|
9015
9400
|
props: {
|
|
9016
9401
|
style: this.style.toJSON(),
|
|
9402
|
+
shadow: this.shadow.toJSON(),
|
|
9403
|
+
outline: this.outline.toJSON(),
|
|
9017
9404
|
...json.props
|
|
9018
9405
|
}
|
|
9019
9406
|
};
|
|
@@ -13232,4 +13619,4 @@ async function render(options) {
|
|
|
13232
13619
|
});
|
|
13233
13620
|
}
|
|
13234
13621
|
|
|
13235
|
-
export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DStyle,
|
|
13622
|
+
export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DStyle, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, EventEmitter, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GIFLoader, GaussianBlurEffect, Geometry, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JSONLoader, KawaseBlurEffect, KawaseTransition, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, Text2D, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, YScrollBar, ZoomBlurEffect, assets, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, frag$1 as frag, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
|