@galacean/engine-rhi-webgl 0.9.21 → 0.9.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/main.js +84 -34
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +84 -34
- package/dist/module.js +57 -4
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/GLBuffer.d.ts +1 -0
- package/types/WebGLGraphicDevice.d.ts +1 -2
package/dist/miniprogram.js
CHANGED
|
@@ -3,20 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var engineMiniprogramAdapter = require('@galacean/engine-miniprogram-adapter');
|
|
6
|
-
var _create_class = require('@swc/helpers/src/_create_class.mjs');
|
|
7
|
-
var _instanceof = require('@swc/helpers/src/_instanceof.mjs');
|
|
8
6
|
var miniprogram = require('@galacean/engine-math/dist/miniprogram');
|
|
9
|
-
var _inherits = require('@swc/helpers/src/_inherits.mjs');
|
|
10
7
|
var miniprogram$1 = require('@galacean/engine-core/dist/miniprogram');
|
|
11
|
-
var _extends = require('@swc/helpers/src/_extends.mjs');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var _create_class__default = /*#__PURE__*/_interopDefaultLegacy(_create_class);
|
|
16
|
-
var _instanceof__default = /*#__PURE__*/_interopDefaultLegacy(_instanceof);
|
|
17
|
-
var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
|
|
18
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
19
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Smoothing plug-in.
|
|
11
|
+
* */ exports.GLCompressedTextureInternalFormat = void 0;
|
|
20
12
|
(function(GLCompressedTextureInternalFormat) {
|
|
21
13
|
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[// astc
|
|
22
14
|
"RGBA_ASTC_4X4_KHR"] = 0x93b0] = "RGBA_ASTC_4X4_KHR";
|
|
@@ -72,6 +64,30 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
72
64
|
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT5_EXT"] = 0x83f3] = "RGBA_S3TC_DXT5_EXT";
|
|
73
65
|
})(exports.GLCompressedTextureInternalFormat || (exports.GLCompressedTextureInternalFormat = {}));
|
|
74
66
|
|
|
67
|
+
function _defineProperties(target, props) {
|
|
68
|
+
for (var i = 0; i < props.length; i++) {
|
|
69
|
+
var descriptor = props[i];
|
|
70
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
71
|
+
descriptor.configurable = true;
|
|
72
|
+
|
|
73
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
74
|
+
|
|
75
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
79
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
80
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
81
|
+
|
|
82
|
+
return Constructor;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function _instanceof(left, right) {
|
|
86
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
87
|
+
return !!right[Symbol.hasInstance](left);
|
|
88
|
+
} else return left instanceof right;
|
|
89
|
+
}
|
|
90
|
+
|
|
75
91
|
/**
|
|
76
92
|
* The canvas used on the web, which can support HTMLCanvasElement and OffscreenCanvas.
|
|
77
93
|
*/ var WebCanvas = /*#__PURE__*/ function() {
|
|
@@ -90,7 +106,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
90
106
|
*/ _proto.resizeByClientSize = function resizeByClientSize(pixelRatio) {
|
|
91
107
|
if (pixelRatio === void 0) pixelRatio = engineMiniprogramAdapter.window.devicePixelRatio;
|
|
92
108
|
var webCanvas = this._webCanvas;
|
|
93
|
-
if (typeof engineMiniprogramAdapter.OffscreenCanvas === "undefined" || !
|
|
109
|
+
if (typeof engineMiniprogramAdapter.OffscreenCanvas === "undefined" || !_instanceof(webCanvas, engineMiniprogramAdapter.OffscreenCanvas)) {
|
|
94
110
|
this.width = webCanvas.clientWidth * pixelRatio;
|
|
95
111
|
this.height = webCanvas.clientHeight * pixelRatio;
|
|
96
112
|
}
|
|
@@ -103,7 +119,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
103
119
|
this._scale.set(x, y);
|
|
104
120
|
this.scale = this._scale;
|
|
105
121
|
};
|
|
106
|
-
|
|
122
|
+
_create_class(WebCanvas, [
|
|
107
123
|
{
|
|
108
124
|
key: "width",
|
|
109
125
|
get: /**
|
|
@@ -139,14 +155,14 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
139
155
|
* @remarks Need to re-assign after modification to ensure that the modification takes effect.
|
|
140
156
|
*/ function get() {
|
|
141
157
|
var webCanvas = this._webCanvas;
|
|
142
|
-
if (typeof engineMiniprogramAdapter.OffscreenCanvas === "undefined" || !
|
|
158
|
+
if (typeof engineMiniprogramAdapter.OffscreenCanvas === "undefined" || !_instanceof(webCanvas, engineMiniprogramAdapter.OffscreenCanvas)) {
|
|
143
159
|
this._scale.set(webCanvas.clientWidth * engineMiniprogramAdapter.devicePixelRatio / webCanvas.width, webCanvas.clientHeight * engineMiniprogramAdapter.devicePixelRatio / webCanvas.height);
|
|
144
160
|
}
|
|
145
161
|
return this._scale;
|
|
146
162
|
},
|
|
147
163
|
set: function set(value) {
|
|
148
164
|
var webCanvas = this._webCanvas;
|
|
149
|
-
if (typeof engineMiniprogramAdapter.OffscreenCanvas === "undefined" || !
|
|
165
|
+
if (typeof engineMiniprogramAdapter.OffscreenCanvas === "undefined" || !_instanceof(webCanvas, engineMiniprogramAdapter.OffscreenCanvas)) {
|
|
150
166
|
webCanvas.style.transformOrigin = "left top";
|
|
151
167
|
webCanvas.style.transform = "scale(" + value.x + ", " + value.y + ")";
|
|
152
168
|
}
|
|
@@ -156,6 +172,39 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
156
172
|
return WebCanvas;
|
|
157
173
|
}();
|
|
158
174
|
|
|
175
|
+
function _set_prototype_of(o, p) {
|
|
176
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
177
|
+
o.__proto__ = p;
|
|
178
|
+
|
|
179
|
+
return o;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
return _set_prototype_of(o, p);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function _inherits(subClass, superClass) {
|
|
186
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
187
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
191
|
+
|
|
192
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function _extends() {
|
|
196
|
+
_extends = Object.assign || function assign(target) {
|
|
197
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
198
|
+
var source = arguments[i];
|
|
199
|
+
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return target;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
return _extends.apply(this, arguments);
|
|
206
|
+
}
|
|
207
|
+
|
|
159
208
|
/**
|
|
160
209
|
* GL capability.
|
|
161
210
|
*/ var GLCapability = /*#__PURE__*/ function() {
|
|
@@ -274,7 +323,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
274
323
|
i != 0 && (items["COLOR_ATTACHMENT" + i] = "COLOR_ATTACHMENT" + i + "_WEBGL");
|
|
275
324
|
items["DRAW_BUFFER" + i] = "DRAW_BUFFER" + i + "_WEBGL";
|
|
276
325
|
}
|
|
277
|
-
this._compatibleInterface(drawBuffers,
|
|
326
|
+
this._compatibleInterface(drawBuffers, _extends({
|
|
278
327
|
drawBuffers: "drawBuffersWEBGL"
|
|
279
328
|
}, items));
|
|
280
329
|
}
|
|
@@ -292,7 +341,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
292
341
|
TEXTURE_MAX_ANISOTROPY_EXT: "TEXTURE_MAX_ANISOTROPY_EXT"
|
|
293
342
|
});
|
|
294
343
|
};
|
|
295
|
-
|
|
344
|
+
_create_class(GLCapability, [
|
|
296
345
|
{
|
|
297
346
|
key: "maxTextureSize",
|
|
298
347
|
get: function get() {
|
|
@@ -1046,7 +1095,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1046
1095
|
}
|
|
1047
1096
|
return true;
|
|
1048
1097
|
};
|
|
1049
|
-
|
|
1098
|
+
_create_class(GLTexture, [
|
|
1050
1099
|
{
|
|
1051
1100
|
key: "wrapModeU",
|
|
1052
1101
|
set: /**
|
|
@@ -1147,7 +1196,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1147
1196
|
this._isWebGL2 = rhi.isWebGL2;
|
|
1148
1197
|
this._target = target;
|
|
1149
1198
|
/** @ts-ignore */ var _colorTextures = target._colorTextures, _depth = target._depth, width = target.width, height = target.height;
|
|
1150
|
-
var isDepthTexture =
|
|
1199
|
+
var isDepthTexture = _instanceof(_depth, miniprogram$1.Texture);
|
|
1151
1200
|
/** todo
|
|
1152
1201
|
* MRT + Cube + [,MSAA]
|
|
1153
1202
|
* MRT + MSAA
|
|
@@ -1173,7 +1222,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1173
1222
|
}
|
|
1174
1223
|
// todo: necessary to support MRT + Cube + [,MSAA] ?
|
|
1175
1224
|
if (_colorTextures.length > 1 && _colorTextures.some(function(v) {
|
|
1176
|
-
return
|
|
1225
|
+
return _instanceof(v, miniprogram$1.TextureCube);
|
|
1177
1226
|
})) {
|
|
1178
1227
|
throw new Error("MRT+Cube+[,MSAA] is not supported");
|
|
1179
1228
|
}
|
|
@@ -1203,14 +1252,14 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1203
1252
|
var mipChanged = mipLevel !== this._curMipLevel;
|
|
1204
1253
|
gl.bindFramebuffer(gl.FRAMEBUFFER, this._frameBuffer);
|
|
1205
1254
|
if (colorTexture) {
|
|
1206
|
-
var isCube =
|
|
1255
|
+
var isCube = _instanceof(colorTexture, miniprogram$1.TextureCube);
|
|
1207
1256
|
if (mipChanged || isCube) {
|
|
1208
1257
|
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, isCube ? gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex : gl.TEXTURE_2D, // @ts-ignore
|
|
1209
1258
|
colorTexture._platformTexture._glTexture, mipLevel);
|
|
1210
1259
|
}
|
|
1211
1260
|
}
|
|
1212
1261
|
if (depthTexture) {
|
|
1213
|
-
var isCube1 =
|
|
1262
|
+
var isCube1 = _instanceof(depthTexture, miniprogram$1.TextureCube);
|
|
1214
1263
|
if (mipChanged || isCube1) {
|
|
1215
1264
|
// @ts-ignore
|
|
1216
1265
|
var platformTexture = depthTexture._platformTexture;
|
|
@@ -1288,7 +1337,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1288
1337
|
var colorTexture = this._target.getColorTexture(i);
|
|
1289
1338
|
var attachment = gl.COLOR_ATTACHMENT0 + i;
|
|
1290
1339
|
drawBuffers[i] = attachment;
|
|
1291
|
-
if (!
|
|
1340
|
+
if (!_instanceof(colorTexture, miniprogram$1.TextureCube)) {
|
|
1292
1341
|
gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, /** @ts-ignore */ colorTexture._platformTexture._glTexture, 0);
|
|
1293
1342
|
}
|
|
1294
1343
|
}
|
|
@@ -1297,7 +1346,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1297
1346
|
}
|
|
1298
1347
|
this._oriDrawBuffers = drawBuffers;
|
|
1299
1348
|
/** depth render buffer */ if (_depth !== null) {
|
|
1300
|
-
if (
|
|
1349
|
+
if (_instanceof(_depth, miniprogram$1.Texture) && !_instanceof(_depth, miniprogram$1.TextureCube)) {
|
|
1301
1350
|
// @ts-ignore
|
|
1302
1351
|
var platformTexture = _depth._platformTexture;
|
|
1303
1352
|
gl.framebufferTexture2D(gl.FRAMEBUFFER, platformTexture._formatDetail.attachment, gl.TEXTURE_2D, platformTexture._glTexture, 0);
|
|
@@ -1333,7 +1382,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1333
1382
|
gl.drawBuffers(this._oriDrawBuffers);
|
|
1334
1383
|
// prepare MSAA depth RBO
|
|
1335
1384
|
if (_depth !== null) {
|
|
1336
|
-
var _ref =
|
|
1385
|
+
var _ref = _instanceof(_depth, miniprogram$1.Texture) ? /** @ts-ignore */ _depth._platformTexture._formatDetail : GLTexture._getRenderBufferDepthFormatDetail(_depth, gl, isWebGL2), internalFormat = _ref.internalFormat, attachment = _ref.attachment;
|
|
1337
1386
|
gl.bindRenderbuffer(gl.RENDERBUFFER, MSAADepthRenderBuffer);
|
|
1338
1387
|
gl.renderbufferStorageMultisample(gl.RENDERBUFFER, antiAliasing, internalFormat, width, height);
|
|
1339
1388
|
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, MSAADepthRenderBuffer);
|
|
@@ -1366,7 +1415,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1366
1415
|
/**
|
|
1367
1416
|
* Texture 2d in WebGL platform.
|
|
1368
1417
|
*/ var GLTexture2D = /*#__PURE__*/ function(GLTexture1) {
|
|
1369
|
-
|
|
1418
|
+
_inherits(GLTexture2D, GLTexture1);
|
|
1370
1419
|
function GLTexture2D(rhi, texture2D) {
|
|
1371
1420
|
var _this;
|
|
1372
1421
|
_this = GLTexture1.call(this, rhi, texture2D, rhi.gl.TEXTURE_2D) || this;
|
|
@@ -1436,7 +1485,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1436
1485
|
/**
|
|
1437
1486
|
* Texture 2D array in WebGL platform.
|
|
1438
1487
|
*/ var GLTexture2DArray = /*#__PURE__*/ function(GLTexture1) {
|
|
1439
|
-
|
|
1488
|
+
_inherits(GLTexture2DArray, GLTexture1);
|
|
1440
1489
|
function GLTexture2DArray(rhi, texture2DArray) {
|
|
1441
1490
|
var _this;
|
|
1442
1491
|
_this = GLTexture1.call(this, rhi, texture2DArray, rhi.gl.TEXTURE_2D_ARRAY) || this;
|
|
@@ -1498,7 +1547,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1498
1547
|
/**
|
|
1499
1548
|
* Cube texture in WebGL platform.
|
|
1500
1549
|
*/ var GLTextureCube = /*#__PURE__*/ function(GLTexture1) {
|
|
1501
|
-
|
|
1550
|
+
_inherits(GLTextureCube, GLTexture1);
|
|
1502
1551
|
function GLTextureCube(rhi, textureCube) {
|
|
1503
1552
|
var _this;
|
|
1504
1553
|
_this = GLTexture1.call(this, rhi, textureCube, rhi.gl.TEXTURE_CUBE_MAP) || this;
|
|
@@ -1570,6 +1619,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1570
1619
|
return GLTextureCube;
|
|
1571
1620
|
}(GLTexture);
|
|
1572
1621
|
|
|
1622
|
+
exports.WebGLMode = void 0;
|
|
1573
1623
|
(function(WebGLMode) {
|
|
1574
1624
|
WebGLMode[WebGLMode[/** Auto, use WebGL2.0 if support, or will fallback to WebGL1.0. */ "Auto"] = 0] = "Auto";
|
|
1575
1625
|
WebGLMode[WebGLMode[/** WebGL2.0. */ "WebGL2"] = 1] = "WebGL2";
|
|
@@ -1587,7 +1637,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1587
1637
|
this._lastScissor = new miniprogram.Vector4(null, null, null, null);
|
|
1588
1638
|
this._lastClearColor = new miniprogram.Color(null, null, null, null);
|
|
1589
1639
|
this._scissorEnable = false;
|
|
1590
|
-
var options =
|
|
1640
|
+
var options = _extends({
|
|
1591
1641
|
webGLMode: 0,
|
|
1592
1642
|
alpha: false,
|
|
1593
1643
|
stencil: true,
|
|
@@ -1614,7 +1664,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1614
1664
|
var gl;
|
|
1615
1665
|
if (webGLMode == 0 || webGLMode == 1) {
|
|
1616
1666
|
gl = webCanvas.getContext("webgl2", options);
|
|
1617
|
-
if (!gl && (typeof engineMiniprogramAdapter.OffscreenCanvas === "undefined" || !
|
|
1667
|
+
if (!gl && (typeof engineMiniprogramAdapter.OffscreenCanvas === "undefined" || !_instanceof(webCanvas, engineMiniprogramAdapter.OffscreenCanvas))) {
|
|
1618
1668
|
gl = webCanvas.getContext("experimental-webgl2", options);
|
|
1619
1669
|
}
|
|
1620
1670
|
this._isWebGL2 = true;
|
|
@@ -1626,7 +1676,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1626
1676
|
if (!gl) {
|
|
1627
1677
|
if (webGLMode == 0 || webGLMode == 2) {
|
|
1628
1678
|
gl = webCanvas.getContext("webgl", options);
|
|
1629
|
-
if (!gl && (typeof engineMiniprogramAdapter.OffscreenCanvas === "undefined" || !
|
|
1679
|
+
if (!gl && (typeof engineMiniprogramAdapter.OffscreenCanvas === "undefined" || !_instanceof(webCanvas, engineMiniprogramAdapter.OffscreenCanvas))) {
|
|
1630
1680
|
gl = webCanvas.getContext("experimental-webgl", options);
|
|
1631
1681
|
}
|
|
1632
1682
|
this._isWebGL2 = false;
|
|
@@ -1790,7 +1840,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1790
1840
|
this._gl.flush();
|
|
1791
1841
|
};
|
|
1792
1842
|
_proto.destroy = function destroy() {};
|
|
1793
|
-
|
|
1843
|
+
_create_class(WebGLRenderer, [
|
|
1794
1844
|
{
|
|
1795
1845
|
key: "isWebGL2",
|
|
1796
1846
|
get: function get() {
|
|
@@ -1837,13 +1887,13 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
1837
1887
|
/**
|
|
1838
1888
|
* WebGL platform engine,support includes WebGL1.0 and WebGL2.0.
|
|
1839
1889
|
*/ var WebGLEngine = /*#__PURE__*/ function(Engine) {
|
|
1840
|
-
|
|
1890
|
+
_inherits(WebGLEngine, Engine);
|
|
1841
1891
|
function WebGLEngine(canvas, webGLRendererOptions) {
|
|
1842
1892
|
var webCanvas = new WebCanvas(typeof canvas === "string" ? engineMiniprogramAdapter.document.getElementById(canvas) : canvas);
|
|
1843
1893
|
var hardwareRenderer = new WebGLRenderer(webGLRendererOptions);
|
|
1844
1894
|
return Engine.call(this, webCanvas, hardwareRenderer);
|
|
1845
1895
|
}
|
|
1846
|
-
|
|
1896
|
+
_create_class(WebGLEngine, [
|
|
1847
1897
|
{
|
|
1848
1898
|
key: "canvas",
|
|
1849
1899
|
get: /**
|
package/dist/module.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import _create_class from '@swc/helpers/src/_create_class.mjs';
|
|
2
|
-
import _instanceof from '@swc/helpers/src/_instanceof.mjs';
|
|
3
1
|
import { Vector2, Vector4, Color } from '@galacean/engine-math';
|
|
4
|
-
import _inherits from '@swc/helpers/src/_inherits.mjs';
|
|
5
2
|
import { GLCapabilityType, Logger, TextureWrapMode, TextureFormat, RenderBufferDepthFormat, TextureFilterMode, TextureDepthCompareFunction, Texture, TextureCube, CameraClearFlags, ColorWriteMask, SystemInfo, Platform, Engine } from '@galacean/engine-core';
|
|
6
|
-
import _extends from '@swc/helpers/src/_extends.mjs';
|
|
7
3
|
|
|
8
4
|
/**
|
|
9
5
|
* Smoothing plug-in.
|
|
@@ -63,6 +59,30 @@ import _extends from '@swc/helpers/src/_extends.mjs';
|
|
|
63
59
|
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT5_EXT"] = 0x83f3] = "RGBA_S3TC_DXT5_EXT";
|
|
64
60
|
})(GLCompressedTextureInternalFormat || (GLCompressedTextureInternalFormat = {}));
|
|
65
61
|
|
|
62
|
+
function _defineProperties(target, props) {
|
|
63
|
+
for (var i = 0; i < props.length; i++) {
|
|
64
|
+
var descriptor = props[i];
|
|
65
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
66
|
+
descriptor.configurable = true;
|
|
67
|
+
|
|
68
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
69
|
+
|
|
70
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
74
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
75
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
76
|
+
|
|
77
|
+
return Constructor;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function _instanceof(left, right) {
|
|
81
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
82
|
+
return !!right[Symbol.hasInstance](left);
|
|
83
|
+
} else return left instanceof right;
|
|
84
|
+
}
|
|
85
|
+
|
|
66
86
|
/**
|
|
67
87
|
* The canvas used on the web, which can support HTMLCanvasElement and OffscreenCanvas.
|
|
68
88
|
*/ var WebCanvas = /*#__PURE__*/ function() {
|
|
@@ -147,6 +167,39 @@ import _extends from '@swc/helpers/src/_extends.mjs';
|
|
|
147
167
|
return WebCanvas;
|
|
148
168
|
}();
|
|
149
169
|
|
|
170
|
+
function _set_prototype_of(o, p) {
|
|
171
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
172
|
+
o.__proto__ = p;
|
|
173
|
+
|
|
174
|
+
return o;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
return _set_prototype_of(o, p);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function _inherits(subClass, superClass) {
|
|
181
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
182
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
186
|
+
|
|
187
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function _extends() {
|
|
191
|
+
_extends = Object.assign || function assign(target) {
|
|
192
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
193
|
+
var source = arguments[i];
|
|
194
|
+
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return target;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
return _extends.apply(this, arguments);
|
|
201
|
+
}
|
|
202
|
+
|
|
150
203
|
/**
|
|
151
204
|
* GL capability.
|
|
152
205
|
*/ var GLCapability = /*#__PURE__*/ function() {
|