@galacean/effects-plugin-spine 2.10.0-alpha.0 → 2.10.0-alpha.2

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 player spine plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 十弦
6
- * Version: v2.10.0-alpha.0
6
+ * Version: v2.10.0-alpha.2
7
7
  */
8
8
 
9
9
  'use strict';
@@ -10769,21 +10769,20 @@ typeof SuppressedError === "function" ? SuppressedError : function _SuppressedEr
10769
10769
 
10770
10770
  var fs = "precision mediump float;varying mediump vec4 vLight;varying mediump vec4 vDark;varying vec2 vTexCoords;uniform sampler2D uTexture;void main(){vec4 texColor=texture2D(uTexture,vTexCoords);gl_FragColor.a=texColor.a*vLight.a;gl_FragColor.rgb=((texColor.a-1.0)*vDark.a+1.0-texColor.rgb)*vDark.rgb+texColor.rgb*vLight.rgb;gl_FragColor.rgb*=gl_FragColor.a;}";
10771
10771
 
10772
- var vs = "attribute vec2 aPosition;attribute vec4 aColor;attribute vec4 aColor2;attribute vec2 aTexCoords;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixVP;uniform vec2 _Size;varying vec4 vLight;varying vec4 vDark;varying vec2 vTexCoords;void main(){vLight=aColor;vDark=aColor2;vTexCoords=aTexCoords;gl_Position=effects_MatrixVP*effects_ObjectToWorld*vec4(aPosition*_Size,0.0,1.0);}";
10772
+ var vs = "attribute vec2 aPos;attribute vec4 aColor;attribute vec4 aColor2;attribute vec2 aUV;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixVP;uniform vec2 _Size;varying vec4 vLight;varying vec4 vDark;varying vec2 vTexCoords;void main(){vLight=aColor;vDark=aColor2;vTexCoords=aUV;gl_Position=effects_MatrixVP*effects_ObjectToWorld*vec4(aPos*_Size,0.0,1.0);}";
10773
10773
 
10774
10774
  var seed = 1;
10775
10775
  var SpineMesh = /*#__PURE__*/ function() {
10776
10776
  function SpineMesh(renderInfo) {
10777
10777
  this.verticesLength = 0;
10778
10778
  this.indicesLength = 0;
10779
- var blendMode = renderInfo.blendMode, texture = renderInfo.texture, priority = renderInfo.priority, _renderInfo_renderOptions = renderInfo.renderOptions, renderOptions = _renderInfo_renderOptions === void 0 ? {} : _renderInfo_renderOptions, _renderInfo_name = renderInfo.name, name = _renderInfo_name === void 0 ? "MSpine" : _renderInfo_name, engine = renderInfo.engine;
10780
- var _renderOptions_mask = renderOptions.mask, mask = _renderOptions_mask === void 0 ? 0 : _renderOptions_mask, _renderOptions_maskMode = renderOptions.maskMode, maskMode = _renderOptions_maskMode === void 0 ? 0 : _renderOptions_maskMode;
10779
+ var blendMode = renderInfo.blendMode, texture = renderInfo.texture, priority = renderInfo.priority, _renderInfo_name = renderInfo.name, name = _renderInfo_name === void 0 ? "MSpine" : _renderInfo_name, engine = renderInfo.engine;
10781
10780
  this.blendMode = blendMode;
10782
10781
  this.lastTexture = texture;
10783
10782
  this.priority = priority;
10784
10783
  this.engine = engine;
10785
10784
  this.geometry = this.createGeometry();
10786
- this.material = this.createMaterial(maskMode, mask);
10785
+ this.material = this.createMaterial();
10787
10786
  this.mesh = EFFECTS.Mesh.create(engine, {
10788
10787
  name: name + seed++,
10789
10788
  priority: this.priority,
@@ -10797,43 +10796,39 @@ var SpineMesh = /*#__PURE__*/ function() {
10797
10796
  _proto.createGeometry = function createGeometry() {
10798
10797
  var BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT;
10799
10798
  var stride = BYTES_PER_ELEMENT * SlotGroup.VERTEX_SIZE;
10800
- var attributes = {
10801
- "aPosition": {
10802
- size: 2,
10803
- offset: 0,
10804
- stride: stride,
10805
- data: new Float32Array(0)
10806
- },
10807
- "aColor": {
10808
- size: 4,
10809
- offset: 2 * BYTES_PER_ELEMENT,
10810
- stride: stride,
10811
- dataSource: "aPosition"
10812
- },
10813
- "aTexCoords": {
10814
- size: 2,
10815
- offset: 6 * BYTES_PER_ELEMENT,
10816
- stride: stride,
10817
- dataSource: "aPosition"
10818
- },
10819
- "aColor2": {
10820
- size: 4,
10821
- offset: 8 * BYTES_PER_ELEMENT,
10822
- stride: stride,
10823
- dataSource: "aPosition"
10824
- }
10825
- };
10799
+ var _obj;
10800
+ var attributes = (_obj = {}, _obj[EFFECTS.VertexBuffer.PositionKind] = {
10801
+ size: 2,
10802
+ offset: 0,
10803
+ stride: stride,
10804
+ data: new Float32Array(0)
10805
+ }, _obj[EFFECTS.VertexBuffer.ColorKind] = {
10806
+ size: 4,
10807
+ offset: 2 * BYTES_PER_ELEMENT,
10808
+ stride: stride,
10809
+ dataSource: EFFECTS.VertexBuffer.PositionKind
10810
+ }, _obj[EFFECTS.VertexBuffer.UVKind] = {
10811
+ size: 2,
10812
+ offset: 6 * BYTES_PER_ELEMENT,
10813
+ stride: stride,
10814
+ dataSource: EFFECTS.VertexBuffer.PositionKind
10815
+ }, _obj.aColor2 = {
10816
+ size: 4,
10817
+ offset: 8 * BYTES_PER_ELEMENT,
10818
+ stride: stride,
10819
+ dataSource: EFFECTS.VertexBuffer.PositionKind
10820
+ }, _obj);
10826
10821
  return EFFECTS.Geometry.create(this.engine, {
10827
10822
  attributes: attributes,
10828
10823
  indices: {
10829
- data: new Uint16Array(0),
10830
- releasable: true
10824
+ data: new Uint16Array(0)
10831
10825
  },
10832
10826
  mode: EFFECTS.glContext.TRIANGLES,
10833
- maxVertex: SlotGroup.MAX_VERTICES
10827
+ maxVertex: SlotGroup.MAX_VERTICES,
10828
+ bufferUsage: EFFECTS.glContext.DYNAMIC_DRAW
10834
10829
  });
10835
10830
  };
10836
- _proto.createMaterial = function createMaterial(maskMode, maskOrder) {
10831
+ _proto.createMaterial = function createMaterial() {
10837
10832
  var material = EFFECTS.Material.create(this.engine, {
10838
10833
  shader: createShader(this.engine)
10839
10834
  });
@@ -10869,7 +10864,7 @@ var SpineMesh = /*#__PURE__*/ function() {
10869
10864
  for(var i1 = this.indicesLength; i1 < this.indices.length; i1++){
10870
10865
  this.indices[i1] = 0;
10871
10866
  }
10872
- this.geometry.setAttributeData("aPosition", this.vertices);
10867
+ this.geometry.setAttributeData(EFFECTS.VertexBuffer.PositionKind, this.vertices);
10873
10868
  this.geometry.setIndexData(this.indices);
10874
10869
  this.geometry.setDrawCount(this.indicesLength);
10875
10870
  };
@@ -10946,7 +10941,6 @@ var SlotGroup = /*#__PURE__*/ function() {
10946
10941
  this.transform = props.transform;
10947
10942
  this.listIndex = props.listIndex;
10948
10943
  this.pma = props.pma;
10949
- this.renderOptions = props.renderOptions;
10950
10944
  this.engine = props.engine;
10951
10945
  }
10952
10946
  var _proto = SlotGroup.prototype;
@@ -11079,7 +11073,6 @@ var SlotGroup = /*#__PURE__*/ function() {
11079
11073
  texture: texture,
11080
11074
  name: this.meshName,
11081
11075
  priority: this.listIndex += 0.01,
11082
- renderOptions: this.renderOptions,
11083
11076
  engine: this.engine
11084
11077
  });
11085
11078
  currentIndex = this.meshGroups.length;
@@ -11163,16 +11156,11 @@ exports.SpineComponent = /*#__PURE__*/ function(RendererComponent) {
11163
11156
  this.options = data.options;
11164
11157
  this.rendererOptions = _extends({
11165
11158
  renderMode: EFFECTS.spec.RenderMode.MESH
11166
- }, data.renderer || {}, {
11167
- mask: 0,
11168
- maskMode: EFFECTS.MaskMode.NONE
11169
- });
11159
+ }, data.renderer || {});
11170
11160
  this.item.getHitTestParams = this.getHitTestParams.bind(this);
11171
11161
  if (data.mask) {
11172
11162
  this.maskManager.setMaskOptions(this.engine, data.mask);
11173
11163
  }
11174
- this.rendererOptions.maskMode = this.maskManager.maskMode;
11175
- this.rendererOptions.mask = this.maskManager.getRefValue();
11176
11164
  // 兼容编辑器逻辑
11177
11165
  if (!this.resource || !Object.keys(this.resource).length) {
11178
11166
  return;
@@ -11296,7 +11284,6 @@ exports.SpineComponent = /*#__PURE__*/ function(RendererComponent) {
11296
11284
  meshName: this.name,
11297
11285
  transform: this.transform,
11298
11286
  pma: this.pma,
11299
- renderOptions: this.rendererOptions,
11300
11287
  engine: this.engine
11301
11288
  });
11302
11289
  };
@@ -11622,7 +11609,7 @@ var SpineLoader = /*#__PURE__*/ function(Plugin) {
11622
11609
  EFFECTS.registerPlugin("spine", SpineLoader);
11623
11610
  /**
11624
11611
  * 插件版本号
11625
- */ var version = "2.10.0-alpha.0";
11612
+ */ var version = "2.10.0-alpha.2";
11626
11613
  EFFECTS.logger.info("Plugin spine version: " + version + ".");
11627
11614
  if (version !== EFFECTS__namespace.version) {
11628
11615
  console.error("注意:请统一 Spine 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Spine plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");