@galacean/effects-threejs 2.3.0-beta.0 → 2.3.0-beta.1

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/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.3.0-beta.0
6
+ * Version: v2.3.0-beta.1
7
7
  */
8
8
 
9
9
  import * as THREE from 'three';
@@ -35,6 +35,41 @@ function _async_to_generator(fn) {
35
35
  };
36
36
  }
37
37
 
38
+ function _array_like_to_array(arr, len) {
39
+ if (len == null || len > arr.length) len = arr.length;
40
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
41
+ return arr2;
42
+ }
43
+
44
+ function _unsupported_iterable_to_array(o, minLen) {
45
+ if (!o) return;
46
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
47
+ var n = Object.prototype.toString.call(o).slice(8, -1);
48
+ if (n === "Object" && o.constructor) n = o.constructor.name;
49
+ if (n === "Map" || n === "Set") return Array.from(n);
50
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
51
+ }
52
+
53
+ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
54
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
55
+ if (it) return (it = it.call(o)).next.bind(it);
56
+ // Fallback for engines without symbol support
57
+ if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
58
+ if (it) o = it;
59
+ var i = 0;
60
+ return function() {
61
+ if (i >= o.length) return {
62
+ done: true
63
+ };
64
+ return {
65
+ done: false,
66
+ value: o[i++]
67
+ };
68
+ };
69
+ }
70
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
71
+ }
72
+
38
73
  function _instanceof1(left, right) {
39
74
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
40
75
  return !!right[Symbol.hasInstance](left);
@@ -818,16 +853,13 @@ var pluginCtrlMap = {};
818
853
  * @param pluginClass class of plugin
819
854
  * @param itemClass class of item
820
855
  * @param isDefault load
821
- */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
822
- function registerPlugin(name, pluginClass, itemClass, isDefault) {
856
+ */ function registerPlugin(name, pluginClass, itemClass) {
823
857
  if (pluginCtrlMap[name]) {
824
858
  logger.error("Duplicate registration for plugin " + name + ".");
825
859
  }
826
860
  pluginCtrlMap[name] = itemClass;
827
861
  pluginLoaderMap[name] = pluginClass;
828
- if (isDefault) {
829
- addItem(defaultPlugins, name);
830
- }
862
+ addItem(defaultPlugins, name);
831
863
  }
832
864
  function unregisterPlugin(name) {
833
865
  delete pluginCtrlMap[name];
@@ -835,7 +867,7 @@ function unregisterPlugin(name) {
835
867
  removeItem(defaultPlugins, name);
836
868
  }
837
869
  var PluginSystem = /*#__PURE__*/ function() {
838
- function PluginSystem(pluginNames) {
870
+ function PluginSystem() {
839
871
  var loaders = {};
840
872
  var loaded = [];
841
873
  var addLoader = function(name) {
@@ -846,7 +878,6 @@ var PluginSystem = /*#__PURE__*/ function() {
846
878
  }
847
879
  };
848
880
  defaultPlugins.forEach(addLoader);
849
- pluginNames.forEach(addLoader);
850
881
  this.plugins = Object.keys(loaders).map(function(name) {
851
882
  var CTRL = pluginLoaderMap[name];
852
883
  if (!CTRL) {
@@ -898,15 +929,10 @@ var PluginSystem = /*#__PURE__*/ function() {
898
929
  })();
899
930
  };
900
931
  _proto.precompile = function precompile(compositions, renderer, options) {
901
- var _this = this;
902
- return _async_to_generator(function() {
903
- return __generator(this, function(_state) {
904
- return [
905
- 2,
906
- _this.callStatic("precompile", compositions, renderer, options)
907
- ];
908
- });
909
- })();
932
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.plugins), _step; !(_step = _iterator()).done;){
933
+ var plugin = _step.value;
934
+ plugin.precompile(compositions, renderer, options);
935
+ }
910
936
  };
911
937
  _proto.loadResources = function loadResources(scene, options) {
912
938
  var _this = this;
@@ -976,6 +1002,11 @@ function getPluginUsageInfo(name) {
976
1002
  this.name = "";
977
1003
  }
978
1004
  var _proto = AbstractPlugin.prototype;
1005
+ /**
1006
+ * 在加载到 JSON 后,就可以进行提前编译
1007
+ * @param json
1008
+ * @param player
1009
+ */ _proto.precompile = function precompile(compositions, renderer, options) {};
979
1010
  _proto.onCompositionConstructed = function onCompositionConstructed(composition, scene) {};
980
1011
  _proto.onCompositionItemLifeBegin = function onCompositionItemLifeBegin(composition, item) {};
981
1012
  _proto.onCompositionItemLifeEnd = function onCompositionItemLifeEnd(composition, item) {};
@@ -988,13 +1019,6 @@ function getPluginUsageInfo(name) {
988
1019
  return false;
989
1020
  };
990
1021
  _proto.postProcessFrame = function postProcessFrame(composition, frame) {};
991
- /**
992
- * 在加载到 JSON 后,就可以进行提前编译
993
- * @param json
994
- * @param player
995
- */ AbstractPlugin.precompile = function precompile(compositions, renderer) {
996
- return Promise.resolve();
997
- };
998
1022
  return AbstractPlugin;
999
1023
  }();
1000
1024
 
@@ -6669,41 +6693,6 @@ function setDefaultTextureFactory(factory) {
6669
6693
  g = factory;
6670
6694
  }
6671
6695
 
6672
- function _array_like_to_array(arr, len) {
6673
- if (len == null || len > arr.length) len = arr.length;
6674
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6675
- return arr2;
6676
- }
6677
-
6678
- function _unsupported_iterable_to_array(o, minLen) {
6679
- if (!o) return;
6680
- if (typeof o === "string") return _array_like_to_array(o, minLen);
6681
- var n = Object.prototype.toString.call(o).slice(8, -1);
6682
- if (n === "Object" && o.constructor) n = o.constructor.name;
6683
- if (n === "Map" || n === "Set") return Array.from(n);
6684
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
6685
- }
6686
-
6687
- function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
6688
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
6689
- if (it) return (it = it.call(o)).next.bind(it);
6690
- // Fallback for engines without symbol support
6691
- if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
6692
- if (it) o = it;
6693
- var i = 0;
6694
- return function() {
6695
- if (i >= o.length) return {
6696
- done: true
6697
- };
6698
- return {
6699
- done: false,
6700
- value: o[i++]
6701
- };
6702
- };
6703
- }
6704
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6705
- }
6706
-
6707
6696
  var ShaderCompileResultStatus;
6708
6697
  (function(ShaderCompileResultStatus) {
6709
6698
  ShaderCompileResultStatus[ShaderCompileResultStatus["noShader"] = 0] = "noShader";
@@ -16160,7 +16149,8 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16160
16149
  var perpY = x0 - x1;
16161
16150
  var perp1x = 0;
16162
16151
  var perp1y = 0;
16163
- var dist = Math.sqrt(perpX * perpX + perpY * perpY);
16152
+ // 计算向量长度并添加极小值 NumberEpsilon 以避免除以零的情况。
16153
+ var dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16164
16154
  perpX /= dist;
16165
16155
  perpY /= dist;
16166
16156
  perpX *= width;
@@ -16187,14 +16177,14 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16187
16177
  y2 = points[(i + 1) * 2 + 1];
16188
16178
  perpX = -(y0 - y1);
16189
16179
  perpY = x0 - x1;
16190
- dist = Math.sqrt(perpX * perpX + perpY * perpY);
16180
+ dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16191
16181
  perpX /= dist;
16192
16182
  perpY /= dist;
16193
16183
  perpX *= width;
16194
16184
  perpY *= width;
16195
16185
  perp1x = -(y1 - y2);
16196
16186
  perp1y = x1 - x2;
16197
- dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y);
16187
+ dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y) + NumberEpsilon;
16198
16188
  perp1x /= dist;
16199
16189
  perp1y /= dist;
16200
16190
  perp1x *= width;
@@ -16295,7 +16285,7 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16295
16285
  y1 = points[(length - 1) * 2 + 1];
16296
16286
  perpX = -(y0 - y1);
16297
16287
  perpY = x0 - x1;
16298
- dist = Math.sqrt(perpX * perpX + perpY * perpY);
16288
+ dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16299
16289
  perpX /= dist;
16300
16290
  perpY /= dist;
16301
16291
  perpX *= width;
@@ -16458,7 +16448,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
16458
16448
  indices.length;
16459
16449
  var vertOffset1 = vertices.length / 2;
16460
16450
  var lineStyle = this.strokeAttributes;
16461
- var close = false;
16451
+ var close = true;
16462
16452
  if (this.shapeAttribute.type === ShapePrimitiveType.Custom) {
16463
16453
  close = shape1.closePath;
16464
16454
  }
@@ -17579,61 +17569,6 @@ function shouldIgnoreBouncing(arg, mul) {
17579
17569
  return MeshCollider;
17580
17570
  }();
17581
17571
 
17582
- var maxSpriteMeshItemCount = 8;
17583
- function setSpriteMeshMaxItemCountByGPU(gpuCapability) {
17584
- if (gpuCapability.maxVertexUniforms >= 256) {
17585
- return maxSpriteMeshItemCount = 32;
17586
- } else if (gpuCapability.maxVertexUniforms >= 128) {
17587
- return maxSpriteMeshItemCount = 16;
17588
- }
17589
- }
17590
- function spriteMeshShaderFromFilter(level, options) {
17591
- var _ref = options != null ? options : {}, _ref_env = _ref.env, env = _ref_env === void 0 ? "" : _ref_env, wireframe = _ref.wireframe;
17592
- var macros = [
17593
- [
17594
- "ENV_EDITOR",
17595
- env === PLAYER_OPTIONS_ENV_EDITOR
17596
- ]
17597
- ];
17598
- var fragment = wireframe ? itemFrameFrag : itemFrag;
17599
- var vertex = itemVert;
17600
- return {
17601
- fragment: fragment,
17602
- vertex: vertex,
17603
- glslVersion: level === 1 ? GLSLVersion.GLSL1 : GLSLVersion.GLSL3,
17604
- macros: macros,
17605
- shared: true
17606
- };
17607
- }
17608
- function spriteMeshShaderIdFromRenderInfo(renderInfo, count) {
17609
- return renderInfo.cachePrefix + "_effects_sprite_" + count;
17610
- }
17611
- function spriteMeshShaderFromRenderInfo(renderInfo, count, level, env) {
17612
- var wireframe = renderInfo.wireframe;
17613
- var shader = spriteMeshShaderFromFilter(level, {
17614
- wireframe: wireframe,
17615
- env: env
17616
- });
17617
- shader.shared = true;
17618
- // if (!wireframe) {
17619
- // shader.cacheId = spriteMeshShaderIdFromRenderInfo(renderInfo, count);
17620
- // }
17621
- return shader;
17622
- }
17623
- // TODO: 只有单测用
17624
- function setMaxSpriteMeshItemCount(count) {
17625
- maxSpriteMeshItemCount = count;
17626
- }
17627
-
17628
- var defRenderInfo = {
17629
- blending: 0,
17630
- cacheId: "-",
17631
- mask: 0,
17632
- maskMode: 0,
17633
- occlusion: false,
17634
- side: 0,
17635
- cachePrefix: "-"
17636
- };
17637
17572
  var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17638
17573
  _inherits(SpriteLoader, AbstractPlugin);
17639
17574
  function SpriteLoader() {
@@ -17642,19 +17577,6 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17642
17577
  _this.name = "sprite";
17643
17578
  return _this;
17644
17579
  }
17645
- SpriteLoader.precompile = function precompile(compositions, render, options) {
17646
- var shaderLibrary = render.getShaderLibrary();
17647
- var _render_engine_gpuCapability = render.engine.gpuCapability, level = _render_engine_gpuCapability.level, detail = _render_engine_gpuCapability.detail;
17648
- var env = (options != null ? options : {}).env;
17649
- if (!(shaderLibrary == null ? void 0 : shaderLibrary.shaderResults[spriteMeshShaderIdFromRenderInfo(defRenderInfo, 2)])) {
17650
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(spriteMeshShaderFromRenderInfo(defRenderInfo, 2, 1, env));
17651
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(spriteMeshShaderFromRenderInfo(defRenderInfo, maxSpriteMeshItemCount, 1, env));
17652
- if (detail.writableFragDepth) {
17653
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(createCopyShader(level, true));
17654
- }
17655
- }
17656
- return Promise.resolve();
17657
- };
17658
17580
  return SpriteLoader;
17659
17581
  }(AbstractPlugin);
17660
17582
 
@@ -19856,66 +19778,6 @@ function calculateDirection(prePoint, point, nextPoint) {
19856
19778
  }
19857
19779
  return dir.normalize().toArray();
19858
19780
  }
19859
- function getTrailMeshShader(trails, particleMaxCount, name, gpuCapability, env) {
19860
- if (env === void 0) env = "";
19861
- var shaderCacheId = 0;
19862
- var lookUpTexture = getConfig(RENDER_PREFER_LOOKUP_TEXTURE) ? 1 : 0;
19863
- var enableVertexTexture = gpuCapability.detail.maxVertexTextures > 0;
19864
- var macros = [
19865
- [
19866
- "ENABLE_VERTEX_TEXTURE",
19867
- enableVertexTexture
19868
- ],
19869
- [
19870
- "LOOKUP_TEXTURE_CURVE",
19871
- lookUpTexture
19872
- ],
19873
- [
19874
- "ENV_EDITOR",
19875
- env === PLAYER_OPTIONS_ENV_EDITOR
19876
- ]
19877
- ];
19878
- var keyFrameMeta = createKeyFrameMeta();
19879
- if (trails.colorOverLifetime) {
19880
- macros.push([
19881
- "COLOR_OVER_LIFETIME",
19882
- true
19883
- ]);
19884
- shaderCacheId |= 1;
19885
- }
19886
- if (trails.colorOverTrail) {
19887
- macros.push([
19888
- "COLOR_OVER_TRAIL",
19889
- true
19890
- ]);
19891
- shaderCacheId |= 1 << 2;
19892
- }
19893
- var useAttributeTrailStart = particleMaxCount > 64;
19894
- if (useAttributeTrailStart) {
19895
- macros.push([
19896
- "ATTR_TRAIL_START",
19897
- 1
19898
- ]);
19899
- shaderCacheId |= 1 << 3;
19900
- }
19901
- getKeyFrameMetaByRawValue(keyFrameMeta, trails.opacityOverLifetime);
19902
- getKeyFrameMetaByRawValue(keyFrameMeta, trails.widthOverTrail);
19903
- macros.push([
19904
- "VERT_CURVE_VALUE_COUNT",
19905
- keyFrameMeta.index
19906
- ], [
19907
- "VERT_MAX_KEY_FRAME_COUNT",
19908
- keyFrameMeta.max
19909
- ]);
19910
- return {
19911
- vertex: trailVert,
19912
- fragment: particleFrag,
19913
- macros: macros,
19914
- shared: true,
19915
- name: "trail#" + name,
19916
- cacheId: "-t:+" + shaderCacheId + "+" + keyFrameMeta.index + "+" + keyFrameMeta.max
19917
- };
19918
- }
19919
19781
 
19920
19782
  /**
19921
19783
  * @since 2.0.0
@@ -24939,59 +24801,57 @@ SpriteComponent = __decorate([
24939
24801
  effectsClass(DataType.SpriteComponent)
24940
24802
  ], SpriteComponent);
24941
24803
 
24804
+ var maxSpriteMeshItemCount = 8;
24805
+ function setSpriteMeshMaxItemCountByGPU(gpuCapability) {
24806
+ if (gpuCapability.maxVertexUniforms >= 256) {
24807
+ return maxSpriteMeshItemCount = 32;
24808
+ } else if (gpuCapability.maxVertexUniforms >= 128) {
24809
+ return maxSpriteMeshItemCount = 16;
24810
+ }
24811
+ }
24812
+ function spriteMeshShaderFromFilter(level, options) {
24813
+ var _ref = options != null ? options : {}, _ref_env = _ref.env, env = _ref_env === void 0 ? "" : _ref_env, wireframe = _ref.wireframe;
24814
+ var macros = [
24815
+ [
24816
+ "ENV_EDITOR",
24817
+ env === PLAYER_OPTIONS_ENV_EDITOR
24818
+ ]
24819
+ ];
24820
+ var fragment = wireframe ? itemFrameFrag : itemFrag;
24821
+ var vertex = itemVert;
24822
+ return {
24823
+ fragment: fragment,
24824
+ vertex: vertex,
24825
+ glslVersion: level === 1 ? GLSLVersion.GLSL1 : GLSLVersion.GLSL3,
24826
+ macros: macros,
24827
+ shared: true
24828
+ };
24829
+ }
24830
+ function spriteMeshShaderIdFromRenderInfo(renderInfo, count) {
24831
+ return renderInfo.cachePrefix + "_effects_sprite_" + count;
24832
+ }
24833
+ function spriteMeshShaderFromRenderInfo(renderInfo, count, level, env) {
24834
+ var wireframe = renderInfo.wireframe;
24835
+ var shader = spriteMeshShaderFromFilter(level, {
24836
+ wireframe: wireframe,
24837
+ env: env
24838
+ });
24839
+ shader.shared = true;
24840
+ // if (!wireframe) {
24841
+ // shader.cacheId = spriteMeshShaderIdFromRenderInfo(renderInfo, count);
24842
+ // }
24843
+ return shader;
24844
+ }
24845
+ // TODO: 只有单测用
24846
+ function setMaxSpriteMeshItemCount(count) {
24847
+ maxSpriteMeshItemCount = count;
24848
+ }
24849
+
24942
24850
  var ParticleLoader = /*#__PURE__*/ function(AbstractPlugin) {
24943
24851
  _inherits(ParticleLoader, AbstractPlugin);
24944
24852
  function ParticleLoader() {
24945
24853
  return AbstractPlugin.apply(this, arguments);
24946
24854
  }
24947
- ParticleLoader.precompile = function precompile(compositions, renderer, options) {
24948
- var gpuCapability = renderer.engine.gpuCapability;
24949
- var level = gpuCapability.level;
24950
- var env = (options != null ? options : {}).env;
24951
- var shaderLibrary = renderer.getShaderLibrary();
24952
- var items = [];
24953
- var shaders = [];
24954
- var maxFragmentCount = 0;
24955
- var maxVertexCount = 0;
24956
- // 增加预合成中的粒子处理
24957
- compositions.forEach(function(comp) {
24958
- comp.items.forEach(function(item) {
24959
- if (Item.isParticle(item)) {
24960
- items.push(item);
24961
- }
24962
- });
24963
- });
24964
- items.forEach(function(item) {
24965
- var _getParticleMeshShader = getParticleMeshShader(item, gpuCapability, env), shader = _getParticleMeshShader.shader, fragment = _getParticleMeshShader.fragment, vertex = _getParticleMeshShader.vertex;
24966
- shaders.push(shader);
24967
- maxFragmentCount = Math.max(maxFragmentCount, fragment);
24968
- maxVertexCount = Math.max(maxVertexCount, vertex);
24969
- // TODO 此处add是否有意义?shader变量似乎没有加到this.shaders数组。
24970
- if (item.content.trails) {
24971
- var shader1 = getTrailMeshShader(item.content.trails, item.content.options.maxCount, item.name, gpuCapability, env);
24972
- shader1.glslVersion = level === 2 ? GLSLVersion.GLSL3 : GLSLVersion.GLSL1;
24973
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(shader1);
24974
- }
24975
- });
24976
- shaders.forEach(function(shader) {
24977
- if (level === 2) {
24978
- modifyMaxKeyframeShader(shader, maxVertexCount, maxFragmentCount);
24979
- shader.glslVersion = GLSLVersion.GLSL3;
24980
- } else {
24981
- shader.glslVersion = GLSLVersion.GLSL1;
24982
- }
24983
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(shader);
24984
- });
24985
- if (level === 2) {
24986
- items.forEach(function(item) {
24987
- item.content.options.meshSlots = [
24988
- maxVertexCount,
24989
- maxFragmentCount
24990
- ];
24991
- });
24992
- }
24993
- return Promise.resolve();
24994
- };
24995
24855
  return ParticleLoader;
24996
24856
  }(AbstractPlugin);
24997
24857
 
@@ -28169,7 +28029,7 @@ var seed$1 = 1;
28169
28029
  });
28170
28030
  });
28171
28031
  loadResourcePromise = /*#__PURE__*/ _async_to_generator(function() {
28172
- var scene, link, jsonScene, pluginSystem, loadedImages, compositions, images, _ref, jsonScene1, pluginSystem1, _jsonScene_bins, bins, images1, compositions1, fonts, _ref1, loadedBins, loadedImages1, loadedTextures, totalTime;
28032
+ var scene, link, jsonScene, pluginSystem, loadedImages, images, _ref, jsonScene1, pluginSystem1, _jsonScene_bins, bins, images1, fonts, _ref1, loadedBins, loadedImages1, loadedTextures, totalTime;
28173
28033
  return __generator(this, function(_state) {
28174
28034
  switch(_state.label){
28175
28035
  case 0:
@@ -28205,16 +28065,13 @@ var seed$1 = 1;
28205
28065
  // 已经加载过的 可能需要更新数据模板
28206
28066
  scene = _extends({}, rawJSON);
28207
28067
  jsonScene = scene.jsonScene, pluginSystem = scene.pluginSystem, loadedImages = scene.images;
28208
- compositions = jsonScene.compositions, images = jsonScene.images;
28068
+ images = jsonScene.images;
28209
28069
  _this.assignImagesToAssets(images, loadedImages);
28210
28070
  return [
28211
28071
  4,
28212
28072
  Promise.all([
28213
28073
  hookTimeInfo("plugin:processAssets", function() {
28214
28074
  return _this.processPluginAssets(jsonScene, pluginSystem, options);
28215
- }),
28216
- hookTimeInfo("plugin:precompile", function() {
28217
- return _this.precompile(compositions, pluginSystem, renderer, options);
28218
28075
  })
28219
28076
  ])
28220
28077
  ];
@@ -28233,7 +28090,7 @@ var seed$1 = 1;
28233
28090
  ];
28234
28091
  case 6:
28235
28092
  _ref = _state.sent(), jsonScene1 = _ref.jsonScene, pluginSystem1 = _ref.pluginSystem;
28236
- _jsonScene_bins = jsonScene1.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images1 = jsonScene1.images, compositions1 = jsonScene1.compositions, fonts = jsonScene1.fonts;
28093
+ _jsonScene_bins = jsonScene1.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images1 = jsonScene1.images, fonts = jsonScene1.fonts;
28237
28094
  return [
28238
28095
  4,
28239
28096
  Promise.all([
@@ -28246,9 +28103,6 @@ var seed$1 = 1;
28246
28103
  hookTimeInfo("plugin:processAssets", function() {
28247
28104
  return _this.processPluginAssets(jsonScene1, pluginSystem1, options);
28248
28105
  }),
28249
- hookTimeInfo("plugin:precompile", function() {
28250
- return _this.precompile(compositions1, pluginSystem1, renderer, options);
28251
- }),
28252
28106
  hookTimeInfo("processFontURL", function() {
28253
28107
  return _this.processFontURL(fonts);
28254
28108
  })
@@ -28314,39 +28168,15 @@ var seed$1 = 1;
28314
28168
  _proto.getAssets = function getAssets() {
28315
28169
  return this.assets;
28316
28170
  };
28317
- _proto.precompile = function precompile(compositions, pluginSystem, renderer, options) {
28318
- return _async_to_generator(function() {
28319
- return __generator(this, function(_state) {
28320
- switch(_state.label){
28321
- case 0:
28322
- if (!renderer || !renderer.getShaderLibrary()) {
28323
- return [
28324
- 2
28325
- ];
28326
- }
28327
- return [
28328
- 4,
28329
- pluginSystem.precompile(compositions, renderer, options)
28330
- ];
28331
- case 1:
28332
- _state.sent();
28333
- return [
28334
- 2
28335
- ];
28336
- }
28337
- });
28338
- })();
28339
- };
28340
28171
  _proto.processJSON = function processJSON(json) {
28341
28172
  var _this = this;
28342
28173
  return _async_to_generator(function() {
28343
- var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
28174
+ var jsonScene, pluginSystem;
28344
28175
  return __generator(this, function(_state) {
28345
28176
  switch(_state.label){
28346
28177
  case 0:
28347
28178
  jsonScene = getStandardJSON(json);
28348
- _jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
28349
- pluginSystem = new PluginSystem(plugins);
28179
+ pluginSystem = new PluginSystem();
28350
28180
  return [
28351
28181
  4,
28352
28182
  pluginSystem.processRawJSON(jsonScene, _this.options)
@@ -28858,7 +28688,6 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
28858
28688
  }
28859
28689
  var _proto = AssetService.prototype;
28860
28690
  /**
28861
- * @internal
28862
28691
  * @param url
28863
28692
  * @param options
28864
28693
  * @returns
@@ -28883,7 +28712,6 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
28883
28712
  * 根据用户参数修改文本元素的原始数据
28884
28713
  * @param scene
28885
28714
  * @param options
28886
- * @internal
28887
28715
  */ _proto.updateTextVariables = function updateTextVariables(scene, variables) {
28888
28716
  var _this = this;
28889
28717
  if (variables === void 0) variables = {};
@@ -32234,13 +32062,13 @@ var DEFAULT_FPS = 60;
32234
32062
  return Ticker;
32235
32063
  }();
32236
32064
 
32237
- registerPlugin("camera", CameraVFXItemLoader, VFXItem, true);
32238
- registerPlugin("text", TextLoader, VFXItem, true);
32239
- registerPlugin("sprite", SpriteLoader, VFXItem, true);
32240
- registerPlugin("particle", ParticleLoader, VFXItem, true);
32241
- registerPlugin("cal", CalculateLoader, VFXItem, true);
32242
- registerPlugin("interact", InteractLoader, VFXItem, true);
32243
- var version$1 = "2.3.0-beta.0";
32065
+ registerPlugin("camera", CameraVFXItemLoader, VFXItem);
32066
+ registerPlugin("text", TextLoader, VFXItem);
32067
+ registerPlugin("sprite", SpriteLoader, VFXItem);
32068
+ registerPlugin("particle", ParticleLoader, VFXItem);
32069
+ registerPlugin("cal", CalculateLoader, VFXItem);
32070
+ registerPlugin("interact", InteractLoader, VFXItem);
32071
+ var version$1 = "2.3.0-beta.1";
32244
32072
  logger.info("Core version: " + version$1 + ".");
32245
32073
 
32246
32074
  var _obj;
@@ -33886,7 +33714,7 @@ setMaxSpriteMeshItemCount(8);
33886
33714
  */ Mesh.create = function(engine, props) {
33887
33715
  return new ThreeMesh(engine, props);
33888
33716
  };
33889
- var version = "2.3.0-beta.0";
33717
+ var version = "2.3.0-beta.1";
33890
33718
  logger.info("THREEJS plugin version: " + version + ".");
33891
33719
 
33892
33720
  export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, ParticleTrack, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, PropertyTrack, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector2Curve, Vector2PropertyPlayableAsset, Vector2PropertyTrack, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };