@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.js 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
  'use strict';
@@ -59,6 +59,41 @@ function _async_to_generator(fn) {
59
59
  };
60
60
  }
61
61
 
62
+ function _array_like_to_array(arr, len) {
63
+ if (len == null || len > arr.length) len = arr.length;
64
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
65
+ return arr2;
66
+ }
67
+
68
+ function _unsupported_iterable_to_array(o, minLen) {
69
+ if (!o) return;
70
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
71
+ var n = Object.prototype.toString.call(o).slice(8, -1);
72
+ if (n === "Object" && o.constructor) n = o.constructor.name;
73
+ if (n === "Map" || n === "Set") return Array.from(n);
74
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
75
+ }
76
+
77
+ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
78
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
79
+ if (it) return (it = it.call(o)).next.bind(it);
80
+ // Fallback for engines without symbol support
81
+ if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
82
+ if (it) o = it;
83
+ var i = 0;
84
+ return function() {
85
+ if (i >= o.length) return {
86
+ done: true
87
+ };
88
+ return {
89
+ done: false,
90
+ value: o[i++]
91
+ };
92
+ };
93
+ }
94
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
95
+ }
96
+
62
97
  function _instanceof1(left, right) {
63
98
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
64
99
  return !!right[Symbol.hasInstance](left);
@@ -842,16 +877,13 @@ var pluginCtrlMap = {};
842
877
  * @param pluginClass class of plugin
843
878
  * @param itemClass class of item
844
879
  * @param isDefault load
845
- */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
846
- function registerPlugin(name, pluginClass, itemClass, isDefault) {
880
+ */ function registerPlugin(name, pluginClass, itemClass) {
847
881
  if (pluginCtrlMap[name]) {
848
882
  logger.error("Duplicate registration for plugin " + name + ".");
849
883
  }
850
884
  pluginCtrlMap[name] = itemClass;
851
885
  pluginLoaderMap[name] = pluginClass;
852
- if (isDefault) {
853
- addItem(defaultPlugins, name);
854
- }
886
+ addItem(defaultPlugins, name);
855
887
  }
856
888
  function unregisterPlugin(name) {
857
889
  delete pluginCtrlMap[name];
@@ -859,7 +891,7 @@ function unregisterPlugin(name) {
859
891
  removeItem(defaultPlugins, name);
860
892
  }
861
893
  var PluginSystem = /*#__PURE__*/ function() {
862
- function PluginSystem(pluginNames) {
894
+ function PluginSystem() {
863
895
  var loaders = {};
864
896
  var loaded = [];
865
897
  var addLoader = function(name) {
@@ -870,7 +902,6 @@ var PluginSystem = /*#__PURE__*/ function() {
870
902
  }
871
903
  };
872
904
  defaultPlugins.forEach(addLoader);
873
- pluginNames.forEach(addLoader);
874
905
  this.plugins = Object.keys(loaders).map(function(name) {
875
906
  var CTRL = pluginLoaderMap[name];
876
907
  if (!CTRL) {
@@ -922,15 +953,10 @@ var PluginSystem = /*#__PURE__*/ function() {
922
953
  })();
923
954
  };
924
955
  _proto.precompile = function precompile(compositions, renderer, options) {
925
- var _this = this;
926
- return _async_to_generator(function() {
927
- return __generator(this, function(_state) {
928
- return [
929
- 2,
930
- _this.callStatic("precompile", compositions, renderer, options)
931
- ];
932
- });
933
- })();
956
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.plugins), _step; !(_step = _iterator()).done;){
957
+ var plugin = _step.value;
958
+ plugin.precompile(compositions, renderer, options);
959
+ }
934
960
  };
935
961
  _proto.loadResources = function loadResources(scene, options) {
936
962
  var _this = this;
@@ -1000,6 +1026,11 @@ function getPluginUsageInfo(name) {
1000
1026
  this.name = "";
1001
1027
  }
1002
1028
  var _proto = AbstractPlugin.prototype;
1029
+ /**
1030
+ * 在加载到 JSON 后,就可以进行提前编译
1031
+ * @param json
1032
+ * @param player
1033
+ */ _proto.precompile = function precompile(compositions, renderer, options) {};
1003
1034
  _proto.onCompositionConstructed = function onCompositionConstructed(composition, scene) {};
1004
1035
  _proto.onCompositionItemLifeBegin = function onCompositionItemLifeBegin(composition, item) {};
1005
1036
  _proto.onCompositionItemLifeEnd = function onCompositionItemLifeEnd(composition, item) {};
@@ -1012,13 +1043,6 @@ function getPluginUsageInfo(name) {
1012
1043
  return false;
1013
1044
  };
1014
1045
  _proto.postProcessFrame = function postProcessFrame(composition, frame) {};
1015
- /**
1016
- * 在加载到 JSON 后,就可以进行提前编译
1017
- * @param json
1018
- * @param player
1019
- */ AbstractPlugin.precompile = function precompile(compositions, renderer) {
1020
- return Promise.resolve();
1021
- };
1022
1046
  return AbstractPlugin;
1023
1047
  }();
1024
1048
 
@@ -6693,41 +6717,6 @@ function setDefaultTextureFactory(factory) {
6693
6717
  g = factory;
6694
6718
  }
6695
6719
 
6696
- function _array_like_to_array(arr, len) {
6697
- if (len == null || len > arr.length) len = arr.length;
6698
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6699
- return arr2;
6700
- }
6701
-
6702
- function _unsupported_iterable_to_array(o, minLen) {
6703
- if (!o) return;
6704
- if (typeof o === "string") return _array_like_to_array(o, minLen);
6705
- var n = Object.prototype.toString.call(o).slice(8, -1);
6706
- if (n === "Object" && o.constructor) n = o.constructor.name;
6707
- if (n === "Map" || n === "Set") return Array.from(n);
6708
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
6709
- }
6710
-
6711
- function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
6712
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
6713
- if (it) return (it = it.call(o)).next.bind(it);
6714
- // Fallback for engines without symbol support
6715
- if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
6716
- if (it) o = it;
6717
- var i = 0;
6718
- return function() {
6719
- if (i >= o.length) return {
6720
- done: true
6721
- };
6722
- return {
6723
- done: false,
6724
- value: o[i++]
6725
- };
6726
- };
6727
- }
6728
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6729
- }
6730
-
6731
6720
  exports.ShaderCompileResultStatus = void 0;
6732
6721
  (function(ShaderCompileResultStatus) {
6733
6722
  ShaderCompileResultStatus[ShaderCompileResultStatus["noShader"] = 0] = "noShader";
@@ -16184,7 +16173,8 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16184
16173
  var perpY = x0 - x1;
16185
16174
  var perp1x = 0;
16186
16175
  var perp1y = 0;
16187
- var dist = Math.sqrt(perpX * perpX + perpY * perpY);
16176
+ // 计算向量长度并添加极小值 NumberEpsilon 以避免除以零的情况。
16177
+ var dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16188
16178
  perpX /= dist;
16189
16179
  perpY /= dist;
16190
16180
  perpX *= width;
@@ -16211,14 +16201,14 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16211
16201
  y2 = points[(i + 1) * 2 + 1];
16212
16202
  perpX = -(y0 - y1);
16213
16203
  perpY = x0 - x1;
16214
- dist = Math.sqrt(perpX * perpX + perpY * perpY);
16204
+ dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16215
16205
  perpX /= dist;
16216
16206
  perpY /= dist;
16217
16207
  perpX *= width;
16218
16208
  perpY *= width;
16219
16209
  perp1x = -(y1 - y2);
16220
16210
  perp1y = x1 - x2;
16221
- dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y);
16211
+ dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y) + NumberEpsilon;
16222
16212
  perp1x /= dist;
16223
16213
  perp1y /= dist;
16224
16214
  perp1x *= width;
@@ -16319,7 +16309,7 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16319
16309
  y1 = points[(length - 1) * 2 + 1];
16320
16310
  perpX = -(y0 - y1);
16321
16311
  perpY = x0 - x1;
16322
- dist = Math.sqrt(perpX * perpX + perpY * perpY);
16312
+ dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16323
16313
  perpX /= dist;
16324
16314
  perpY /= dist;
16325
16315
  perpX *= width;
@@ -16482,7 +16472,7 @@ exports.ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
16482
16472
  indices.length;
16483
16473
  var vertOffset1 = vertices.length / 2;
16484
16474
  var lineStyle = this.strokeAttributes;
16485
- var close = false;
16475
+ var close = true;
16486
16476
  if (this.shapeAttribute.type === ShapePrimitiveType.Custom) {
16487
16477
  close = shape1.closePath;
16488
16478
  }
@@ -17603,61 +17593,6 @@ function shouldIgnoreBouncing(arg, mul) {
17603
17593
  return MeshCollider;
17604
17594
  }();
17605
17595
 
17606
- exports.maxSpriteMeshItemCount = 8;
17607
- function setSpriteMeshMaxItemCountByGPU(gpuCapability) {
17608
- if (gpuCapability.maxVertexUniforms >= 256) {
17609
- return exports.maxSpriteMeshItemCount = 32;
17610
- } else if (gpuCapability.maxVertexUniforms >= 128) {
17611
- return exports.maxSpriteMeshItemCount = 16;
17612
- }
17613
- }
17614
- function spriteMeshShaderFromFilter(level, options) {
17615
- var _ref = options != null ? options : {}, _ref_env = _ref.env, env = _ref_env === void 0 ? "" : _ref_env, wireframe = _ref.wireframe;
17616
- var macros = [
17617
- [
17618
- "ENV_EDITOR",
17619
- env === PLAYER_OPTIONS_ENV_EDITOR
17620
- ]
17621
- ];
17622
- var fragment = wireframe ? itemFrameFrag : itemFrag;
17623
- var vertex = itemVert;
17624
- return {
17625
- fragment: fragment,
17626
- vertex: vertex,
17627
- glslVersion: level === 1 ? exports.GLSLVersion.GLSL1 : exports.GLSLVersion.GLSL3,
17628
- macros: macros,
17629
- shared: true
17630
- };
17631
- }
17632
- function spriteMeshShaderIdFromRenderInfo(renderInfo, count) {
17633
- return renderInfo.cachePrefix + "_effects_sprite_" + count;
17634
- }
17635
- function spriteMeshShaderFromRenderInfo(renderInfo, count, level, env) {
17636
- var wireframe = renderInfo.wireframe;
17637
- var shader = spriteMeshShaderFromFilter(level, {
17638
- wireframe: wireframe,
17639
- env: env
17640
- });
17641
- shader.shared = true;
17642
- // if (!wireframe) {
17643
- // shader.cacheId = spriteMeshShaderIdFromRenderInfo(renderInfo, count);
17644
- // }
17645
- return shader;
17646
- }
17647
- // TODO: 只有单测用
17648
- function setMaxSpriteMeshItemCount(count) {
17649
- exports.maxSpriteMeshItemCount = count;
17650
- }
17651
-
17652
- var defRenderInfo = {
17653
- blending: 0,
17654
- cacheId: "-",
17655
- mask: 0,
17656
- maskMode: 0,
17657
- occlusion: false,
17658
- side: 0,
17659
- cachePrefix: "-"
17660
- };
17661
17596
  var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17662
17597
  _inherits(SpriteLoader, AbstractPlugin);
17663
17598
  function SpriteLoader() {
@@ -17666,19 +17601,6 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17666
17601
  _this.name = "sprite";
17667
17602
  return _this;
17668
17603
  }
17669
- SpriteLoader.precompile = function precompile(compositions, render, options) {
17670
- var shaderLibrary = render.getShaderLibrary();
17671
- var _render_engine_gpuCapability = render.engine.gpuCapability, level = _render_engine_gpuCapability.level, detail = _render_engine_gpuCapability.detail;
17672
- var env = (options != null ? options : {}).env;
17673
- if (!(shaderLibrary == null ? void 0 : shaderLibrary.shaderResults[spriteMeshShaderIdFromRenderInfo(defRenderInfo, 2)])) {
17674
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(spriteMeshShaderFromRenderInfo(defRenderInfo, 2, 1, env));
17675
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(spriteMeshShaderFromRenderInfo(defRenderInfo, exports.maxSpriteMeshItemCount, 1, env));
17676
- if (detail.writableFragDepth) {
17677
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(createCopyShader(level, true));
17678
- }
17679
- }
17680
- return Promise.resolve();
17681
- };
17682
17604
  return SpriteLoader;
17683
17605
  }(AbstractPlugin);
17684
17606
 
@@ -19880,66 +19802,6 @@ function calculateDirection(prePoint, point, nextPoint) {
19880
19802
  }
19881
19803
  return dir.normalize().toArray();
19882
19804
  }
19883
- function getTrailMeshShader(trails, particleMaxCount, name, gpuCapability, env) {
19884
- if (env === void 0) env = "";
19885
- var shaderCacheId = 0;
19886
- var lookUpTexture = getConfig(RENDER_PREFER_LOOKUP_TEXTURE) ? 1 : 0;
19887
- var enableVertexTexture = gpuCapability.detail.maxVertexTextures > 0;
19888
- var macros = [
19889
- [
19890
- "ENABLE_VERTEX_TEXTURE",
19891
- enableVertexTexture
19892
- ],
19893
- [
19894
- "LOOKUP_TEXTURE_CURVE",
19895
- lookUpTexture
19896
- ],
19897
- [
19898
- "ENV_EDITOR",
19899
- env === PLAYER_OPTIONS_ENV_EDITOR
19900
- ]
19901
- ];
19902
- var keyFrameMeta = createKeyFrameMeta();
19903
- if (trails.colorOverLifetime) {
19904
- macros.push([
19905
- "COLOR_OVER_LIFETIME",
19906
- true
19907
- ]);
19908
- shaderCacheId |= 1;
19909
- }
19910
- if (trails.colorOverTrail) {
19911
- macros.push([
19912
- "COLOR_OVER_TRAIL",
19913
- true
19914
- ]);
19915
- shaderCacheId |= 1 << 2;
19916
- }
19917
- var useAttributeTrailStart = particleMaxCount > 64;
19918
- if (useAttributeTrailStart) {
19919
- macros.push([
19920
- "ATTR_TRAIL_START",
19921
- 1
19922
- ]);
19923
- shaderCacheId |= 1 << 3;
19924
- }
19925
- getKeyFrameMetaByRawValue(keyFrameMeta, trails.opacityOverLifetime);
19926
- getKeyFrameMetaByRawValue(keyFrameMeta, trails.widthOverTrail);
19927
- macros.push([
19928
- "VERT_CURVE_VALUE_COUNT",
19929
- keyFrameMeta.index
19930
- ], [
19931
- "VERT_MAX_KEY_FRAME_COUNT",
19932
- keyFrameMeta.max
19933
- ]);
19934
- return {
19935
- vertex: trailVert,
19936
- fragment: particleFrag,
19937
- macros: macros,
19938
- shared: true,
19939
- name: "trail#" + name,
19940
- cacheId: "-t:+" + shaderCacheId + "+" + keyFrameMeta.index + "+" + keyFrameMeta.max
19941
- };
19942
- }
19943
19805
 
19944
19806
  /**
19945
19807
  * @since 2.0.0
@@ -24963,59 +24825,57 @@ exports.SpriteComponent = __decorate([
24963
24825
  effectsClass(DataType.SpriteComponent)
24964
24826
  ], exports.SpriteComponent);
24965
24827
 
24828
+ exports.maxSpriteMeshItemCount = 8;
24829
+ function setSpriteMeshMaxItemCountByGPU(gpuCapability) {
24830
+ if (gpuCapability.maxVertexUniforms >= 256) {
24831
+ return exports.maxSpriteMeshItemCount = 32;
24832
+ } else if (gpuCapability.maxVertexUniforms >= 128) {
24833
+ return exports.maxSpriteMeshItemCount = 16;
24834
+ }
24835
+ }
24836
+ function spriteMeshShaderFromFilter(level, options) {
24837
+ var _ref = options != null ? options : {}, _ref_env = _ref.env, env = _ref_env === void 0 ? "" : _ref_env, wireframe = _ref.wireframe;
24838
+ var macros = [
24839
+ [
24840
+ "ENV_EDITOR",
24841
+ env === PLAYER_OPTIONS_ENV_EDITOR
24842
+ ]
24843
+ ];
24844
+ var fragment = wireframe ? itemFrameFrag : itemFrag;
24845
+ var vertex = itemVert;
24846
+ return {
24847
+ fragment: fragment,
24848
+ vertex: vertex,
24849
+ glslVersion: level === 1 ? exports.GLSLVersion.GLSL1 : exports.GLSLVersion.GLSL3,
24850
+ macros: macros,
24851
+ shared: true
24852
+ };
24853
+ }
24854
+ function spriteMeshShaderIdFromRenderInfo(renderInfo, count) {
24855
+ return renderInfo.cachePrefix + "_effects_sprite_" + count;
24856
+ }
24857
+ function spriteMeshShaderFromRenderInfo(renderInfo, count, level, env) {
24858
+ var wireframe = renderInfo.wireframe;
24859
+ var shader = spriteMeshShaderFromFilter(level, {
24860
+ wireframe: wireframe,
24861
+ env: env
24862
+ });
24863
+ shader.shared = true;
24864
+ // if (!wireframe) {
24865
+ // shader.cacheId = spriteMeshShaderIdFromRenderInfo(renderInfo, count);
24866
+ // }
24867
+ return shader;
24868
+ }
24869
+ // TODO: 只有单测用
24870
+ function setMaxSpriteMeshItemCount(count) {
24871
+ exports.maxSpriteMeshItemCount = count;
24872
+ }
24873
+
24966
24874
  var ParticleLoader = /*#__PURE__*/ function(AbstractPlugin) {
24967
24875
  _inherits(ParticleLoader, AbstractPlugin);
24968
24876
  function ParticleLoader() {
24969
24877
  return AbstractPlugin.apply(this, arguments);
24970
24878
  }
24971
- ParticleLoader.precompile = function precompile(compositions, renderer, options) {
24972
- var gpuCapability = renderer.engine.gpuCapability;
24973
- var level = gpuCapability.level;
24974
- var env = (options != null ? options : {}).env;
24975
- var shaderLibrary = renderer.getShaderLibrary();
24976
- var items = [];
24977
- var shaders = [];
24978
- var maxFragmentCount = 0;
24979
- var maxVertexCount = 0;
24980
- // 增加预合成中的粒子处理
24981
- compositions.forEach(function(comp) {
24982
- comp.items.forEach(function(item) {
24983
- if (exports.Item.isParticle(item)) {
24984
- items.push(item);
24985
- }
24986
- });
24987
- });
24988
- items.forEach(function(item) {
24989
- var _getParticleMeshShader = getParticleMeshShader(item, gpuCapability, env), shader = _getParticleMeshShader.shader, fragment = _getParticleMeshShader.fragment, vertex = _getParticleMeshShader.vertex;
24990
- shaders.push(shader);
24991
- maxFragmentCount = Math.max(maxFragmentCount, fragment);
24992
- maxVertexCount = Math.max(maxVertexCount, vertex);
24993
- // TODO 此处add是否有意义?shader变量似乎没有加到this.shaders数组。
24994
- if (item.content.trails) {
24995
- var shader1 = getTrailMeshShader(item.content.trails, item.content.options.maxCount, item.name, gpuCapability, env);
24996
- shader1.glslVersion = level === 2 ? exports.GLSLVersion.GLSL3 : exports.GLSLVersion.GLSL1;
24997
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(shader1);
24998
- }
24999
- });
25000
- shaders.forEach(function(shader) {
25001
- if (level === 2) {
25002
- modifyMaxKeyframeShader(shader, maxVertexCount, maxFragmentCount);
25003
- shader.glslVersion = exports.GLSLVersion.GLSL3;
25004
- } else {
25005
- shader.glslVersion = exports.GLSLVersion.GLSL1;
25006
- }
25007
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(shader);
25008
- });
25009
- if (level === 2) {
25010
- items.forEach(function(item) {
25011
- item.content.options.meshSlots = [
25012
- maxVertexCount,
25013
- maxFragmentCount
25014
- ];
25015
- });
25016
- }
25017
- return Promise.resolve();
25018
- };
25019
24879
  return ParticleLoader;
25020
24880
  }(AbstractPlugin);
25021
24881
 
@@ -28193,7 +28053,7 @@ var seed$1 = 1;
28193
28053
  });
28194
28054
  });
28195
28055
  loadResourcePromise = /*#__PURE__*/ _async_to_generator(function() {
28196
- var scene, link, jsonScene, pluginSystem, loadedImages, compositions, images, _ref, jsonScene1, pluginSystem1, _jsonScene_bins, bins, images1, compositions1, fonts, _ref1, loadedBins, loadedImages1, loadedTextures, totalTime;
28056
+ var scene, link, jsonScene, pluginSystem, loadedImages, images, _ref, jsonScene1, pluginSystem1, _jsonScene_bins, bins, images1, fonts, _ref1, loadedBins, loadedImages1, loadedTextures, totalTime;
28197
28057
  return __generator(this, function(_state) {
28198
28058
  switch(_state.label){
28199
28059
  case 0:
@@ -28229,16 +28089,13 @@ var seed$1 = 1;
28229
28089
  // 已经加载过的 可能需要更新数据模板
28230
28090
  scene = _extends({}, rawJSON);
28231
28091
  jsonScene = scene.jsonScene, pluginSystem = scene.pluginSystem, loadedImages = scene.images;
28232
- compositions = jsonScene.compositions, images = jsonScene.images;
28092
+ images = jsonScene.images;
28233
28093
  _this.assignImagesToAssets(images, loadedImages);
28234
28094
  return [
28235
28095
  4,
28236
28096
  Promise.all([
28237
28097
  hookTimeInfo("plugin:processAssets", function() {
28238
28098
  return _this.processPluginAssets(jsonScene, pluginSystem, options);
28239
- }),
28240
- hookTimeInfo("plugin:precompile", function() {
28241
- return _this.precompile(compositions, pluginSystem, renderer, options);
28242
28099
  })
28243
28100
  ])
28244
28101
  ];
@@ -28257,7 +28114,7 @@ var seed$1 = 1;
28257
28114
  ];
28258
28115
  case 6:
28259
28116
  _ref = _state.sent(), jsonScene1 = _ref.jsonScene, pluginSystem1 = _ref.pluginSystem;
28260
- _jsonScene_bins = jsonScene1.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images1 = jsonScene1.images, compositions1 = jsonScene1.compositions, fonts = jsonScene1.fonts;
28117
+ _jsonScene_bins = jsonScene1.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images1 = jsonScene1.images, fonts = jsonScene1.fonts;
28261
28118
  return [
28262
28119
  4,
28263
28120
  Promise.all([
@@ -28270,9 +28127,6 @@ var seed$1 = 1;
28270
28127
  hookTimeInfo("plugin:processAssets", function() {
28271
28128
  return _this.processPluginAssets(jsonScene1, pluginSystem1, options);
28272
28129
  }),
28273
- hookTimeInfo("plugin:precompile", function() {
28274
- return _this.precompile(compositions1, pluginSystem1, renderer, options);
28275
- }),
28276
28130
  hookTimeInfo("processFontURL", function() {
28277
28131
  return _this.processFontURL(fonts);
28278
28132
  })
@@ -28338,39 +28192,15 @@ var seed$1 = 1;
28338
28192
  _proto.getAssets = function getAssets() {
28339
28193
  return this.assets;
28340
28194
  };
28341
- _proto.precompile = function precompile(compositions, pluginSystem, renderer, options) {
28342
- return _async_to_generator(function() {
28343
- return __generator(this, function(_state) {
28344
- switch(_state.label){
28345
- case 0:
28346
- if (!renderer || !renderer.getShaderLibrary()) {
28347
- return [
28348
- 2
28349
- ];
28350
- }
28351
- return [
28352
- 4,
28353
- pluginSystem.precompile(compositions, renderer, options)
28354
- ];
28355
- case 1:
28356
- _state.sent();
28357
- return [
28358
- 2
28359
- ];
28360
- }
28361
- });
28362
- })();
28363
- };
28364
28195
  _proto.processJSON = function processJSON(json) {
28365
28196
  var _this = this;
28366
28197
  return _async_to_generator(function() {
28367
- var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
28198
+ var jsonScene, pluginSystem;
28368
28199
  return __generator(this, function(_state) {
28369
28200
  switch(_state.label){
28370
28201
  case 0:
28371
28202
  jsonScene = getStandardJSON(json);
28372
- _jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
28373
- pluginSystem = new PluginSystem(plugins);
28203
+ pluginSystem = new PluginSystem();
28374
28204
  return [
28375
28205
  4,
28376
28206
  pluginSystem.processRawJSON(jsonScene, _this.options)
@@ -28882,7 +28712,6 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
28882
28712
  }
28883
28713
  var _proto = AssetService.prototype;
28884
28714
  /**
28885
- * @internal
28886
28715
  * @param url
28887
28716
  * @param options
28888
28717
  * @returns
@@ -28907,7 +28736,6 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
28907
28736
  * 根据用户参数修改文本元素的原始数据
28908
28737
  * @param scene
28909
28738
  * @param options
28910
- * @internal
28911
28739
  */ _proto.updateTextVariables = function updateTextVariables(scene, variables) {
28912
28740
  var _this = this;
28913
28741
  if (variables === void 0) variables = {};
@@ -32258,13 +32086,13 @@ var DEFAULT_FPS = 60;
32258
32086
  return Ticker;
32259
32087
  }();
32260
32088
 
32261
- registerPlugin("camera", CameraVFXItemLoader, exports.VFXItem, true);
32262
- registerPlugin("text", TextLoader, exports.VFXItem, true);
32263
- registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
32264
- registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
32265
- registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
32266
- registerPlugin("interact", InteractLoader, exports.VFXItem, true);
32267
- var version$1 = "2.3.0-beta.0";
32089
+ registerPlugin("camera", CameraVFXItemLoader, exports.VFXItem);
32090
+ registerPlugin("text", TextLoader, exports.VFXItem);
32091
+ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
32092
+ registerPlugin("particle", ParticleLoader, exports.VFXItem);
32093
+ registerPlugin("cal", CalculateLoader, exports.VFXItem);
32094
+ registerPlugin("interact", InteractLoader, exports.VFXItem);
32095
+ var version$1 = "2.3.0-beta.1";
32268
32096
  logger.info("Core version: " + version$1 + ".");
32269
32097
 
32270
32098
  var _obj;
@@ -33910,7 +33738,7 @@ setMaxSpriteMeshItemCount(8);
33910
33738
  */ Mesh.create = function(engine, props) {
33911
33739
  return new ThreeMesh(engine, props);
33912
33740
  };
33913
- var version = "2.3.0-beta.0";
33741
+ var version = "2.3.0-beta.1";
33914
33742
  logger.info("THREEJS plugin version: " + version + ".");
33915
33743
 
33916
33744
  exports.AbstractPlugin = AbstractPlugin;