@galacean/engine-loader 1.1.0-beta.14 → 1.1.0-beta.16
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 +47 -35
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +47 -35
- package/dist/module.js +47 -35
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
package/dist/main.js
CHANGED
|
@@ -2928,14 +2928,6 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2928
2928
|
});
|
|
2929
2929
|
};
|
|
2930
2930
|
_proto._isKhronosSupported = function _isKhronosSupported(priorityFormats, engine) {
|
|
2931
|
-
if (priorityFormats === void 0) priorityFormats = [
|
|
2932
|
-
exports.KTX2TargetFormat.ASTC,
|
|
2933
|
-
exports.KTX2TargetFormat.ETC,
|
|
2934
|
-
exports.KTX2TargetFormat.BC7,
|
|
2935
|
-
exports.KTX2TargetFormat.BC1_BC3,
|
|
2936
|
-
exports.KTX2TargetFormat.PVRTC,
|
|
2937
|
-
exports.KTX2TargetFormat.R8G8B8A8
|
|
2938
|
-
];
|
|
2939
2931
|
return !!KhronosTranscoder.transcoderMap[exports.KTX2Loader._detectSupportedFormat(engine._hardwareRenderer, priorityFormats)];
|
|
2940
2932
|
};
|
|
2941
2933
|
/**
|
|
@@ -3019,10 +3011,21 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
3019
3011
|
};
|
|
3020
3012
|
KTX2Loader1._detectSupportedFormat = function _detectSupportedFormat(renderer, priorityFormats) {
|
|
3021
3013
|
for(var i = 0; i < priorityFormats.length; i++){
|
|
3022
|
-
var
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3014
|
+
var format = priorityFormats[i];
|
|
3015
|
+
var capabilities = this._supportedMap[format];
|
|
3016
|
+
if (capabilities) {
|
|
3017
|
+
for(var j = 0; j < capabilities.length; j++){
|
|
3018
|
+
if (renderer.canIUse(capabilities[j])) {
|
|
3019
|
+
return format;
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
} else {
|
|
3023
|
+
switch(priorityFormats[i]){
|
|
3024
|
+
case exports.KTX2TargetFormat.R8G8B8A8:
|
|
3025
|
+
return format;
|
|
3026
|
+
case exports.KTX2TargetFormat.R8:
|
|
3027
|
+
case exports.KTX2TargetFormat.R8G8:
|
|
3028
|
+
if (renderer.isWebGL2) return format;
|
|
3026
3029
|
}
|
|
3027
3030
|
}
|
|
3028
3031
|
}
|
|
@@ -3541,6 +3544,10 @@ exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3541
3544
|
relativePath = relativePath === "" ? "" + entity.name : entity.name + "/" + relativePath;
|
|
3542
3545
|
entity = entity.parent;
|
|
3543
3546
|
}
|
|
3547
|
+
// If the target node is in the default scene, relativePath will be empty
|
|
3548
|
+
if (entity !== context.glTFResource.defaultSceneRoot) {
|
|
3549
|
+
continue;
|
|
3550
|
+
}
|
|
3544
3551
|
var ComponentType = void 0;
|
|
3545
3552
|
var propertyName = void 0;
|
|
3546
3553
|
switch(target.path){
|
|
@@ -5537,29 +5544,34 @@ var SceneLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
5537
5544
|
var promises = [];
|
|
5538
5545
|
// parse ambient light
|
|
5539
5546
|
var ambient = data.scene.ambient;
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5547
|
+
if (ambient) {
|
|
5548
|
+
var useCustomAmbient = ambient.specularMode === "Custom";
|
|
5549
|
+
var useSH = ambient.diffuseMode === engineCore.DiffuseMode.SphericalHarmonics;
|
|
5550
|
+
scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
|
|
5551
|
+
scene.ambientLight.specularIntensity = ambient.specularIntensity;
|
|
5552
|
+
scene.ambientLight.diffuseMode = ambient.diffuseMode;
|
|
5553
|
+
scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
|
|
5554
|
+
scene.ambientLight.specularTextureDecodeRGBM = true;
|
|
5555
|
+
if (useCustomAmbient && ambient.customAmbientLight) {
|
|
5556
|
+
promises.push(// @ts-ignore
|
|
5557
|
+
resourceManager.getResourceByRef(ambient.customAmbientLight).then(function(ambientLight) {
|
|
5558
|
+
var _ambientLight;
|
|
5559
|
+
scene.ambientLight.specularTexture = (_ambientLight = ambientLight) == null ? void 0 : _ambientLight.specularTexture;
|
|
5560
|
+
}));
|
|
5561
|
+
}
|
|
5562
|
+
if (ambient.ambientLight && (!useCustomAmbient || useSH)) {
|
|
5563
|
+
promises.push(// @ts-ignore
|
|
5564
|
+
resourceManager.getResourceByRef(ambient.ambientLight).then(function(ambientLight) {
|
|
5565
|
+
if (!useCustomAmbient) {
|
|
5566
|
+
var _ambientLight;
|
|
5567
|
+
scene.ambientLight.specularTexture = (_ambientLight = ambientLight) == null ? void 0 : _ambientLight.specularTexture;
|
|
5568
|
+
}
|
|
5569
|
+
if (useSH) {
|
|
5570
|
+
var _ambientLight1;
|
|
5571
|
+
scene.ambientLight.diffuseSphericalHarmonics = (_ambientLight1 = ambientLight) == null ? void 0 : _ambientLight1.diffuseSphericalHarmonics;
|
|
5572
|
+
}
|
|
5573
|
+
}));
|
|
5574
|
+
}
|
|
5563
5575
|
}
|
|
5564
5576
|
var background = data.scene.background;
|
|
5565
5577
|
scene.background.mode = background.mode;
|