@galacean/engine 1.6.10 → 1.6.12
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/browser.js +221 -155
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/module.js +1 -1
- package/package.json +5 -5
package/dist/browser.js
CHANGED
|
@@ -5703,86 +5703,6 @@
|
|
|
5703
5703
|
this.isEnabled = false;
|
|
5704
5704
|
}
|
|
5705
5705
|
};
|
|
5706
|
-
/**
|
|
5707
|
-
* Data type enumeration
|
|
5708
|
-
*/ var DataType = /*#__PURE__*/ function(DataType) {
|
|
5709
|
-
/** Float */ DataType[DataType["FLOAT"] = 5126] = "FLOAT";
|
|
5710
|
-
/** Floating-point two-dimensional vector */ DataType[DataType["FLOAT_VEC2"] = 35664] = "FLOAT_VEC2";
|
|
5711
|
-
/** Floating-point three-dimensional vector */ DataType[DataType["FLOAT_VEC3"] = 35665] = "FLOAT_VEC3";
|
|
5712
|
-
/** Floating-point four-dimensional vector */ DataType[DataType["FLOAT_VEC4"] = 35666] = "FLOAT_VEC4";
|
|
5713
|
-
/** Integer */ DataType[DataType["INT"] = 5124] = "INT";
|
|
5714
|
-
/** Integer two-dimensional vector */ DataType[DataType["INT_VEC2"] = 35667] = "INT_VEC2";
|
|
5715
|
-
/** Integer three-dimensional vector */ DataType[DataType["INT_VEC3"] = 35668] = "INT_VEC3";
|
|
5716
|
-
/** Integer four-dimensional vector */ DataType[DataType["INT_VEC4"] = 35669] = "INT_VEC4";
|
|
5717
|
-
/** Boolean */ DataType[DataType["BOOL"] = 35670] = "BOOL";
|
|
5718
|
-
/** Boolean two-dimensional vector */ DataType[DataType["BOOL_VEC2"] = 35671] = "BOOL_VEC2";
|
|
5719
|
-
/** Boolean three-dimensional vector */ DataType[DataType["BOOL_VEC3"] = 35672] = "BOOL_VEC3";
|
|
5720
|
-
/** Boolean four-dimensional vector */ DataType[DataType["BOOL_VEC4"] = 35673] = "BOOL_VEC4";
|
|
5721
|
-
/** Second-order matrix */ DataType[DataType["FLOAT_MAT2"] = 35674] = "FLOAT_MAT2";
|
|
5722
|
-
/** Third-order matrix */ DataType[DataType["FLOAT_MAT3"] = 35675] = "FLOAT_MAT3";
|
|
5723
|
-
/** Fourth-order matrix */ DataType[DataType["FLOAT_MAT4"] = 35676] = "FLOAT_MAT4";
|
|
5724
|
-
/** Float array */ DataType[DataType["FLOAT_ARRAY"] = 35677] = "FLOAT_ARRAY";
|
|
5725
|
-
/** Floating-point two-dimensional vector array */ DataType[DataType["FLOAT_VEC2_ARRAY"] = 100000] = "FLOAT_VEC2_ARRAY";
|
|
5726
|
-
/** Floating-point three-dimensional vector array */ DataType[DataType["FLOAT_VEC3_ARRAY"] = 100001] = "FLOAT_VEC3_ARRAY";
|
|
5727
|
-
/** Floating-point four-dimensional vector array */ DataType[DataType["FLOAT_VEC4_ARRAY"] = 100002] = "FLOAT_VEC4_ARRAY";
|
|
5728
|
-
/** Integer array */ DataType[DataType["INT_ARRAY"] = 100003] = "INT_ARRAY";
|
|
5729
|
-
/** Integer two-dimensional vector array */ DataType[DataType["INT_VEC2_ARRAY"] = 100004] = "INT_VEC2_ARRAY";
|
|
5730
|
-
/** Integer three-dimensional vector array */ DataType[DataType["INT_VEC3_ARRAY"] = 100005] = "INT_VEC3_ARRAY";
|
|
5731
|
-
/** Integer four-dimensional vector array */ DataType[DataType["INT_VEC4_ARRAY"] = 100006] = "INT_VEC4_ARRAY";
|
|
5732
|
-
/** Second-order matrix array */ DataType[DataType["FLOAT_MAT2_ARRAY"] = 100007] = "FLOAT_MAT2_ARRAY";
|
|
5733
|
-
/** Third-order matrix array */ DataType[DataType["FLOAT_MAT3_ARRAY"] = 100008] = "FLOAT_MAT3_ARRAY";
|
|
5734
|
-
/** Fourth-order matrix array */ DataType[DataType["FLOAT_MAT4_ARRAY"] = 100009] = "FLOAT_MAT4_ARRAY";
|
|
5735
|
-
/** 2D texture sampler array */ DataType[DataType["SAMPLER_2D_ARRAY"] = 100010] = "SAMPLER_2D_ARRAY";
|
|
5736
|
-
/** Cube map texture sampler array */ DataType[DataType["SAMPLER_CUBE_ARRAY"] = 100011] = "SAMPLER_CUBE_ARRAY";
|
|
5737
|
-
/** 2D sampler */ DataType[DataType["SAMPLER_2D"] = 35678] = "SAMPLER_2D";
|
|
5738
|
-
/** Cube map Texture sampler */ DataType[DataType["SAMPLER_CUBE"] = 35680] = "SAMPLER_CUBE";
|
|
5739
|
-
/** Byte */ DataType[DataType["BYTE"] = 5120] = "BYTE";
|
|
5740
|
-
/** Unsigned byte */ DataType[DataType["UNSIGNED_BYTE"] = 5121] = "UNSIGNED_BYTE";
|
|
5741
|
-
/** Short */ DataType[DataType["SHORT"] = 5122] = "SHORT";
|
|
5742
|
-
/** Unsigned short */ DataType[DataType["UNSIGNED_SHORT"] = 5123] = "UNSIGNED_SHORT";
|
|
5743
|
-
/** Unsigned int */ DataType[DataType["UNSIGNED_INT"] = 5125] = "UNSIGNED_INT"; // gl.UNSIGNED_INT
|
|
5744
|
-
return DataType;
|
|
5745
|
-
}({});
|
|
5746
|
-
/**
|
|
5747
|
-
* GL Capabilities
|
|
5748
|
-
* Some capabilities can be smoothed out by extension, and some capabilities must use WebGL 2.0.
|
|
5749
|
-
* */ var GLCapabilityType = /*#__PURE__*/ function(GLCapabilityType) {
|
|
5750
|
-
GLCapabilityType["shaderVertexID"] = "shaderVertexID";
|
|
5751
|
-
GLCapabilityType["standardDerivatives"] = "OES_standard_derivatives";
|
|
5752
|
-
GLCapabilityType["shaderTextureLod"] = "EXT_shader_texture_lod";
|
|
5753
|
-
GLCapabilityType["elementIndexUint"] = "OES_element_index_uint";
|
|
5754
|
-
GLCapabilityType["depthTexture"] = "WEBGL_depth_texture";
|
|
5755
|
-
GLCapabilityType["drawBuffers"] = "WEBGL_draw_buffers";
|
|
5756
|
-
GLCapabilityType["vertexArrayObject"] = "OES_vertex_array_object";
|
|
5757
|
-
GLCapabilityType["instancedArrays"] = "ANGLE_instanced_arrays";
|
|
5758
|
-
GLCapabilityType["multipleSample"] = "multipleSampleOnlySupportedInWebGL2";
|
|
5759
|
-
GLCapabilityType["textureFloat"] = "OES_texture_float";
|
|
5760
|
-
GLCapabilityType["textureFloatLinear"] = "OES_texture_float_linear";
|
|
5761
|
-
GLCapabilityType["textureHalfFloat"] = "OES_texture_half_float";
|
|
5762
|
-
GLCapabilityType["textureHalfFloatLinear"] = "OES_texture_half_float_linear";
|
|
5763
|
-
GLCapabilityType["WEBGL_colorBufferFloat"] = "WEBGL_color_buffer_float";
|
|
5764
|
-
GLCapabilityType["colorBufferFloat"] = "EXT_color_buffer_float";
|
|
5765
|
-
GLCapabilityType["colorBufferHalfFloat"] = "EXT_color_buffer_half_float";
|
|
5766
|
-
GLCapabilityType["textureFilterAnisotropic"] = "EXT_texture_filter_anisotropic";
|
|
5767
|
-
GLCapabilityType["blendMinMax"] = "EXT_blend_minmax";
|
|
5768
|
-
GLCapabilityType["fragDepth"] = "EXT_frag_depth";
|
|
5769
|
-
GLCapabilityType["astc"] = "WEBGL_compressed_texture_astc";
|
|
5770
|
-
GLCapabilityType["astc_webkit"] = "WEBKIT_WEBGL_compressed_texture_astc";
|
|
5771
|
-
GLCapabilityType["astc_hdr"] = "WEBGL_compressed_texture_astc_hdr";
|
|
5772
|
-
GLCapabilityType["etc"] = "WEBGL_compressed_texture_etc";
|
|
5773
|
-
GLCapabilityType["etc_webkit"] = "WEBKIT_WEBGL_compressed_texture_etc";
|
|
5774
|
-
GLCapabilityType["etc1"] = "WEBGL_compressed_texture_etc1";
|
|
5775
|
-
GLCapabilityType["etc1_webkit"] = "WEBKIT_WEBGL_compressed_texture_etc1";
|
|
5776
|
-
GLCapabilityType["pvrtc"] = "WEBGL_compressed_texture_pvrtc";
|
|
5777
|
-
GLCapabilityType["pvrtc_webkit"] = "WEBKIT_WEBGL_compressed_texture_pvrtc";
|
|
5778
|
-
GLCapabilityType["s3tc"] = "WEBGL_compressed_texture_s3tc";
|
|
5779
|
-
GLCapabilityType["s3tc_webkit"] = "WEBKIT_WEBGL_compressed_texture_s3tc";
|
|
5780
|
-
GLCapabilityType["s3tc_srgb"] = "WEBGL_compressed_texture_s3tc_srgb";
|
|
5781
|
-
GLCapabilityType["bptc"] = "EXT_texture_compression_bptc";
|
|
5782
|
-
GLCapabilityType["WEBGL_lose_context"] = "WEBGL_lose_context";
|
|
5783
|
-
GLCapabilityType["sRGB"] = "EXT_sRGB";
|
|
5784
|
-
return GLCapabilityType;
|
|
5785
|
-
}({});
|
|
5786
5706
|
var AssetPromise = /*#__PURE__*/ function() {
|
|
5787
5707
|
function AssetPromise(executor) {
|
|
5788
5708
|
var _this = this;
|
|
@@ -5969,10 +5889,98 @@
|
|
|
5969
5889
|
]);
|
|
5970
5890
|
return AssetPromise;
|
|
5971
5891
|
}();
|
|
5892
|
+
/**
|
|
5893
|
+
* Data type enumeration
|
|
5894
|
+
*/ var DataType = /*#__PURE__*/ function(DataType) {
|
|
5895
|
+
/** Float */ DataType[DataType["FLOAT"] = 5126] = "FLOAT";
|
|
5896
|
+
/** Floating-point two-dimensional vector */ DataType[DataType["FLOAT_VEC2"] = 35664] = "FLOAT_VEC2";
|
|
5897
|
+
/** Floating-point three-dimensional vector */ DataType[DataType["FLOAT_VEC3"] = 35665] = "FLOAT_VEC3";
|
|
5898
|
+
/** Floating-point four-dimensional vector */ DataType[DataType["FLOAT_VEC4"] = 35666] = "FLOAT_VEC4";
|
|
5899
|
+
/** Integer */ DataType[DataType["INT"] = 5124] = "INT";
|
|
5900
|
+
/** Integer two-dimensional vector */ DataType[DataType["INT_VEC2"] = 35667] = "INT_VEC2";
|
|
5901
|
+
/** Integer three-dimensional vector */ DataType[DataType["INT_VEC3"] = 35668] = "INT_VEC3";
|
|
5902
|
+
/** Integer four-dimensional vector */ DataType[DataType["INT_VEC4"] = 35669] = "INT_VEC4";
|
|
5903
|
+
/** Boolean */ DataType[DataType["BOOL"] = 35670] = "BOOL";
|
|
5904
|
+
/** Boolean two-dimensional vector */ DataType[DataType["BOOL_VEC2"] = 35671] = "BOOL_VEC2";
|
|
5905
|
+
/** Boolean three-dimensional vector */ DataType[DataType["BOOL_VEC3"] = 35672] = "BOOL_VEC3";
|
|
5906
|
+
/** Boolean four-dimensional vector */ DataType[DataType["BOOL_VEC4"] = 35673] = "BOOL_VEC4";
|
|
5907
|
+
/** Second-order matrix */ DataType[DataType["FLOAT_MAT2"] = 35674] = "FLOAT_MAT2";
|
|
5908
|
+
/** Third-order matrix */ DataType[DataType["FLOAT_MAT3"] = 35675] = "FLOAT_MAT3";
|
|
5909
|
+
/** Fourth-order matrix */ DataType[DataType["FLOAT_MAT4"] = 35676] = "FLOAT_MAT4";
|
|
5910
|
+
/** Float array */ DataType[DataType["FLOAT_ARRAY"] = 35677] = "FLOAT_ARRAY";
|
|
5911
|
+
/** Floating-point two-dimensional vector array */ DataType[DataType["FLOAT_VEC2_ARRAY"] = 100000] = "FLOAT_VEC2_ARRAY";
|
|
5912
|
+
/** Floating-point three-dimensional vector array */ DataType[DataType["FLOAT_VEC3_ARRAY"] = 100001] = "FLOAT_VEC3_ARRAY";
|
|
5913
|
+
/** Floating-point four-dimensional vector array */ DataType[DataType["FLOAT_VEC4_ARRAY"] = 100002] = "FLOAT_VEC4_ARRAY";
|
|
5914
|
+
/** Integer array */ DataType[DataType["INT_ARRAY"] = 100003] = "INT_ARRAY";
|
|
5915
|
+
/** Integer two-dimensional vector array */ DataType[DataType["INT_VEC2_ARRAY"] = 100004] = "INT_VEC2_ARRAY";
|
|
5916
|
+
/** Integer three-dimensional vector array */ DataType[DataType["INT_VEC3_ARRAY"] = 100005] = "INT_VEC3_ARRAY";
|
|
5917
|
+
/** Integer four-dimensional vector array */ DataType[DataType["INT_VEC4_ARRAY"] = 100006] = "INT_VEC4_ARRAY";
|
|
5918
|
+
/** Second-order matrix array */ DataType[DataType["FLOAT_MAT2_ARRAY"] = 100007] = "FLOAT_MAT2_ARRAY";
|
|
5919
|
+
/** Third-order matrix array */ DataType[DataType["FLOAT_MAT3_ARRAY"] = 100008] = "FLOAT_MAT3_ARRAY";
|
|
5920
|
+
/** Fourth-order matrix array */ DataType[DataType["FLOAT_MAT4_ARRAY"] = 100009] = "FLOAT_MAT4_ARRAY";
|
|
5921
|
+
/** 2D texture sampler array */ DataType[DataType["SAMPLER_2D_ARRAY"] = 100010] = "SAMPLER_2D_ARRAY";
|
|
5922
|
+
/** Cube map texture sampler array */ DataType[DataType["SAMPLER_CUBE_ARRAY"] = 100011] = "SAMPLER_CUBE_ARRAY";
|
|
5923
|
+
/** 2D sampler */ DataType[DataType["SAMPLER_2D"] = 35678] = "SAMPLER_2D";
|
|
5924
|
+
/** Cube map Texture sampler */ DataType[DataType["SAMPLER_CUBE"] = 35680] = "SAMPLER_CUBE";
|
|
5925
|
+
/** Byte */ DataType[DataType["BYTE"] = 5120] = "BYTE";
|
|
5926
|
+
/** Unsigned byte */ DataType[DataType["UNSIGNED_BYTE"] = 5121] = "UNSIGNED_BYTE";
|
|
5927
|
+
/** Short */ DataType[DataType["SHORT"] = 5122] = "SHORT";
|
|
5928
|
+
/** Unsigned short */ DataType[DataType["UNSIGNED_SHORT"] = 5123] = "UNSIGNED_SHORT";
|
|
5929
|
+
/** Unsigned int */ DataType[DataType["UNSIGNED_INT"] = 5125] = "UNSIGNED_INT"; // gl.UNSIGNED_INT
|
|
5930
|
+
return DataType;
|
|
5931
|
+
}({});
|
|
5932
|
+
/**
|
|
5933
|
+
* GL Capabilities
|
|
5934
|
+
* Some capabilities can be smoothed out by extension, and some capabilities must use WebGL 2.0.
|
|
5935
|
+
* */ var GLCapabilityType = /*#__PURE__*/ function(GLCapabilityType) {
|
|
5936
|
+
GLCapabilityType["shaderVertexID"] = "shaderVertexID";
|
|
5937
|
+
GLCapabilityType["standardDerivatives"] = "OES_standard_derivatives";
|
|
5938
|
+
GLCapabilityType["shaderTextureLod"] = "EXT_shader_texture_lod";
|
|
5939
|
+
GLCapabilityType["elementIndexUint"] = "OES_element_index_uint";
|
|
5940
|
+
GLCapabilityType["depthTexture"] = "WEBGL_depth_texture";
|
|
5941
|
+
GLCapabilityType["drawBuffers"] = "WEBGL_draw_buffers";
|
|
5942
|
+
GLCapabilityType["vertexArrayObject"] = "OES_vertex_array_object";
|
|
5943
|
+
GLCapabilityType["instancedArrays"] = "ANGLE_instanced_arrays";
|
|
5944
|
+
GLCapabilityType["multipleSample"] = "multipleSampleOnlySupportedInWebGL2";
|
|
5945
|
+
GLCapabilityType["textureFloat"] = "OES_texture_float";
|
|
5946
|
+
GLCapabilityType["textureFloatLinear"] = "OES_texture_float_linear";
|
|
5947
|
+
GLCapabilityType["textureHalfFloat"] = "OES_texture_half_float";
|
|
5948
|
+
GLCapabilityType["textureHalfFloatLinear"] = "OES_texture_half_float_linear";
|
|
5949
|
+
GLCapabilityType["WEBGL_colorBufferFloat"] = "WEBGL_color_buffer_float";
|
|
5950
|
+
GLCapabilityType["colorBufferFloat"] = "EXT_color_buffer_float";
|
|
5951
|
+
GLCapabilityType["colorBufferHalfFloat"] = "EXT_color_buffer_half_float";
|
|
5952
|
+
GLCapabilityType["textureFilterAnisotropic"] = "EXT_texture_filter_anisotropic";
|
|
5953
|
+
GLCapabilityType["blendMinMax"] = "EXT_blend_minmax";
|
|
5954
|
+
GLCapabilityType["fragDepth"] = "EXT_frag_depth";
|
|
5955
|
+
GLCapabilityType["astc"] = "WEBGL_compressed_texture_astc";
|
|
5956
|
+
GLCapabilityType["astc_webkit"] = "WEBKIT_WEBGL_compressed_texture_astc";
|
|
5957
|
+
GLCapabilityType["astc_hdr"] = "WEBGL_compressed_texture_astc_hdr";
|
|
5958
|
+
GLCapabilityType["etc"] = "WEBGL_compressed_texture_etc";
|
|
5959
|
+
GLCapabilityType["etc_webkit"] = "WEBKIT_WEBGL_compressed_texture_etc";
|
|
5960
|
+
GLCapabilityType["etc1"] = "WEBGL_compressed_texture_etc1";
|
|
5961
|
+
GLCapabilityType["etc1_webkit"] = "WEBKIT_WEBGL_compressed_texture_etc1";
|
|
5962
|
+
GLCapabilityType["pvrtc"] = "WEBGL_compressed_texture_pvrtc";
|
|
5963
|
+
GLCapabilityType["pvrtc_webkit"] = "WEBKIT_WEBGL_compressed_texture_pvrtc";
|
|
5964
|
+
GLCapabilityType["s3tc"] = "WEBGL_compressed_texture_s3tc";
|
|
5965
|
+
GLCapabilityType["s3tc_webkit"] = "WEBKIT_WEBGL_compressed_texture_s3tc";
|
|
5966
|
+
GLCapabilityType["s3tc_srgb"] = "WEBGL_compressed_texture_s3tc_srgb";
|
|
5967
|
+
GLCapabilityType["bptc"] = "EXT_texture_compression_bptc";
|
|
5968
|
+
GLCapabilityType["WEBGL_lose_context"] = "WEBGL_lose_context";
|
|
5969
|
+
GLCapabilityType["sRGB"] = "EXT_sRGB";
|
|
5970
|
+
return GLCapabilityType;
|
|
5971
|
+
}({});
|
|
5972
5972
|
/**
|
|
5973
5973
|
* Access operating system, platform and hardware information.
|
|
5974
5974
|
*/ var SystemInfo = /*#__PURE__*/ function() {
|
|
5975
5975
|
function SystemInfo() {}
|
|
5976
|
+
SystemInfo._parseAppleMobileOSVersion = function _parseAppleMobileOSVersion(userAgent, osPrefix) {
|
|
5977
|
+
// Since iOS 26, Safari freezes UA OS version at 18.6, so Version/xx is more reliable
|
|
5978
|
+
// Use Version/ if available, otherwise fallback to OS version
|
|
5979
|
+
var v = userAgent.match(/Version\/(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
|
|
5980
|
+
if (v) return osPrefix + " " + v[1] + "." + (v[2] || 0) + "." + (v[3] || 0);
|
|
5981
|
+
v = userAgent.match(/OS (\d+)_(\d+)(?:_(\d+))?/);
|
|
5982
|
+
return v ? osPrefix + " " + v[1] + "." + v[2] + "." + (v[3] || 0) : osPrefix;
|
|
5983
|
+
};
|
|
5976
5984
|
/**
|
|
5977
5985
|
* @internal
|
|
5978
5986
|
*/ SystemInfo._initialize = function _initialize() {
|
|
@@ -5994,12 +6002,10 @@
|
|
|
5994
6002
|
var v;
|
|
5995
6003
|
switch(SystemInfo.platform){
|
|
5996
6004
|
case Platform.IPhone:
|
|
5997
|
-
|
|
5998
|
-
this.operatingSystem = v ? "iPhone OS " + v[1] + "." + (v[2] || 0) + "." + (v[3] || 0) : "iPhone OS";
|
|
6005
|
+
this.operatingSystem = this._parseAppleMobileOSVersion(userAgent, "iPhone OS");
|
|
5999
6006
|
break;
|
|
6000
6007
|
case Platform.IPad:
|
|
6001
|
-
|
|
6002
|
-
this.operatingSystem = v ? "iPad OS " + v[1] + "." + (v[2] || 0) + "." + (v[3] || 0) : "iPad OS";
|
|
6008
|
+
this.operatingSystem = this._parseAppleMobileOSVersion(userAgent, "iPad OS");
|
|
6003
6009
|
break;
|
|
6004
6010
|
case Platform.Android:
|
|
6005
6011
|
v = userAgent.match(/Android (\d+).?(\d+)?.?(\d+)?/);
|
|
@@ -8077,12 +8083,13 @@
|
|
|
8077
8083
|
if (Utils.isBase64Url(relativeUrl)) {
|
|
8078
8084
|
return relativeUrl;
|
|
8079
8085
|
}
|
|
8080
|
-
if (
|
|
8081
|
-
|
|
8082
|
-
baseUrl = fileSchema + baseUrl;
|
|
8083
|
-
return new URL(relativeUrl, baseUrl).href.substring(fileSchema.length);
|
|
8086
|
+
if (Utils.isAbsoluteUrl(baseUrl)) {
|
|
8087
|
+
return relativeUrl ? new URL(relativeUrl, baseUrl).href : baseUrl;
|
|
8084
8088
|
}
|
|
8085
|
-
|
|
8089
|
+
var head = "file://";
|
|
8090
|
+
var encodedBaseUrl = head + this._encodePathComponents(baseUrl);
|
|
8091
|
+
var encodedRelativeUrl = this._encodePathComponents(relativeUrl);
|
|
8092
|
+
return decodeURIComponent(new URL(encodedRelativeUrl, encodedBaseUrl).href.slice(head.length));
|
|
8086
8093
|
};
|
|
8087
8094
|
/**
|
|
8088
8095
|
* @internal
|
|
@@ -8241,6 +8248,9 @@
|
|
|
8241
8248
|
a[j + 1] = element;
|
|
8242
8249
|
}
|
|
8243
8250
|
};
|
|
8251
|
+
Utils._encodePathComponents = function _encodePathComponents(path) {
|
|
8252
|
+
return path.split("/").map(encodeURIComponent).join("/");
|
|
8253
|
+
};
|
|
8244
8254
|
return Utils;
|
|
8245
8255
|
}();
|
|
8246
8256
|
var charCodeOfDot$1 = ".".charCodeAt(0);
|
|
@@ -9699,9 +9709,9 @@
|
|
|
9699
9709
|
ShadowVertexDeclaration: ShadowVertexDeclaration,
|
|
9700
9710
|
ShadowVertex: ShadowVertex
|
|
9701
9711
|
};
|
|
9702
|
-
var particle_common = "\n\nvec3 rotationByEuler(in vec3 vector, in vec3 rot) {\n float halfRoll = rot.z * 0.5;\n float halfPitch = rot.x * 0.5;\n float halfYaw = rot.y * 0.5;\n\n float sinRoll = sin(halfRoll);\n float cosRoll = cos(halfRoll);\n float sinPitch = sin(halfPitch);\n float cosPitch = cos(halfPitch);\n float sinYaw = sin(halfYaw);\n float cosYaw = cos(halfYaw);\n\n float
|
|
9712
|
+
var particle_common = "vec3 rotationByQuaternions(in vec3 v, in vec4 q) {\n return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n}\n\nvec3 rotationByEuler(in vec3 vector, in vec3 rot) {\n float halfRoll = rot.z * 0.5;\n float halfPitch = rot.x * 0.5;\n float halfYaw = rot.y * 0.5;\n\n float sinRoll = sin(halfRoll);\n float cosRoll = cos(halfRoll);\n float sinPitch = sin(halfPitch);\n float cosPitch = cos(halfPitch);\n float sinYaw = sin(halfYaw);\n float cosYaw = cos(halfYaw);\n\n float cosYawPitch = cosYaw * cosPitch;\n float sinYawPitch = sinYaw * sinPitch;\n\n float quaX = (cosYaw * sinPitch * cosRoll) + (sinYaw * cosPitch * sinRoll);\n float quaY = (sinYaw * cosPitch * cosRoll) - (cosYaw * sinPitch * sinRoll);\n float quaZ = (cosYawPitch * sinRoll) - (sinYawPitch * cosRoll);\n float quaW = (cosYawPitch * cosRoll) + (sinYawPitch * sinRoll);\n\n return rotationByQuaternions(vector, vec4(quaX, quaY, quaZ, quaW));\n}\n\n// Assume axis is normalized\nvec3 rotationByAxis(in vec3 vector, in vec3 axis, in float angle) {\n float halfAngle = angle * 0.5;\n float s = sin(halfAngle);\n\n return rotationByQuaternions(vector, vec4(axis * s, cos(halfAngle)));\n}\n\n\nfloat evaluateParticleCurve(in vec2 keys[4], in float normalizedAge) {\n float value;\n for (int i = 1; i < 4; i++) {\n vec2 key = keys[i];\n float time = key.x;\n if (time >= normalizedAge) {\n vec2 lastKey = keys[i - 1];\n float lastTime = lastKey.x;\n float age = (normalizedAge - lastTime) / (time - lastTime);\n value = mix(lastKey.y, key.y, age);\n break;\n }\n }\n return value;\n}\n\nfloat evaluateParticleCurveCumulative(in vec2 keys[4], in float normalizedAge, out float currentValue){\n float cumulativeValue = 0.0;\n for (int i = 1; i < 4; i++){\n\t vec2 key = keys[i];\n\t float time = key.x;\n\t vec2 lastKey = keys[i - 1];\n\t float lastValue = lastKey.y;\n\n\t if (time >= normalizedAge){\n\t\t float lastTime = lastKey.x;\n float offsetTime = normalizedAge - lastTime;\n\t\t float age = offsetTime / (time - lastTime);\n currentValue = mix(lastValue, key.y, age);\n\t\t cumulativeValue += (lastValue + currentValue) * 0.5 * offsetTime;\n\t\t break;\n\t\t}\n\t else{\n\t\t cumulativeValue += (lastValue + key.y) * 0.5 * (time - lastKey.x);\n\t\t}\n\t}\n return cumulativeValue;\n}"; // eslint-disable-line
|
|
9703
9713
|
var velocity_over_lifetime_module = "#if defined(RENDERER_VOL_CONSTANT_MODE) || defined(RENDERER_VOL_CURVE_MODE)\n #define _VOL_MODULE_ENABLED\n#endif\n\n#ifdef _VOL_MODULE_ENABLED\n uniform int renderer_VOLSpace;\n\n #ifdef RENDERER_VOL_CONSTANT_MODE\n uniform vec3 renderer_VOLMaxConst;\n\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n uniform vec3 renderer_VOLMinConst;\n #endif\n #endif\n\n #ifdef RENDERER_VOL_CURVE_MODE\n uniform vec2 renderer_VOLMaxGradientX[4]; // x:time y:value\n uniform vec2 renderer_VOLMaxGradientY[4]; // x:time y:value\n uniform vec2 renderer_VOLMaxGradientZ[4]; // x:time y:value\n\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n uniform vec2 renderer_VOLMinGradientX[4]; // x:time y:value\n uniform vec2 renderer_VOLMinGradientY[4]; // x:time y:value\n uniform vec2 renderer_VOLMinGradientZ[4]; // x:time y:value\n #endif\n #endif\n\n\n vec3 computeVelocityPositionOffset(in float normalizedAge, in float age, out vec3 currentVelocity) {\n vec3 velocityPosition;\n\n #ifdef RENDERER_VOL_CONSTANT_MODE\n currentVelocity = renderer_VOLMaxConst;\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n currentVelocity = mix(renderer_VOLMinConst, currentVelocity, a_Random1.yzw);\n #endif\n\n velocityPosition = currentVelocity * age;\n #endif\n\n #ifdef RENDERER_VOL_CURVE_MODE\n velocityPosition = vec3(\n evaluateParticleCurveCumulative(renderer_VOLMaxGradientX, normalizedAge, currentVelocity.x),\n evaluateParticleCurveCumulative(renderer_VOLMaxGradientY, normalizedAge, currentVelocity.y),\n evaluateParticleCurveCumulative(renderer_VOLMaxGradientZ, normalizedAge, currentVelocity.z));\n\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n vec3 minCurrentVelocity;\n vec3 minVelocityPosition = vec3(\n evaluateParticleCurveCumulative(renderer_VOLMinGradientX, normalizedAge, minCurrentVelocity.x),\n evaluateParticleCurveCumulative(renderer_VOLMinGradientY, normalizedAge, minCurrentVelocity.y),\n evaluateParticleCurveCumulative(renderer_VOLMinGradientZ, normalizedAge, minCurrentVelocity.z));\n\n currentVelocity = mix(minCurrentVelocity, currentVelocity, a_Random1.yzw);\n velocityPosition = mix(minVelocityPosition, velocityPosition, a_Random1.yzw);\n #endif\n\n velocityPosition *= vec3(a_ShapePositionStartLifeTime.w);\n #endif\n return velocityPosition;\n }\n#endif\n"; // eslint-disable-line
|
|
9704
|
-
var rotation_over_lifetime_module = "#if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n uniform vec2 renderer_ROLMaxCurveZ[4];\n // #ifdef RENDERER_ROL_IS_SEPARATE\n // uniform vec2 renderer_ROLMaxCurveX[4];\n // uniform vec2 renderer_ROLMaxCurveY[4];\n // #endif\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec2 renderer_ROLMinCurveZ[4];\n // #ifdef RENDERER_ROL_IS_SEPARATE\n // uniform vec2 renderer_ROLMinCurveX[4];\n // uniform vec2 renderer_ROLMinCurveY[4];\n // #endif\n #endif\n #else\n uniform vec3 renderer_ROLMaxConst;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec3 renderer_ROLMinConst;\n #endif\n #endif\n#endif\n\nfloat computeParticleRotationFloat(in float rotation, in float age, in float normalizedAge) {\n #if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n float currentValue;\n float lifeRotation = evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue);\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveZ, normalizedAge, currentValue), lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * a_ShapePositionStartLifeTime.w;\n #else\n float lifeRotation = renderer_ROLMaxConst.z;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(renderer_ROLMinConst.z, lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * age;\n #endif\n #endif\n return rotation;\n}\n\n\n#if defined(RENDERER_MODE_MESH) && (defined(
|
|
9714
|
+
var rotation_over_lifetime_module = "#if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n uniform vec2 renderer_ROLMaxCurveZ[4];\n // #ifdef RENDERER_ROL_IS_SEPARATE\n // uniform vec2 renderer_ROLMaxCurveX[4];\n // uniform vec2 renderer_ROLMaxCurveY[4];\n // #endif\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec2 renderer_ROLMinCurveZ[4];\n // #ifdef RENDERER_ROL_IS_SEPARATE\n // uniform vec2 renderer_ROLMinCurveX[4];\n // uniform vec2 renderer_ROLMinCurveY[4];\n // #endif\n #endif\n #else\n uniform vec3 renderer_ROLMaxConst;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec3 renderer_ROLMinConst;\n #endif\n #endif\n#endif\n\nfloat computeParticleRotationFloat(in float rotation, in float age, in float normalizedAge) {\n #if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n float currentValue;\n float lifeRotation = evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue);\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveZ, normalizedAge, currentValue), lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * a_ShapePositionStartLifeTime.w;\n #else\n float lifeRotation = renderer_ROLMaxConst.z;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(renderer_ROLMinConst.z, lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * age;\n #endif\n #endif\n return rotation;\n}\n\n\n#if defined(RENDERER_MODE_MESH) && (defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE))\nvec3 computeParticleRotationVec3(in vec3 rotation, in float age, in float normalizedAge) {\n #ifdef RENDERER_ROL_IS_SEPARATE\n #ifdef RENDERER_ROL_CONSTANT_MODE\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n vec3 ageRot = mix(renderer_ROLMinConst, renderer_ROLMaxConst, a_Random0.w) * age;\n #else\n vec3 ageRot = renderer_ROLMaxConst * age;\n #endif\n rotation += ageRot;\n #endif\n #ifdef RENDERER_ROL_CURVE_MODE\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n rotation += vec3(\n mix(getTotalValueFromGradientFloat(renderer_ROLMinCurveX, normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveX, normalizedAge), a_Random0.w),\n mix(getTotalValueFromGradientFloat(renderer_ROLMinCurveY, normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveY, normalizedAge), a_Random0.w),\n mix(getTotalValueFromGradientFloat(renderer_ROLMinCurveZ, normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveZ, normalizedAge), a_Random0.w));\n #else\n rotation += vec3(getTotalValueFromGradientFloat(renderer_ROLMaxCurveX, normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveY, normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveZ, normalizedAge));\n #endif\n #endif\n #else\n #ifdef RENDERER_ROL_CONSTANT_MODE\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n float ageRot = mix(renderer_ROLMinConst.z, renderer_ROLMaxConst.z, a_Random0.w) * age;\n #else\n float ageRot = renderer_ROLMaxConst.z * age;\n #endif\n rotation += ageRot;\n #endif\n\n #ifdef RENDERER_ROL_CURVE_MODE\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n rotation += mix(\n getTotalValueFromGradientFloat(renderer_ROLMinCurveZ, normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveZ, normalizedAge),\n a_Random0.w);\n #else\n rotation += getTotalValueFromGradientFloat(renderer_ROLMaxCurveZ, normalizedAge);\n #endif\n #endif\n #endif\n return rotation;\n}\n#endif\n"; // eslint-disable-line
|
|
9705
9715
|
var size_over_lifetime_module = "#ifdef RENDERER_SOL_CURVE_MODE\n uniform vec2 renderer_SOLMaxCurveX[4]; // x:time y:value\n #ifdef RENDERER_SOL_IS_SEPARATE\n uniform vec2 renderer_SOLMaxCurveY[4]; // x:time y:value\n uniform vec2 renderer_SOLMaxCurveZ[4]; // x:time y:value\n #endif\n\n #ifdef RENDERER_SOL_IS_RANDOM_TWO\n uniform vec2 renderer_SOLMinCurveX[4]; // x:time y:value\n #ifdef RENDERER_SOL_IS_SEPARATE\n uniform vec2 renderer_SOLMinCurveY[4]; // x:time y:value\n uniform vec2 renderer_SOLMinCurveZ[4]; // x:time y:value\n #endif\n #endif\n#endif\n\nvec2 computeParticleSizeBillboard(in vec2 size, in float normalizedAge) {\n #ifdef RENDERER_SOL_CURVE_MODE\n float lifeSizeX = evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge);\n #ifdef RENDERER_SOL_IS_RANDOM_TWO\n lifeSizeX = mix(evaluateParticleCurve(renderer_SOLMinCurveX, normalizedAge), lifeSizeX, a_Random0.z);\n #endif\n\n #ifdef RENDERER_SOL_IS_SEPARATE\n float lifeSizeY = evaluateParticleCurve(renderer_SOLMaxCurveY, normalizedAge);\n #ifdef RENDERER_SOL_IS_RANDOM_TWO\n lifeSizeY = mix(evaluateParticleCurve(renderer_SOLMinCurveY, normalizedAge), lifeSizeY, a_Random0.z);\n #endif\n size *= vec2(lifeSizeX, lifeSizeY);\n #else\n size *= lifeSizeX;\n #endif\n #endif\n return size;\n}\n\n#ifdef RENDERER_MODE_MESH\n vec3 computeParticleSizeMesh(in vec3 size, in float normalizedAge) {\n #ifdef RENDERER_SOL_CURVE\n size *= evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge);\n #endif\n #ifdef RENDERER_SOL_RANDOM_CURVES\n size *= mix(evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge),\n evaluateParticleCurve(u_SOLSizeGradientMax, normalizedAge),\n a_Random0.z);\n #endif\n #ifdef RENDERER_SOL_CURVE_SEPARATE\n size *= vec3(evaluateParticleCurve(renderer_SOLMinCurveX, normalizedAge),\n evaluateParticleCurve(renderer_SOLMinCurveY, normalizedAge),\n evaluateParticleCurve(renderer_SOLMinCurveZ, normalizedAge));\n #endif\n #ifdef RENDERER_SOL_RANDOM_CURVES_SEPARATE\n size *= vec3(mix(evaluateParticleCurve(renderer_SOLMinCurveX, normalizedAge),\n evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge),\n a_Random0.z),\n mix(evaluateParticleCurve(renderer_SOLMinCurveY, normalizedAge),\n evaluateParticleCurve(renderer_SOLMaxCurveY, normalizedAge),\n a_Random0.z),\n mix(evaluateParticleCurve(renderer_SOLMinCurveZ, normalizedAge),\n evaluateParticleCurve(renderer_SOLMaxCurveZ, normalizedAge),\n a_Random0.z));\n #endif\n return size;\n }\n#endif"; // eslint-disable-line
|
|
9706
9716
|
var color_over_lifetime_module = "\n#if defined(RENDERER_COL_GRADIENT) || defined(RENDERER_COL_RANDOM_GRADIENTS)\n uniform vec4 renderer_COLMaxGradientColor[4]; // x:time y:r z:g w:b\n uniform vec2 renderer_COLMaxGradientAlpha[4]; // x:time y:alpha\n\n #ifdef RENDERER_COL_RANDOM_GRADIENTS\n uniform vec4 renderer_COLMinGradientColor[4]; // x:time y:r z:g w:b\n uniform vec2 renderer_COLMinGradientAlpha[4]; // x:time y:alpha\n #endif\n\n uniform vec4 renderer_COLGradientKeysMaxTime; // x: minColorKeysMaxTime, y: minAlphaKeysMaxTime, z: maxColorKeysMaxTime, w: maxAlphaKeysMaxTime\n#endif\n\n\n\n#if defined(RENDERER_COL_GRADIENT) || defined(RENDERER_COL_RANDOM_GRADIENTS)\n vec4 evaluateParticleGradient(in vec4 colorKeys[4], in float colorKeysMaxTime, in vec2 alphaKeys[4], in float alphaKeysMaxTime, in float normalizedAge){\n vec4 value;\n float alphaAge = min(normalizedAge, alphaKeysMaxTime);\n for(int i = 0; i < 4; i++){\n vec2 key = alphaKeys[i];\n float time = key.x;\n if(alphaAge <= time){\n if(i == 0){\n value.a = alphaKeys[0].y;\n }\n else {\n vec2 lastKey = alphaKeys[i-1];\n float lastTime = lastKey.x;\n float age = (alphaAge - lastTime) / (time - lastTime);\n value.a = mix(lastKey.y, key.y, age);\n }\n break;\n }\n }\n \n float colorAge = min(normalizedAge, colorKeysMaxTime);\n for(int i = 0; i < 4; i++){\n vec4 key = colorKeys[i];\n float time = key.x;\n if(colorAge <= time){\n if(i == 0){\n value.rgb = colorKeys[0].yzw;\n }\n else {\n vec4 lastKey = colorKeys[i-1];\n float lastTime = lastKey.x;\n float age = (colorAge - lastTime) / (time-lastTime);\n value.rgb = mix(lastKey.yzw, key.yzw, age);\n }\n break;\n }\n }\n return value;\n }\n#endif\n\n\nvec4 computeParticleColor(in vec4 color, in float normalizedAge) {\n #if defined(RENDERER_COL_GRADIENT) || defined(RENDERER_COL_RANDOM_GRADIENTS)\n vec4 gradientColor = evaluateParticleGradient(renderer_COLMaxGradientColor, renderer_COLGradientKeysMaxTime.z, renderer_COLMaxGradientAlpha, renderer_COLGradientKeysMaxTime.w, normalizedAge);\n #endif\n\n #ifdef RENDERER_COL_RANDOM_GRADIENTS\n gradientColor = mix(evaluateParticleGradient(renderer_COLMinGradientColor,renderer_COLGradientKeysMaxTime.x, renderer_COLMinGradientAlpha, renderer_COLGradientKeysMaxTime.y, normalizedAge), gradientColor, a_Random0.y);\n #endif\n\n #if defined(RENDERER_COL_GRADIENT) || defined(RENDERER_COL_RANDOM_GRADIENTS)\n color *= gradientColor;\n #endif\n\n return color;\n}\n"; // eslint-disable-line
|
|
9707
9717
|
var texture_sheet_animation_module = "#if defined(RENDERER_TSA_FRAME_CURVE) || defined(RENDERER_TSA_FRAME_RANDOM_CURVES)\n uniform float renderer_TSACycles;\n uniform vec3 renderer_TSATillingParams; // x:subU y:subV z:tileCount\n uniform vec2 renderer_TSAFrameMaxCurve[4]; // x:time y:value\n\n #ifdef RENDERER_TSA_FRAME_RANDOM_CURVES\n uniform vec2 renderer_TSAFrameMinCurve[4]; // x:time y:value\n #endif\n#endif\n\nvec2 computeParticleUV(in vec2 uv, in float normalizedAge) {\n #if defined(RENDERER_TSA_FRAME_CURVE) || defined(RENDERER_TSA_FRAME_RANDOM_CURVES)\n float scaledNormalizedAge = normalizedAge * renderer_TSACycles;\n float cycleNormalizedAge = scaledNormalizedAge - floor(scaledNormalizedAge);\n float normalizedFrame = evaluateParticleCurve(renderer_TSAFrameMaxCurve, cycleNormalizedAge);\n #ifdef RENDERER_TSA_FRAME_RANDOM_CURVES\n normalizedFrame = mix(evaluateParticleCurve(renderer_TSAFrameMinCurve, cycleNormalizedAge), normalizedFrame, a_Random1.x);\n #endif\n\n float frame = floor(normalizedFrame * renderer_TSATillingParams.z);\n\n float tileRow = frame * renderer_TSATillingParams.x;\n float tileRowIndex = floor(tileRow);\n uv.x += tileRow - tileRowIndex;\n uv.y += tileRowIndex * renderer_TSATillingParams.y;\n #endif\n \n return uv;\n}\n"; // eslint-disable-line
|
|
@@ -9710,7 +9720,7 @@
|
|
|
9710
9720
|
var stretched_billboard = "#ifdef RENDERER_MODE_STRETCHED_BILLBOARD\n\tvec2 corner = a_CornerTextureCoordinate.xy + renderer_PivotOffset.xy;\n\tvec3 velocity = rotationByQuaternions(renderer_SizeScale * localVelocity, worldRotation) + worldVelocity;\n\tvec3 cameraUpVector = normalize(velocity);\n\tvec3 direction = normalize(center - camera_Position);\n\tvec3 sideVector = normalize(cross(direction, normalize(velocity)));\n\n\tsideVector = renderer_SizeScale.xzy * sideVector;\n\tcameraUpVector = length(vec3(renderer_SizeScale.x, 0.0, 0.0)) * cameraUpVector;\n\n\tvec2 size = computeParticleSizeBillboard(a_StartSize.xy, normalizedAge);\n\n\tconst mat2 rotationZHalfPI = mat2(0.0, -1.0, 1.0, 0.0);\n\tcorner = rotationZHalfPI * corner;\n\tcorner.y = corner.y - abs(corner.y);\n\n\tfloat speed = length(velocity); // TODO:\n\tcenter += sign(renderer_SizeScale.x) * (sign(renderer_StretchedBillboardLengthScale) * size.x * corner.x * sideVector\n\t + (speed * renderer_StretchedBillboardSpeedScale + size.y * renderer_StretchedBillboardLengthScale) * corner.y * cameraUpVector);\n#endif"; // eslint-disable-line
|
|
9711
9721
|
var vertical_billboard = "#ifdef RENDERER_MODE_VERTICAL_BILLBOARD\n\tvec2 corner = a_CornerTextureCoordinate.xy + renderer_PivotOffset.xy; // Billboard模式z轴无效\n\tconst vec3 cameraUpVector = vec3(0.0, 1.0, 0.0);\n\tvec3 sideVector = normalize(cross(camera_Forward, cameraUpVector));\n\n\tfloat rot = computeParticleRotationFloat(a_StartRotation0.x, age, normalizedAge);\n\tfloat c = cos(rot);\n\tfloat s = sin(rot);\n\tmat2 rotation = mat2(c, -s, s, c);\n\tcorner = rotation * corner * cos(0.78539816339744830961566084581988); // TODO:临时缩小cos45,不确定U3D原因\n\tcorner *= computeParticleSizeBillboard(a_StartSize.xy, normalizedAge);\n\tcenter += renderer_SizeScale.xzy * (corner.x * sideVector + corner.y * cameraUpVector);\n#endif"; // eslint-disable-line
|
|
9712
9722
|
var horizontal_billboard = "#ifdef RENDERER_MODE_HORIZONTAL_BILLBOARD\n\tvec2 corner = a_CornerTextureCoordinate.xy + renderer_PivotOffset.xy; // Billboard模式z轴无效\n\tconst vec3 cameraUpVector = vec3(0.0, 0.0, 1.0);\n\tconst vec3 sideVector = vec3(-1.0, 0.0, 0.0);\n\n\tfloat rot = computeParticleRotationFloat(a_StartRotation0.x, age, normalizedAge);\n\tfloat c = cos(rot);\n\tfloat s = sin(rot);\n\tmat2 rotation = mat2(c, -s, s, c);\n\tcorner = rotation * corner * cos(0.78539816339744830961566084581988); // TODO:临时缩小cos45,不确定U3D原因\n\tcorner *= computeParticleSizeBillboard(a_StartSize.xy, normalizedAge);\n\tcenter += renderer_SizeScale.xzy * (corner.x * sideVector + corner.y * cameraUpVector);\n#endif"; // eslint-disable-line
|
|
9713
|
-
var particle_mesh = "#ifdef RENDERER_MODE_MESH\n
|
|
9723
|
+
var particle_mesh = "// Only support local alignment mode\n#ifdef RENDERER_MODE_MESH\n #if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #define RENDERER_ROL_ENABLED\n #endif\n\n\tvec3 size = computeParticleSizeMesh(a_StartSize, normalizedAge);\n\n bool is3DRotation = renderer_ThreeDStartRotation;\n #if defined(RENDERER_ROL_ENABLED) && defined(RENDERER_ROL_IS_SEPARATE)\n is3DRotation = true;\n #endif\n\n if (is3DRotation) {\n #ifdef RENDERER_ROL_ENABLED\n vec3 startRotation = renderer_ThreeDStartRotation ? a_StartRotation0 : vec3(0.0, 0.0, a_StartRotation0.x);\n vec3 rotation = computeParticleRotationVec3(startRotation, age, normalizedAge);\n #else\n vec3 rotation = a_StartRotation0;\n #endif\n // 3D Start Rotation is same in local and world simulation space\n center += rotationByQuaternions(renderer_SizeScale * rotationByEuler(POSITION * size, rotation), worldRotation);\n } else {\n #ifdef RENDERER_ROL_ENABLED\n float angle = computeParticleRotationFloat(a_StartRotation0.x, age, normalizedAge);\n #else\n float angle = a_StartRotation0.x;\n #endif\n #ifdef RENDERER_EMISSION_SHAPE\n // Axis is side vector of emit position look at zero\n vec3 axis = vec3(a_ShapePositionStartLifeTime.xy, 0.0);\n if (renderer_SimulationSpace == 1){\n axis = rotationByQuaternions(axis, worldRotation);\n }\n vec3 crossResult = cross(axis, vec3(0.0, 0.0, -1.0));\n float crossLen = length(crossResult);\n vec3 rotateAxis = crossLen > 0.0001 ? crossResult / crossLen : vec3(0.0, 1.0, 0.0);\n #else\n // Axis is negative z\n vec3 rotateAxis = vec3(0.0, 0.0, -1.0);\n #endif\n center += rotationByQuaternions(renderer_SizeScale *rotationByAxis(POSITION * size, rotateAxis, angle), worldRotation);\n }\n #ifdef RENDERER_ENABLE_VERTEXCOLOR\n\t\tv_MeshColor = COLOR_0;\n\t#endif\n#endif"; // eslint-disable-line
|
|
9714
9724
|
var ParticleShaderLib = {
|
|
9715
9725
|
particle_common: particle_common,
|
|
9716
9726
|
velocity_over_lifetime_module: velocity_over_lifetime_module,
|
|
@@ -23948,11 +23958,11 @@
|
|
|
23948
23958
|
]);
|
|
23949
23959
|
return MeshRenderer;
|
|
23950
23960
|
}(exports.Renderer);
|
|
23961
|
+
/** @internal */ MeshRenderer._enableVertexColorMacro = ShaderMacro.getByName("RENDERER_ENABLE_VERTEXCOLOR");
|
|
23951
23962
|
MeshRenderer._uvMacro = ShaderMacro.getByName("RENDERER_HAS_UV");
|
|
23952
23963
|
MeshRenderer._uv1Macro = ShaderMacro.getByName("RENDERER_HAS_UV1");
|
|
23953
23964
|
MeshRenderer._normalMacro = ShaderMacro.getByName("RENDERER_HAS_NORMAL");
|
|
23954
23965
|
MeshRenderer._tangentMacro = ShaderMacro.getByName("RENDERER_HAS_TANGENT");
|
|
23955
|
-
MeshRenderer._enableVertexColorMacro = ShaderMacro.getByName("RENDERER_ENABLE_VERTEXCOLOR");
|
|
23956
23966
|
__decorate$1([
|
|
23957
23967
|
ignoreClone
|
|
23958
23968
|
], MeshRenderer.prototype, "_mesh", void 0);
|
|
@@ -30536,8 +30546,8 @@
|
|
|
30536
30546
|
var blinnPhongVs = "#include <common>\n#include <common_vert>\n#include <blendShape_input>\n#include <uv_share>\n#include <color_share>\n#include <normal_share>\n#include <worldpos_share>\n\n#include <ShadowVertexDeclaration>\n#include <FogVertexDeclaration>\n\nvoid main() {\n\n #include <begin_position_vert>\n #include <begin_normal_vert>\n #include <blendShape_vert>\n #include <skinning_vert>\n #include <uv_vert>\n #include <color_vert>\n #include <normal_vert>\n #include <worldpos_vert>\n #include <position_vert>\n\n #include <ShadowVertex>\n #include <FogVertex>\n}\n"; // eslint-disable-line
|
|
30537
30547
|
var depthOnlyFs = "void main() {\n}"; // eslint-disable-line
|
|
30538
30548
|
var depthOnlyVs = "#define MATERIAL_OMIT_NORMAL\n#include <common>\n#include <common_vert>\n#include <blendShape_input>\nuniform mat4 camera_VPMat;\n\n\nvoid main() {\n\n #include <begin_position_vert>\n #include <blendShape_vert>\n #include <skinning_vert>\n #include <position_vert>\n\n}\n"; // eslint-disable-line
|
|
30539
|
-
var particleFs = "#include <common>\n\nvarying vec4 v_Color;\nvarying vec2 v_TextureCoordinate;\nuniform sampler2D material_BaseTexture;\nuniform vec4 material_BaseColor;\n \nuniform mediump vec3 material_EmissiveColor;\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\n uniform sampler2D material_EmissiveTexture;\n#endif\n\n#ifdef RENDERER_MODE_MESH\n\tvarying vec4 v_MeshColor;\n#endif\n\nvoid main() {\n\tvec4 color = material_BaseColor * v_Color;\n\n\t#
|
|
30540
|
-
var particleVs = "#if defined(RENDERER_MODE_SPHERE_BILLBOARD) || defined(RENDERER_MODE_STRETCHED_BILLBOARD) || defined(RENDERER_MODE_HORIZONTAL_BILLBOARD) || defined(RENDERER_MODE_VERTICAL_BILLBOARD)\n attribute vec4 a_CornerTextureCoordinate;\n#endif\n\n#ifdef RENDERER_MODE_MESH\n attribute vec3
|
|
30549
|
+
var particleFs = "#include <common>\n\nvarying vec4 v_Color;\nvarying vec2 v_TextureCoordinate;\nuniform sampler2D material_BaseTexture;\nuniform vec4 material_BaseColor;\n \nuniform mediump vec3 material_EmissiveColor;\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\n uniform sampler2D material_EmissiveTexture;\n#endif\n\n#ifdef RENDERER_MODE_MESH\n\tvarying vec4 v_MeshColor;\n#endif\n\nvoid main() {\n\tvec4 color = material_BaseColor * v_Color;\n\n\t#if defined(RENDERER_MODE_MESH) && defined(RENDERER_ENABLE_VERTEXCOLOR)\n\t\tcolor *= v_MeshColor;\n\t#endif\n\n\t#ifdef MATERIAL_HAS_BASETEXTURE\n\t\tcolor *= texture2DSRGB(material_BaseTexture, v_TextureCoordinate);\n\t#endif\n\t\n\t// Emissive\n\tvec3 emissiveRadiance = material_EmissiveColor;\n\t#ifdef MATERIAL_HAS_EMISSIVETEXTURE\n\t\temissiveRadiance *= texture2DSRGB(material_EmissiveTexture, v_TextureCoordinate).rgb;\n\t#endif\n\n\tcolor.rgb += emissiveRadiance;\n\n\tgl_FragColor = color;\n}"; // eslint-disable-line
|
|
30550
|
+
var particleVs = "#if defined(RENDERER_MODE_SPHERE_BILLBOARD) || defined(RENDERER_MODE_STRETCHED_BILLBOARD) || defined(RENDERER_MODE_HORIZONTAL_BILLBOARD) || defined(RENDERER_MODE_VERTICAL_BILLBOARD)\n attribute vec4 a_CornerTextureCoordinate;\n#endif\n\n#ifdef RENDERER_MODE_MESH\n attribute vec3 POSITION;\n #ifdef RENDERER_ENABLE_VERTEXCOLOR\n attribute vec4 COLOR_0;\n #endif\n attribute vec2 TEXCOORD_0;\n varying vec4 v_MeshColor;\n#endif\n\nattribute vec4 a_ShapePositionStartLifeTime;\nattribute vec4 a_DirectionTime;\nattribute vec4 a_StartColor;\nattribute vec3 a_StartSize;\nattribute vec3 a_StartRotation0;\nattribute float a_StartSpeed;\n\n//#if defined(COLOR_OVER_LIFETIME) || defined(RENDERER_COL_RANDOM_GRADIENTS) || defined(RENDERER_SOL_RANDOM_CURVES) || defined(RENDERER_SOL_RANDOM_CURVES_SEPARATE) || defined(ROTATION_OVER_LIFE_TIME_RANDOM_CONSTANTS) || defined(ROTATION_OVER_LIFETIME_RANDOM_CURVES)\n attribute vec4 a_Random0;\n//#endif\n\n#if defined(RENDERER_TSA_FRAME_RANDOM_CURVES) || defined(RENDERER_VOL_IS_RANDOM_TWO)\n attribute vec4 a_Random1; // x:texture sheet animation random\n#endif\n\nattribute vec3 a_SimulationWorldPosition;\nattribute vec4 a_SimulationWorldRotation;\n\nvarying vec4 v_Color;\n#ifdef MATERIAL_HAS_BASETEXTURE\n attribute vec4 a_SimulationUV;\n varying vec2 v_TextureCoordinate;\n#endif\n\nuniform float renderer_CurrentTime;\nuniform vec3 renderer_Gravity;\nuniform vec2 u_DragConstant;\nuniform vec3 renderer_WorldPosition;\nuniform vec4 renderer_WorldRotation;\nuniform bool renderer_ThreeDStartRotation;\nuniform int renderer_ScalingMode;\nuniform vec3 renderer_PositionScale;\nuniform vec3 renderer_SizeScale;\nuniform vec3 renderer_PivotOffset;\n\nuniform mat4 camera_ViewMat;\nuniform mat4 camera_ProjMat;\n\n#ifdef RENDERER_MODE_STRETCHED_BILLBOARD\n uniform vec3 camera_Position;\n#endif\nuniform vec3 camera_Forward; // TODO:只有几种广告牌模式需要用\nuniform vec3 camera_Up;\n\nuniform float renderer_StretchedBillboardLengthScale;\nuniform float renderer_StretchedBillboardSpeedScale;\nuniform int renderer_SimulationSpace;\n\n#include <particle_common>\n#include <velocity_over_lifetime_module>\n#include <force_over_lifetime_module>\n#include <color_over_lifetime_module>\n#include <size_over_lifetime_module>\n#include <rotation_over_lifetime_module>\n#include <texture_sheet_animation_module>\n\nvec3 getStartPosition(vec3 startVelocity, float age, vec3 dragData) {\n vec3 startPosition;\n float lastTime = min(startVelocity.x / dragData.x, age); // todo 0/0\n startPosition = lastTime * (startVelocity - 0.5 * dragData * lastTime);\n return startPosition;\n}\n\nvec3 computeParticlePosition(in vec3 startVelocity, in float age, in float normalizedAge, vec3 gravityVelocity, vec4 worldRotation, vec3 dragData, inout vec3 localVelocity, inout vec3 worldVelocity) {\n vec3 startPosition = getStartPosition(startVelocity, age, dragData);\n\n vec3 finalPosition;\n vec3 localPositionOffset = startPosition;\n vec3 worldPositionOffset;\n\n #ifdef _VOL_MODULE_ENABLED\n vec3 lifeVelocity; \n vec3 velocityPositionOffset = computeVelocityPositionOffset(normalizedAge, age, lifeVelocity);\n if (renderer_VOLSpace == 0) {\n localVelocity += lifeVelocity;\n localPositionOffset += velocityPositionOffset;\n } else {\n worldVelocity += lifeVelocity;\n worldPositionOffset += velocityPositionOffset;\n }\n #endif\n\n #ifdef _FOL_MODULE_ENABLED\n vec3 forceVelocity;\n vec3 forcePositionOffset = computeForcePositionOffset(normalizedAge, age, forceVelocity);\n if (renderer_FOLSpace == 0) {\n localVelocity += forceVelocity;\n localPositionOffset += forcePositionOffset;\n } else {\n worldVelocity += forceVelocity;\n worldPositionOffset += forcePositionOffset;\n }\n #endif\n\n finalPosition = rotationByQuaternions(a_ShapePositionStartLifeTime.xyz + localPositionOffset, worldRotation) + worldPositionOffset;\n\n if (renderer_SimulationSpace == 0) {\n finalPosition = finalPosition + renderer_WorldPosition;\n } else if (renderer_SimulationSpace == 1) {\n\t finalPosition = finalPosition + a_SimulationWorldPosition;\n\t}\n\n finalPosition += 0.5 * gravityVelocity * age;\n\n return finalPosition;\n}\n\nvoid main() {\n float age = renderer_CurrentTime - a_DirectionTime.w;\n float normalizedAge = age / a_ShapePositionStartLifeTime.w;\n if (normalizedAge < 1.0) {\n vec3 startVelocity = a_DirectionTime.xyz * a_StartSpeed;\n vec3 gravityVelocity = renderer_Gravity * a_Random0.x * age;\n\n vec4 worldRotation;\n if (renderer_SimulationSpace == 0) {\n worldRotation = renderer_WorldRotation;\n } else {\n worldRotation = a_SimulationWorldRotation;\n }\n\n vec3 localVelocity = startVelocity;\n vec3 worldVelocity = gravityVelocity;\n\n //drag\n vec3 dragData = a_DirectionTime.xyz * mix(u_DragConstant.x, u_DragConstant.y, a_Random0.x);\n vec3 center = computeParticlePosition(startVelocity, age, normalizedAge, gravityVelocity, worldRotation, dragData, localVelocity, worldVelocity);\n\n #include <sphere_billboard>\n #include <stretched_billboard>\n #include <horizontal_billboard>\n #include <vertical_billboard>\n #include <particle_mesh>\n\n gl_Position = camera_ProjMat * camera_ViewMat * vec4(center, 1.0);\n v_Color = computeParticleColor(a_StartColor, normalizedAge);\n\n #ifdef MATERIAL_HAS_BASETEXTURE\n vec2 simulateUV;\n #if defined(RENDERER_MODE_SPHERE_BILLBOARD) || defined(RENDERER_MODE_STRETCHED_BILLBOARD) || defined(RENDERER_MODE_HORIZONTAL_BILLBOARD) || defined(RENDERER_MODE_VERTICAL_BILLBOARD)\n simulateUV = a_CornerTextureCoordinate.zw * a_SimulationUV.xy + a_SimulationUV.zw;\n v_TextureCoordinate = computeParticleUV(simulateUV, normalizedAge);\n #endif\n #ifdef RENDERER_MODE_MESH\n simulateUV = a_SimulationUV.zw + TEXCOORD_0 * a_SimulationUV.xy;\n v_TextureCoordinate = computeParticleUV(simulateUV, normalizedAge);\n #endif\n #endif\n } else {\n\t gl_Position = vec4(2.0, 2.0, 2.0, 1.0); // Discard use out of X(-1,1),Y(-1,1),Z(0,1)\n }\n}"; // eslint-disable-line
|
|
30541
30551
|
var pbrSpecularFs = "#include <common>\n#include <camera_declare>\n\n#include <FogFragmentDeclaration>\n\n#include <uv_share>\n#include <normal_share>\n#include <color_share>\n#include <worldpos_share>\n\n#include <light_frag_define>\n\n\n#include <pbr_frag_define>\n#include <pbr_helper>\n\nvoid main() {\n #include <pbr_frag>\n #include <FogFragment>\n}\n"; // eslint-disable-line
|
|
30542
30552
|
var pbrFs = "#include <common>\n#include <camera_declare>\n#include <transform_declare>\n\n#include <FogFragmentDeclaration>\n#include <PositionClipSpaceDeclaration>\n\n#include <uv_share>\n#include <normal_share>\n#include <color_share>\n#include <worldpos_share>\n\n#include <light_frag_define>\n\n#include <pbr_frag_define>\n#include <pbr_helper>\n\nvoid main() {\n #include <pbr_frag>\n #include <FogFragment>\n}\n"; // eslint-disable-line
|
|
30543
30553
|
var pbrVs = "#include <common>\n#include <common_vert>\n#include <blendShape_input>\n#include <uv_share>\n#include <color_share>\n#include <normal_share>\n#include <worldpos_share>\n\n#include <ShadowVertexDeclaration>\n#include <FogVertexDeclaration>\n#include <PositionClipSpaceDeclaration>\n\nvoid main() {\n\n #include <begin_position_vert>\n #include <begin_normal_vert>\n #include <blendShape_vert>\n #include <skinning_vert>\n #include <uv_vert>\n #include <color_vert>\n #include <normal_vert>\n #include <worldpos_vert>\n #include <position_vert>\n\n #include <ShadowVertex>\n #include <FogVertex>\n #include <PositionClipSpaceVertex>\n}\n"; // eslint-disable-line
|
|
@@ -37122,7 +37132,7 @@
|
|
|
37122
37132
|
}
|
|
37123
37133
|
generator._primitive.instanceCount = aliveParticleCount;
|
|
37124
37134
|
var material = this.getMaterial();
|
|
37125
|
-
if (!material) {
|
|
37135
|
+
if (!material || this._renderMode === ParticleRenderMode.Mesh && !this._mesh) {
|
|
37126
37136
|
return;
|
|
37127
37137
|
}
|
|
37128
37138
|
if (material.destroyed || material.shader.destroyed) {
|
|
@@ -37182,7 +37192,6 @@
|
|
|
37182
37192
|
var lastRenderMode = this._renderMode;
|
|
37183
37193
|
this._renderMode = value;
|
|
37184
37194
|
var renderModeMacro = null;
|
|
37185
|
-
var shaderData = this.shaderData;
|
|
37186
37195
|
switch(value){
|
|
37187
37196
|
case ParticleRenderMode.Billboard:
|
|
37188
37197
|
renderModeMacro = ParticleRenderer._billboardModeMacro;
|
|
@@ -37195,16 +37204,21 @@
|
|
|
37195
37204
|
case ParticleRenderMode.VerticalBillboard:
|
|
37196
37205
|
throw "Not implemented";
|
|
37197
37206
|
case ParticleRenderMode.Mesh:
|
|
37198
|
-
|
|
37207
|
+
renderModeMacro = ParticleRenderer._meshModeMacro;
|
|
37208
|
+
break;
|
|
37199
37209
|
}
|
|
37200
37210
|
if (this._currentRenderModeMacro !== renderModeMacro) {
|
|
37211
|
+
var shaderData = this.shaderData;
|
|
37201
37212
|
this._currentRenderModeMacro && shaderData.disableMacro(this._currentRenderModeMacro);
|
|
37202
37213
|
renderModeMacro && shaderData.enableMacro(renderModeMacro);
|
|
37203
37214
|
this._currentRenderModeMacro = renderModeMacro;
|
|
37204
37215
|
}
|
|
37205
|
-
|
|
37206
|
-
|
|
37207
|
-
|
|
37216
|
+
var wasMeshMode = lastRenderMode === ParticleRenderMode.Mesh;
|
|
37217
|
+
var isMeshMode = value === ParticleRenderMode.Mesh;
|
|
37218
|
+
if (wasMeshMode !== isMeshMode) {
|
|
37219
|
+
if (!isMeshMode || this.mesh) {
|
|
37220
|
+
this.generator._reorganizeGeometryBuffers();
|
|
37221
|
+
}
|
|
37208
37222
|
}
|
|
37209
37223
|
}
|
|
37210
37224
|
}
|
|
@@ -37212,8 +37226,8 @@
|
|
|
37212
37226
|
{
|
|
37213
37227
|
key: "mesh",
|
|
37214
37228
|
get: /**
|
|
37215
|
-
* The mesh
|
|
37216
|
-
* @remarks
|
|
37229
|
+
* The mesh shape for rendering each emitted particle.
|
|
37230
|
+
* @remarks Only effective when `renderMode` is `ParticleRenderMode.Mesh`.
|
|
37217
37231
|
*/ function get() {
|
|
37218
37232
|
return this._mesh;
|
|
37219
37233
|
},
|
|
@@ -37222,9 +37236,14 @@
|
|
|
37222
37236
|
if (lastMesh !== value) {
|
|
37223
37237
|
this._mesh = value;
|
|
37224
37238
|
lastMesh && this._addResourceReferCount(lastMesh, -1);
|
|
37225
|
-
|
|
37226
|
-
|
|
37227
|
-
|
|
37239
|
+
if (value) {
|
|
37240
|
+
if (value.subMeshes.length !== 1) {
|
|
37241
|
+
Logger.error("Particle emit mesh must have only one sub mesh.");
|
|
37242
|
+
}
|
|
37243
|
+
this._addResourceReferCount(value, 1);
|
|
37244
|
+
if (this.renderMode === ParticleRenderMode.Mesh) {
|
|
37245
|
+
this.generator._reorganizeGeometryBuffers();
|
|
37246
|
+
}
|
|
37228
37247
|
}
|
|
37229
37248
|
}
|
|
37230
37249
|
}
|
|
@@ -37236,7 +37255,7 @@
|
|
|
37236
37255
|
ParticleRenderer._stretchedBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_STRETCHED_BILLBOARD");
|
|
37237
37256
|
ParticleRenderer._horizontalBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_HORIZONTAL_BILLBOARD");
|
|
37238
37257
|
ParticleRenderer._verticalBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_VERTICAL_BILLBOARD");
|
|
37239
|
-
ParticleRenderer.
|
|
37258
|
+
ParticleRenderer._meshModeMacro = ShaderMacro.getByName("RENDERER_MODE_MESH");
|
|
37240
37259
|
ParticleRenderer._pivotOffsetProperty = ShaderProperty.getByName("renderer_PivotOffset");
|
|
37241
37260
|
ParticleRenderer._lengthScale = ShaderProperty.getByName("renderer_StretchedBillboardLengthScale");
|
|
37242
37261
|
ParticleRenderer._speedScale = ShaderProperty.getByName("renderer_StretchedBillboardSpeedScale");
|
|
@@ -38118,6 +38137,24 @@
|
|
|
38118
38137
|
this._currentBurstIndex = index;
|
|
38119
38138
|
};
|
|
38120
38139
|
_create_class$2(EmissionModule, [
|
|
38140
|
+
{
|
|
38141
|
+
key: "enabled",
|
|
38142
|
+
get: /**
|
|
38143
|
+
* @inheritdoc
|
|
38144
|
+
*/ function get() {
|
|
38145
|
+
return this._enabled;
|
|
38146
|
+
},
|
|
38147
|
+
set: function set(value) {
|
|
38148
|
+
if (value !== this._enabled) {
|
|
38149
|
+
this._enabled = value;
|
|
38150
|
+
if (value && this._shape) {
|
|
38151
|
+
this._generator._renderer.shaderData.enableMacro(EmissionModule._emissionShapeMacro);
|
|
38152
|
+
} else {
|
|
38153
|
+
this._generator._renderer.shaderData.disableMacro(EmissionModule._emissionShapeMacro);
|
|
38154
|
+
}
|
|
38155
|
+
}
|
|
38156
|
+
}
|
|
38157
|
+
},
|
|
38121
38158
|
{
|
|
38122
38159
|
key: "shape",
|
|
38123
38160
|
get: /**
|
|
@@ -38131,7 +38168,12 @@
|
|
|
38131
38168
|
this._shape = value;
|
|
38132
38169
|
var renderer = this._generator._renderer;
|
|
38133
38170
|
lastShape == null ? void 0 : lastShape._unRegisterOnValueChanged(renderer._onGeneratorParamsChanged);
|
|
38134
|
-
|
|
38171
|
+
if (value) {
|
|
38172
|
+
value._registerOnValueChanged(renderer._onGeneratorParamsChanged);
|
|
38173
|
+
this.enabled && renderer.shaderData.enableMacro(EmissionModule._emissionShapeMacro);
|
|
38174
|
+
} else {
|
|
38175
|
+
renderer.shaderData.disableMacro(EmissionModule._emissionShapeMacro);
|
|
38176
|
+
}
|
|
38135
38177
|
renderer._onGeneratorParamsChanged();
|
|
38136
38178
|
}
|
|
38137
38179
|
}
|
|
@@ -38147,6 +38189,7 @@
|
|
|
38147
38189
|
]);
|
|
38148
38190
|
return EmissionModule;
|
|
38149
38191
|
}(ParticleGeneratorModule);
|
|
38192
|
+
/** @internal */ EmissionModule._emissionShapeMacro = ShaderMacro.getByName("RENDERER_EMISSION_SHAPE");
|
|
38150
38193
|
__decorate$1([
|
|
38151
38194
|
deepClone
|
|
38152
38195
|
], EmissionModule.prototype, "rateOverTime", void 0);
|
|
@@ -38674,7 +38717,7 @@
|
|
|
38674
38717
|
* @internal
|
|
38675
38718
|
*/ _proto._updateShaderData = function _updateShaderData(shaderData) {
|
|
38676
38719
|
var enableSeparateMacro = null;
|
|
38677
|
-
var
|
|
38720
|
+
var modeMacro = null;
|
|
38678
38721
|
var isRandomTwoMacro = null;
|
|
38679
38722
|
if (this.enabled) {
|
|
38680
38723
|
var rotationX = this.rotationX;
|
|
@@ -38697,7 +38740,7 @@
|
|
|
38697
38740
|
}
|
|
38698
38741
|
isRandomTwoMacro = RotationOverLifetimeModule._isRandomTwoMacro;
|
|
38699
38742
|
}
|
|
38700
|
-
|
|
38743
|
+
modeMacro = RotationOverLifetimeModule._curveModeMacro;
|
|
38701
38744
|
} else {
|
|
38702
38745
|
var constantMax = this._rotationMaxConstant;
|
|
38703
38746
|
constantMax.set(MathUtil.degreeToRadian(rotationX.constantMax), MathUtil.degreeToRadian(rotationY.constantMax), MathUtil.degreeToRadian(rotationZ.constantMax));
|
|
@@ -38708,14 +38751,14 @@
|
|
|
38708
38751
|
shaderData.setVector3(RotationOverLifetimeModule._minConstantProperty, constantMin);
|
|
38709
38752
|
isRandomTwoMacro = RotationOverLifetimeModule._isRandomTwoMacro;
|
|
38710
38753
|
}
|
|
38711
|
-
|
|
38754
|
+
modeMacro = RotationOverLifetimeModule._constantModeMacro;
|
|
38712
38755
|
}
|
|
38713
38756
|
if (separateAxes) {
|
|
38714
38757
|
enableSeparateMacro = RotationOverLifetimeModule._isSeparateMacro;
|
|
38715
38758
|
}
|
|
38716
38759
|
}
|
|
38717
38760
|
this._enableSeparateMacro = this._enableMacro(shaderData, this._enableSeparateMacro, enableSeparateMacro);
|
|
38718
|
-
this.
|
|
38761
|
+
this._modeMacro = this._enableMacro(shaderData, this._modeMacro, modeMacro);
|
|
38719
38762
|
this._isRandomTwoMacro = this._enableMacro(shaderData, this._isRandomTwoMacro, isRandomTwoMacro);
|
|
38720
38763
|
};
|
|
38721
38764
|
/**
|
|
@@ -38760,7 +38803,7 @@
|
|
|
38760
38803
|
], RotationOverLifetimeModule.prototype, "_enableSeparateMacro", void 0);
|
|
38761
38804
|
__decorate$1([
|
|
38762
38805
|
ignoreClone
|
|
38763
|
-
], RotationOverLifetimeModule.prototype, "
|
|
38806
|
+
], RotationOverLifetimeModule.prototype, "_modeMacro", void 0);
|
|
38764
38807
|
__decorate$1([
|
|
38765
38808
|
ignoreClone
|
|
38766
38809
|
], RotationOverLifetimeModule.prototype, "_isRandomTwoMacro", void 0);
|
|
@@ -39445,25 +39488,32 @@
|
|
|
39445
39488
|
/**
|
|
39446
39489
|
* @internal
|
|
39447
39490
|
*/ _proto._emit = function _emit(playTime, count) {
|
|
39448
|
-
|
|
39491
|
+
var emission = this.emission;
|
|
39492
|
+
if (emission.enabled) {
|
|
39493
|
+
var main = this.main;
|
|
39449
39494
|
// Wait the existing particles to be retired
|
|
39450
39495
|
var notRetireParticleCount = this._getNotRetiredParticleCount();
|
|
39451
|
-
if (notRetireParticleCount >=
|
|
39496
|
+
if (notRetireParticleCount >= main.maxParticles) {
|
|
39452
39497
|
return;
|
|
39453
39498
|
}
|
|
39454
39499
|
var position = ParticleGenerator._tempVector30;
|
|
39455
39500
|
var direction = ParticleGenerator._tempVector31;
|
|
39456
39501
|
var transform = this._renderer.entity.transform;
|
|
39457
|
-
var shape =
|
|
39502
|
+
var shape = emission.shape;
|
|
39503
|
+
var positionScale = main._getPositionScale();
|
|
39458
39504
|
for(var i = 0; i < count; i++){
|
|
39459
39505
|
if (shape == null ? void 0 : shape.enabled) {
|
|
39460
|
-
shape._generatePositionAndDirection(
|
|
39461
|
-
var positionScale = this.main._getPositionScale();
|
|
39506
|
+
shape._generatePositionAndDirection(emission._shapeRand, playTime, position, direction);
|
|
39462
39507
|
position.multiply(positionScale);
|
|
39463
39508
|
direction.normalize().multiply(positionScale);
|
|
39464
39509
|
} else {
|
|
39465
39510
|
position.set(0, 0, 0);
|
|
39466
39511
|
direction.set(0, 0, -1);
|
|
39512
|
+
// Speed is scaled by shape scale in world simulation space
|
|
39513
|
+
// So if no shape and in world simulation space, we shouldn't scale the speed
|
|
39514
|
+
if (main.simulationSpace === ParticleSimulationSpace.Local) {
|
|
39515
|
+
direction.multiply(positionScale);
|
|
39516
|
+
}
|
|
39467
39517
|
}
|
|
39468
39518
|
this._addNewParticle(position, direction, transform, playTime);
|
|
39469
39519
|
}
|
|
@@ -39530,17 +39580,12 @@
|
|
|
39530
39580
|
/**
|
|
39531
39581
|
* @internal
|
|
39532
39582
|
*/ _proto._reorganizeGeometryBuffers = function _reorganizeGeometryBuffers() {
|
|
39533
|
-
var renderer =
|
|
39534
|
-
var
|
|
39535
|
-
var primitive = this._primitive;
|
|
39536
|
-
var vertexBufferBindings = this._vertexBufferBindings;
|
|
39583
|
+
var _this = this, renderer = _this._renderer, primitive = _this._primitive, vertexBufferBindings = _this._vertexBufferBindings;
|
|
39584
|
+
var _renderer_engine = renderer.engine, particleUtils = _renderer_engine._particleBufferUtils;
|
|
39537
39585
|
primitive.clearVertexElements();
|
|
39538
39586
|
vertexBufferBindings.length = 0;
|
|
39539
39587
|
if (renderer.renderMode === ParticleRenderMode.Mesh) {
|
|
39540
39588
|
var mesh = renderer.mesh;
|
|
39541
|
-
if (!mesh) {
|
|
39542
|
-
return;
|
|
39543
|
-
}
|
|
39544
39589
|
var positionElement = mesh.getVertexElement(VertexAttribute.Position);
|
|
39545
39590
|
var colorElement = mesh.getVertexElement(VertexAttribute.Color);
|
|
39546
39591
|
var uvElement = mesh.getVertexElement(VertexAttribute.UV);
|
|
@@ -39554,28 +39599,38 @@
|
|
|
39554
39599
|
if (colorBufferBinding) {
|
|
39555
39600
|
var index1 = this._addVertexBufferBindingsFilterDuplicate(colorBufferBinding, vertexBufferBindings);
|
|
39556
39601
|
primitive.addVertexElement(new VertexElement(VertexAttribute.Color, colorElement.offset, colorElement.format, index1));
|
|
39602
|
+
renderer.shaderData.enableMacro(MeshRenderer._enableVertexColorMacro);
|
|
39603
|
+
} else {
|
|
39604
|
+
renderer.shaderData.disableMacro(MeshRenderer._enableVertexColorMacro);
|
|
39557
39605
|
}
|
|
39558
39606
|
if (uvBufferBinding) {
|
|
39559
39607
|
var index2 = this._addVertexBufferBindingsFilterDuplicate(uvBufferBinding, vertexBufferBindings);
|
|
39560
39608
|
primitive.addVertexElement(new VertexElement(VertexAttribute.UV, uvElement.offset, uvElement.format, index2));
|
|
39561
39609
|
}
|
|
39562
|
-
|
|
39563
|
-
var
|
|
39564
|
-
|
|
39565
|
-
|
|
39610
|
+
primitive.setIndexBufferBinding(mesh._primitive.indexBufferBinding);
|
|
39611
|
+
var subMesh = mesh.subMesh;
|
|
39612
|
+
var _this1 = this, subPrimitive = _this1._subPrimitive;
|
|
39613
|
+
subPrimitive.start = subMesh.start;
|
|
39614
|
+
subPrimitive.topology = subMesh.topology;
|
|
39615
|
+
subPrimitive.count = subMesh.count;
|
|
39566
39616
|
} else {
|
|
39617
|
+
renderer.shaderData.disableMacro(MeshRenderer._enableVertexColorMacro);
|
|
39567
39618
|
primitive.addVertexElement(particleUtils.billboardVertexElement);
|
|
39568
39619
|
vertexBufferBindings.push(particleUtils.billboardVertexBufferBinding);
|
|
39569
39620
|
primitive.setIndexBufferBinding(particleUtils.billboardIndexBufferBinding);
|
|
39570
39621
|
this._subPrimitive.count = ParticleBufferUtils.billboardIndexCount;
|
|
39571
39622
|
}
|
|
39572
|
-
primitive.setVertexBufferBindings(vertexBufferBindings);
|
|
39573
39623
|
var instanceVertexElements = particleUtils.instanceVertexElements;
|
|
39574
39624
|
var bindingIndex = vertexBufferBindings.length;
|
|
39575
39625
|
for(var i = 0, n = instanceVertexElements.length; i < n; i++){
|
|
39576
39626
|
var element = instanceVertexElements[i];
|
|
39577
39627
|
primitive.addVertexElement(new VertexElement(element.attribute, element.offset, element.format, bindingIndex, element.instanceStepRate));
|
|
39578
39628
|
}
|
|
39629
|
+
// If instance buffer already created
|
|
39630
|
+
if (this._instanceVertexBufferBinding) {
|
|
39631
|
+
vertexBufferBindings.push(this._instanceVertexBufferBinding);
|
|
39632
|
+
}
|
|
39633
|
+
primitive.setVertexBufferBindings(vertexBufferBindings);
|
|
39579
39634
|
};
|
|
39580
39635
|
/**
|
|
39581
39636
|
* @internal
|
|
@@ -39839,16 +39894,20 @@
|
|
|
39839
39894
|
}
|
|
39840
39895
|
// Start rotation
|
|
39841
39896
|
var startRotationRand = main._startRotationRand, flipRotation = main.flipRotation;
|
|
39842
|
-
var
|
|
39897
|
+
var isFlip = flipRotation > startRotationRand.random();
|
|
39898
|
+
// @todo:None-Mesh mode should inverse the rotation, maybe should unify it
|
|
39899
|
+
if (this._renderer.renderMode !== ParticleRenderMode.Mesh) {
|
|
39900
|
+
isFlip = !isFlip;
|
|
39901
|
+
}
|
|
39843
39902
|
var rotationZ = MathUtil.degreeToRadian(main.startRotationZ.evaluate(undefined, startRotationRand.random()));
|
|
39844
39903
|
if (main.startRotation3D) {
|
|
39845
39904
|
var rotationX = MathUtil.degreeToRadian(main.startRotationX.evaluate(undefined, startRotationRand.random()));
|
|
39846
39905
|
var rotationY = MathUtil.degreeToRadian(main.startRotationY.evaluate(undefined, startRotationRand.random()));
|
|
39847
|
-
instanceVertices[offset + 15] =
|
|
39848
|
-
instanceVertices[offset + 16] =
|
|
39849
|
-
instanceVertices[offset + 17] =
|
|
39906
|
+
instanceVertices[offset + 15] = isFlip ? -rotationX : rotationX;
|
|
39907
|
+
instanceVertices[offset + 16] = isFlip ? -rotationY : rotationY;
|
|
39908
|
+
instanceVertices[offset + 17] = isFlip ? -rotationZ : rotationZ;
|
|
39850
39909
|
} else {
|
|
39851
|
-
instanceVertices[offset + 15] =
|
|
39910
|
+
instanceVertices[offset + 15] = isFlip ? -rotationZ : rotationZ;
|
|
39852
39911
|
}
|
|
39853
39912
|
// Start speed
|
|
39854
39913
|
instanceVertices[offset + 18] = startSpeed;
|
|
@@ -45469,6 +45528,25 @@
|
|
|
45469
45528
|
/** start parse the scene or prefab or others */ _proto.start = function start() {
|
|
45470
45529
|
this._parseEntities().then(this._organizeEntities).then(this._parseComponents).then(this._parseAddedComponents).then(this._parseComponentsPropsAndMethods).then(this._parsePrefabModification).then(this._parsePrefabRemovedEntities).then(this._parsePrefabRemovedComponents).then(this._clearAndResolve).then(this._resolve).catch(this._reject);
|
|
45471
45530
|
};
|
|
45531
|
+
_proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
|
|
45532
|
+
if (entityConfig === void 0) entityConfig = {};
|
|
45533
|
+
var _entityConfig_isActive;
|
|
45534
|
+
entity.isActive = (_entityConfig_isActive = entityConfig.isActive) != null ? _entityConfig_isActive : entity.isActive;
|
|
45535
|
+
var _entityConfig_name;
|
|
45536
|
+
entity.name = (_entityConfig_name = entityConfig.name) != null ? _entityConfig_name : entity.name;
|
|
45537
|
+
var transform = entity.transform;
|
|
45538
|
+
var transformConfig = entityConfig.transform;
|
|
45539
|
+
if (transformConfig) {
|
|
45540
|
+
this._reflectionParser.parsePropsAndMethods(transform, transformConfig);
|
|
45541
|
+
} else {
|
|
45542
|
+
var position = entityConfig.position, rotation = entityConfig.rotation, scale = entityConfig.scale;
|
|
45543
|
+
if (position) transform.position.copyFrom(position);
|
|
45544
|
+
if (rotation) transform.rotation.copyFrom(rotation);
|
|
45545
|
+
if (scale) transform.scale.copyFrom(scale);
|
|
45546
|
+
}
|
|
45547
|
+
if (entityConfig.layer) entity.layer = entityConfig.layer;
|
|
45548
|
+
return entity;
|
|
45549
|
+
};
|
|
45472
45550
|
_proto._parseEntities = function _parseEntities() {
|
|
45473
45551
|
var _this = this;
|
|
45474
45552
|
var entitiesConfig = this.data.entities;
|
|
@@ -45679,25 +45757,6 @@
|
|
|
45679
45757
|
this._addComponentPlugin(componentId, component);
|
|
45680
45758
|
}
|
|
45681
45759
|
};
|
|
45682
|
-
_proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
|
|
45683
|
-
if (entityConfig === void 0) entityConfig = {};
|
|
45684
|
-
var _entityConfig_isActive;
|
|
45685
|
-
entity.isActive = (_entityConfig_isActive = entityConfig.isActive) != null ? _entityConfig_isActive : entity.isActive;
|
|
45686
|
-
var _entityConfig_name;
|
|
45687
|
-
entity.name = (_entityConfig_name = entityConfig.name) != null ? _entityConfig_name : entity.name;
|
|
45688
|
-
var transform = entity.transform;
|
|
45689
|
-
var transformConfig = entityConfig.transform;
|
|
45690
|
-
if (transformConfig) {
|
|
45691
|
-
this._reflectionParser.parsePropsAndMethods(transform, transformConfig);
|
|
45692
|
-
} else {
|
|
45693
|
-
var position = entityConfig.position, rotation = entityConfig.rotation, scale = entityConfig.scale;
|
|
45694
|
-
if (position) transform.position.copyFrom(position);
|
|
45695
|
-
if (rotation) transform.rotation.copyFrom(rotation);
|
|
45696
|
-
if (scale) transform.scale.copyFrom(scale);
|
|
45697
|
-
}
|
|
45698
|
-
if (entityConfig.layer) entity.layer = entityConfig.layer;
|
|
45699
|
-
return entity;
|
|
45700
|
-
};
|
|
45701
45760
|
_proto._generateInstanceContext = function _generateInstanceContext(entity, context, path) {
|
|
45702
45761
|
var entityMap = context.entityMap, components = context.components;
|
|
45703
45762
|
var componentsMap = {};
|
|
@@ -49598,6 +49657,13 @@
|
|
|
49598
49657
|
return _this;
|
|
49599
49658
|
}
|
|
49600
49659
|
var _proto = PrefabParser.prototype;
|
|
49660
|
+
_proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
|
|
49661
|
+
if (entityConfig === void 0) entityConfig = {};
|
|
49662
|
+
HierarchyParser.prototype._applyEntityData.call(this, entity, entityConfig);
|
|
49663
|
+
// @ts-ignore
|
|
49664
|
+
entity._markAsTemplate(this.context.resource);
|
|
49665
|
+
return entity;
|
|
49666
|
+
};
|
|
49601
49667
|
_proto._handleRootEntity = function _handleRootEntity(id) {
|
|
49602
49668
|
this.prefabResource._root = this.context.entityMap.get(id);
|
|
49603
49669
|
};
|
|
@@ -51616,7 +51682,7 @@
|
|
|
51616
51682
|
], EXT_texture_webp);
|
|
51617
51683
|
|
|
51618
51684
|
//@ts-ignore
|
|
51619
|
-
var version = "1.6.
|
|
51685
|
+
var version = "1.6.12";
|
|
51620
51686
|
console.log("Galacean Engine Version: " + version);
|
|
51621
51687
|
for(var key in CoreObjects){
|
|
51622
51688
|
Loader.registerClass(key, CoreObjects[key]);
|