@galacean/engine-loader 1.1.0-beta.21 → 1.1.0-beta.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 +28 -14
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +28 -14
- package/dist/module.js +29 -15
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/gltf/GLTFUtil.d.ts +3 -3
- package/types/index.d.ts +1 -1
- package/types/ktx2/BinomialLLCTranscoder/BinomialLLCTranscoder.d.ts +13 -0
- package/types/ktx2/BinomialLLCTranscoder/TranscodeWorkerCode.d.ts +33 -0
- package/types/ktx2/KTX2Loader.d.ts +12 -2
- package/types/ktx2/KhronosTranscoder/KhronosTranscoder.d.ts +17 -0
- package/types/ktx2/KhronosTranscoder/TranscoderWorkerCode.d.ts +34 -0
- package/types/ktx2/TranscodeResult.d.ts +10 -0
- package/types/ktx2/constants.d.ts +7 -0
- package/types/ktx2/zstddec.d.ts +62 -0
package/dist/miniprogram.js
CHANGED
|
@@ -2962,11 +2962,14 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2962
2962
|
return Loader1.apply(this, arguments);
|
|
2963
2963
|
}
|
|
2964
2964
|
var _proto = KTX2Loader1.prototype;
|
|
2965
|
-
_proto.initialize = function initialize(
|
|
2965
|
+
_proto.initialize = function initialize(_, configuration) {
|
|
2966
2966
|
if (configuration.ktx2Loader) {
|
|
2967
2967
|
var options = configuration.ktx2Loader;
|
|
2968
|
-
if (options.priorityFormats)
|
|
2969
|
-
|
|
2968
|
+
if (options.priorityFormats) {
|
|
2969
|
+
exports.KTX2Loader._priorityFormats["etc1s"] = options.priorityFormats;
|
|
2970
|
+
exports.KTX2Loader._priorityFormats["uastc"] = options.priorityFormats;
|
|
2971
|
+
}
|
|
2972
|
+
if (options.transcoder === /** Khronos transcoder. */ 1) {
|
|
2970
2973
|
return exports.KTX2Loader._getKhronosTranscoder(options.workerCount).init();
|
|
2971
2974
|
} else {
|
|
2972
2975
|
return exports.KTX2Loader._getBinomialLLCTranscoder(options.workerCount).init();
|
|
@@ -2985,9 +2988,6 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2985
2988
|
});
|
|
2986
2989
|
});
|
|
2987
2990
|
};
|
|
2988
|
-
_proto._isKhronosSupported = function _isKhronosSupported(priorityFormats, engine) {
|
|
2989
|
-
return !!KhronosTranscoder.transcoderMap[exports.KTX2Loader._detectSupportedFormat(engine._hardwareRenderer, priorityFormats)];
|
|
2990
|
-
};
|
|
2991
2991
|
/**
|
|
2992
2992
|
* Destroy ktx2 transcoder worker.
|
|
2993
2993
|
*/ KTX2Loader1.destroy = function destroy() {
|
|
@@ -3001,7 +3001,7 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
3001
3001
|
var _params;
|
|
3002
3002
|
var ktx2Container = new KTX2Container(buffer);
|
|
3003
3003
|
var _params_priorityFormats;
|
|
3004
|
-
var formatPriorities = (_params_priorityFormats = (_params = params) == null ? void 0 : _params.priorityFormats) != null ? _params_priorityFormats : exports.KTX2Loader._priorityFormats;
|
|
3004
|
+
var formatPriorities = (_params_priorityFormats = (_params = params) == null ? void 0 : _params.priorityFormats) != null ? _params_priorityFormats : exports.KTX2Loader._priorityFormats[ktx2Container.isUASTC ? "uastc" : "etc1s"];
|
|
3005
3005
|
var targetFormat = exports.KTX2Loader._decideTargetFormat(engine, ktx2Container, formatPriorities);
|
|
3006
3006
|
var transcodeResultPromise;
|
|
3007
3007
|
if (exports.KTX2Loader._isBinomialInit || !KhronosTranscoder.transcoderMap[targetFormat] || !ktx2Container.isUASTC) {
|
|
@@ -3121,13 +3121,22 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
3121
3121
|
}(miniprogram.Loader), function() {
|
|
3122
3122
|
_KTX2Loader._isBinomialInit = false;
|
|
3123
3123
|
}(), function() {
|
|
3124
|
-
_KTX2Loader._priorityFormats =
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3124
|
+
_KTX2Loader._priorityFormats = {
|
|
3125
|
+
etc1s: [
|
|
3126
|
+
exports.KTX2TargetFormat.ETC,
|
|
3127
|
+
exports.KTX2TargetFormat.BC7,
|
|
3128
|
+
exports.KTX2TargetFormat.ASTC,
|
|
3129
|
+
exports.KTX2TargetFormat.BC1_BC3,
|
|
3130
|
+
exports.KTX2TargetFormat.PVRTC
|
|
3131
|
+
],
|
|
3132
|
+
uastc: [
|
|
3133
|
+
exports.KTX2TargetFormat.ASTC,
|
|
3134
|
+
exports.KTX2TargetFormat.BC7,
|
|
3135
|
+
exports.KTX2TargetFormat.ETC,
|
|
3136
|
+
exports.KTX2TargetFormat.BC1_BC3,
|
|
3137
|
+
exports.KTX2TargetFormat.PVRTC
|
|
3138
|
+
]
|
|
3139
|
+
};
|
|
3131
3140
|
}(), function() {
|
|
3132
3141
|
var _obj;
|
|
3133
3142
|
_KTX2Loader._supportedMap = (_obj = {}, _obj[exports.KTX2TargetFormat.ASTC] = [
|
|
@@ -3148,6 +3157,11 @@ exports.KTX2Loader = __decorate([
|
|
|
3148
3157
|
"ktx2"
|
|
3149
3158
|
])
|
|
3150
3159
|
], exports.KTX2Loader);
|
|
3160
|
+
exports.KTX2Transcoder = void 0;
|
|
3161
|
+
(function(KTX2Transcoder) {
|
|
3162
|
+
KTX2Transcoder[KTX2Transcoder[/** BinomialLLC transcoder. */ "BinomialLLC"] = 0] = "BinomialLLC";
|
|
3163
|
+
KTX2Transcoder[KTX2Transcoder["Khronos"] = 1] = "Khronos";
|
|
3164
|
+
})(exports.KTX2Transcoder || (exports.KTX2Transcoder = {}));
|
|
3151
3165
|
|
|
3152
3166
|
/**
|
|
3153
3167
|
* @internal
|
package/dist/module.js
CHANGED
|
@@ -2957,11 +2957,14 @@ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2957
2957
|
return Loader1.apply(this, arguments);
|
|
2958
2958
|
}
|
|
2959
2959
|
var _proto = KTX2Loader1.prototype;
|
|
2960
|
-
_proto.initialize = function initialize(
|
|
2960
|
+
_proto.initialize = function initialize(_, configuration) {
|
|
2961
2961
|
if (configuration.ktx2Loader) {
|
|
2962
2962
|
var options = configuration.ktx2Loader;
|
|
2963
|
-
if (options.priorityFormats)
|
|
2964
|
-
|
|
2963
|
+
if (options.priorityFormats) {
|
|
2964
|
+
KTX2Loader._priorityFormats["etc1s"] = options.priorityFormats;
|
|
2965
|
+
KTX2Loader._priorityFormats["uastc"] = options.priorityFormats;
|
|
2966
|
+
}
|
|
2967
|
+
if (options.transcoder === /** Khronos transcoder. */ 1) {
|
|
2965
2968
|
return KTX2Loader._getKhronosTranscoder(options.workerCount).init();
|
|
2966
2969
|
} else {
|
|
2967
2970
|
return KTX2Loader._getBinomialLLCTranscoder(options.workerCount).init();
|
|
@@ -2980,9 +2983,6 @@ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2980
2983
|
});
|
|
2981
2984
|
});
|
|
2982
2985
|
};
|
|
2983
|
-
_proto._isKhronosSupported = function _isKhronosSupported(priorityFormats, engine) {
|
|
2984
|
-
return !!KhronosTranscoder.transcoderMap[KTX2Loader._detectSupportedFormat(engine._hardwareRenderer, priorityFormats)];
|
|
2985
|
-
};
|
|
2986
2986
|
/**
|
|
2987
2987
|
* Destroy ktx2 transcoder worker.
|
|
2988
2988
|
*/ KTX2Loader1.destroy = function destroy() {
|
|
@@ -2996,7 +2996,7 @@ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2996
2996
|
var _params;
|
|
2997
2997
|
var ktx2Container = new KTX2Container(buffer);
|
|
2998
2998
|
var _params_priorityFormats;
|
|
2999
|
-
var formatPriorities = (_params_priorityFormats = (_params = params) == null ? void 0 : _params.priorityFormats) != null ? _params_priorityFormats : KTX2Loader._priorityFormats;
|
|
2999
|
+
var formatPriorities = (_params_priorityFormats = (_params = params) == null ? void 0 : _params.priorityFormats) != null ? _params_priorityFormats : KTX2Loader._priorityFormats[ktx2Container.isUASTC ? "uastc" : "etc1s"];
|
|
3000
3000
|
var targetFormat = KTX2Loader._decideTargetFormat(engine, ktx2Container, formatPriorities);
|
|
3001
3001
|
var transcodeResultPromise;
|
|
3002
3002
|
if (KTX2Loader._isBinomialInit || !KhronosTranscoder.transcoderMap[targetFormat] || !ktx2Container.isUASTC) {
|
|
@@ -3116,13 +3116,22 @@ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
3116
3116
|
}(Loader), function() {
|
|
3117
3117
|
_KTX2Loader._isBinomialInit = false;
|
|
3118
3118
|
}(), function() {
|
|
3119
|
-
_KTX2Loader._priorityFormats =
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3119
|
+
_KTX2Loader._priorityFormats = {
|
|
3120
|
+
etc1s: [
|
|
3121
|
+
KTX2TargetFormat.ETC,
|
|
3122
|
+
KTX2TargetFormat.BC7,
|
|
3123
|
+
KTX2TargetFormat.ASTC,
|
|
3124
|
+
KTX2TargetFormat.BC1_BC3,
|
|
3125
|
+
KTX2TargetFormat.PVRTC
|
|
3126
|
+
],
|
|
3127
|
+
uastc: [
|
|
3128
|
+
KTX2TargetFormat.ASTC,
|
|
3129
|
+
KTX2TargetFormat.BC7,
|
|
3130
|
+
KTX2TargetFormat.ETC,
|
|
3131
|
+
KTX2TargetFormat.BC1_BC3,
|
|
3132
|
+
KTX2TargetFormat.PVRTC
|
|
3133
|
+
]
|
|
3134
|
+
};
|
|
3126
3135
|
}(), function() {
|
|
3127
3136
|
var _obj;
|
|
3128
3137
|
_KTX2Loader._supportedMap = (_obj = {}, _obj[KTX2TargetFormat.ASTC] = [
|
|
@@ -3143,6 +3152,11 @@ KTX2Loader = __decorate([
|
|
|
3143
3152
|
"ktx2"
|
|
3144
3153
|
])
|
|
3145
3154
|
], KTX2Loader);
|
|
3155
|
+
var KTX2Transcoder;
|
|
3156
|
+
(function(KTX2Transcoder) {
|
|
3157
|
+
KTX2Transcoder[KTX2Transcoder[/** BinomialLLC transcoder. */ "BinomialLLC"] = 0] = "BinomialLLC";
|
|
3158
|
+
KTX2Transcoder[KTX2Transcoder["Khronos"] = 1] = "Khronos";
|
|
3159
|
+
})(KTX2Transcoder || (KTX2Transcoder = {}));
|
|
3146
3160
|
|
|
3147
3161
|
/**
|
|
3148
3162
|
* @internal
|
|
@@ -6161,5 +6175,5 @@ GALACEAN_animation_event = __decorate([
|
|
|
6161
6175
|
registerGLTFExtension("GALACEAN_animation_event", GLTFExtensionMode.AdditiveParse)
|
|
6162
6176
|
], GALACEAN_animation_event);
|
|
6163
6177
|
|
|
6164
|
-
export { AnimationClipDecoder, ComponentMap, EditorTextureLoader, GLTFAnimationParser, GLTFBufferParser, GLTFEntityParser, GLTFExtensionMode, GLTFExtensionParser, GLTFMaterialParser, GLTFMeshParser, GLTFParser, GLTFParserContext, GLTFParserType, GLTFResource, GLTFSceneParser, GLTFSchemaParser, GLTFSkinParser, GLTFTextureParser, GLTFUtils, GLTFValidator, InterpolableValueType, KTX2Loader, KTX2TargetFormat, MeshDecoder, MeshLoader$1 as MeshLoader, PrefabParser, ReflectionParser, SceneParser, SpecularMode, Texture2DDecoder, decode, parseSingleKTX, registerGLTFExtension, registerGLTFParser };
|
|
6178
|
+
export { AnimationClipDecoder, ComponentMap, EditorTextureLoader, GLTFAnimationParser, GLTFBufferParser, GLTFEntityParser, GLTFExtensionMode, GLTFExtensionParser, GLTFMaterialParser, GLTFMeshParser, GLTFParser, GLTFParserContext, GLTFParserType, GLTFResource, GLTFSceneParser, GLTFSchemaParser, GLTFSkinParser, GLTFTextureParser, GLTFUtils, GLTFValidator, InterpolableValueType, KTX2Loader, KTX2TargetFormat, KTX2Transcoder, MeshDecoder, MeshLoader$1 as MeshLoader, PrefabParser, ReflectionParser, SceneParser, SpecularMode, Texture2DDecoder, decode, parseSingleKTX, registerGLTFExtension, registerGLTFParser };
|
|
6165
6179
|
//# sourceMappingURL=module.js.map
|