@galacean/engine-rhi-webgl 1.3.23 → 1.4.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +104 -102
- package/dist/main.js.map +1 -1
- package/dist/module.js +79 -79
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/dist/miniprogram.js +0 -2076
package/dist/main.js
CHANGED
|
@@ -7,66 +7,68 @@ var engineMath = require('@galacean/engine-math');
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Smoothing plug-in.
|
|
10
|
-
* */
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
15
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
16
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
17
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
18
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
19
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
20
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
21
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
22
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
23
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
24
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
25
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
26
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
27
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
28
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
29
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
30
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
31
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
32
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
33
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
34
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
35
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
36
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
37
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
38
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
39
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
40
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
41
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[
|
|
42
|
-
|
|
43
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[
|
|
44
|
-
|
|
45
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
46
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
47
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
48
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
49
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
50
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
51
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
52
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
53
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
54
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[
|
|
55
|
-
|
|
56
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
57
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
58
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
59
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[
|
|
60
|
-
|
|
61
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
62
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
63
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
64
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[
|
|
65
|
-
|
|
66
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
67
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
68
|
-
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["
|
|
69
|
-
|
|
10
|
+
* */ /**
|
|
11
|
+
* @deprecated
|
|
12
|
+
*/ var GLCompressedTextureInternalFormat = /*#__PURE__*/ function(GLCompressedTextureInternalFormat) {
|
|
13
|
+
// astc
|
|
14
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_4X4_KHR"] = 37808] = "RGBA_ASTC_4X4_KHR";
|
|
15
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_5X4_KHR"] = 37809] = "RGBA_ASTC_5X4_KHR";
|
|
16
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_5X5_KHR"] = 37810] = "RGBA_ASTC_5X5_KHR";
|
|
17
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_6X5_KHR"] = 37811] = "RGBA_ASTC_6X5_KHR";
|
|
18
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_6X6_KHR"] = 37812] = "RGBA_ASTC_6X6_KHR";
|
|
19
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_8X5_KHR"] = 37813] = "RGBA_ASTC_8X5_KHR";
|
|
20
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_8X6_KHR"] = 37814] = "RGBA_ASTC_8X6_KHR";
|
|
21
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_8X8_KHR"] = 37815] = "RGBA_ASTC_8X8_KHR";
|
|
22
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X5_KHR"] = 37816] = "RGBA_ASTC_10X5_KHR";
|
|
23
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X6_KHR"] = 37817] = "RGBA_ASTC_10X6_KHR";
|
|
24
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X8_KHR"] = 37818] = "RGBA_ASTC_10X8_KHR";
|
|
25
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X10_KHR"] = 37819] = "RGBA_ASTC_10X10_KHR";
|
|
26
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_12X10_KHR"] = 37820] = "RGBA_ASTC_12X10_KHR";
|
|
27
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_12X12_KHR"] = 37821] = "RGBA_ASTC_12X12_KHR";
|
|
28
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_4X4_KHR"] = 37840] = "SRGB8_ALPHA8_ASTC_4X4_KHR";
|
|
29
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_5X4_KHR"] = 37841] = "SRGB8_ALPHA8_ASTC_5X4_KHR";
|
|
30
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_5X5_KHR"] = 37842] = "SRGB8_ALPHA8_ASTC_5X5_KHR";
|
|
31
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_6X5_KHR"] = 37843] = "SRGB8_ALPHA8_ASTC_6X5_KHR";
|
|
32
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_6X6_KHR"] = 37844] = "SRGB8_ALPHA8_ASTC_6X6_KHR";
|
|
33
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_8X5_KHR"] = 37845] = "SRGB8_ALPHA8_ASTC_8X5_KHR";
|
|
34
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_8X6_KHR"] = 37846] = "SRGB8_ALPHA8_ASTC_8X6_KHR";
|
|
35
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_8X8_KHR"] = 37847] = "SRGB8_ALPHA8_ASTC_8X8_KHR";
|
|
36
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X5_KHR"] = 37848] = "SRGB8_ALPHA8_ASTC_10X5_KHR";
|
|
37
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X6_KHR"] = 37849] = "SRGB8_ALPHA8_ASTC_10X6_KHR";
|
|
38
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X8_KHR"] = 37850] = "SRGB8_ALPHA8_ASTC_10X8_KHR";
|
|
39
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X10_KHR"] = 37851] = "SRGB8_ALPHA8_ASTC_10X10_KHR";
|
|
40
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_12X10_KHR"] = 37852] = "SRGB8_ALPHA8_ASTC_12X10_KHR";
|
|
41
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_12X12_KHR"] = 37853] = "SRGB8_ALPHA8_ASTC_12X12_KHR";
|
|
42
|
+
// etc1
|
|
43
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_ETC1_WEBGL"] = 36196] = "RGB_ETC1_WEBGL";
|
|
44
|
+
// etc2
|
|
45
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["R11_EAC"] = 37488] = "R11_EAC";
|
|
46
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SIGNED_R11_EAC"] = 37489] = "SIGNED_R11_EAC";
|
|
47
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RG11_EAC"] = 37490] = "RG11_EAC";
|
|
48
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SIGNED_RG11_EAC"] = 37491] = "SIGNED_RG11_EAC";
|
|
49
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB8_ETC2"] = 37492] = "RGB8_ETC2";
|
|
50
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ETC2"] = 37493] = "SRGB8_ETC2";
|
|
51
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB8_PUNCHTHROUGH_ALPHA1_ETC2"] = 37494] = "RGB8_PUNCHTHROUGH_ALPHA1_ETC2";
|
|
52
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"] = 37495] = "SRGB8_PUNCHTHROUGH_ALPHA1_ETC2";
|
|
53
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA8_ETC2_EAC"] = 37496] = "RGBA8_ETC2_EAC";
|
|
54
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ETC2_EAC"] = 37497] = "SRGB8_ALPHA8_ETC2_EAC";
|
|
55
|
+
// pvrtc
|
|
56
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_PVRTC_4BPPV1_IMG"] = 35840] = "RGB_PVRTC_4BPPV1_IMG";
|
|
57
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_PVRTC_2BPPV1_IMG"] = 35841] = "RGB_PVRTC_2BPPV1_IMG";
|
|
58
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_PVRTC_4BPPV1_IMG"] = 35842] = "RGBA_PVRTC_4BPPV1_IMG";
|
|
59
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_PVRTC_2BPPV1_IMG"] = 35843] = "RGBA_PVRTC_2BPPV1_IMG";
|
|
60
|
+
// s3tc
|
|
61
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_S3TC_DXT1_EXT"] = 33776] = "RGB_S3TC_DXT1_EXT";
|
|
62
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT1_EXT"] = 33777] = "RGBA_S3TC_DXT1_EXT";
|
|
63
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT3_EXT"] = 33778] = "RGBA_S3TC_DXT3_EXT";
|
|
64
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT5_EXT"] = 33779] = "RGBA_S3TC_DXT5_EXT";
|
|
65
|
+
// bptc
|
|
66
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_BPTC_UNORM_EXT"] = 36492] = "RGBA_BPTC_UNORM_EXT";
|
|
67
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB_ALPHA_BPTC_UNORM_EXT"] = 36493] = "SRGB_ALPHA_BPTC_UNORM_EXT";
|
|
68
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_BPTC_SIGNED_FLOAT_EXT"] = 36494] = "RGB_BPTC_SIGNED_FLOAT_EXT";
|
|
69
|
+
GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_BPTC_UNSIGNED_FLOAT_EXT"] = 36495] = "RGB_BPTC_UNSIGNED_FLOAT_EXT";
|
|
70
|
+
return GLCompressedTextureInternalFormat;
|
|
71
|
+
}({});
|
|
70
72
|
|
|
71
73
|
function _defineProperties(target, props) {
|
|
72
74
|
for (var i = 0; i < props.length; i++) {
|
|
@@ -114,12 +116,11 @@ function _instanceof(left, right) {
|
|
|
114
116
|
|
|
115
117
|
/**
|
|
116
118
|
* The canvas used on the web, which can support HTMLCanvasElement and OffscreenCanvas.
|
|
117
|
-
*/ var WebCanvas = /*#__PURE__*/ function(
|
|
118
|
-
_inherits(WebCanvas,
|
|
119
|
+
*/ var WebCanvas = /*#__PURE__*/ function(Canvas) {
|
|
120
|
+
_inherits(WebCanvas, Canvas);
|
|
119
121
|
function WebCanvas(webCanvas) {
|
|
120
122
|
var _this;
|
|
121
|
-
_this =
|
|
122
|
-
_this._scale = new engineMath.Vector2();
|
|
123
|
+
_this = Canvas.call(this) || this, _this._scale = new engineMath.Vector2();
|
|
123
124
|
var width = webCanvas.width;
|
|
124
125
|
var height = webCanvas.height;
|
|
125
126
|
_this._webCanvas = webCanvas;
|
|
@@ -182,10 +183,10 @@ function _instanceof(left, right) {
|
|
|
182
183
|
|
|
183
184
|
/**
|
|
184
185
|
* WebGL platform engine,support includes WebGL1.0 and WebGL2.0.
|
|
185
|
-
*/ var WebGLEngine = /*#__PURE__*/ function(
|
|
186
|
-
_inherits(WebGLEngine,
|
|
186
|
+
*/ var WebGLEngine = /*#__PURE__*/ function(Engine) {
|
|
187
|
+
_inherits(WebGLEngine, Engine);
|
|
187
188
|
function WebGLEngine() {
|
|
188
|
-
return
|
|
189
|
+
return Engine.apply(this, arguments) || this;
|
|
189
190
|
}
|
|
190
191
|
/**
|
|
191
192
|
* Create a WebGL engine.
|
|
@@ -323,12 +324,12 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
323
324
|
* Check if can use some compressed texture format.
|
|
324
325
|
*/ _proto.canIUseCompressedTextureInternalFormat = function canIUseCompressedTextureInternalFormat(internalType) {
|
|
325
326
|
var // astc
|
|
326
|
-
RGBA_ASTC_4X4_KHR =
|
|
327
|
-
RGB_ETC1_WEBGL =
|
|
328
|
-
R11_EAC =
|
|
329
|
-
RGB_PVRTC_4BPPV1_IMG =
|
|
330
|
-
RGB_S3TC_DXT1_EXT =
|
|
331
|
-
RGBA_BPTC_UNORM_EXT =
|
|
327
|
+
RGBA_ASTC_4X4_KHR = GLCompressedTextureInternalFormat.RGBA_ASTC_4X4_KHR, RGBA_ASTC_12X12_KHR = GLCompressedTextureInternalFormat.RGBA_ASTC_12X12_KHR, SRGB8_ALPHA8_ASTC_4X4_KHR = GLCompressedTextureInternalFormat.SRGB8_ALPHA8_ASTC_4X4_KHR, SRGB8_ALPHA8_ASTC_12X12_KHR = GLCompressedTextureInternalFormat.SRGB8_ALPHA8_ASTC_12X12_KHR, // etc1
|
|
328
|
+
RGB_ETC1_WEBGL = GLCompressedTextureInternalFormat.RGB_ETC1_WEBGL, // etc
|
|
329
|
+
R11_EAC = GLCompressedTextureInternalFormat.R11_EAC, SRGB8_ALPHA8_ETC2_EAC = GLCompressedTextureInternalFormat.SRGB8_ALPHA8_ETC2_EAC, // pvrtc
|
|
330
|
+
RGB_PVRTC_4BPPV1_IMG = GLCompressedTextureInternalFormat.RGB_PVRTC_4BPPV1_IMG, RGBA_PVRTC_2BPPV1_IMG = GLCompressedTextureInternalFormat.RGBA_PVRTC_2BPPV1_IMG, // s3tc
|
|
331
|
+
RGB_S3TC_DXT1_EXT = GLCompressedTextureInternalFormat.RGB_S3TC_DXT1_EXT, RGBA_S3TC_DXT5_EXT = GLCompressedTextureInternalFormat.RGBA_S3TC_DXT5_EXT, // bptc
|
|
332
|
+
RGBA_BPTC_UNORM_EXT = GLCompressedTextureInternalFormat.RGBA_BPTC_UNORM_EXT, RGB_BPTC_UNSIGNED_FLOAT_EXT = GLCompressedTextureInternalFormat.RGB_BPTC_UNSIGNED_FLOAT_EXT;
|
|
332
333
|
if (internalType >= RGBA_ASTC_4X4_KHR && RGBA_ASTC_12X12_KHR <= RGBA_ASTC_12X12_KHR || internalType >= SRGB8_ALPHA8_ASTC_4X4_KHR && internalType <= SRGB8_ALPHA8_ASTC_12X12_KHR) {
|
|
333
334
|
return this.canIUse(engineCore.GLCapabilityType.astc);
|
|
334
335
|
} else if (internalType === RGB_ETC1_WEBGL) {
|
|
@@ -389,11 +390,10 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
389
390
|
var ext = null;
|
|
390
391
|
if (ext = rhi.requireExtension(capabilityType)) {
|
|
391
392
|
for(var glKey in flatItem){
|
|
392
|
-
var _extensionVal;
|
|
393
393
|
var extensionKey = flatItem[glKey];
|
|
394
394
|
var extensionVal = ext[extensionKey];
|
|
395
395
|
// Mini game hack the native function,use “.bind” to smooth out if is “Funcion”.
|
|
396
|
-
if (
|
|
396
|
+
if (extensionVal == null ? void 0 : extensionVal.bind) {
|
|
397
397
|
gl[glKey] = extensionVal.bind(ext);
|
|
398
398
|
} else {
|
|
399
399
|
gl[glKey] = extensionVal;
|
|
@@ -937,87 +937,87 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
937
937
|
};
|
|
938
938
|
case engineCore.TextureFormat.BC1:
|
|
939
939
|
return {
|
|
940
|
-
internalFormat:
|
|
940
|
+
internalFormat: GLCompressedTextureInternalFormat.RGB_S3TC_DXT1_EXT,
|
|
941
941
|
isCompressed: true
|
|
942
942
|
};
|
|
943
943
|
case engineCore.TextureFormat.BC3:
|
|
944
944
|
return {
|
|
945
|
-
internalFormat:
|
|
945
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA_S3TC_DXT5_EXT,
|
|
946
946
|
isCompressed: true
|
|
947
947
|
};
|
|
948
948
|
case engineCore.TextureFormat.BC7:
|
|
949
949
|
return {
|
|
950
|
-
internalFormat:
|
|
950
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA_BPTC_UNORM_EXT,
|
|
951
951
|
isCompressed: true
|
|
952
952
|
};
|
|
953
953
|
case engineCore.TextureFormat.ETC1_RGB:
|
|
954
954
|
return {
|
|
955
|
-
internalFormat:
|
|
955
|
+
internalFormat: GLCompressedTextureInternalFormat.RGB_ETC1_WEBGL,
|
|
956
956
|
isCompressed: true
|
|
957
957
|
};
|
|
958
958
|
case engineCore.TextureFormat.ETC2_RGB:
|
|
959
959
|
return {
|
|
960
|
-
internalFormat:
|
|
960
|
+
internalFormat: GLCompressedTextureInternalFormat.RGB8_ETC2,
|
|
961
961
|
isCompressed: true
|
|
962
962
|
};
|
|
963
963
|
case engineCore.TextureFormat.ETC2_RGBA5:
|
|
964
964
|
return {
|
|
965
|
-
internalFormat:
|
|
965
|
+
internalFormat: GLCompressedTextureInternalFormat.RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
|
|
966
966
|
isCompressed: true
|
|
967
967
|
};
|
|
968
968
|
case engineCore.TextureFormat.ETC2_RGBA8:
|
|
969
969
|
return {
|
|
970
|
-
internalFormat:
|
|
970
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA8_ETC2_EAC,
|
|
971
971
|
isCompressed: true
|
|
972
972
|
};
|
|
973
973
|
case engineCore.TextureFormat.PVRTC_RGB2:
|
|
974
974
|
return {
|
|
975
|
-
internalFormat:
|
|
975
|
+
internalFormat: GLCompressedTextureInternalFormat.RGB_PVRTC_2BPPV1_IMG,
|
|
976
976
|
isCompressed: true
|
|
977
977
|
};
|
|
978
978
|
case engineCore.TextureFormat.PVRTC_RGBA2:
|
|
979
979
|
return {
|
|
980
|
-
internalFormat:
|
|
980
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA_PVRTC_2BPPV1_IMG,
|
|
981
981
|
isCompressed: true
|
|
982
982
|
};
|
|
983
983
|
case engineCore.TextureFormat.PVRTC_RGB4:
|
|
984
984
|
return {
|
|
985
|
-
internalFormat:
|
|
985
|
+
internalFormat: GLCompressedTextureInternalFormat.RGB_PVRTC_4BPPV1_IMG,
|
|
986
986
|
isCompressed: true
|
|
987
987
|
};
|
|
988
988
|
case engineCore.TextureFormat.PVRTC_RGBA4:
|
|
989
989
|
return {
|
|
990
|
-
internalFormat:
|
|
990
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA_PVRTC_4BPPV1_IMG,
|
|
991
991
|
isCompressed: true
|
|
992
992
|
};
|
|
993
993
|
case engineCore.TextureFormat.ASTC_4x4:
|
|
994
994
|
return {
|
|
995
|
-
internalFormat:
|
|
995
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_4X4_KHR,
|
|
996
996
|
isCompressed: true
|
|
997
997
|
};
|
|
998
998
|
case engineCore.TextureFormat.ASTC_5x5:
|
|
999
999
|
return {
|
|
1000
|
-
internalFormat:
|
|
1000
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_5X5_KHR,
|
|
1001
1001
|
isCompressed: true
|
|
1002
1002
|
};
|
|
1003
1003
|
case engineCore.TextureFormat.ASTC_6x6:
|
|
1004
1004
|
return {
|
|
1005
|
-
internalFormat:
|
|
1005
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_6X6_KHR,
|
|
1006
1006
|
isCompressed: true
|
|
1007
1007
|
};
|
|
1008
1008
|
case engineCore.TextureFormat.ASTC_8x8:
|
|
1009
1009
|
return {
|
|
1010
|
-
internalFormat:
|
|
1010
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_8X8_KHR,
|
|
1011
1011
|
isCompressed: true
|
|
1012
1012
|
};
|
|
1013
1013
|
case engineCore.TextureFormat.ASTC_10x10:
|
|
1014
1014
|
return {
|
|
1015
|
-
internalFormat:
|
|
1015
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_10X10_KHR,
|
|
1016
1016
|
isCompressed: true
|
|
1017
1017
|
};
|
|
1018
1018
|
case engineCore.TextureFormat.ASTC_12x12:
|
|
1019
1019
|
return {
|
|
1020
|
-
internalFormat:
|
|
1020
|
+
internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_12X12_KHR,
|
|
1021
1021
|
isCompressed: true
|
|
1022
1022
|
};
|
|
1023
1023
|
case engineCore.TextureFormat.Depth:
|
|
@@ -1539,8 +1539,7 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
1539
1539
|
_inherits(GLTexture2D, GLTexture1);
|
|
1540
1540
|
function GLTexture2D(rhi, texture2D) {
|
|
1541
1541
|
var _this;
|
|
1542
|
-
_this = GLTexture1.call(this, rhi, texture2D, rhi.gl.TEXTURE_2D) || this;
|
|
1543
|
-
/** Backward compatible with WebGL1.0. */ _this._compressedMipFilled = 0;
|
|
1542
|
+
_this = GLTexture1.call(this, rhi, texture2D, rhi.gl.TEXTURE_2D) || this, /** Backward compatible with WebGL1.0. */ _this._compressedMipFilled = 0;
|
|
1544
1543
|
/** @ts-ignore */ var format = texture2D.format, _mipmap = texture2D._mipmap, width = texture2D.width, height = texture2D.height;
|
|
1545
1544
|
var isWebGL2 = _this._isWebGL2;
|
|
1546
1545
|
/** @ts-ignore */ if (!GLTexture._supportTextureFormat(format, rhi)) {
|
|
@@ -1676,8 +1675,7 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
1676
1675
|
_inherits(GLTextureCube, GLTexture1);
|
|
1677
1676
|
function GLTextureCube(rhi, textureCube) {
|
|
1678
1677
|
var _this;
|
|
1679
|
-
_this = GLTexture1.call(this, rhi, textureCube, rhi.gl.TEXTURE_CUBE_MAP) || this
|
|
1680
|
-
/** Backward compatible with WebGL1.0. */ _this._compressedFaceFilled = [
|
|
1678
|
+
_this = GLTexture1.call(this, rhi, textureCube, rhi.gl.TEXTURE_CUBE_MAP) || this, /** Backward compatible with WebGL1.0. */ _this._compressedFaceFilled = [
|
|
1681
1679
|
0,
|
|
1682
1680
|
0,
|
|
1683
1681
|
0,
|
|
@@ -1745,12 +1743,14 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
1745
1743
|
return GLTextureCube;
|
|
1746
1744
|
}(GLTexture);
|
|
1747
1745
|
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1746
|
+
/**
|
|
1747
|
+
* WebGL mode.
|
|
1748
|
+
*/ var WebGLMode = /*#__PURE__*/ function(WebGLMode) {
|
|
1749
|
+
/** Auto, use WebGL2.0 if support, or will fallback to WebGL1.0. */ WebGLMode[WebGLMode["Auto"] = 0] = "Auto";
|
|
1750
|
+
/** WebGL2.0. */ WebGLMode[WebGLMode["WebGL2"] = 1] = "WebGL2";
|
|
1751
|
+
/** WebGL1.0, */ WebGLMode[WebGLMode["WebGL1"] = 2] = "WebGL1";
|
|
1752
|
+
return WebGLMode;
|
|
1753
|
+
}({});
|
|
1754
1754
|
/**
|
|
1755
1755
|
* WebGL graphic device, including WebGL1.0 and WebGL2.0.
|
|
1756
1756
|
*/ var WebGLGraphicDevice = /*#__PURE__*/ function() {
|
|
@@ -2070,7 +2070,9 @@ exports.WebGLMode = void 0;
|
|
|
2070
2070
|
return WebGLGraphicDevice;
|
|
2071
2071
|
}();
|
|
2072
2072
|
|
|
2073
|
+
exports.GLCompressedTextureInternalFormat = GLCompressedTextureInternalFormat;
|
|
2073
2074
|
exports.WebCanvas = WebCanvas;
|
|
2074
2075
|
exports.WebGLEngine = WebGLEngine;
|
|
2075
2076
|
exports.WebGLGraphicDevice = WebGLGraphicDevice;
|
|
2077
|
+
exports.WebGLMode = WebGLMode;
|
|
2076
2078
|
//# sourceMappingURL=main.js.map
|