@galacean/engine-core 1.3.15 → 1.3.17
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 +74 -57
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +74 -57
- package/dist/module.js +74 -57
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/asset/AssetType.d.ts +2 -0
- package/types/asset/Loader.d.ts +1 -1
- package/types/particle/modules/MainModule.d.ts +1 -2
package/dist/module.js
CHANGED
|
@@ -634,6 +634,11 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
634
634
|
if (Utils.isBase64Url(relativeUrl)) {
|
|
635
635
|
return relativeUrl;
|
|
636
636
|
}
|
|
637
|
+
if (!/^https?:/.test(baseUrl)) {
|
|
638
|
+
var fileSchema = "files://";
|
|
639
|
+
baseUrl = fileSchema + baseUrl;
|
|
640
|
+
return new URL(relativeUrl, baseUrl).href.substring(fileSchema.length);
|
|
641
|
+
}
|
|
637
642
|
return relativeUrl ? new URL(relativeUrl, baseUrl).href : baseUrl;
|
|
638
643
|
};
|
|
639
644
|
/**
|
|
@@ -2248,7 +2253,7 @@ var size_over_lifetime_module = "#define GLSLIFY 1\n#ifdef RENDERER_SOL_CURVE_MO
|
|
|
2248
2253
|
|
|
2249
2254
|
var color_over_lifetime_module = "#define GLSLIFY 1\n#if defined(RENDERER_COL_GRADIENT) || defined(RENDERER_COL_RANDOM_GRADIENTS)\nuniform vec4 renderer_COLMaxGradientColor[4];uniform vec2 renderer_COLMaxGradientAlpha[4];\n#ifdef RENDERER_COL_RANDOM_GRADIENTS\nuniform vec4 renderer_COLMinGradientColor[4];uniform vec2 renderer_COLMinGradientAlpha[4];\n#endif\nuniform vec4 renderer_COLGradientKeysMaxTime;\n#endif\n#if defined(RENDERER_COL_GRADIENT) || defined(RENDERER_COL_RANDOM_GRADIENTS)\nvec4 evaluateParticleGradient(in vec4 colorKeys[4],in float colorKeysMaxTime,in vec2 alphaKeys[4],in float alphaKeysMaxTime,in float normalizedAge){vec4 value;float alphaAge=min(normalizedAge,alphaKeysMaxTime);for(int i=0;i<4;i++){vec2 key=alphaKeys[i];float time=key.x;if(alphaAge<=time){if(i==0){value.a=alphaKeys[0].y;}else{vec2 lastKey=alphaKeys[i-1];float lastTime=lastKey.x;float age=(alphaAge-lastTime)/(time-lastTime);value.a=mix(lastKey.y,key.y,age);}break;}}float colorAge=min(normalizedAge,colorKeysMaxTime);for(int i=0;i<4;i++){vec4 key=colorKeys[i];float time=key.x;if(colorAge<=time){if(i==0){value.rgb=colorKeys[0].yzw;}else{vec4 lastKey=colorKeys[i-1];float lastTime=lastKey.x;float age=(colorAge-lastTime)/(time-lastTime);value.rgb=mix(lastKey.yzw,key.yzw,age);}break;}}return value;}\n#endif\nvec4 computeParticleColor(in vec4 color,in float normalizedAge){\n#if defined(RENDERER_COL_GRADIENT) || defined(RENDERER_COL_RANDOM_GRADIENTS)\nvec4 gradientColor=evaluateParticleGradient(renderer_COLMaxGradientColor,renderer_COLGradientKeysMaxTime.z,renderer_COLMaxGradientAlpha,renderer_COLGradientKeysMaxTime.w,normalizedAge);\n#endif\n#ifdef RENDERER_COL_RANDOM_GRADIENTS\ngradientColor=mix(evaluateParticleGradient(renderer_COLMinGradientColor,renderer_COLGradientKeysMaxTime.x,renderer_COLMinGradientAlpha,renderer_COLGradientKeysMaxTime.y,normalizedAge),gradientColor,a_Random0.y);\n#endif\n#if defined(RENDERER_COL_GRADIENT) || defined(RENDERER_COL_RANDOM_GRADIENTS)\ncolor*=gradientColor;\n#endif\nreturn color;}"; // eslint-disable-line
|
|
2250
2255
|
|
|
2251
|
-
var texture_sheet_animation_module = "#define GLSLIFY 1\n#if defined(RENDERER_TSA_FRAME_CURVE) || defined(RENDERER_TSA_FRAME_RANDOM_CURVES)\nuniform float renderer_TSACycles;uniform vec3 renderer_TSATillingParams;uniform vec2 renderer_TSAFrameMaxCurve[4];\n#ifdef RENDERER_TSA_FRAME_RANDOM_CURVES\nuniform vec2 renderer_TSAFrameMinCurve[4];\n#endif\n#endif\nvec2 computeParticleUV(in vec2 uv,in float normalizedAge){\n#if defined(RENDERER_TSA_FRAME_CURVE) || defined(RENDERER_TSA_FRAME_RANDOM_CURVES)\nfloat scaledNormalizedAge=normalizedAge*renderer_TSACycles;float cycleNormalizedAge=scaledNormalizedAge-floor(scaledNormalizedAge);float normalizedFrame=evaluateParticleCurve(renderer_TSAFrameMaxCurve,cycleNormalizedAge);\n#ifdef RENDERER_TSA_FRAME_RANDOM_CURVES\nnormalizedFrame=mix(evaluateParticleCurve(renderer_TSAFrameMinCurve,cycleNormalizedAge),normalizedFrame,a_Random1.x);\n#endif\nfloat frame=floor(normalizedFrame*renderer_TSATillingParams.z);float tileRow=frame*renderer_TSATillingParams.x;float
|
|
2256
|
+
var texture_sheet_animation_module = "#define GLSLIFY 1\n#if defined(RENDERER_TSA_FRAME_CURVE) || defined(RENDERER_TSA_FRAME_RANDOM_CURVES)\nuniform float renderer_TSACycles;uniform vec3 renderer_TSATillingParams;uniform vec2 renderer_TSAFrameMaxCurve[4];\n#ifdef RENDERER_TSA_FRAME_RANDOM_CURVES\nuniform vec2 renderer_TSAFrameMinCurve[4];\n#endif\n#endif\nvec2 computeParticleUV(in vec2 uv,in float normalizedAge){\n#if defined(RENDERER_TSA_FRAME_CURVE) || defined(RENDERER_TSA_FRAME_RANDOM_CURVES)\nfloat scaledNormalizedAge=normalizedAge*renderer_TSACycles;float cycleNormalizedAge=scaledNormalizedAge-floor(scaledNormalizedAge);float normalizedFrame=evaluateParticleCurve(renderer_TSAFrameMaxCurve,cycleNormalizedAge);\n#ifdef RENDERER_TSA_FRAME_RANDOM_CURVES\nnormalizedFrame=mix(evaluateParticleCurve(renderer_TSAFrameMinCurve,cycleNormalizedAge),normalizedFrame,a_Random1.x);\n#endif\nfloat frame=floor(normalizedFrame*renderer_TSATillingParams.z);float tileRow=frame*renderer_TSATillingParams.x;float tileRowIndex=floor(tileRow);uv.x+=tileRow-tileRowIndex;uv.y+=tileRowIndex*renderer_TSATillingParams.y;\n#endif\nreturn uv;}"; // eslint-disable-line
|
|
2252
2257
|
|
|
2253
2258
|
var sphere_billboard = "#define GLSLIFY 1\n#ifdef RENDERER_MODE_SPHERE_BILLBOARD\nvec2 corner=a_CornerTextureCoordinate.xy+renderer_PivotOffset.xy;vec3 sideVector=normalize(cross(camera_Forward,camera_Up));vec3 upVector=normalize(cross(sideVector,camera_Forward));corner*=computeParticleSizeBillboard(a_StartSize.xy,normalizedAge);\n#if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\nif(renderer_ThreeDStartRotation){vec3 rotation=vec3(a_StartRotation0.xy,computeParticleRotationFloat(a_StartRotation0.z,age,normalizedAge));center+=renderer_SizeScale.xzy*rotationByEuler(corner.x*sideVector+corner.y*upVector,rotation);}else{float rot=computeParticleRotationFloat(a_StartRotation0.x,age,normalizedAge);float c=cos(rot);float s=sin(rot);mat2 rotation=mat2(c,-s,s,c);corner=rotation*corner;center+=renderer_SizeScale.xzy*(corner.x*sideVector+corner.y*upVector);}\n#else\nif(renderer_ThreeDStartRotation){center+=renderer_SizeScale.xzy*rotationByEuler(corner.x*sideVector+corner.y*upVector,a_StartRotation0);}else{float c=cos(a_StartRotation0.x);float s=sin(a_StartRotation0.x);mat2 rotation=mat2(c,-s,s,c);corner=rotation*corner;center+=renderer_SizeScale.xzy*(corner.x*sideVector+corner.y*upVector);}\n#endif\n#endif\n"; // eslint-disable-line
|
|
2254
2259
|
|
|
@@ -10328,7 +10333,7 @@ var /**
|
|
|
10328
10333
|
if (background.mode === BackgroundMode.Sky) {
|
|
10329
10334
|
background.sky._render(context);
|
|
10330
10335
|
} else if (background.mode === BackgroundMode.Texture && background.texture) {
|
|
10331
|
-
this._drawBackgroundTexture(
|
|
10336
|
+
this._drawBackgroundTexture(camera, background);
|
|
10332
10337
|
}
|
|
10333
10338
|
}
|
|
10334
10339
|
// Copy opaque texture
|
|
@@ -10424,7 +10429,8 @@ var /**
|
|
|
10424
10429
|
renderElement.renderQueueFlags |= flag;
|
|
10425
10430
|
}
|
|
10426
10431
|
};
|
|
10427
|
-
_proto._drawBackgroundTexture = function _drawBackgroundTexture(
|
|
10432
|
+
_proto._drawBackgroundTexture = function _drawBackgroundTexture(camera, background) {
|
|
10433
|
+
var engine = camera.engine;
|
|
10428
10434
|
var rhi = engine._hardwareRenderer;
|
|
10429
10435
|
var canvas = engine.canvas;
|
|
10430
10436
|
var material = background._material, mesh = background._mesh;
|
|
@@ -10436,6 +10442,7 @@ var /**
|
|
|
10436
10442
|
var program = pass._getShaderProgram(engine, Shader._compileMacros);
|
|
10437
10443
|
program.bind();
|
|
10438
10444
|
program.uploadAll(program.materialUniformBlock, material.shaderData);
|
|
10445
|
+
program.uploadAll(program.cameraUniformBlock, camera.shaderData);
|
|
10439
10446
|
program.uploadUnGroupTextures();
|
|
10440
10447
|
(pass._renderState || material.renderState)._applyStates(engine, false, pass._renderStateDataMap, material.shaderData);
|
|
10441
10448
|
rhi.drawPrimitive(mesh._primitive, mesh.subMesh, program);
|
|
@@ -19056,6 +19063,7 @@ var ObjectPool = /*#__PURE__*/ function() {
|
|
|
19056
19063
|
AssetType[/** 2D Texture. */ "Texture2D"] = "Texture2D";
|
|
19057
19064
|
AssetType[/** Cube Texture. */ "TextureCube"] = "TextureCube";
|
|
19058
19065
|
AssetType[/** Material. */ "Material"] = "Material";
|
|
19066
|
+
AssetType[/** Shader. */ "Shader"] = "Shader";
|
|
19059
19067
|
AssetType[/** Mesh. */ "Mesh"] = "Mesh";
|
|
19060
19068
|
AssetType[/** AnimationClip. */ "AnimationClip"] = "AnimationClip";
|
|
19061
19069
|
AssetType[/** AnimatorController. */ "AnimatorController"] = "AnimatorController";
|
|
@@ -19548,14 +19556,16 @@ var /** @internal */ PromiseState;
|
|
|
19548
19556
|
/**
|
|
19549
19557
|
* @internal
|
|
19550
19558
|
*/ _proto._onSubAssetSuccess = function _onSubAssetSuccess(assetBaseURL, assetSubPath, value) {
|
|
19551
|
-
var
|
|
19552
|
-
var
|
|
19559
|
+
var _this__subAssetPromiseCallbacks_remoteAssetBaseURL;
|
|
19560
|
+
var _this__virtualPathMap_assetBaseURL;
|
|
19561
|
+
var remoteAssetBaseURL = (_this__virtualPathMap_assetBaseURL = this._virtualPathMap[assetBaseURL]) != null ? _this__virtualPathMap_assetBaseURL : assetBaseURL;
|
|
19562
|
+
var subPromiseCallback = (_this__subAssetPromiseCallbacks_remoteAssetBaseURL = this._subAssetPromiseCallbacks[remoteAssetBaseURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_remoteAssetBaseURL[assetSubPath];
|
|
19553
19563
|
if (subPromiseCallback) {
|
|
19554
19564
|
subPromiseCallback.resolve(value);
|
|
19555
19565
|
} else {
|
|
19556
19566
|
var // Pending
|
|
19557
|
-
_this__subAssetPromiseCallbacks,
|
|
19558
|
-
((_this__subAssetPromiseCallbacks = this._subAssetPromiseCallbacks)[
|
|
19567
|
+
_this__subAssetPromiseCallbacks, _remoteAssetBaseURL;
|
|
19568
|
+
((_this__subAssetPromiseCallbacks = this._subAssetPromiseCallbacks)[_remoteAssetBaseURL = remoteAssetBaseURL] || (_this__subAssetPromiseCallbacks[_remoteAssetBaseURL] = {}))[assetSubPath] = {
|
|
19559
19569
|
resolvedValue: value
|
|
19560
19570
|
};
|
|
19561
19571
|
}
|
|
@@ -19677,33 +19687,34 @@ var /** @internal */ PromiseState;
|
|
|
19677
19687
|
var item = this._assignDefaultOptions(typeof itemOrURL === "string" ? {
|
|
19678
19688
|
url: itemOrURL
|
|
19679
19689
|
} : itemOrURL);
|
|
19680
|
-
|
|
19681
|
-
var itemURL = item.url;
|
|
19682
|
-
var url = this._virtualPathMap[itemURL] ? this._virtualPathMap[itemURL] : itemURL;
|
|
19690
|
+
var url = item.url;
|
|
19683
19691
|
// Not absolute and base url is set
|
|
19684
19692
|
if (!Utils.isAbsoluteUrl(url) && this.baseUrl) url = Utils.resolveAbsoluteUrl(this.baseUrl, url);
|
|
19685
19693
|
// Parse url
|
|
19686
19694
|
var _this__parseURL = this._parseURL(url), assetBaseURL = _this__parseURL.assetBaseURL, queryPath = _this__parseURL.queryPath;
|
|
19687
19695
|
var paths = queryPath ? this._parseQueryPath(queryPath) : [];
|
|
19696
|
+
var _this__virtualPathMap_assetBaseURL;
|
|
19697
|
+
// Get remote asset base url
|
|
19698
|
+
var remoteAssetBaseURL = (_this__virtualPathMap_assetBaseURL = this._virtualPathMap[assetBaseURL]) != null ? _this__virtualPathMap_assetBaseURL : assetBaseURL;
|
|
19688
19699
|
// Check cache
|
|
19689
|
-
var cacheObject = this._assetUrlPool[
|
|
19700
|
+
var cacheObject = this._assetUrlPool[remoteAssetBaseURL];
|
|
19690
19701
|
if (cacheObject) {
|
|
19691
19702
|
return new AssetPromise(function(resolve) {
|
|
19692
19703
|
resolve(_this._getResolveResource(cacheObject, paths));
|
|
19693
19704
|
});
|
|
19694
19705
|
}
|
|
19695
19706
|
// Get asset url
|
|
19696
|
-
var
|
|
19707
|
+
var remoteAssetURL = remoteAssetBaseURL;
|
|
19697
19708
|
if (queryPath) {
|
|
19698
|
-
|
|
19709
|
+
remoteAssetURL += "?q=" + paths.shift();
|
|
19699
19710
|
var index;
|
|
19700
19711
|
while(index = paths.shift()){
|
|
19701
|
-
|
|
19712
|
+
remoteAssetURL += "[" + index + "]";
|
|
19702
19713
|
}
|
|
19703
19714
|
}
|
|
19704
19715
|
// Check is loading
|
|
19705
19716
|
var loadingPromises = this._loadingPromises;
|
|
19706
|
-
var loadingPromise = loadingPromises[
|
|
19717
|
+
var loadingPromise = loadingPromises[remoteAssetURL];
|
|
19707
19718
|
if (loadingPromise) {
|
|
19708
19719
|
return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
19709
19720
|
loadingPromise.onProgress(setTaskCompleteProgress, setTaskDetailProgress).then(function(resource) {
|
|
@@ -19721,37 +19732,37 @@ var /** @internal */ PromiseState;
|
|
|
19721
19732
|
// Check sub asset
|
|
19722
19733
|
if (queryPath) {
|
|
19723
19734
|
// Check whether load main asset
|
|
19724
|
-
var mainPromise = loadingPromises[
|
|
19735
|
+
var mainPromise = loadingPromises[remoteAssetBaseURL] || this._loadMainAsset(loader, item, remoteAssetBaseURL, assetBaseURL);
|
|
19725
19736
|
mainPromise.catch(function(e) {
|
|
19726
|
-
_this._onSubAssetFail(
|
|
19737
|
+
_this._onSubAssetFail(remoteAssetBaseURL, queryPath, e);
|
|
19727
19738
|
});
|
|
19728
|
-
return this._createSubAssetPromiseCallback(
|
|
19739
|
+
return this._createSubAssetPromiseCallback(remoteAssetBaseURL, remoteAssetURL, queryPath);
|
|
19729
19740
|
}
|
|
19730
|
-
return this._loadMainAsset(loader, item, assetBaseURL);
|
|
19741
|
+
return this._loadMainAsset(loader, item, remoteAssetBaseURL, assetBaseURL);
|
|
19731
19742
|
};
|
|
19732
|
-
_proto._loadMainAsset = function _loadMainAsset(loader, item, assetBaseURL) {
|
|
19743
|
+
_proto._loadMainAsset = function _loadMainAsset(loader, item, remoteAssetBaseURL, assetBaseURL) {
|
|
19733
19744
|
var _this = this;
|
|
19734
19745
|
item.url = assetBaseURL;
|
|
19735
19746
|
var loadingPromises = this._loadingPromises;
|
|
19736
19747
|
var promise = loader.load(item, this);
|
|
19737
|
-
loadingPromises[
|
|
19748
|
+
loadingPromises[remoteAssetBaseURL] = promise;
|
|
19738
19749
|
promise.then(function(resource) {
|
|
19739
19750
|
if (loader.useCache) {
|
|
19740
|
-
_this._addAsset(
|
|
19751
|
+
_this._addAsset(remoteAssetBaseURL, resource);
|
|
19741
19752
|
}
|
|
19742
|
-
delete loadingPromises[
|
|
19743
|
-
_this._releaseSubAssetPromiseCallback(
|
|
19753
|
+
delete loadingPromises[remoteAssetBaseURL];
|
|
19754
|
+
_this._releaseSubAssetPromiseCallback(remoteAssetBaseURL);
|
|
19744
19755
|
}, function() {
|
|
19745
|
-
delete loadingPromises[
|
|
19746
|
-
_this._releaseSubAssetPromiseCallback(
|
|
19756
|
+
delete loadingPromises[remoteAssetBaseURL];
|
|
19757
|
+
_this._releaseSubAssetPromiseCallback(remoteAssetBaseURL);
|
|
19747
19758
|
});
|
|
19748
19759
|
return promise;
|
|
19749
19760
|
};
|
|
19750
|
-
_proto._createSubAssetPromiseCallback = function _createSubAssetPromiseCallback(
|
|
19761
|
+
_proto._createSubAssetPromiseCallback = function _createSubAssetPromiseCallback(remoteAssetBaseURL, remoteAssetURL, assetSubPath) {
|
|
19751
19762
|
var _this = this;
|
|
19752
|
-
var
|
|
19763
|
+
var _this__subAssetPromiseCallbacks_remoteAssetBaseURL, _subPromiseCallback, _subPromiseCallback1;
|
|
19753
19764
|
var loadingPromises = this._loadingPromises;
|
|
19754
|
-
var subPromiseCallback = (
|
|
19765
|
+
var subPromiseCallback = (_this__subAssetPromiseCallbacks_remoteAssetBaseURL = this._subAssetPromiseCallbacks[remoteAssetBaseURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_remoteAssetBaseURL[assetSubPath];
|
|
19755
19766
|
var resolvedValue = (_subPromiseCallback = subPromiseCallback) == null ? void 0 : _subPromiseCallback.resolvedValue;
|
|
19756
19767
|
var rejectedValue = (_subPromiseCallback1 = subPromiseCallback) == null ? void 0 : _subPromiseCallback1.rejectedValue;
|
|
19757
19768
|
// Already resolved or rejected
|
|
@@ -19766,17 +19777,17 @@ var /** @internal */ PromiseState;
|
|
|
19766
19777
|
}
|
|
19767
19778
|
// Pending
|
|
19768
19779
|
var promise = new AssetPromise(function(resolve, reject) {
|
|
19769
|
-
var _this__subAssetPromiseCallbacks,
|
|
19770
|
-
((_this__subAssetPromiseCallbacks = _this._subAssetPromiseCallbacks)[
|
|
19780
|
+
var _this__subAssetPromiseCallbacks, _remoteAssetBaseURL;
|
|
19781
|
+
((_this__subAssetPromiseCallbacks = _this._subAssetPromiseCallbacks)[_remoteAssetBaseURL = remoteAssetBaseURL] || (_this__subAssetPromiseCallbacks[_remoteAssetBaseURL] = {}))[assetSubPath] = {
|
|
19771
19782
|
resolve: resolve,
|
|
19772
19783
|
reject: reject
|
|
19773
19784
|
};
|
|
19774
19785
|
});
|
|
19775
|
-
loadingPromises[
|
|
19786
|
+
loadingPromises[remoteAssetURL] = promise;
|
|
19776
19787
|
promise.then(function() {
|
|
19777
|
-
delete loadingPromises[
|
|
19788
|
+
delete loadingPromises[remoteAssetURL];
|
|
19778
19789
|
}, function() {
|
|
19779
|
-
return delete loadingPromises[
|
|
19790
|
+
return delete loadingPromises[remoteAssetURL];
|
|
19780
19791
|
});
|
|
19781
19792
|
return promise;
|
|
19782
19793
|
};
|
|
@@ -19849,16 +19860,20 @@ var /** @internal */ PromiseState;
|
|
|
19849
19860
|
if (obj) {
|
|
19850
19861
|
promise = Promise.resolve(obj);
|
|
19851
19862
|
} else {
|
|
19852
|
-
var
|
|
19853
|
-
|
|
19854
|
-
if (!url) {
|
|
19863
|
+
var resourceConfig = this._editorResourceConfig[refId];
|
|
19864
|
+
if (!resourceConfig) {
|
|
19855
19865
|
Logger.warn("refId:" + refId + " is not find in this._editorResourceConfig.");
|
|
19856
19866
|
return Promise.resolve(null);
|
|
19857
19867
|
}
|
|
19858
|
-
|
|
19868
|
+
var remoteUrl = resourceConfig.path;
|
|
19869
|
+
var queryPath = new URL(remoteUrl).search;
|
|
19870
|
+
var url = resourceConfig.virtualPath + queryPath;
|
|
19871
|
+
if (key) {
|
|
19872
|
+
url += (url.indexOf("?") > -1 ? "&" : "?") + "q=" + key;
|
|
19873
|
+
}
|
|
19859
19874
|
promise = this.load({
|
|
19860
19875
|
url: url,
|
|
19861
|
-
type:
|
|
19876
|
+
type: resourceConfig.type
|
|
19862
19877
|
});
|
|
19863
19878
|
}
|
|
19864
19879
|
return promise.then(function(item) {
|
|
@@ -23074,7 +23089,7 @@ var skyProceduralVs = "#define GLSLIFY 1\n#define OUTER_RADIUS 1.025\n#define RA
|
|
|
23074
23089
|
|
|
23075
23090
|
var backgroundTextureFs = "#define GLSLIFY 1\nuniform sampler2D material_BaseTexture;varying vec2 v_uv;void main(){gl_FragColor=texture2D(material_BaseTexture,v_uv);}"; // eslint-disable-line
|
|
23076
23091
|
|
|
23077
|
-
var backgroundTextureVs = "#define GLSLIFY 1\nattribute vec3 POSITION;attribute vec2 TEXCOORD_0;varying vec2 v_uv;void main(){gl_Position=vec4(POSITION,1.0);v_uv=TEXCOORD_0;}"; // eslint-disable-line
|
|
23092
|
+
var backgroundTextureVs = "#define GLSLIFY 1\nattribute vec3 POSITION;attribute vec2 TEXCOORD_0;varying vec2 v_uv;uniform vec4 camera_ProjectionParams;void main(){gl_Position=vec4(POSITION,1.0);gl_Position.y*=camera_ProjectionParams.x;v_uv=TEXCOORD_0;}"; // eslint-disable-line
|
|
23078
23093
|
|
|
23079
23094
|
var blinnPhongFs = "#define GLSLIFY 1\n#include <common>\n#include <camera_declare>\n#include <uv_share>\n#include <normal_share>\n#include <color_share>\n#include <worldpos_share>\n#include <light_frag_define>\n#include <ShadowFragmentDeclaration>\n#include <mobile_material_frag>\n#include <FogFragmentDeclaration>\n#include <normal_get>\nvoid main(){\n#include <begin_mobile_frag>\n#include <begin_viewdir_frag>\n#include <mobile_blinnphong_frag>\ngl_FragColor=emission+ambient+diffuse+specular;\n#ifdef MATERIAL_IS_TRANSPARENT\ngl_FragColor.a=diffuse.a;\n#else\ngl_FragColor.a=1.0;\n#endif\n#include <FogFragment>\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\ngl_FragColor=linearToGamma(gl_FragColor);\n#endif\n}"; // eslint-disable-line
|
|
23080
23095
|
|
|
@@ -23086,7 +23101,7 @@ var depthOnlyVs = "#define GLSLIFY 1\n#include <common>\n#include <common_vert>\
|
|
|
23086
23101
|
|
|
23087
23102
|
var particleFs = "#define GLSLIFY 1\n#include <common>\nvarying vec4 v_Color;varying vec2 v_TextureCoordinate;uniform sampler2D material_BaseTexture;uniform vec4 material_BaseColor;\n#ifdef RENDERER_MODE_MESH\nvarying vec4 v_MeshColor;\n#endif\nvoid main(){vec4 color=material_BaseColor*v_Color;\n#ifdef RENDERER_MODE_MESH\ncolor*=v_MeshColor;\n#endif\n#ifdef MATERIAL_HAS_BASETEXTURE\nvec4 textureColor=texture2D(material_BaseTexture,v_TextureCoordinate);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\ntextureColor=gammaToLinear(textureColor);\n#endif\ncolor*=textureColor;\n#endif\ngl_FragColor=color;\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\ngl_FragColor=linearToGamma(gl_FragColor);\n#endif\n}"; // eslint-disable-line
|
|
23088
23103
|
|
|
23089
|
-
var particleVs = "#define GLSLIFY 1\n#if defined(RENDERER_MODE_SPHERE_BILLBOARD) || defined(RENDERER_MODE_STRETCHED_BILLBOARD) || defined(RENDERER_MODE_HORIZONTAL_BILLBOARD) || defined(RENDERER_MODE_VERTICAL_BILLBOARD)\nattribute vec4 a_CornerTextureCoordinate;\n#endif\n#ifdef RENDERER_MODE_MESH\nattribute vec3 a_MeshPosition;attribute vec4 a_MeshColor;attribute vec2 a_MeshTextureCoordinate;varying vec4 v_MeshColor;\n#endif\nattribute vec4 a_ShapePositionStartLifeTime;attribute vec4 a_DirectionTime;attribute vec4 a_StartColor;attribute vec3 a_StartSize;attribute vec3 a_StartRotation0;attribute float a_StartSpeed;attribute vec4 a_Random0;\n#if defined(RENDERER_TSA_FRAME_RANDOM_CURVES) || defined(RENDERER_VOL_RANDOM_CONSTANT) || defined(RENDERER_VOL_RANDOM_CURVE)\nattribute vec4 a_Random1;\n#endif\nattribute vec3 a_SimulationWorldPosition;attribute vec4 a_SimulationWorldRotation;varying vec4 v_Color;\n#ifdef MATERIAL_HAS_BASETEXTURE\nattribute vec4 a_SimulationUV;varying vec2 v_TextureCoordinate;\n#endif\nuniform float renderer_CurrentTime;uniform vec3 renderer_Gravity;uniform vec2 u_DragConstant;uniform vec3 renderer_WorldPosition;uniform vec4 renderer_WorldRotation;uniform bool renderer_ThreeDStartRotation;uniform int renderer_ScalingMode;uniform vec3 renderer_PositionScale;uniform vec3 renderer_SizeScale;uniform vec3 renderer_PivotOffset;uniform mat4 camera_ViewMat;uniform mat4 camera_ProjMat;\n#ifdef RENDERER_MODE_STRETCHED_BILLBOARD\nuniform vec3 camera_Position;\n#endif\nuniform vec3 camera_Forward;uniform vec3 camera_Up;uniform float renderer_StretchedBillboardLengthScale;uniform float renderer_StretchedBillboardSpeedScale;uniform int renderer_SimulationSpace;\n#include <particle_common>\n#include <velocity_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>\nvoid main(){float age=renderer_CurrentTime-a_DirectionTime.w;float normalizedAge=age/a_ShapePositionStartLifeTime.w;vec3 lifeVelocity;if(normalizedAge<1.0){vec3 startVelocity=a_DirectionTime.xyz*a_StartSpeed;\n#if defined(RENDERER_VOL_CONSTANT) || defined(RENDERER_VOL_CURVE) || defined(RENDERER_VOL_RANDOM_CONSTANT) || defined(RENDERER_VOL_RANDOM_CURVE)\nlifeVelocity=computeParticleLifeVelocity(normalizedAge);\n#endif\nvec3 gravityVelocity=renderer_Gravity*age;vec4 worldRotation;if(renderer_SimulationSpace==0){worldRotation=renderer_WorldRotation;}else{worldRotation=a_SimulationWorldRotation;}vec3 dragData=a_DirectionTime.xyz*mix(u_DragConstant.x,u_DragConstant.y,a_Random0.x);vec3 center=computeParticlePosition(startVelocity,lifeVelocity,age,normalizedAge,gravityVelocity,worldRotation,dragData);\n#include <sphere_billboard>\n#include <stretched_billboard>\n#include <horizontal_billboard>\n#include <vertical_billboard>\n#include <particle_mesh>\ngl_Position=camera_ProjMat*camera_ViewMat*vec4(center,1.0);v_Color=computeParticleColor(a_StartColor,normalizedAge);\n#ifdef MATERIAL_HAS_BASETEXTURE\nvec2 simulateUV;\n#if defined(RENDERER_MODE_SPHERE_BILLBOARD) || defined(RENDERER_MODE_STRETCHED_BILLBOARD) || defined(RENDERER_MODE_HORIZONTAL_BILLBOARD) || defined(RENDERER_MODE_VERTICAL_BILLBOARD)\nsimulateUV=a_CornerTextureCoordinate.zw*a_SimulationUV.xy+a_SimulationUV.zw;v_TextureCoordinate=computeParticleUV(simulateUV,normalizedAge);\n#endif\n#ifdef RENDERER_MODE_MESH\nsimulateUV=a_SimulationUV.xy+a_MeshTextureCoordinate*a_SimulationUV.zw;v_TextureCoordinate=computeParticleUV(simulateUV,normalizedAge);\n#endif\n#endif\n}else{gl_Position=vec4(2.0,2.0,2.0,1.0);}}"; // eslint-disable-line
|
|
23104
|
+
var particleVs = "#define GLSLIFY 1\n#if defined(RENDERER_MODE_SPHERE_BILLBOARD) || defined(RENDERER_MODE_STRETCHED_BILLBOARD) || defined(RENDERER_MODE_HORIZONTAL_BILLBOARD) || defined(RENDERER_MODE_VERTICAL_BILLBOARD)\nattribute vec4 a_CornerTextureCoordinate;\n#endif\n#ifdef RENDERER_MODE_MESH\nattribute vec3 a_MeshPosition;attribute vec4 a_MeshColor;attribute vec2 a_MeshTextureCoordinate;varying vec4 v_MeshColor;\n#endif\nattribute vec4 a_ShapePositionStartLifeTime;attribute vec4 a_DirectionTime;attribute vec4 a_StartColor;attribute vec3 a_StartSize;attribute vec3 a_StartRotation0;attribute float a_StartSpeed;attribute vec4 a_Random0;\n#if defined(RENDERER_TSA_FRAME_RANDOM_CURVES) || defined(RENDERER_VOL_RANDOM_CONSTANT) || defined(RENDERER_VOL_RANDOM_CURVE)\nattribute vec4 a_Random1;\n#endif\nattribute vec3 a_SimulationWorldPosition;attribute vec4 a_SimulationWorldRotation;varying vec4 v_Color;\n#ifdef MATERIAL_HAS_BASETEXTURE\nattribute vec4 a_SimulationUV;varying vec2 v_TextureCoordinate;\n#endif\nuniform float renderer_CurrentTime;uniform vec3 renderer_Gravity;uniform vec2 u_DragConstant;uniform vec3 renderer_WorldPosition;uniform vec4 renderer_WorldRotation;uniform bool renderer_ThreeDStartRotation;uniform int renderer_ScalingMode;uniform vec3 renderer_PositionScale;uniform vec3 renderer_SizeScale;uniform vec3 renderer_PivotOffset;uniform mat4 camera_ViewMat;uniform mat4 camera_ProjMat;\n#ifdef RENDERER_MODE_STRETCHED_BILLBOARD\nuniform vec3 camera_Position;\n#endif\nuniform vec3 camera_Forward;uniform vec3 camera_Up;uniform float renderer_StretchedBillboardLengthScale;uniform float renderer_StretchedBillboardSpeedScale;uniform int renderer_SimulationSpace;\n#include <particle_common>\n#include <velocity_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>\nvoid main(){float age=renderer_CurrentTime-a_DirectionTime.w;float normalizedAge=age/a_ShapePositionStartLifeTime.w;vec3 lifeVelocity;if(normalizedAge<1.0){vec3 startVelocity=a_DirectionTime.xyz*a_StartSpeed;\n#if defined(RENDERER_VOL_CONSTANT) || defined(RENDERER_VOL_CURVE) || defined(RENDERER_VOL_RANDOM_CONSTANT) || defined(RENDERER_VOL_RANDOM_CURVE)\nlifeVelocity=computeParticleLifeVelocity(normalizedAge);\n#endif\nvec3 gravityVelocity=renderer_Gravity*a_Random0.x*age;vec4 worldRotation;if(renderer_SimulationSpace==0){worldRotation=renderer_WorldRotation;}else{worldRotation=a_SimulationWorldRotation;}vec3 dragData=a_DirectionTime.xyz*mix(u_DragConstant.x,u_DragConstant.y,a_Random0.x);vec3 center=computeParticlePosition(startVelocity,lifeVelocity,age,normalizedAge,gravityVelocity,worldRotation,dragData);\n#include <sphere_billboard>\n#include <stretched_billboard>\n#include <horizontal_billboard>\n#include <vertical_billboard>\n#include <particle_mesh>\ngl_Position=camera_ProjMat*camera_ViewMat*vec4(center,1.0);v_Color=computeParticleColor(a_StartColor,normalizedAge);\n#ifdef MATERIAL_HAS_BASETEXTURE\nvec2 simulateUV;\n#if defined(RENDERER_MODE_SPHERE_BILLBOARD) || defined(RENDERER_MODE_STRETCHED_BILLBOARD) || defined(RENDERER_MODE_HORIZONTAL_BILLBOARD) || defined(RENDERER_MODE_VERTICAL_BILLBOARD)\nsimulateUV=a_CornerTextureCoordinate.zw*a_SimulationUV.xy+a_SimulationUV.zw;v_TextureCoordinate=computeParticleUV(simulateUV,normalizedAge);\n#endif\n#ifdef RENDERER_MODE_MESH\nsimulateUV=a_SimulationUV.xy+a_MeshTextureCoordinate*a_SimulationUV.zw;v_TextureCoordinate=computeParticleUV(simulateUV,normalizedAge);\n#endif\n#endif\n}else{gl_Position=vec4(2.0,2.0,2.0,1.0);}}"; // eslint-disable-line
|
|
23090
23105
|
|
|
23091
23106
|
var pbrSpecularFs = "#define GLSLIFY 1\n#include <common>\n#include <camera_declare>\n#include <FogFragmentDeclaration>\n#include <uv_share>\n#include <normal_share>\n#include <color_share>\n#include <worldpos_share>\n#include <light_frag_define>\n#include <pbr_frag_define>\n#include <pbr_helper>\nvoid main(){\n#include <pbr_frag>\n#include <FogFragment>\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\ngl_FragColor=linearToGamma(gl_FragColor);\n#endif\n}"; // eslint-disable-line
|
|
23092
23107
|
|
|
@@ -26466,8 +26481,13 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
26466
26481
|
*/ var Loader = /*#__PURE__*/ function() {
|
|
26467
26482
|
function Loader(useCache) {
|
|
26468
26483
|
this.useCache = useCache;
|
|
26469
|
-
this.request = request;
|
|
26470
26484
|
}
|
|
26485
|
+
var _proto = Loader.prototype;
|
|
26486
|
+
_proto.request = function request1(url, resourceManager, config) {
|
|
26487
|
+
var _resourceManager__virtualPathMap_url;
|
|
26488
|
+
var remoteUrl = (_resourceManager__virtualPathMap_url = resourceManager._virtualPathMap[url]) != null ? _resourceManager__virtualPathMap_url : url;
|
|
26489
|
+
return request(remoteUrl, config);
|
|
26490
|
+
};
|
|
26471
26491
|
/**
|
|
26472
26492
|
* Register a class with a string name for serialization and deserialization.
|
|
26473
26493
|
* @param key - class name
|
|
@@ -31444,6 +31464,7 @@ __decorate([
|
|
|
31444
31464
|
|
|
31445
31465
|
var MainModule = /*#__PURE__*/ function() {
|
|
31446
31466
|
function MainModule(generator) {
|
|
31467
|
+
this._tempVector40 = new Vector4();
|
|
31447
31468
|
/** The duration of the Particle Generator in seconds. */ this.duration = 5.0;
|
|
31448
31469
|
/** Specifies whether the Particle Generator loops. */ this.isLoop = true;
|
|
31449
31470
|
/** Start delay in seconds. */ this.startDelay = new ParticleCompositeCurve(0);
|
|
@@ -31465,7 +31486,6 @@ var MainModule = /*#__PURE__*/ function() {
|
|
|
31465
31486
|
this._gravityModifierRand = new Rand(0, ParticleRandomSubSeeds.GravityModifier);
|
|
31466
31487
|
this._startSize3D = false;
|
|
31467
31488
|
this._simulationSpace = ParticleSimulationSpace.Local;
|
|
31468
|
-
this._gravity = new Vector3();
|
|
31469
31489
|
this._generator = generator;
|
|
31470
31490
|
this.startLifetime = new ParticleCompositeCurve(5);
|
|
31471
31491
|
this.startSpeed = new ParticleCompositeCurve(5);
|
|
@@ -31505,8 +31525,7 @@ var MainModule = /*#__PURE__*/ function() {
|
|
|
31505
31525
|
case ParticleSimulationSpace.Local:
|
|
31506
31526
|
shaderData.setVector3(MainModule._worldPosition, transform.worldPosition);
|
|
31507
31527
|
var worldRotation = transform.worldRotationQuaternion;
|
|
31508
|
-
var worldRotationV4 =
|
|
31509
|
-
worldRotationV4.copyFrom(worldRotation);
|
|
31528
|
+
var worldRotationV4 = this._tempVector40.copyFrom(worldRotation); // Maybe shaderData should support Quaternion
|
|
31510
31529
|
shaderData.setVector4(MainModule._worldRotation, worldRotationV4);
|
|
31511
31530
|
break;
|
|
31512
31531
|
case ParticleSimulationSpace.World:
|
|
@@ -31530,10 +31549,7 @@ var MainModule = /*#__PURE__*/ function() {
|
|
|
31530
31549
|
shaderData.setVector3(MainModule._sizeScale, MainModule._vector3One);
|
|
31531
31550
|
break;
|
|
31532
31551
|
}
|
|
31533
|
-
|
|
31534
|
-
var gravityModifierValue = this.gravityModifier.evaluate(undefined, this._gravityModifierRand.random());
|
|
31535
|
-
Vector3.scale(renderer.scene.physics.gravity, gravityModifierValue, particleGravity);
|
|
31536
|
-
shaderData.setVector3(MainModule._gravity, particleGravity);
|
|
31552
|
+
shaderData.setVector3(MainModule._gravity, renderer.scene.physics.gravity);
|
|
31537
31553
|
shaderData.setInt(MainModule._simulationSpace, this.simulationSpace);
|
|
31538
31554
|
shaderData.setFloat(MainModule._startRotation3D, +this.startRotation3D);
|
|
31539
31555
|
shaderData.setInt(MainModule._scaleMode, this.scalingMode);
|
|
@@ -31701,9 +31717,6 @@ var MainModule = /*#__PURE__*/ function() {
|
|
|
31701
31717
|
]);
|
|
31702
31718
|
return MainModule;
|
|
31703
31719
|
}();
|
|
31704
|
-
(function() {
|
|
31705
|
-
MainModule._tempVector40 = new Vector4();
|
|
31706
|
-
})();
|
|
31707
31720
|
(function() {
|
|
31708
31721
|
MainModule._vector3One = new Vector3(1, 1, 1);
|
|
31709
31722
|
})();
|
|
@@ -31788,9 +31801,6 @@ __decorate([
|
|
|
31788
31801
|
__decorate([
|
|
31789
31802
|
ignoreClone
|
|
31790
31803
|
], MainModule.prototype, "_generator", void 0);
|
|
31791
|
-
__decorate([
|
|
31792
|
-
ignoreClone
|
|
31793
|
-
], MainModule.prototype, "_gravity", void 0);
|
|
31794
31804
|
|
|
31795
31805
|
/**
|
|
31796
31806
|
* Rotate particles throughout their lifetime.
|
|
@@ -33060,8 +33070,15 @@ __decorate([
|
|
|
33060
33070
|
}
|
|
33061
33071
|
// Start speed
|
|
33062
33072
|
instanceVertices[offset + 18] = startSpeed;
|
|
33063
|
-
//
|
|
33064
|
-
|
|
33073
|
+
// Gravity, unused, size, rotation
|
|
33074
|
+
switch(main.gravityModifier.mode){
|
|
33075
|
+
case ParticleCurveMode.Constant:
|
|
33076
|
+
instanceVertices[offset + 19] = main.gravityModifier.constant;
|
|
33077
|
+
break;
|
|
33078
|
+
case ParticleCurveMode.TwoConstants:
|
|
33079
|
+
instanceVertices[offset + 19] = main.gravityModifier.evaluate(undefined, main._gravityModifierRand.random());
|
|
33080
|
+
break;
|
|
33081
|
+
}
|
|
33065
33082
|
var colorOverLifetime = this.colorOverLifetime;
|
|
33066
33083
|
if (colorOverLifetime.enabled && colorOverLifetime.color.mode === ParticleGradientMode.TwoGradients) {
|
|
33067
33084
|
instanceVertices[offset + 20] = colorOverLifetime._colorGradientRand.random();
|