@galacean/engine-core 1.1.0-beta.24 → 1.1.0-beta.25
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/main.js +101 -16
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +101 -16
- package/dist/module.js +101 -16
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/particle/modules/ParticleGradient.d.ts +38 -18
package/dist/main.js
CHANGED
|
@@ -5028,7 +5028,7 @@ var begin_position_vert = "#define GLSLIFY 1\nvec4 position=vec4(POSITION,1.0);"
|
|
|
5028
5028
|
|
|
5029
5029
|
var blendShape_input = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_BLENDSHAPE\n#ifdef RENDERER_BLENDSHAPE_USE_TEXTURE\nuniform mediump sampler2DArray renderer_BlendShapeTexture;uniform ivec3 renderer_BlendShapeTextureInfo;uniform float renderer_BlendShapeWeights[RENDERER_BLENDSHAPE_COUNT];\n#else\nattribute vec3 POSITION_BS0;attribute vec3 POSITION_BS1;\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) && defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\nattribute vec3 NORMAL_BS0;attribute vec3 NORMAL_BS1;attribute vec3 TANGENT_BS0;attribute vec3 TANGENT_BS1;uniform float renderer_BlendShapeWeights[2];\n#else\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) || defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\nattribute vec3 POSITION_BS2;attribute vec3 POSITION_BS3;\n#ifdef RENDERER_BLENDSHAPE_HAS_NORMAL\nattribute vec3 NORMAL_BS0;attribute vec3 NORMAL_BS1;attribute vec3 NORMAL_BS2;attribute vec3 NORMAL_BS3;\n#endif\n#ifdef RENDERER_BLENDSHAPE_HAS_TANGENT\nattribute vec3 TANGENT_BS0;attribute vec3 TANGENT_BS1;attribute vec3 TANGENT_BS2;attribute vec3 TANGENT_BS3;\n#endif\nuniform float renderer_BlendShapeWeights[4];\n#else\nattribute vec3 POSITION_BS2;attribute vec3 POSITION_BS3;attribute vec3 POSITION_BS4;attribute vec3 POSITION_BS5;attribute vec3 POSITION_BS6;attribute vec3 POSITION_BS7;uniform float renderer_BlendShapeWeights[8];\n#endif\n#endif\n#endif\n#ifdef RENDERER_BLENDSHAPE_USE_TEXTURE\nvec3 getBlendShapeVertexElement(int blendShapeIndex,int vertexElementIndex){int y=vertexElementIndex/renderer_BlendShapeTextureInfo.y;int x=vertexElementIndex-y*renderer_BlendShapeTextureInfo.y;ivec3 uv=ivec3(x,y,blendShapeIndex);return texelFetch(renderer_BlendShapeTexture,uv,0).xyz;}\n#endif\n#endif\n"; // eslint-disable-line
|
|
5030
5030
|
|
|
5031
|
-
var blendShape_vert = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_BLENDSHAPE\n#ifdef RENDERER_BLENDSHAPE_USE_TEXTURE\nint vertexOffset=gl_VertexID*renderer_BlendShapeTextureInfo.x;for(int i=0;i<RENDERER_BLENDSHAPE_COUNT;i++){int vertexElementOffset=vertexOffset;float weight=renderer_BlendShapeWeights[i];position.xyz+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#ifndef MATERIAL_OMIT_NORMAL\n#if defined( RENDERER_HAS_NORMAL ) && defined( RENDERER_BLENDSHAPE_HAS_NORMAL )\nvertexElementOffset+=1;normal+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#endif\n#if defined( RENDERER_HAS_TANGENT ) && defined(RENDERER_BLENDSHAPE_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\nvertexElementOffset+=1;tangent.xyz+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#endif\n#endif\n}\n#else\nposition.xyz+=POSITION_BS0*renderer_BlendShapeWeights[0];position.xyz+=POSITION_BS1*renderer_BlendShapeWeights[1];\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) && defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\n#ifndef MATERIAL_OMIT_NORMAL\n#ifdef RENDERER_HAS_NORMAL\nnormal+=NORMAL_BS0*renderer_BlendShapeWeights[0];normal+=NORMAL_BS1*renderer_BlendShapeWeights[1];\n#endif\n#if defined( RENDERER_HAS_TANGENT ) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\ntangent.xyz+=TANGENT_BS0*renderer_BlendShapeWeights[0];tangent.xyz+=TANGENT_BS1*renderer_BlendShapeWeights[1];\n#endif\n#endif\n#else\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) || defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\n#ifndef MATERIAL_OMIT_NORMAL\nposition.xyz+=POSITION_BS2*renderer_BlendShapeWeights[2];position.xyz+=POSITION_BS3*renderer_BlendShapeWeights[3];\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) && defined( RENDERER_HAS_NORMAL )\nnormal+=NORMAL_BS0*renderer_BlendShapeWeights[0];normal+=NORMAL_BS1*renderer_BlendShapeWeights[1];normal+=NORMAL_BS2*renderer_BlendShapeWeights[2];normal+=NORMAL_BS3*renderer_BlendShapeWeights[3];\n#endif\n#if defined(RENDERER_BLENDSHAPE_HAS_TANGENT) && defined( RENDERER_HAS_TANGENT ) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\ntangent.xyz+=TANGENT_BS0*renderer_BlendShapeWeights[0];tangent.xyz+=TANGENT_BS1*renderer_BlendShapeWeights[1];tangent.xyz+=TANGENT_BS2*renderer_BlendShapeWeights[2];tangent.xyz+=TANGENT_BS3*renderer_BlendShapeWeights[3];\n#endif\n#endif\n#else\nposition.xyz+=POSITION_BS2*renderer_BlendShapeWeights[2];position.xyz+=POSITION_BS3*renderer_BlendShapeWeights[3];position.xyz+=POSITION_BS4*renderer_BlendShapeWeights[4];position.xyz+=POSITION_BS5*renderer_BlendShapeWeights[5];position.xyz+=POSITION_BS6*renderer_BlendShapeWeights[6];position.xyz+=POSITION_BS7*renderer_BlendShapeWeights[7];\n#endif\n#endif\n#endif\n#endif\n"; // eslint-disable-line
|
|
5031
|
+
var blendShape_vert = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_BLENDSHAPE\n#ifdef RENDERER_BLENDSHAPE_USE_TEXTURE\nint vertexOffset=gl_VertexID*renderer_BlendShapeTextureInfo.x;for(int i=0;i<RENDERER_BLENDSHAPE_COUNT;i++){int vertexElementOffset=vertexOffset;float weight=renderer_BlendShapeWeights[i];if(weight!=0.0){position.xyz+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#ifndef MATERIAL_OMIT_NORMAL\n#if defined( RENDERER_HAS_NORMAL ) && defined( RENDERER_BLENDSHAPE_HAS_NORMAL )\nvertexElementOffset+=1;normal+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#endif\n#if defined( RENDERER_HAS_TANGENT ) && defined(RENDERER_BLENDSHAPE_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\nvertexElementOffset+=1;tangent.xyz+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#endif\n#endif\n}}\n#else\nposition.xyz+=POSITION_BS0*renderer_BlendShapeWeights[0];position.xyz+=POSITION_BS1*renderer_BlendShapeWeights[1];\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) && defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\n#ifndef MATERIAL_OMIT_NORMAL\n#ifdef RENDERER_HAS_NORMAL\nnormal+=NORMAL_BS0*renderer_BlendShapeWeights[0];normal+=NORMAL_BS1*renderer_BlendShapeWeights[1];\n#endif\n#if defined( RENDERER_HAS_TANGENT ) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\ntangent.xyz+=TANGENT_BS0*renderer_BlendShapeWeights[0];tangent.xyz+=TANGENT_BS1*renderer_BlendShapeWeights[1];\n#endif\n#endif\n#else\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) || defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\n#ifndef MATERIAL_OMIT_NORMAL\nposition.xyz+=POSITION_BS2*renderer_BlendShapeWeights[2];position.xyz+=POSITION_BS3*renderer_BlendShapeWeights[3];\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) && defined( RENDERER_HAS_NORMAL )\nnormal+=NORMAL_BS0*renderer_BlendShapeWeights[0];normal+=NORMAL_BS1*renderer_BlendShapeWeights[1];normal+=NORMAL_BS2*renderer_BlendShapeWeights[2];normal+=NORMAL_BS3*renderer_BlendShapeWeights[3];\n#endif\n#if defined(RENDERER_BLENDSHAPE_HAS_TANGENT) && defined( RENDERER_HAS_TANGENT ) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\ntangent.xyz+=TANGENT_BS0*renderer_BlendShapeWeights[0];tangent.xyz+=TANGENT_BS1*renderer_BlendShapeWeights[1];tangent.xyz+=TANGENT_BS2*renderer_BlendShapeWeights[2];tangent.xyz+=TANGENT_BS3*renderer_BlendShapeWeights[3];\n#endif\n#endif\n#else\nposition.xyz+=POSITION_BS2*renderer_BlendShapeWeights[2];position.xyz+=POSITION_BS3*renderer_BlendShapeWeights[3];position.xyz+=POSITION_BS4*renderer_BlendShapeWeights[4];position.xyz+=POSITION_BS5*renderer_BlendShapeWeights[5];position.xyz+=POSITION_BS6*renderer_BlendShapeWeights[6];position.xyz+=POSITION_BS7*renderer_BlendShapeWeights[7];\n#endif\n#endif\n#endif\n#endif\n"; // eslint-disable-line
|
|
5032
5032
|
|
|
5033
5033
|
var color_vert = "#define GLSLIFY 1\n#ifdef RENDERER_ENABLE_VERTEXCOLOR\nv_color=COLOR_0;\n#endif\n"; // eslint-disable-line
|
|
5034
5034
|
|
|
@@ -6696,6 +6696,9 @@ __decorate([
|
|
|
6696
6696
|
throw "ShaderLab has not been set up yet.";
|
|
6697
6697
|
}
|
|
6698
6698
|
var shaderInfo = Shader._shaderLab.parseShader(nameOrShaderSource);
|
|
6699
|
+
if (shaderMap[shaderInfo.name]) {
|
|
6700
|
+
throw 'Shader named "' + shaderInfo.name + '" already exists.';
|
|
6701
|
+
}
|
|
6699
6702
|
var subShaderList = shaderInfo.subShaders.map(function(subShaderInfo) {
|
|
6700
6703
|
var passList = subShaderInfo.passes.map(function(passInfo) {
|
|
6701
6704
|
if (typeof passInfo === "string") {
|
|
@@ -27684,15 +27687,17 @@ __decorate([
|
|
|
27684
27687
|
throw new Error("Gradient can only have 4 color keys");
|
|
27685
27688
|
}
|
|
27686
27689
|
var key = typeof timeOrKey === "number" ? new GradientColorKey(timeOrKey, color) : timeOrKey;
|
|
27690
|
+
key._onValueChanged = this._setColorTypeArrayDirty.bind(this);
|
|
27687
27691
|
this._addKey(colorKeys, key);
|
|
27688
27692
|
this._colorTypeArrayDirty = true;
|
|
27689
27693
|
};
|
|
27690
27694
|
_proto.addAlphaKey = function addAlphaKey(timeOrKey, alpha) {
|
|
27691
27695
|
var alphaKeys = this._alphaKeys;
|
|
27692
27696
|
if (alphaKeys.length === 4) {
|
|
27693
|
-
throw new Error("Gradient can only have 4
|
|
27697
|
+
throw new Error("Gradient can only have 4 alpha keys");
|
|
27694
27698
|
}
|
|
27695
27699
|
var key = typeof timeOrKey === "number" ? new GradientAlphaKey(timeOrKey, alpha) : timeOrKey;
|
|
27700
|
+
key._onValueChanged = this._setAlphaTypeArrayDirty.bind(this);
|
|
27696
27701
|
this._addKey(alphaKeys, key);
|
|
27697
27702
|
this._alphaTypeArrayDirty = true;
|
|
27698
27703
|
};
|
|
@@ -27700,6 +27705,7 @@ __decorate([
|
|
|
27700
27705
|
* Remove a color key from the gradient.
|
|
27701
27706
|
* @param index - The remove color key index
|
|
27702
27707
|
*/ _proto.removeColorKey = function removeColorKey(index) {
|
|
27708
|
+
this._colorKeys[index]._onValueChanged = null;
|
|
27703
27709
|
this._removeKey(this._colorKeys, index);
|
|
27704
27710
|
this._colorTypeArrayDirty = true;
|
|
27705
27711
|
};
|
|
@@ -27707,6 +27713,7 @@ __decorate([
|
|
|
27707
27713
|
* Remove an alpha key from the gradient.
|
|
27708
27714
|
* @param index - The remove alpha key index
|
|
27709
27715
|
*/ _proto.removeAlphaKey = function removeAlphaKey(index) {
|
|
27716
|
+
this._alphaKeys[index]._onValueChanged = null;
|
|
27710
27717
|
this._removeKey(this._alphaKeys, index);
|
|
27711
27718
|
this._alphaTypeArrayDirty = true;
|
|
27712
27719
|
};
|
|
@@ -27715,13 +27722,21 @@ __decorate([
|
|
|
27715
27722
|
* @param colorKeys - The color keys
|
|
27716
27723
|
* @param alphaKeys - The alpha keys
|
|
27717
27724
|
*/ _proto.setKeys = function setKeys(colorKeys, alphaKeys) {
|
|
27718
|
-
|
|
27719
|
-
|
|
27720
|
-
for(var i = 0, n =
|
|
27721
|
-
|
|
27725
|
+
var currentColorKeys = this._colorKeys;
|
|
27726
|
+
var currentAlphaKeys = this._alphaKeys;
|
|
27727
|
+
for(var i = 0, n = currentColorKeys.length; i < n; i++){
|
|
27728
|
+
currentColorKeys[i]._onValueChanged = null;
|
|
27729
|
+
}
|
|
27730
|
+
for(var i1 = 0, n1 = currentAlphaKeys.length; i1 < n1; i1++){
|
|
27731
|
+
currentAlphaKeys[i1]._onValueChanged = null;
|
|
27732
|
+
}
|
|
27733
|
+
currentColorKeys.length = 0;
|
|
27734
|
+
currentAlphaKeys.length = 0;
|
|
27735
|
+
for(var i2 = 0, n2 = colorKeys.length; i2 < n2; i2++){
|
|
27736
|
+
this._addKey(currentColorKeys, colorKeys[i2]);
|
|
27722
27737
|
}
|
|
27723
|
-
for(var
|
|
27724
|
-
this._addKey(
|
|
27738
|
+
for(var i3 = 0, n3 = alphaKeys.length; i3 < n3; i3++){
|
|
27739
|
+
this._addKey(currentAlphaKeys, alphaKeys[i3]);
|
|
27725
27740
|
}
|
|
27726
27741
|
this._alphaTypeArrayDirty = true;
|
|
27727
27742
|
this._colorTypeArrayDirty = true;
|
|
@@ -27782,6 +27797,12 @@ __decorate([
|
|
|
27782
27797
|
_proto._removeKey = function _removeKey(keys, index) {
|
|
27783
27798
|
keys.splice(index, 1);
|
|
27784
27799
|
};
|
|
27800
|
+
_proto._setColorTypeArrayDirty = function _setColorTypeArrayDirty() {
|
|
27801
|
+
this._colorTypeArrayDirty = true;
|
|
27802
|
+
};
|
|
27803
|
+
_proto._setAlphaTypeArrayDirty = function _setAlphaTypeArrayDirty() {
|
|
27804
|
+
this._alphaTypeArrayDirty = true;
|
|
27805
|
+
};
|
|
27785
27806
|
_create_class(ParticleGradient, [
|
|
27786
27807
|
{
|
|
27787
27808
|
key: "colorKeys",
|
|
@@ -27816,16 +27837,80 @@ __decorate([
|
|
|
27816
27837
|
], ParticleGradient.prototype, "_alphaTypeArray", void 0);
|
|
27817
27838
|
/**
|
|
27818
27839
|
* The color key of the particle gradient.
|
|
27819
|
-
*/ var GradientColorKey = function
|
|
27820
|
-
|
|
27821
|
-
|
|
27822
|
-
|
|
27840
|
+
*/ var GradientColorKey = /*#__PURE__*/ function() {
|
|
27841
|
+
function GradientColorKey(time, color) {
|
|
27842
|
+
/** @internal */ this._onValueChanged = null;
|
|
27843
|
+
this._color = new engineMath.Color();
|
|
27844
|
+
this._time = time;
|
|
27845
|
+
color && this._color.copyFrom(color);
|
|
27846
|
+
// @ts-ignore
|
|
27847
|
+
this._color._onValueChanged = this._onValueChanged;
|
|
27848
|
+
}
|
|
27849
|
+
_create_class(GradientColorKey, [
|
|
27850
|
+
{
|
|
27851
|
+
key: "time",
|
|
27852
|
+
get: /**
|
|
27853
|
+
* The key time.
|
|
27854
|
+
*/ function get() {
|
|
27855
|
+
return this._time;
|
|
27856
|
+
},
|
|
27857
|
+
set: function set(value) {
|
|
27858
|
+
this._time = value;
|
|
27859
|
+
this._onValueChanged && this._onValueChanged();
|
|
27860
|
+
}
|
|
27861
|
+
},
|
|
27862
|
+
{
|
|
27863
|
+
key: "color",
|
|
27864
|
+
get: /**
|
|
27865
|
+
* The key color.
|
|
27866
|
+
*/ function get() {
|
|
27867
|
+
return this._color;
|
|
27868
|
+
},
|
|
27869
|
+
set: function set(value) {
|
|
27870
|
+
if (this._color !== value) {
|
|
27871
|
+
this._color.copyFrom(value);
|
|
27872
|
+
}
|
|
27873
|
+
}
|
|
27874
|
+
}
|
|
27875
|
+
]);
|
|
27876
|
+
return GradientColorKey;
|
|
27877
|
+
}();
|
|
27823
27878
|
/**
|
|
27824
27879
|
* The alpha key of the particle gradient.
|
|
27825
|
-
*/ var GradientAlphaKey = function
|
|
27826
|
-
|
|
27827
|
-
|
|
27828
|
-
|
|
27880
|
+
*/ var GradientAlphaKey = /*#__PURE__*/ function() {
|
|
27881
|
+
function GradientAlphaKey(time, alpha) {
|
|
27882
|
+
/** @internal */ this._onValueChanged = null;
|
|
27883
|
+
this._time = time;
|
|
27884
|
+
this._alpha = alpha;
|
|
27885
|
+
}
|
|
27886
|
+
_create_class(GradientAlphaKey, [
|
|
27887
|
+
{
|
|
27888
|
+
key: "time",
|
|
27889
|
+
get: /**
|
|
27890
|
+
* The key time.
|
|
27891
|
+
*/ function get() {
|
|
27892
|
+
return this._time;
|
|
27893
|
+
},
|
|
27894
|
+
set: function set(value) {
|
|
27895
|
+
this._time = value;
|
|
27896
|
+
this._onValueChanged && this._onValueChanged();
|
|
27897
|
+
}
|
|
27898
|
+
},
|
|
27899
|
+
{
|
|
27900
|
+
key: "alpha",
|
|
27901
|
+
get: /**
|
|
27902
|
+
* The key alpha.
|
|
27903
|
+
*/ function get() {
|
|
27904
|
+
return this._alpha;
|
|
27905
|
+
},
|
|
27906
|
+
set: function set(value) {
|
|
27907
|
+
this._alpha = value;
|
|
27908
|
+
this._onValueChanged && this._onValueChanged();
|
|
27909
|
+
}
|
|
27910
|
+
}
|
|
27911
|
+
]);
|
|
27912
|
+
return GradientAlphaKey;
|
|
27913
|
+
}();
|
|
27829
27914
|
|
|
27830
27915
|
/**
|
|
27831
27916
|
* Particle composite gradient.
|