@galacean/engine 1.6.6 → 1.6.9
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/browser.js +14 -11
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/module.js +1 -1
- package/package.json +5 -5
package/dist/browser.js
CHANGED
|
@@ -6731,7 +6731,8 @@
|
|
|
6731
6731
|
function TextureUtils() {}
|
|
6732
6732
|
/**
|
|
6733
6733
|
* Check if the texture config supports auto mipmap generation with real correction for mipmap and isSRGBColorSpace.
|
|
6734
|
-
*/ TextureUtils.supportGenerateMipmapsWithCorrection = function supportGenerateMipmapsWithCorrection(width, height, format, mipmap, isSRGBColorSpace
|
|
6734
|
+
*/ TextureUtils.supportGenerateMipmapsWithCorrection = function supportGenerateMipmapsWithCorrection(engine, width, height, format, mipmap, isSRGBColorSpace) {
|
|
6735
|
+
var isWebGL2 = engine._hardwareRenderer._isWebGL2;
|
|
6735
6736
|
if (!mipmap) {
|
|
6736
6737
|
return false;
|
|
6737
6738
|
}
|
|
@@ -49405,7 +49406,11 @@
|
|
|
49405
49406
|
var buffer = buffers[bufferView.buffer];
|
|
49406
49407
|
var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
|
|
49407
49408
|
return GLTFUtils.loadImageBuffer(imageBuffer, mimeType).then(function(image) {
|
|
49408
|
-
var
|
|
49409
|
+
var width = image.width, height = image.height;
|
|
49410
|
+
var format = TextureFormat.R8G8B8A8;
|
|
49411
|
+
var _samplerInfo_mipmap;
|
|
49412
|
+
var generateMipmap = TextureUtils.supportGenerateMipmapsWithCorrection(engine, width, height, format, (_samplerInfo_mipmap = samplerInfo == null ? void 0 : samplerInfo.mipmap) != null ? _samplerInfo_mipmap : true, isSRGBColorSpace);
|
|
49413
|
+
var texture = new Texture2D(engine, width, height, format, generateMipmap, isSRGBColorSpace);
|
|
49409
49414
|
texture.setImageSource(image);
|
|
49410
49415
|
texture.generateMipmaps();
|
|
49411
49416
|
texture.name = textureName || imageName || "texture_" + textureIndex;
|
|
@@ -50711,10 +50716,9 @@
|
|
|
50711
50716
|
var _item_params;
|
|
50712
50717
|
var _ref = (_item_params = item.params) != null ? _item_params : {}, _ref_format = _ref.format, format = _ref_format === void 0 ? TextureFormat.R8G8B8A8 : _ref_format, anisoLevel = _ref.anisoLevel, wrapModeU = _ref.wrapModeU, wrapModeV = _ref.wrapModeV, filterMode = _ref.filterMode, _ref_isSRGBColorSpace = _ref.isSRGBColorSpace, isSRGBColorSpace = _ref_isSRGBColorSpace === void 0 ? true : _ref_isSRGBColorSpace, _ref_mipmap = _ref.mipmap, mipmap = _ref_mipmap === void 0 ? true : _ref_mipmap;
|
|
50713
50718
|
var width = image.width, height = image.height;
|
|
50714
|
-
|
|
50715
|
-
var
|
|
50716
|
-
var
|
|
50717
|
-
var texture = new Texture2D(resourceManager.engine, width, height, format, generateMipmap, isSRGBColorSpace);
|
|
50719
|
+
var engine = resourceManager.engine;
|
|
50720
|
+
var generateMipmap = TextureUtils.supportGenerateMipmapsWithCorrection(engine, width, height, format, mipmap, isSRGBColorSpace);
|
|
50721
|
+
var texture = new Texture2D(engine, width, height, format, generateMipmap, isSRGBColorSpace);
|
|
50718
50722
|
texture.anisoLevel = anisoLevel != null ? anisoLevel : texture.anisoLevel;
|
|
50719
50723
|
texture.filterMode = filterMode != null ? filterMode : texture.filterMode;
|
|
50720
50724
|
texture.wrapModeU = wrapModeU != null ? wrapModeU : texture.wrapModeU;
|
|
@@ -50790,14 +50794,13 @@
|
|
|
50790
50794
|
var _item_params;
|
|
50791
50795
|
var _ref = (_item_params = item.params) != null ? _item_params : {}, _ref_format = _ref.format, format = _ref_format === void 0 ? TextureFormat.R8G8B8A8 : _ref_format, anisoLevel = _ref.anisoLevel, wrapModeU = _ref.wrapModeU, wrapModeV = _ref.wrapModeV, filterMode = _ref.filterMode, _ref_isSRGBColorSpace = _ref.isSRGBColorSpace, isSRGBColorSpace = _ref_isSRGBColorSpace === void 0 ? true : _ref_isSRGBColorSpace, _ref_mipmap = _ref.mipmap, mipmap = _ref_mipmap === void 0 ? true : _ref_mipmap;
|
|
50792
50796
|
var _images_ = images[0], width = _images_.width, height = _images_.height;
|
|
50793
|
-
// @ts-ignore
|
|
50794
|
-
var isWebGL2 = resourceManager.engine._hardwareRenderer._isWebGL2;
|
|
50795
50797
|
if (width !== height) {
|
|
50796
50798
|
console.error("The cube texture must have the same width and height");
|
|
50797
50799
|
return;
|
|
50798
50800
|
}
|
|
50799
|
-
var
|
|
50800
|
-
var
|
|
50801
|
+
var engine = resourceManager.engine;
|
|
50802
|
+
var generateMipmap = TextureUtils.supportGenerateMipmapsWithCorrection(engine, width, height, format, mipmap, isSRGBColorSpace);
|
|
50803
|
+
var texture = new TextureCube(engine, width, format, generateMipmap, isSRGBColorSpace);
|
|
50801
50804
|
texture.anisoLevel = anisoLevel != null ? anisoLevel : texture.anisoLevel;
|
|
50802
50805
|
texture.filterMode = filterMode != null ? filterMode : texture.filterMode;
|
|
50803
50806
|
texture.wrapModeU = wrapModeU != null ? wrapModeU : texture.wrapModeU;
|
|
@@ -51613,7 +51616,7 @@
|
|
|
51613
51616
|
], EXT_texture_webp);
|
|
51614
51617
|
|
|
51615
51618
|
//@ts-ignore
|
|
51616
|
-
var version = "1.6.
|
|
51619
|
+
var version = "1.6.9";
|
|
51617
51620
|
console.log("Galacean Engine Version: " + version);
|
|
51618
51621
|
for(var key in CoreObjects){
|
|
51619
51622
|
Loader.registerClass(key, CoreObjects[key]);
|