@galacean/effects-core 2.8.0-alpha.0 → 2.8.0-alpha.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 core for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.8.0-alpha.0
6
+ * Version: v2.8.0-alpha.1
7
7
  */
8
8
 
9
9
  'use strict';
@@ -9881,6 +9881,8 @@ var TextureFactory = /*#__PURE__*/ function() {
9881
9881
  internalFormat: textureData.internalFormat,
9882
9882
  format: textureData.format,
9883
9883
  mipmaps: textureData.mipmaps,
9884
+ minFilter: glContext.LINEAR,
9885
+ magFilter: glContext.LINEAR,
9884
9886
  sourceFrom: sourceFrom
9885
9887
  }, config)
9886
9888
  ];
@@ -10522,41 +10524,6 @@ function _assert_this_initialized(self) {
10522
10524
  return self;
10523
10525
  }
10524
10526
 
10525
- var SemanticMap = /*#__PURE__*/ function() {
10526
- function SemanticMap(semantics) {
10527
- if (semantics === void 0) semantics = {};
10528
- this.semantics = _extends({}, semantics);
10529
- }
10530
- var _proto = SemanticMap.prototype;
10531
- _proto.toObject = function toObject() {
10532
- return _extends({}, this.semantics);
10533
- };
10534
- _proto.setSemantic = function setSemantic(name, value) {
10535
- if (value === undefined) {
10536
- delete this.semantics[name];
10537
- } else {
10538
- this.semantics[name] = value;
10539
- }
10540
- };
10541
- _proto.getSemanticValue = function getSemanticValue(name, state) {
10542
- var ret = this.semantics[name];
10543
- if (isFunction(ret)) {
10544
- return ret(state);
10545
- }
10546
- return ret;
10547
- };
10548
- _proto.hasSemanticValue = function hasSemanticValue(name) {
10549
- return name in this.semantics;
10550
- };
10551
- _proto.dispose = function dispose() {
10552
- var _this = this;
10553
- Object.keys(this.semantics).forEach(function(name) {
10554
- delete _this.semantics[name];
10555
- });
10556
- };
10557
- return SemanticMap;
10558
- }();
10559
-
10560
10527
  var RenderPassPriorityPrepare = 0;
10561
10528
  var RenderPassPriorityNormal = 1000;
10562
10529
  var RenderPassPriorityPostprocess = 3000;
@@ -10687,26 +10654,31 @@ var seed$7 = 1;
10687
10654
  */ var RenderPass = /*#__PURE__*/ function() {
10688
10655
  function RenderPass(renderer, options) {
10689
10656
  /**
10657
+ * 优先级
10658
+ */ this.priority = 0;
10659
+ /**
10690
10660
  * ColorAttachment 数组
10691
10661
  */ this.attachments = [];
10692
- this.destroyed = false;
10662
+ /**
10663
+ * 名称
10664
+ */ this.name = "RenderPass" + seed$7++;
10665
+ /**
10666
+ * 包含的 Mesh 列表
10667
+ */ this.meshes = [];
10668
+ /**
10669
+ * Mesh 渲染顺序,按照优先级升序或降序
10670
+ */ this.meshOrder = exports.OrderType.ascending;
10671
+ this.disposed = false;
10693
10672
  this.initialized = false;
10694
- var _options_name = options.name, name = _options_name === void 0 ? "RenderPass_" + seed$7++ : _options_name, clearAction = options.clearAction, semantics = options.semantics, depthStencilAttachment = options.depthStencilAttachment, storeAction = options.storeAction, _options_priority = options.priority, priority = _options_priority === void 0 ? 0 : _options_priority, _options_meshOrder = options.meshOrder, meshOrder = _options_meshOrder === void 0 ? exports.OrderType.ascending : _options_meshOrder, _options_meshes = options.meshes, meshes = _options_meshes === void 0 ? [] : _options_meshes, _options_delegate = options.delegate, delegate = _options_delegate === void 0 ? {} : _options_delegate;
10695
- this.name = name;
10673
+ var depthStencilAttachment = options.depthStencilAttachment;
10696
10674
  this.renderer = renderer;
10697
- this.priority = priority;
10698
- this.meshOrder = meshOrder;
10699
- this.meshes = sortByOrder(meshes.slice(), this.meshOrder);
10700
10675
  this.depthStencilType = (depthStencilAttachment == null ? void 0 : depthStencilAttachment.storageType) || 0;
10701
- this.clearAction = _extends({}, clearAction);
10702
- this.storeAction = _extends({
10676
+ this.storeAction = {
10703
10677
  colorAction: 0,
10704
10678
  depthAction: 0,
10705
10679
  stencilAction: 0
10706
- }, storeAction);
10707
- this.semantics = new SemanticMap(semantics);
10680
+ };
10708
10681
  this.options = options;
10709
- this.delegate = delegate;
10710
10682
  }
10711
10683
  var _proto = RenderPass.prototype;
10712
10684
  _proto.addMesh = function addMesh(mesh) {
@@ -10739,13 +10711,13 @@ var seed$7 = 1;
10739
10711
  /**
10740
10712
  * 执行当前pass,每帧调用一次
10741
10713
  */ _proto.execute = function execute(renderer) {
10742
- renderer.clear(this.clearAction);
10743
- renderer.renderMeshes(this.meshes);
10744
- renderer.clear(this.storeAction);
10714
+ // OVERRIDE
10745
10715
  };
10746
10716
  /**
10747
10717
  * 每帧所有的pass渲染完后调用,通常用于清空临时的RT资源
10748
- */ _proto.frameCleanup = function frameCleanup(renderer) {};
10718
+ */ _proto.frameCleanup = function frameCleanup(renderer) {
10719
+ // OVERRIDE
10720
+ };
10749
10721
  _proto._resetAttachments = function _resetAttachments() {
10750
10722
  var _this = this;
10751
10723
  var _options_attachments;
@@ -10806,7 +10778,7 @@ var seed$7 = 1;
10806
10778
  * 获取当前视口大小,格式:[x偏移,y偏移,宽度,高度]
10807
10779
  */ _proto.getViewport = function getViewport() {
10808
10780
  var _this_framebuffer;
10809
- var ret = ((_this_framebuffer = this.framebuffer) == null ? void 0 : _this_framebuffer.viewport) || this.customViewport;
10781
+ var ret = (_this_framebuffer = this.framebuffer) == null ? void 0 : _this_framebuffer.viewport;
10810
10782
  if (ret) {
10811
10783
  return ret;
10812
10784
  }
@@ -10889,7 +10861,7 @@ var seed$7 = 1;
10889
10861
  * 销毁 RenderPass
10890
10862
  * @param options - 有选择销毁内部对象
10891
10863
  */ _proto.dispose = function dispose(options) {
10892
- if (this.destroyed) {
10864
+ if (this.disposed) {
10893
10865
  return;
10894
10866
  }
10895
10867
  var destroyMeshOption = (options == null ? void 0 : options.meshes) || undefined;
@@ -10907,10 +10879,7 @@ var seed$7 = 1;
10907
10879
  }
10908
10880
  });
10909
10881
  this.attachments.length = 0;
10910
- if ((options == null ? void 0 : options.semantics) !== exports.DestroyOptions.keep) {
10911
- this.semantics.dispose();
10912
- }
10913
- this.destroyed = true;
10882
+ this.disposed = true;
10914
10883
  var depthStencilOpt = (options == null ? void 0 : options.depthStencilAttachment) ? options.depthStencilAttachment : 0;
10915
10884
  var fbo = this.framebuffer;
10916
10885
  if (fbo) {
@@ -10932,7 +10901,7 @@ var seed$7 = 1;
10932
10901
  {
10933
10902
  key: "isDestroyed",
10934
10903
  get: function get() {
10935
- return this.destroyed;
10904
+ return this.disposed;
10936
10905
  }
10937
10906
  },
10938
10907
  {
@@ -10962,11 +10931,22 @@ var DrawObjectPass = /*#__PURE__*/ function(RenderPass) {
10962
10931
  function DrawObjectPass(renderer, options) {
10963
10932
  var _this;
10964
10933
  _this = RenderPass.call(this, renderer, options) || this;
10934
+ _this.priority = RenderPassPriorityNormal;
10935
+ _this.name = "DrawObjectPass";
10965
10936
  _this.onResize = _this.onResize.bind(_assert_this_initialized(_this));
10966
10937
  _this.renderer.engine.on("resize", _this.onResize);
10967
10938
  return _this;
10968
10939
  }
10969
10940
  var _proto = DrawObjectPass.prototype;
10941
+ _proto.execute = function execute(renderer) {
10942
+ renderer.clear({
10943
+ colorAction: exports.TextureLoadAction.clear,
10944
+ depthAction: exports.TextureLoadAction.clear,
10945
+ stencilAction: exports.TextureLoadAction.clear
10946
+ });
10947
+ renderer.renderMeshes(this.meshes);
10948
+ renderer.clear(this.storeAction);
10949
+ };
10970
10950
  _proto.onResize = function onResize() {
10971
10951
  var _this_framebuffer;
10972
10952
  var width = this.renderer.getWidth();
@@ -13061,6 +13041,7 @@ var BloomThresholdPass = /*#__PURE__*/ function(RenderPass) {
13061
13041
  priority: 0
13062
13042
  });
13063
13043
  _this.priority = 5000;
13044
+ _this.name = "BloomThresholdPass";
13064
13045
  _this.onResize = _this.onResize.bind(_assert_this_initialized(_this));
13065
13046
  _this.renderer.engine.on("resize", _this.onResize);
13066
13047
  return _this;
@@ -13148,6 +13129,7 @@ var HQGaussianDownSamplePass = /*#__PURE__*/ function(RenderPass) {
13148
13129
  priority: 0
13149
13130
  });
13150
13131
  _this.priority = 5000;
13132
+ _this.name = "GaussianDownPass" + type + level;
13151
13133
  _this.onResize = _this.onResize.bind(_assert_this_initialized(_this));
13152
13134
  _this.renderer.engine.on("resize", _this.onResize);
13153
13135
  return _this;
@@ -13236,6 +13218,7 @@ var HQGaussianUpSamplePass = /*#__PURE__*/ function(RenderPass) {
13236
13218
  priority: 0
13237
13219
  });
13238
13220
  _this.priority = 5000;
13221
+ _this.name = "GaussianUpPass" + level;
13239
13222
  _this.onResize = _this.onResize.bind(_assert_this_initialized(_this));
13240
13223
  _this.renderer.engine.on("resize", _this.onResize);
13241
13224
  return _this;
@@ -13323,6 +13306,7 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
13323
13306
  priority: 0
13324
13307
  });
13325
13308
  _this.priority = 5000;
13309
+ _this.name = "ToneMappingPass";
13326
13310
  return _this;
13327
13311
  }
13328
13312
  var _proto = ToneMappingPass.prototype;
@@ -13384,6 +13368,41 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
13384
13368
  return ToneMappingPass;
13385
13369
  }(RenderPass);
13386
13370
 
13371
+ var SemanticMap = /*#__PURE__*/ function() {
13372
+ function SemanticMap(semantics) {
13373
+ if (semantics === void 0) semantics = {};
13374
+ this.semantics = _extends({}, semantics);
13375
+ }
13376
+ var _proto = SemanticMap.prototype;
13377
+ _proto.toObject = function toObject() {
13378
+ return _extends({}, this.semantics);
13379
+ };
13380
+ _proto.setSemantic = function setSemantic(name, value) {
13381
+ if (value === undefined) {
13382
+ delete this.semantics[name];
13383
+ } else {
13384
+ this.semantics[name] = value;
13385
+ }
13386
+ };
13387
+ _proto.getSemanticValue = function getSemanticValue(name, state) {
13388
+ var ret = this.semantics[name];
13389
+ if (isFunction(ret)) {
13390
+ return ret(state);
13391
+ }
13392
+ return ret;
13393
+ };
13394
+ _proto.hasSemanticValue = function hasSemanticValue(name) {
13395
+ return name in this.semantics;
13396
+ };
13397
+ _proto.dispose = function dispose() {
13398
+ var _this = this;
13399
+ Object.keys(this.semantics).forEach(function(name) {
13400
+ delete _this.semantics[name];
13401
+ });
13402
+ };
13403
+ return SemanticMap;
13404
+ }();
13405
+
13387
13406
  var RENDER_PASS_NAME_PREFIX = "_effects_default_";
13388
13407
  var seed$5 = 1;
13389
13408
  /**
@@ -13412,7 +13431,6 @@ var seed$5 = 1;
13412
13431
  this.globalUniforms = new GlobalUniforms();
13413
13432
  var attachments = []; //渲染场景物体Pass的RT
13414
13433
  var depthStencilAttachment;
13415
- var drawObjectPassClearAction = {};
13416
13434
  this.renderer = renderer;
13417
13435
  if (postProcessingEnabled) {
13418
13436
  var enableHDR = true;
@@ -13434,19 +13452,10 @@ var seed$5 = 1;
13434
13452
  depthStencilAttachment = {
13435
13453
  storageType: exports.RenderPassAttachmentStorageType.depth_stencil_opaque
13436
13454
  };
13437
- drawObjectPassClearAction = {
13438
- colorAction: exports.TextureLoadAction.clear,
13439
- stencilAction: exports.TextureLoadAction.clear,
13440
- depthAction: exports.TextureLoadAction.clear
13441
- };
13442
13455
  }
13443
13456
  this.drawObjectPass = new DrawObjectPass(renderer, {
13444
- name: RENDER_PASS_NAME_PREFIX,
13445
- priority: RenderPassPriorityNormal,
13446
- meshOrder: exports.OrderType.ascending,
13447
13457
  depthStencilAttachment: depthStencilAttachment,
13448
- attachments: attachments,
13449
- clearAction: drawObjectPassClearAction
13458
+ attachments: attachments
13450
13459
  });
13451
13460
  var renderPasses = [
13452
13461
  this.drawObjectPass
@@ -13465,7 +13474,6 @@ var seed$5 = 1;
13465
13474
  var enableHDR1 = true;
13466
13475
  var textureType1 = enableHDR1 ? glContext.HALF_FLOAT : glContext.UNSIGNED_BYTE;
13467
13476
  var bloomThresholdPass = new BloomThresholdPass(renderer, {
13468
- name: "BloomThresholdPass",
13469
13477
  attachments: [
13470
13478
  {
13471
13479
  texture: {
@@ -13482,7 +13490,6 @@ var seed$5 = 1;
13482
13490
  for(var i = 0; i < gaussianStep; i++){
13483
13491
  gaussianDownResults[i] = new RenderTargetHandle(engine);
13484
13492
  var gaussianDownHPass = new HQGaussianDownSamplePass(renderer, "H", i, {
13485
- name: "GaussianDownPassH" + i,
13486
13493
  attachments: [
13487
13494
  {
13488
13495
  texture: {
@@ -13495,7 +13502,6 @@ var seed$5 = 1;
13495
13502
  ]
13496
13503
  });
13497
13504
  var gaussianDownVPass = new HQGaussianDownSamplePass(renderer, "V", i, {
13498
- name: "GaussianDownPassV" + i,
13499
13505
  attachments: [
13500
13506
  {
13501
13507
  texture: {
@@ -13518,7 +13524,6 @@ var seed$5 = 1;
13518
13524
  viewport[3] *= 4;
13519
13525
  for(var i1 = 0; i1 < gaussianStep - 1; i1++){
13520
13526
  var gaussianUpPass = new HQGaussianUpSamplePass(renderer, gaussianStep - i1, {
13521
- name: "GaussianUpPass" + i1,
13522
13527
  attachments: [
13523
13528
  {
13524
13529
  texture: {
@@ -29281,6 +29286,12 @@ var TextComponentBase = /*#__PURE__*/ function() {
29281
29286
  this.textLayout.textVerticalAlign = value;
29282
29287
  this.isDirty = true;
29283
29288
  };
29289
+ /**
29290
+ * @deprecated 2.8.0 本方法已废弃,请使用 setTextVerticalAlign 替代。
29291
+ */ _proto.setTextBaseline = function setTextBaseline(value) {
29292
+ console.warn("setTextBaseline 已废弃,请改用 setTextVerticalAlign。" + "本次调用将转调用 setTextVerticalAlign。");
29293
+ this.setTextVerticalAlign(value);
29294
+ };
29284
29295
  _proto.setTextColor = function setTextColor(value) {
29285
29296
  if (this.textStyle.textColor === value) {
29286
29297
  return;
@@ -29545,7 +29556,9 @@ exports.TextComponent = /*#__PURE__*/ function(MaskableGraphic) {
29545
29556
  this.lineCount = this.getLineCount(this.text);
29546
29557
  this.isDirty = true;
29547
29558
  };
29548
- _proto.updateWithOptions = function updateWithOptions(options) {
29559
+ /**
29560
+ * 根据配置更新文本样式和布局
29561
+ */ _proto.updateWithOptions = function updateWithOptions(options) {
29549
29562
  // 初始化 textStyle 和 textLayout
29550
29563
  if (!this.textStyle) {
29551
29564
  this.textStyle = new TextStyle(options);
@@ -31855,7 +31868,7 @@ function getStandardSpriteContent(sprite, transform) {
31855
31868
  return ret;
31856
31869
  }
31857
31870
 
31858
- var version$1 = "2.8.0-alpha.0";
31871
+ var version$1 = "2.8.0-alpha.1";
31859
31872
  var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
31860
31873
  var standardVersion = /^(\d+)\.(\d+)$/;
31861
31874
  var reverseParticle = false;
@@ -35486,7 +35499,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
35486
35499
  registerPlugin("particle", ParticleLoader, exports.VFXItem);
35487
35500
  registerPlugin("cal", CalculateLoader, exports.VFXItem);
35488
35501
  registerPlugin("interact", InteractLoader, exports.VFXItem);
35489
- var version = "2.8.0-alpha.0";
35502
+ var version = "2.8.0-alpha.1";
35490
35503
  logger.info("Core version: " + version + ".");
35491
35504
 
35492
35505
  exports.AbstractPlugin = AbstractPlugin;