@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/main.js
CHANGED
|
@@ -638,6 +638,11 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
638
638
|
if (Utils.isBase64Url(relativeUrl)) {
|
|
639
639
|
return relativeUrl;
|
|
640
640
|
}
|
|
641
|
+
if (!/^https?:/.test(baseUrl)) {
|
|
642
|
+
var fileSchema = "files://";
|
|
643
|
+
baseUrl = fileSchema + baseUrl;
|
|
644
|
+
return new URL(relativeUrl, baseUrl).href.substring(fileSchema.length);
|
|
645
|
+
}
|
|
641
646
|
return relativeUrl ? new URL(relativeUrl, baseUrl).href : baseUrl;
|
|
642
647
|
};
|
|
643
648
|
/**
|
|
@@ -2252,7 +2257,7 @@ var size_over_lifetime_module = "#define GLSLIFY 1\n#ifdef RENDERER_SOL_CURVE_MO
|
|
|
2252
2257
|
|
|
2253
2258
|
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
|
|
2254
2259
|
|
|
2255
|
-
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
|
|
2260
|
+
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
|
|
2256
2261
|
|
|
2257
2262
|
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
|
|
2258
2263
|
|
|
@@ -10332,7 +10337,7 @@ var /**
|
|
|
10332
10337
|
if (background.mode === exports.BackgroundMode.Sky) {
|
|
10333
10338
|
background.sky._render(context);
|
|
10334
10339
|
} else if (background.mode === exports.BackgroundMode.Texture && background.texture) {
|
|
10335
|
-
this._drawBackgroundTexture(
|
|
10340
|
+
this._drawBackgroundTexture(camera, background);
|
|
10336
10341
|
}
|
|
10337
10342
|
}
|
|
10338
10343
|
// Copy opaque texture
|
|
@@ -10428,7 +10433,8 @@ var /**
|
|
|
10428
10433
|
renderElement.renderQueueFlags |= flag;
|
|
10429
10434
|
}
|
|
10430
10435
|
};
|
|
10431
|
-
_proto._drawBackgroundTexture = function _drawBackgroundTexture(
|
|
10436
|
+
_proto._drawBackgroundTexture = function _drawBackgroundTexture(camera, background) {
|
|
10437
|
+
var engine = camera.engine;
|
|
10432
10438
|
var rhi = engine._hardwareRenderer;
|
|
10433
10439
|
var canvas = engine.canvas;
|
|
10434
10440
|
var material = background._material, mesh = background._mesh;
|
|
@@ -10440,6 +10446,7 @@ var /**
|
|
|
10440
10446
|
var program = pass._getShaderProgram(engine, Shader._compileMacros);
|
|
10441
10447
|
program.bind();
|
|
10442
10448
|
program.uploadAll(program.materialUniformBlock, material.shaderData);
|
|
10449
|
+
program.uploadAll(program.cameraUniformBlock, camera.shaderData);
|
|
10443
10450
|
program.uploadUnGroupTextures();
|
|
10444
10451
|
(pass._renderState || material.renderState)._applyStates(engine, false, pass._renderStateDataMap, material.shaderData);
|
|
10445
10452
|
rhi.drawPrimitive(mesh._primitive, mesh.subMesh, program);
|
|
@@ -19060,6 +19067,7 @@ var ObjectPool = /*#__PURE__*/ function() {
|
|
|
19060
19067
|
AssetType[/** 2D Texture. */ "Texture2D"] = "Texture2D";
|
|
19061
19068
|
AssetType[/** Cube Texture. */ "TextureCube"] = "TextureCube";
|
|
19062
19069
|
AssetType[/** Material. */ "Material"] = "Material";
|
|
19070
|
+
AssetType[/** Shader. */ "Shader"] = "Shader";
|
|
19063
19071
|
AssetType[/** Mesh. */ "Mesh"] = "Mesh";
|
|
19064
19072
|
AssetType[/** AnimationClip. */ "AnimationClip"] = "AnimationClip";
|
|
19065
19073
|
AssetType[/** AnimatorController. */ "AnimatorController"] = "AnimatorController";
|
|
@@ -19552,14 +19560,16 @@ var /** @internal */ PromiseState;
|
|
|
19552
19560
|
/**
|
|
19553
19561
|
* @internal
|
|
19554
19562
|
*/ _proto._onSubAssetSuccess = function _onSubAssetSuccess(assetBaseURL, assetSubPath, value) {
|
|
19555
|
-
var
|
|
19556
|
-
var
|
|
19563
|
+
var _this__subAssetPromiseCallbacks_remoteAssetBaseURL;
|
|
19564
|
+
var _this__virtualPathMap_assetBaseURL;
|
|
19565
|
+
var remoteAssetBaseURL = (_this__virtualPathMap_assetBaseURL = this._virtualPathMap[assetBaseURL]) != null ? _this__virtualPathMap_assetBaseURL : assetBaseURL;
|
|
19566
|
+
var subPromiseCallback = (_this__subAssetPromiseCallbacks_remoteAssetBaseURL = this._subAssetPromiseCallbacks[remoteAssetBaseURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_remoteAssetBaseURL[assetSubPath];
|
|
19557
19567
|
if (subPromiseCallback) {
|
|
19558
19568
|
subPromiseCallback.resolve(value);
|
|
19559
19569
|
} else {
|
|
19560
19570
|
var // Pending
|
|
19561
|
-
_this__subAssetPromiseCallbacks,
|
|
19562
|
-
((_this__subAssetPromiseCallbacks = this._subAssetPromiseCallbacks)[
|
|
19571
|
+
_this__subAssetPromiseCallbacks, _remoteAssetBaseURL;
|
|
19572
|
+
((_this__subAssetPromiseCallbacks = this._subAssetPromiseCallbacks)[_remoteAssetBaseURL = remoteAssetBaseURL] || (_this__subAssetPromiseCallbacks[_remoteAssetBaseURL] = {}))[assetSubPath] = {
|
|
19563
19573
|
resolvedValue: value
|
|
19564
19574
|
};
|
|
19565
19575
|
}
|
|
@@ -19681,33 +19691,34 @@ var /** @internal */ PromiseState;
|
|
|
19681
19691
|
var item = this._assignDefaultOptions(typeof itemOrURL === "string" ? {
|
|
19682
19692
|
url: itemOrURL
|
|
19683
19693
|
} : itemOrURL);
|
|
19684
|
-
|
|
19685
|
-
var itemURL = item.url;
|
|
19686
|
-
var url = this._virtualPathMap[itemURL] ? this._virtualPathMap[itemURL] : itemURL;
|
|
19694
|
+
var url = item.url;
|
|
19687
19695
|
// Not absolute and base url is set
|
|
19688
19696
|
if (!Utils.isAbsoluteUrl(url) && this.baseUrl) url = Utils.resolveAbsoluteUrl(this.baseUrl, url);
|
|
19689
19697
|
// Parse url
|
|
19690
19698
|
var _this__parseURL = this._parseURL(url), assetBaseURL = _this__parseURL.assetBaseURL, queryPath = _this__parseURL.queryPath;
|
|
19691
19699
|
var paths = queryPath ? this._parseQueryPath(queryPath) : [];
|
|
19700
|
+
var _this__virtualPathMap_assetBaseURL;
|
|
19701
|
+
// Get remote asset base url
|
|
19702
|
+
var remoteAssetBaseURL = (_this__virtualPathMap_assetBaseURL = this._virtualPathMap[assetBaseURL]) != null ? _this__virtualPathMap_assetBaseURL : assetBaseURL;
|
|
19692
19703
|
// Check cache
|
|
19693
|
-
var cacheObject = this._assetUrlPool[
|
|
19704
|
+
var cacheObject = this._assetUrlPool[remoteAssetBaseURL];
|
|
19694
19705
|
if (cacheObject) {
|
|
19695
19706
|
return new AssetPromise(function(resolve) {
|
|
19696
19707
|
resolve(_this._getResolveResource(cacheObject, paths));
|
|
19697
19708
|
});
|
|
19698
19709
|
}
|
|
19699
19710
|
// Get asset url
|
|
19700
|
-
var
|
|
19711
|
+
var remoteAssetURL = remoteAssetBaseURL;
|
|
19701
19712
|
if (queryPath) {
|
|
19702
|
-
|
|
19713
|
+
remoteAssetURL += "?q=" + paths.shift();
|
|
19703
19714
|
var index;
|
|
19704
19715
|
while(index = paths.shift()){
|
|
19705
|
-
|
|
19716
|
+
remoteAssetURL += "[" + index + "]";
|
|
19706
19717
|
}
|
|
19707
19718
|
}
|
|
19708
19719
|
// Check is loading
|
|
19709
19720
|
var loadingPromises = this._loadingPromises;
|
|
19710
|
-
var loadingPromise = loadingPromises[
|
|
19721
|
+
var loadingPromise = loadingPromises[remoteAssetURL];
|
|
19711
19722
|
if (loadingPromise) {
|
|
19712
19723
|
return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
19713
19724
|
loadingPromise.onProgress(setTaskCompleteProgress, setTaskDetailProgress).then(function(resource) {
|
|
@@ -19725,37 +19736,37 @@ var /** @internal */ PromiseState;
|
|
|
19725
19736
|
// Check sub asset
|
|
19726
19737
|
if (queryPath) {
|
|
19727
19738
|
// Check whether load main asset
|
|
19728
|
-
var mainPromise = loadingPromises[
|
|
19739
|
+
var mainPromise = loadingPromises[remoteAssetBaseURL] || this._loadMainAsset(loader, item, remoteAssetBaseURL, assetBaseURL);
|
|
19729
19740
|
mainPromise.catch(function(e) {
|
|
19730
|
-
_this._onSubAssetFail(
|
|
19741
|
+
_this._onSubAssetFail(remoteAssetBaseURL, queryPath, e);
|
|
19731
19742
|
});
|
|
19732
|
-
return this._createSubAssetPromiseCallback(
|
|
19743
|
+
return this._createSubAssetPromiseCallback(remoteAssetBaseURL, remoteAssetURL, queryPath);
|
|
19733
19744
|
}
|
|
19734
|
-
return this._loadMainAsset(loader, item, assetBaseURL);
|
|
19745
|
+
return this._loadMainAsset(loader, item, remoteAssetBaseURL, assetBaseURL);
|
|
19735
19746
|
};
|
|
19736
|
-
_proto._loadMainAsset = function _loadMainAsset(loader, item, assetBaseURL) {
|
|
19747
|
+
_proto._loadMainAsset = function _loadMainAsset(loader, item, remoteAssetBaseURL, assetBaseURL) {
|
|
19737
19748
|
var _this = this;
|
|
19738
19749
|
item.url = assetBaseURL;
|
|
19739
19750
|
var loadingPromises = this._loadingPromises;
|
|
19740
19751
|
var promise = loader.load(item, this);
|
|
19741
|
-
loadingPromises[
|
|
19752
|
+
loadingPromises[remoteAssetBaseURL] = promise;
|
|
19742
19753
|
promise.then(function(resource) {
|
|
19743
19754
|
if (loader.useCache) {
|
|
19744
|
-
_this._addAsset(
|
|
19755
|
+
_this._addAsset(remoteAssetBaseURL, resource);
|
|
19745
19756
|
}
|
|
19746
|
-
delete loadingPromises[
|
|
19747
|
-
_this._releaseSubAssetPromiseCallback(
|
|
19757
|
+
delete loadingPromises[remoteAssetBaseURL];
|
|
19758
|
+
_this._releaseSubAssetPromiseCallback(remoteAssetBaseURL);
|
|
19748
19759
|
}, function() {
|
|
19749
|
-
delete loadingPromises[
|
|
19750
|
-
_this._releaseSubAssetPromiseCallback(
|
|
19760
|
+
delete loadingPromises[remoteAssetBaseURL];
|
|
19761
|
+
_this._releaseSubAssetPromiseCallback(remoteAssetBaseURL);
|
|
19751
19762
|
});
|
|
19752
19763
|
return promise;
|
|
19753
19764
|
};
|
|
19754
|
-
_proto._createSubAssetPromiseCallback = function _createSubAssetPromiseCallback(
|
|
19765
|
+
_proto._createSubAssetPromiseCallback = function _createSubAssetPromiseCallback(remoteAssetBaseURL, remoteAssetURL, assetSubPath) {
|
|
19755
19766
|
var _this = this;
|
|
19756
|
-
var
|
|
19767
|
+
var _this__subAssetPromiseCallbacks_remoteAssetBaseURL, _subPromiseCallback, _subPromiseCallback1;
|
|
19757
19768
|
var loadingPromises = this._loadingPromises;
|
|
19758
|
-
var subPromiseCallback = (
|
|
19769
|
+
var subPromiseCallback = (_this__subAssetPromiseCallbacks_remoteAssetBaseURL = this._subAssetPromiseCallbacks[remoteAssetBaseURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_remoteAssetBaseURL[assetSubPath];
|
|
19759
19770
|
var resolvedValue = (_subPromiseCallback = subPromiseCallback) == null ? void 0 : _subPromiseCallback.resolvedValue;
|
|
19760
19771
|
var rejectedValue = (_subPromiseCallback1 = subPromiseCallback) == null ? void 0 : _subPromiseCallback1.rejectedValue;
|
|
19761
19772
|
// Already resolved or rejected
|
|
@@ -19770,17 +19781,17 @@ var /** @internal */ PromiseState;
|
|
|
19770
19781
|
}
|
|
19771
19782
|
// Pending
|
|
19772
19783
|
var promise = new AssetPromise(function(resolve, reject) {
|
|
19773
|
-
var _this__subAssetPromiseCallbacks,
|
|
19774
|
-
((_this__subAssetPromiseCallbacks = _this._subAssetPromiseCallbacks)[
|
|
19784
|
+
var _this__subAssetPromiseCallbacks, _remoteAssetBaseURL;
|
|
19785
|
+
((_this__subAssetPromiseCallbacks = _this._subAssetPromiseCallbacks)[_remoteAssetBaseURL = remoteAssetBaseURL] || (_this__subAssetPromiseCallbacks[_remoteAssetBaseURL] = {}))[assetSubPath] = {
|
|
19775
19786
|
resolve: resolve,
|
|
19776
19787
|
reject: reject
|
|
19777
19788
|
};
|
|
19778
19789
|
});
|
|
19779
|
-
loadingPromises[
|
|
19790
|
+
loadingPromises[remoteAssetURL] = promise;
|
|
19780
19791
|
promise.then(function() {
|
|
19781
|
-
delete loadingPromises[
|
|
19792
|
+
delete loadingPromises[remoteAssetURL];
|
|
19782
19793
|
}, function() {
|
|
19783
|
-
return delete loadingPromises[
|
|
19794
|
+
return delete loadingPromises[remoteAssetURL];
|
|
19784
19795
|
});
|
|
19785
19796
|
return promise;
|
|
19786
19797
|
};
|
|
@@ -19853,16 +19864,20 @@ var /** @internal */ PromiseState;
|
|
|
19853
19864
|
if (obj) {
|
|
19854
19865
|
promise = Promise.resolve(obj);
|
|
19855
19866
|
} else {
|
|
19856
|
-
var
|
|
19857
|
-
|
|
19858
|
-
if (!url) {
|
|
19867
|
+
var resourceConfig = this._editorResourceConfig[refId];
|
|
19868
|
+
if (!resourceConfig) {
|
|
19859
19869
|
Logger.warn("refId:" + refId + " is not find in this._editorResourceConfig.");
|
|
19860
19870
|
return Promise.resolve(null);
|
|
19861
19871
|
}
|
|
19862
|
-
|
|
19872
|
+
var remoteUrl = resourceConfig.path;
|
|
19873
|
+
var queryPath = new URL(remoteUrl).search;
|
|
19874
|
+
var url = resourceConfig.virtualPath + queryPath;
|
|
19875
|
+
if (key) {
|
|
19876
|
+
url += (url.indexOf("?") > -1 ? "&" : "?") + "q=" + key;
|
|
19877
|
+
}
|
|
19863
19878
|
promise = this.load({
|
|
19864
19879
|
url: url,
|
|
19865
|
-
type:
|
|
19880
|
+
type: resourceConfig.type
|
|
19866
19881
|
});
|
|
19867
19882
|
}
|
|
19868
19883
|
return promise.then(function(item) {
|
|
@@ -23078,7 +23093,7 @@ var skyProceduralVs = "#define GLSLIFY 1\n#define OUTER_RADIUS 1.025\n#define RA
|
|
|
23078
23093
|
|
|
23079
23094
|
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
|
|
23080
23095
|
|
|
23081
|
-
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
|
|
23096
|
+
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
|
|
23082
23097
|
|
|
23083
23098
|
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
|
|
23084
23099
|
|
|
@@ -23090,7 +23105,7 @@ var depthOnlyVs = "#define GLSLIFY 1\n#include <common>\n#include <common_vert>\
|
|
|
23090
23105
|
|
|
23091
23106
|
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
|
|
23092
23107
|
|
|
23093
|
-
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
|
|
23108
|
+
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
|
|
23094
23109
|
|
|
23095
23110
|
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
|
|
23096
23111
|
|
|
@@ -26470,8 +26485,13 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
26470
26485
|
*/ var Loader = /*#__PURE__*/ function() {
|
|
26471
26486
|
function Loader(useCache) {
|
|
26472
26487
|
this.useCache = useCache;
|
|
26473
|
-
this.request = request;
|
|
26474
26488
|
}
|
|
26489
|
+
var _proto = Loader.prototype;
|
|
26490
|
+
_proto.request = function request1(url, resourceManager, config) {
|
|
26491
|
+
var _resourceManager__virtualPathMap_url;
|
|
26492
|
+
var remoteUrl = (_resourceManager__virtualPathMap_url = resourceManager._virtualPathMap[url]) != null ? _resourceManager__virtualPathMap_url : url;
|
|
26493
|
+
return request(remoteUrl, config);
|
|
26494
|
+
};
|
|
26475
26495
|
/**
|
|
26476
26496
|
* Register a class with a string name for serialization and deserialization.
|
|
26477
26497
|
* @param key - class name
|
|
@@ -31448,6 +31468,7 @@ __decorate([
|
|
|
31448
31468
|
|
|
31449
31469
|
var MainModule = /*#__PURE__*/ function() {
|
|
31450
31470
|
function MainModule(generator) {
|
|
31471
|
+
this._tempVector40 = new engineMath.Vector4();
|
|
31451
31472
|
/** The duration of the Particle Generator in seconds. */ this.duration = 5.0;
|
|
31452
31473
|
/** Specifies whether the Particle Generator loops. */ this.isLoop = true;
|
|
31453
31474
|
/** Start delay in seconds. */ this.startDelay = new ParticleCompositeCurve(0);
|
|
@@ -31469,7 +31490,6 @@ var MainModule = /*#__PURE__*/ function() {
|
|
|
31469
31490
|
this._gravityModifierRand = new engineMath.Rand(0, ParticleRandomSubSeeds.GravityModifier);
|
|
31470
31491
|
this._startSize3D = false;
|
|
31471
31492
|
this._simulationSpace = exports.ParticleSimulationSpace.Local;
|
|
31472
|
-
this._gravity = new engineMath.Vector3();
|
|
31473
31493
|
this._generator = generator;
|
|
31474
31494
|
this.startLifetime = new ParticleCompositeCurve(5);
|
|
31475
31495
|
this.startSpeed = new ParticleCompositeCurve(5);
|
|
@@ -31509,8 +31529,7 @@ var MainModule = /*#__PURE__*/ function() {
|
|
|
31509
31529
|
case exports.ParticleSimulationSpace.Local:
|
|
31510
31530
|
shaderData.setVector3(MainModule._worldPosition, transform.worldPosition);
|
|
31511
31531
|
var worldRotation = transform.worldRotationQuaternion;
|
|
31512
|
-
var worldRotationV4 =
|
|
31513
|
-
worldRotationV4.copyFrom(worldRotation);
|
|
31532
|
+
var worldRotationV4 = this._tempVector40.copyFrom(worldRotation); // Maybe shaderData should support Quaternion
|
|
31514
31533
|
shaderData.setVector4(MainModule._worldRotation, worldRotationV4);
|
|
31515
31534
|
break;
|
|
31516
31535
|
case exports.ParticleSimulationSpace.World:
|
|
@@ -31534,10 +31553,7 @@ var MainModule = /*#__PURE__*/ function() {
|
|
|
31534
31553
|
shaderData.setVector3(MainModule._sizeScale, MainModule._vector3One);
|
|
31535
31554
|
break;
|
|
31536
31555
|
}
|
|
31537
|
-
|
|
31538
|
-
var gravityModifierValue = this.gravityModifier.evaluate(undefined, this._gravityModifierRand.random());
|
|
31539
|
-
engineMath.Vector3.scale(renderer.scene.physics.gravity, gravityModifierValue, particleGravity);
|
|
31540
|
-
shaderData.setVector3(MainModule._gravity, particleGravity);
|
|
31556
|
+
shaderData.setVector3(MainModule._gravity, renderer.scene.physics.gravity);
|
|
31541
31557
|
shaderData.setInt(MainModule._simulationSpace, this.simulationSpace);
|
|
31542
31558
|
shaderData.setFloat(MainModule._startRotation3D, +this.startRotation3D);
|
|
31543
31559
|
shaderData.setInt(MainModule._scaleMode, this.scalingMode);
|
|
@@ -31705,9 +31721,6 @@ var MainModule = /*#__PURE__*/ function() {
|
|
|
31705
31721
|
]);
|
|
31706
31722
|
return MainModule;
|
|
31707
31723
|
}();
|
|
31708
|
-
(function() {
|
|
31709
|
-
MainModule._tempVector40 = new engineMath.Vector4();
|
|
31710
|
-
})();
|
|
31711
31724
|
(function() {
|
|
31712
31725
|
MainModule._vector3One = new engineMath.Vector3(1, 1, 1);
|
|
31713
31726
|
})();
|
|
@@ -31792,9 +31805,6 @@ __decorate([
|
|
|
31792
31805
|
__decorate([
|
|
31793
31806
|
ignoreClone
|
|
31794
31807
|
], MainModule.prototype, "_generator", void 0);
|
|
31795
|
-
__decorate([
|
|
31796
|
-
ignoreClone
|
|
31797
|
-
], MainModule.prototype, "_gravity", void 0);
|
|
31798
31808
|
|
|
31799
31809
|
/**
|
|
31800
31810
|
* Rotate particles throughout their lifetime.
|
|
@@ -33064,8 +33074,15 @@ __decorate([
|
|
|
33064
33074
|
}
|
|
33065
33075
|
// Start speed
|
|
33066
33076
|
instanceVertices[offset + 18] = startSpeed;
|
|
33067
|
-
//
|
|
33068
|
-
|
|
33077
|
+
// Gravity, unused, size, rotation
|
|
33078
|
+
switch(main.gravityModifier.mode){
|
|
33079
|
+
case exports.ParticleCurveMode.Constant:
|
|
33080
|
+
instanceVertices[offset + 19] = main.gravityModifier.constant;
|
|
33081
|
+
break;
|
|
33082
|
+
case exports.ParticleCurveMode.TwoConstants:
|
|
33083
|
+
instanceVertices[offset + 19] = main.gravityModifier.evaluate(undefined, main._gravityModifierRand.random());
|
|
33084
|
+
break;
|
|
33085
|
+
}
|
|
33069
33086
|
var colorOverLifetime = this.colorOverLifetime;
|
|
33070
33087
|
if (colorOverLifetime.enabled && colorOverLifetime.color.mode === exports.ParticleGradientMode.TwoGradients) {
|
|
33071
33088
|
instanceVertices[offset + 20] = colorOverLifetime._colorGradientRand.random();
|