@galacean/effects-plugin-spine 2.10.0-alpha.1 → 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.mjs CHANGED
@@ -3,11 +3,11 @@
3
3
  * Description: Galacean Effects player spine plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 十弦
6
- * Version: v2.10.0-alpha.1
6
+ * Version: v2.10.0-alpha.2
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
10
- import { assertExist, glContext, Mesh, Geometry, Material, GLSLVersion, PLAYER_OPTIONS_ENV_EDITOR, math, serialize, effectsClass, spec, HitTestType, RendererComponent, Plugin, registerPlugin, logger } from '@galacean/effects';
10
+ import { assertExist, glContext, Mesh, VertexBuffer, Geometry, Material, GLSLVersion, PLAYER_OPTIONS_ENV_EDITOR, math, serialize, effectsClass, spec, HitTestType, RendererComponent, Plugin, registerPlugin, logger } from '@galacean/effects';
11
11
 
12
12
  function _set_prototype_of(o, p) {
13
13
  _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
@@ -10746,7 +10746,7 @@ typeof SuppressedError === "function" ? SuppressedError : function _SuppressedEr
10746
10746
 
10747
10747
  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;}";
10748
10748
 
10749
- 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);}";
10749
+ 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);}";
10750
10750
 
10751
10751
  var seed = 1;
10752
10752
  var SpineMesh = /*#__PURE__*/ function() {
@@ -10773,40 +10773,36 @@ var SpineMesh = /*#__PURE__*/ function() {
10773
10773
  _proto.createGeometry = function createGeometry() {
10774
10774
  var BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT;
10775
10775
  var stride = BYTES_PER_ELEMENT * SlotGroup.VERTEX_SIZE;
10776
- var attributes = {
10777
- "aPosition": {
10778
- size: 2,
10779
- offset: 0,
10780
- stride: stride,
10781
- data: new Float32Array(0)
10782
- },
10783
- "aColor": {
10784
- size: 4,
10785
- offset: 2 * BYTES_PER_ELEMENT,
10786
- stride: stride,
10787
- dataSource: "aPosition"
10788
- },
10789
- "aTexCoords": {
10790
- size: 2,
10791
- offset: 6 * BYTES_PER_ELEMENT,
10792
- stride: stride,
10793
- dataSource: "aPosition"
10794
- },
10795
- "aColor2": {
10796
- size: 4,
10797
- offset: 8 * BYTES_PER_ELEMENT,
10798
- stride: stride,
10799
- dataSource: "aPosition"
10800
- }
10801
- };
10776
+ var _obj;
10777
+ var attributes = (_obj = {}, _obj[VertexBuffer.PositionKind] = {
10778
+ size: 2,
10779
+ offset: 0,
10780
+ stride: stride,
10781
+ data: new Float32Array(0)
10782
+ }, _obj[VertexBuffer.ColorKind] = {
10783
+ size: 4,
10784
+ offset: 2 * BYTES_PER_ELEMENT,
10785
+ stride: stride,
10786
+ dataSource: VertexBuffer.PositionKind
10787
+ }, _obj[VertexBuffer.UVKind] = {
10788
+ size: 2,
10789
+ offset: 6 * BYTES_PER_ELEMENT,
10790
+ stride: stride,
10791
+ dataSource: VertexBuffer.PositionKind
10792
+ }, _obj.aColor2 = {
10793
+ size: 4,
10794
+ offset: 8 * BYTES_PER_ELEMENT,
10795
+ stride: stride,
10796
+ dataSource: VertexBuffer.PositionKind
10797
+ }, _obj);
10802
10798
  return Geometry.create(this.engine, {
10803
10799
  attributes: attributes,
10804
10800
  indices: {
10805
- data: new Uint16Array(0),
10806
- releasable: true
10801
+ data: new Uint16Array(0)
10807
10802
  },
10808
10803
  mode: glContext.TRIANGLES,
10809
- maxVertex: SlotGroup.MAX_VERTICES
10804
+ maxVertex: SlotGroup.MAX_VERTICES,
10805
+ bufferUsage: glContext.DYNAMIC_DRAW
10810
10806
  });
10811
10807
  };
10812
10808
  _proto.createMaterial = function createMaterial() {
@@ -10845,7 +10841,7 @@ var SpineMesh = /*#__PURE__*/ function() {
10845
10841
  for(var i1 = this.indicesLength; i1 < this.indices.length; i1++){
10846
10842
  this.indices[i1] = 0;
10847
10843
  }
10848
- this.geometry.setAttributeData("aPosition", this.vertices);
10844
+ this.geometry.setAttributeData(VertexBuffer.PositionKind, this.vertices);
10849
10845
  this.geometry.setIndexData(this.indices);
10850
10846
  this.geometry.setDrawCount(this.indicesLength);
10851
10847
  };
@@ -11590,7 +11586,7 @@ var SpineLoader = /*#__PURE__*/ function(Plugin) {
11590
11586
  registerPlugin("spine", SpineLoader);
11591
11587
  /**
11592
11588
  * 插件版本号
11593
- */ var version = "2.10.0-alpha.1";
11589
+ */ var version = "2.10.0-alpha.2";
11594
11590
  logger.info("Plugin spine version: " + version + ".");
11595
11591
  if (version !== EFFECTS.version) {
11596
11592
  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!");