@galacean/engine 1.1.0-beta.45 → 1.1.0-beta.47

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 CHANGED
@@ -18303,10 +18303,20 @@
18303
18303
  };
18304
18304
  _proto._parseURL = function _parseURL(path) {
18305
18305
  var _path_split = path.split("?"), baseUrl = _path_split[0], searchStr = _path_split[1];
18306
- var searchParams = new URLSearchParams(searchStr);
18307
- var queryPath = searchParams.get("q");
18308
- searchParams.delete("q");
18309
- var assetBaseURL = searchParams.size > 0 ? baseUrl + "?" + searchParams.toString() : baseUrl;
18306
+ var queryPath = undefined;
18307
+ var assetBaseURL = baseUrl;
18308
+ if (searchStr) {
18309
+ var params = searchStr.split("&");
18310
+ for(var i = 0; i < params.length; i++){
18311
+ var param = params[i];
18312
+ if (param.startsWith("q=")) {
18313
+ queryPath = decodeURIComponent(param.split("=")[1]);
18314
+ params.splice(i, 1);
18315
+ break;
18316
+ }
18317
+ }
18318
+ assetBaseURL = params.length > 0 ? baseUrl + "?" + params.join("&") : baseUrl;
18319
+ }
18310
18320
  return {
18311
18321
  assetBaseURL: assetBaseURL,
18312
18322
  queryPath: queryPath
@@ -36018,7 +36028,7 @@
36018
36028
  var cap = this.capabilityList;
36019
36029
  var isWebGL2 = this.rhi.isWebGL2;
36020
36030
  var requireExtension = this.rhi.requireExtension.bind(this.rhi);
36021
- var shaderVertexID = exports.GLCapabilityType.shaderVertexID, standardDerivatives = exports.GLCapabilityType.standardDerivatives, shaderTextureLod = exports.GLCapabilityType.shaderTextureLod, elementIndexUint = exports.GLCapabilityType.elementIndexUint, depthTexture = exports.GLCapabilityType.depthTexture, vertexArrayObject = exports.GLCapabilityType.vertexArrayObject, instancedArrays = exports.GLCapabilityType.instancedArrays, multipleSample = exports.GLCapabilityType.multipleSample, drawBuffers = exports.GLCapabilityType.drawBuffers, astc = exports.GLCapabilityType.astc, astc_webkit = exports.GLCapabilityType.astc_webkit, etc = exports.GLCapabilityType.etc, etc_webkit = exports.GLCapabilityType.etc_webkit, etc1 = exports.GLCapabilityType.etc1, etc1_webkit = exports.GLCapabilityType.etc1_webkit, pvrtc = exports.GLCapabilityType.pvrtc, pvrtc_webkit = exports.GLCapabilityType.pvrtc_webkit, s3tc = exports.GLCapabilityType.s3tc, s3tc_webkit = exports.GLCapabilityType.s3tc_webkit, bptc = exports.GLCapabilityType.bptc, textureFloat = exports.GLCapabilityType.textureFloat, textureHalfFloat = exports.GLCapabilityType.textureHalfFloat, textureFloatLinear = exports.GLCapabilityType.textureFloatLinear, textureHalfFloatLinear = exports.GLCapabilityType.textureHalfFloatLinear, WEBGL_colorBufferFloat = exports.GLCapabilityType.WEBGL_colorBufferFloat, colorBufferFloat = exports.GLCapabilityType.colorBufferFloat, colorBufferHalfFloat = exports.GLCapabilityType.colorBufferHalfFloat, textureFilterAnisotropic = exports.GLCapabilityType.textureFilterAnisotropic;
36031
+ var shaderVertexID = exports.GLCapabilityType.shaderVertexID, standardDerivatives = exports.GLCapabilityType.standardDerivatives, shaderTextureLod = exports.GLCapabilityType.shaderTextureLod, elementIndexUint = exports.GLCapabilityType.elementIndexUint, depthTexture = exports.GLCapabilityType.depthTexture, vertexArrayObject = exports.GLCapabilityType.vertexArrayObject, instancedArrays = exports.GLCapabilityType.instancedArrays, multipleSample = exports.GLCapabilityType.multipleSample, drawBuffers = exports.GLCapabilityType.drawBuffers, blendMinMax = exports.GLCapabilityType.blendMinMax, astc = exports.GLCapabilityType.astc, astc_webkit = exports.GLCapabilityType.astc_webkit, etc = exports.GLCapabilityType.etc, etc_webkit = exports.GLCapabilityType.etc_webkit, etc1 = exports.GLCapabilityType.etc1, etc1_webkit = exports.GLCapabilityType.etc1_webkit, pvrtc = exports.GLCapabilityType.pvrtc, pvrtc_webkit = exports.GLCapabilityType.pvrtc_webkit, s3tc = exports.GLCapabilityType.s3tc, s3tc_webkit = exports.GLCapabilityType.s3tc_webkit, bptc = exports.GLCapabilityType.bptc, textureFloat = exports.GLCapabilityType.textureFloat, textureHalfFloat = exports.GLCapabilityType.textureHalfFloat, textureFloatLinear = exports.GLCapabilityType.textureFloatLinear, textureHalfFloatLinear = exports.GLCapabilityType.textureHalfFloatLinear, WEBGL_colorBufferFloat = exports.GLCapabilityType.WEBGL_colorBufferFloat, colorBufferFloat = exports.GLCapabilityType.colorBufferFloat, colorBufferHalfFloat = exports.GLCapabilityType.colorBufferHalfFloat, textureFilterAnisotropic = exports.GLCapabilityType.textureFilterAnisotropic;
36022
36032
  cap.set(shaderVertexID, isWebGL2);
36023
36033
  cap.set(standardDerivatives, isWebGL2 || !!requireExtension(standardDerivatives));
36024
36034
  cap.set(shaderTextureLod, isWebGL2 || !!requireExtension(shaderTextureLod));
@@ -36028,6 +36038,7 @@
36028
36038
  cap.set(instancedArrays, isWebGL2 || !!requireExtension(instancedArrays));
36029
36039
  cap.set(multipleSample, isWebGL2);
36030
36040
  cap.set(drawBuffers, isWebGL2 || !!requireExtension(drawBuffers));
36041
+ cap.set(blendMinMax, isWebGL2 || !!requireExtension(blendMinMax));
36031
36042
  cap.set(textureFloat, isWebGL2 || !!requireExtension(textureFloat));
36032
36043
  cap.set(textureHalfFloat, isWebGL2 || !!requireExtension(textureHalfFloat));
36033
36044
  cap.set(textureFloatLinear, !!requireExtension(textureFloatLinear));
@@ -36068,9 +36079,13 @@
36068
36079
  }
36069
36080
  };
36070
36081
  _proto._compatibleAllInterface = function _compatibleAllInterface() {
36071
- var depthTexture = exports.GLCapabilityType.depthTexture, vertexArrayObject = exports.GLCapabilityType.vertexArrayObject, instancedArrays = exports.GLCapabilityType.instancedArrays, drawBuffers = exports.GLCapabilityType.drawBuffers, textureFilterAnisotropic = exports.GLCapabilityType.textureFilterAnisotropic, textureHalfFloat = exports.GLCapabilityType.textureHalfFloat, colorBufferHalfFloat = exports.GLCapabilityType.colorBufferHalfFloat, WEBGL_colorBufferFloat = exports.GLCapabilityType.WEBGL_colorBufferFloat;
36082
+ var depthTexture = exports.GLCapabilityType.depthTexture, vertexArrayObject = exports.GLCapabilityType.vertexArrayObject, instancedArrays = exports.GLCapabilityType.instancedArrays, drawBuffers = exports.GLCapabilityType.drawBuffers, textureFilterAnisotropic = exports.GLCapabilityType.textureFilterAnisotropic, textureHalfFloat = exports.GLCapabilityType.textureHalfFloat, colorBufferHalfFloat = exports.GLCapabilityType.colorBufferHalfFloat, WEBGL_colorBufferFloat = exports.GLCapabilityType.WEBGL_colorBufferFloat, blendMinMax = exports.GLCapabilityType.blendMinMax;
36072
36083
  var isWebGL2 = this.rhi.isWebGL2;
36073
36084
  if (!isWebGL2) {
36085
+ this._compatibleInterface(blendMinMax, {
36086
+ MIN: "MIN_EXT",
36087
+ MAX: "MAX_EXT"
36088
+ });
36074
36089
  this._compatibleInterface(depthTexture, {
36075
36090
  UNSIGNED_INT_24_8: "UNSIGNED_INT_24_8_WEBGL"
36076
36091
  });
@@ -39993,7 +40008,7 @@
39993
40008
  };
39994
40009
  /**
39995
40010
  * Parse the glb format.
39996
- */ GLTFUtils.parseGLB = function parseGLB(context, glb) {
40011
+ */ GLTFUtils.parseGLB = function parseGLB(context, originBuffer) {
39997
40012
  var UINT32_LENGTH = 4;
39998
40013
  var GLB_HEADER_MAGIC = 0x46546c67; // 'glTF'
39999
40014
  var GLB_HEADER_LENGTH = 12;
@@ -40001,7 +40016,7 @@
40001
40016
  JSON: 0x4e4f534a,
40002
40017
  BIN: 0x004e4942
40003
40018
  };
40004
- var dataView = new DataView(glb);
40019
+ var dataView = new DataView(originBuffer);
40005
40020
  // read header
40006
40021
  var header = {
40007
40022
  magic: dataView.getUint32(0, true),
@@ -40009,8 +40024,9 @@
40009
40024
  length: dataView.getUint32(2 * UINT32_LENGTH, true)
40010
40025
  };
40011
40026
  if (header.magic !== GLB_HEADER_MAGIC) {
40012
- console.error("Invalid glb magic number. Expected 0x46546C67, found 0x" + header.magic.toString(16));
40013
- return null;
40027
+ return {
40028
+ originBuffer: originBuffer
40029
+ };
40014
40030
  }
40015
40031
  // read main data
40016
40032
  var chunkLength = dataView.getUint32(GLB_HEADER_LENGTH, true);
@@ -40020,7 +40036,7 @@
40020
40036
  console.error("Invalid glb chunk type. Expected 0x4E4F534A, found 0x" + chunkType.toString(16));
40021
40037
  return null;
40022
40038
  }
40023
- var glTFData = new Uint8Array(glb, GLB_HEADER_LENGTH + 2 * UINT32_LENGTH, chunkLength);
40039
+ var glTFData = new Uint8Array(originBuffer, GLB_HEADER_LENGTH + 2 * UINT32_LENGTH, chunkLength);
40024
40040
  var glTF = JSON.parse(Utils.decodeText(glTFData));
40025
40041
  // read all buffers
40026
40042
  var buffers = [];
@@ -40034,7 +40050,7 @@
40034
40050
  return null;
40035
40051
  }
40036
40052
  var currentOffset = byteOffset + 2 * UINT32_LENGTH;
40037
- var buffer = glb.slice(currentOffset, currentOffset + chunkLength);
40053
+ var buffer = originBuffer.slice(currentOffset, currentOffset + chunkLength);
40038
40054
  buffers.push(buffer);
40039
40055
  restoreGLBBufferSlice.push(new Vector2(currentOffset, chunkLength));
40040
40056
  byteOffset += chunkLength + 2 * UINT32_LENGTH;
@@ -41430,23 +41446,20 @@
41430
41446
  var requestConfig = {
41431
41447
  type: "arraybuffer"
41432
41448
  };
41433
- var isGLB = this._isGLB(url);
41434
- contentRestorer.isGLB = isGLB;
41435
- var promise = isGLB ? request(url, requestConfig).then(function(glb) {
41449
+ return request(url, requestConfig).then(function(buffer) {
41436
41450
  restoreBufferRequests.push(new BufferRequestInfo(url, requestConfig));
41437
- return GLTFUtils.parseGLB(context, glb);
41438
- }).then(function(param) {
41439
- var glTF = param.glTF, buffers = param.buffers;
41440
- context.buffers = buffers;
41441
- return glTF;
41442
- }) : request(url, {
41443
- type: "json"
41451
+ return GLTFUtils.parseGLB(context, buffer);
41452
+ }).then(function(result) {
41453
+ var _result;
41454
+ if ((_result = result) == null ? void 0 : _result.glTF) {
41455
+ contentRestorer.isGLB = true;
41456
+ context.buffers = result.buffers;
41457
+ return result.glTF;
41458
+ } else {
41459
+ contentRestorer.isGLB = false;
41460
+ return JSON.parse(Utils.decodeText(new Uint8Array(result.originBuffer)));
41461
+ }
41444
41462
  });
41445
- return promise;
41446
- };
41447
- _proto._isGLB = function _isGLB(url) {
41448
- var index = url.lastIndexOf(".");
41449
- return url.substring(index + 1, index + 4) === "glb";
41450
41463
  };
41451
41464
  return GLTFSchemaParser;
41452
41465
  }(GLTFParser);
@@ -44080,7 +44093,7 @@
44080
44093
  ], GALACEAN_animation_event);
44081
44094
 
44082
44095
  //@ts-ignore
44083
- var version = "1.1.0-beta.45";
44096
+ var version = "1.1.0-beta.47";
44084
44097
  console.log("Galacean engine version: " + version);
44085
44098
  for(var key in CoreObjects){
44086
44099
  Loader.registerClass(key, CoreObjects[key]);