@galacean/engine-core 1.2.0-beta.6 → 1.2.0
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 +151 -53
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +151 -53
- package/dist/module.js +152 -54
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Camera.d.ts +7 -4
- package/types/Entity.d.ts +4 -1
- package/types/RenderPipeline/BatcherManager.d.ts +1 -12
- package/types/RenderPipeline/PrimitiveChunk.d.ts +1 -0
- package/types/RenderPipeline/PrimitiveChunkManager.d.ts +1 -0
- package/types/RenderPipeline/SubPrimitiveChunk.d.ts +1 -0
- package/types/RenderPipeline/SubRenderElement.d.ts +22 -0
- package/types/RenderPipeline/VertexArea.d.ts +1 -0
- package/types/animation/AnimatorCondition.d.ts +13 -0
- package/types/animation/AnimatorControllerParameter.d.ts +10 -0
- package/types/animation/AnimatorStateTransition.d.ts +51 -0
- package/types/asset/ResourceManager.d.ts +3 -1
- package/types/enums/ReplacementFailureStrategy.d.ts +9 -0
- package/types/index.d.ts +1 -0
- package/types/postProcess/PostProcessManager.d.ts +1 -0
- package/types/postProcess/effects/BloomEffect.d.ts +94 -0
- package/types/postProcess/effects/TonemappingEffect.d.ts +35 -0
- package/types/postProcess/effects/index.d.ts +2 -0
- package/types/postProcess/index.d.ts +3 -0
- package/types/shader/enums/ShaderPlatformTarget.d.ts +4 -0
- package/types/shader/enums/ShaderType.d.ts +1 -0
- package/types/utils/ClearableObjectPool.d.ts +16 -0
- package/types/utils/ObjectPool.d.ts +16 -0
- package/types/utils/ReturnableObjectPool.d.ts +16 -0
- package/types/utils/index.d.ts +4 -0
- package/types/RenderPipeline/RenderData2D.d.ts +0 -14
- package/types/RenderPipeline/RenderPass.d.ts +0 -55
- package/types/RenderPipeline/enums/ForceUploadShaderDataFlag.d.ts +0 -15
- package/types/RenderPipeline/enums/RenderDataUsage.d.ts +0 -13
- package/types/input/pointer/PointerEvent.d.ts +0 -4
- package/types/input/pointer/PointerEventType.d.ts +0 -7
- package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +0 -6
- package/types/ui/Image.d.ts +0 -41
- package/types/ui/RedBlackTree.d.ts +0 -2
- package/types/ui/UICanvas.d.ts +0 -49
- package/types/ui/UIRenderer.d.ts +0 -20
- package/types/ui/UITransform.d.ts +0 -20
- package/types/ui/enums/BlockingObjects.d.ts +0 -6
- package/types/ui/enums/CanvasRenderMode.d.ts +0 -8
- package/types/ui/enums/ResolutionAdaptationStrategy.d.ts +0 -10
- package/types/ui/index.d.ts +0 -6
- package/types/utils/Pool.d.ts +0 -12
- /package/types/RenderPipeline/{DynamicGeometryData.d.ts → BatchUtils.d.ts} +0 -0
- /package/types/RenderPipeline/{DynamicGeometryDataManager.d.ts → MaskManager.d.ts} +0 -0
package/dist/miniprogram.js
CHANGED
|
@@ -10981,6 +10981,38 @@ var PrimitiveType;
|
|
|
10981
10981
|
PrimitiveMesh._spherePoleIdx = 0;
|
|
10982
10982
|
})();
|
|
10983
10983
|
|
|
10984
|
+
function _is_native_reflect_construct() {
|
|
10985
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
10986
|
+
if (Reflect.construct.sham) return false;
|
|
10987
|
+
if (typeof Proxy === "function") return true;
|
|
10988
|
+
|
|
10989
|
+
try {
|
|
10990
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
10991
|
+
|
|
10992
|
+
return true;
|
|
10993
|
+
} catch (e) {
|
|
10994
|
+
return false;
|
|
10995
|
+
}
|
|
10996
|
+
}
|
|
10997
|
+
|
|
10998
|
+
function _construct(Parent, args, Class) {
|
|
10999
|
+
if (_is_native_reflect_construct()) _construct = Reflect.construct;
|
|
11000
|
+
else {
|
|
11001
|
+
_construct = function construct(Parent, args, Class) {
|
|
11002
|
+
var a = [null];
|
|
11003
|
+
a.push.apply(a, args);
|
|
11004
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
11005
|
+
var instance = new Constructor();
|
|
11006
|
+
|
|
11007
|
+
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
11008
|
+
|
|
11009
|
+
return instance;
|
|
11010
|
+
};
|
|
11011
|
+
}
|
|
11012
|
+
|
|
11013
|
+
return _construct.apply(null, arguments);
|
|
11014
|
+
}
|
|
11015
|
+
|
|
10984
11016
|
/**
|
|
10985
11017
|
* Layer, used for bit operations.
|
|
10986
11018
|
*/ exports.Layer = void 0;
|
|
@@ -11068,10 +11100,14 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
11068
11100
|
/**
|
|
11069
11101
|
* Add component based on the component type.
|
|
11070
11102
|
* @param type - The type of the component
|
|
11103
|
+
* @param args - The arguments of the component
|
|
11071
11104
|
* @returns The component which has been added
|
|
11072
11105
|
*/ _proto.addComponent = function addComponent(type) {
|
|
11106
|
+
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
11107
|
+
args[_key - 1] = arguments[_key];
|
|
11108
|
+
}
|
|
11073
11109
|
ComponentsDependencies._addCheck(this, type);
|
|
11074
|
-
var component =
|
|
11110
|
+
var component = _construct(type, [].concat(this, args));
|
|
11075
11111
|
this._components.push(component);
|
|
11076
11112
|
component._setActive(true, ActiveChangeFlag.All);
|
|
11077
11113
|
return component;
|
|
@@ -11240,7 +11276,7 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
11240
11276
|
* Clone this entity include children and components.
|
|
11241
11277
|
* @returns Cloned entity
|
|
11242
11278
|
*/ _proto.clone = function clone() {
|
|
11243
|
-
var cloneEntity = this._createCloneEntity(
|
|
11279
|
+
var cloneEntity = this._createCloneEntity();
|
|
11244
11280
|
this._parseCloneEntity(this, cloneEntity, this, cloneEntity, new Map());
|
|
11245
11281
|
return cloneEntity;
|
|
11246
11282
|
};
|
|
@@ -11250,23 +11286,23 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
11250
11286
|
this._isTemplate = true;
|
|
11251
11287
|
this._templateResource = templateResource;
|
|
11252
11288
|
};
|
|
11253
|
-
_proto._createCloneEntity = function _createCloneEntity(
|
|
11254
|
-
var cloneEntity = new Entity(
|
|
11289
|
+
_proto._createCloneEntity = function _createCloneEntity() {
|
|
11290
|
+
var cloneEntity = new Entity(this._engine, this.name);
|
|
11255
11291
|
var templateResource = this._templateResource;
|
|
11256
11292
|
if (templateResource) {
|
|
11257
11293
|
cloneEntity._templateResource = templateResource;
|
|
11258
11294
|
templateResource._addReferCount(1);
|
|
11259
11295
|
}
|
|
11260
|
-
cloneEntity.layer =
|
|
11261
|
-
cloneEntity._isActive =
|
|
11296
|
+
cloneEntity.layer = this.layer;
|
|
11297
|
+
cloneEntity._isActive = this._isActive;
|
|
11262
11298
|
var cloneTransform = cloneEntity.transform;
|
|
11263
|
-
var srcTransform =
|
|
11299
|
+
var _this = this, srcTransform = _this.transform;
|
|
11264
11300
|
cloneTransform.position = srcTransform.position;
|
|
11265
11301
|
cloneTransform.rotation = srcTransform.rotation;
|
|
11266
11302
|
cloneTransform.scale = srcTransform.scale;
|
|
11267
|
-
var
|
|
11268
|
-
for(var i = 0, n =
|
|
11269
|
-
cloneEntity.addChild(
|
|
11303
|
+
var srcChildren = this._children;
|
|
11304
|
+
for(var i = 0, n = srcChildren.length; i < n; i++){
|
|
11305
|
+
cloneEntity.addChild(srcChildren[i]._createCloneEntity());
|
|
11270
11306
|
}
|
|
11271
11307
|
return cloneEntity;
|
|
11272
11308
|
};
|
|
@@ -13477,7 +13513,7 @@ var /**
|
|
|
13477
13513
|
if (info) {
|
|
13478
13514
|
return info;
|
|
13479
13515
|
}
|
|
13480
|
-
info = TextUtils._measureFontOrChar(fontString);
|
|
13516
|
+
info = TextUtils._measureFontOrChar(fontString, TextUtils._measureString, false);
|
|
13481
13517
|
fontSizeInfoCache[fontString] = info;
|
|
13482
13518
|
return info;
|
|
13483
13519
|
};
|
|
@@ -13498,7 +13534,7 @@ var /**
|
|
|
13498
13534
|
return str;
|
|
13499
13535
|
};
|
|
13500
13536
|
TextUtils.measureChar = function measureChar(char, fontString) {
|
|
13501
|
-
return TextUtils._measureFontOrChar(fontString, char);
|
|
13537
|
+
return TextUtils._measureFontOrChar(fontString, char, true);
|
|
13502
13538
|
};
|
|
13503
13539
|
TextUtils.measureTextWithWrap = function measureTextWithWrap(renderer) {
|
|
13504
13540
|
var subFont = renderer._subFont;
|
|
@@ -13718,15 +13754,15 @@ var /**
|
|
|
13718
13754
|
/**
|
|
13719
13755
|
* @internal
|
|
13720
13756
|
* Use internal for CanvasRenderer plugin.
|
|
13721
|
-
*/ TextUtils._measureFontOrChar = function _measureFontOrChar(fontString,
|
|
13722
|
-
if (char === void 0) char = "";
|
|
13757
|
+
*/ TextUtils._measureFontOrChar = function _measureFontOrChar(fontString, measureString, isChar) {
|
|
13723
13758
|
var _TextUtils_textContext = TextUtils.textContext(), canvas = _TextUtils_textContext.canvas, context = _TextUtils_textContext.context;
|
|
13724
13759
|
context.font = fontString;
|
|
13725
|
-
var measureString = char || TextUtils._measureString;
|
|
13726
13760
|
// Safari gets data confusion through getImageData when the canvas width is not an integer.
|
|
13727
13761
|
// The measure text width of some special invisible characters may be 0, so make sure the width is at least 1.
|
|
13728
13762
|
// @todo: Text layout may vary from standard and not support emoji.
|
|
13729
|
-
var
|
|
13763
|
+
var textMetrics = context.measureText(measureString);
|
|
13764
|
+
// In some case (ex: " "), actualBoundingBoxRight and actualBoundingBoxLeft will be 0, so use width.
|
|
13765
|
+
var width = Math.max(1, Math.round(textMetrics.actualBoundingBoxRight - textMetrics.actualBoundingBoxLeft || textMetrics.width));
|
|
13730
13766
|
var baseline = Math.ceil(context.measureText(TextUtils._measureBaseline).width);
|
|
13731
13767
|
var height = baseline * TextUtils._heightMultiplier;
|
|
13732
13768
|
baseline = TextUtils._baselineMultiplier * baseline | 0;
|
|
@@ -13771,12 +13807,7 @@ var /**
|
|
|
13771
13807
|
descent = bottom - baseline + 1;
|
|
13772
13808
|
size = ascent + descent;
|
|
13773
13809
|
}
|
|
13774
|
-
|
|
13775
|
-
ascent: ascent,
|
|
13776
|
-
descent: descent,
|
|
13777
|
-
size: size
|
|
13778
|
-
};
|
|
13779
|
-
if (char) {
|
|
13810
|
+
if (isChar) {
|
|
13780
13811
|
var data = null;
|
|
13781
13812
|
if (size > 0) {
|
|
13782
13813
|
var lineIntegerW = integerW * 4;
|
|
@@ -13784,7 +13815,7 @@ var /**
|
|
|
13784
13815
|
data = new Uint8Array(colorData.buffer, top * lineIntegerW, size * lineIntegerW);
|
|
13785
13816
|
}
|
|
13786
13817
|
return {
|
|
13787
|
-
char:
|
|
13818
|
+
char: measureString,
|
|
13788
13819
|
x: 0,
|
|
13789
13820
|
y: 0,
|
|
13790
13821
|
w: width,
|
|
@@ -13804,7 +13835,11 @@ var /**
|
|
|
13804
13835
|
data: data
|
|
13805
13836
|
};
|
|
13806
13837
|
} else {
|
|
13807
|
-
return
|
|
13838
|
+
return {
|
|
13839
|
+
ascent: ascent,
|
|
13840
|
+
descent: descent,
|
|
13841
|
+
size: size
|
|
13842
|
+
};
|
|
13808
13843
|
}
|
|
13809
13844
|
};
|
|
13810
13845
|
/**
|
|
@@ -16753,17 +16788,35 @@ var /** @internal */ PromiseState;
|
|
|
16753
16788
|
};
|
|
16754
16789
|
/**
|
|
16755
16790
|
* @internal
|
|
16756
|
-
*/ _proto._onSubAssetSuccess = function _onSubAssetSuccess(
|
|
16757
|
-
var
|
|
16758
|
-
(
|
|
16759
|
-
|
|
16791
|
+
*/ _proto._onSubAssetSuccess = function _onSubAssetSuccess(assetBaseURL, assetSubPath, value) {
|
|
16792
|
+
var _this__subAssetPromiseCallbacks_assetBaseURL;
|
|
16793
|
+
var subPromiseCallback = (_this__subAssetPromiseCallbacks_assetBaseURL = this._subAssetPromiseCallbacks[assetBaseURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_assetBaseURL[assetSubPath];
|
|
16794
|
+
if (subPromiseCallback) {
|
|
16795
|
+
// Already resolved
|
|
16796
|
+
subPromiseCallback.resolve(value);
|
|
16797
|
+
} else {
|
|
16798
|
+
var // Pending
|
|
16799
|
+
_this__subAssetPromiseCallbacks, _assetBaseURL;
|
|
16800
|
+
((_this__subAssetPromiseCallbacks = this._subAssetPromiseCallbacks)[_assetBaseURL = assetBaseURL] || (_this__subAssetPromiseCallbacks[_assetBaseURL] = {}))[assetSubPath] = {
|
|
16801
|
+
resolve: value
|
|
16802
|
+
};
|
|
16803
|
+
}
|
|
16760
16804
|
};
|
|
16761
16805
|
/**
|
|
16762
16806
|
* @internal
|
|
16763
|
-
*/ _proto._onSubAssetFail = function _onSubAssetFail(
|
|
16764
|
-
var
|
|
16765
|
-
(
|
|
16766
|
-
|
|
16807
|
+
*/ _proto._onSubAssetFail = function _onSubAssetFail(assetBaseURL, assetSubPath, value) {
|
|
16808
|
+
var _this__subAssetPromiseCallbacks_assetBaseURL;
|
|
16809
|
+
var subPromiseCallback = (_this__subAssetPromiseCallbacks_assetBaseURL = this._subAssetPromiseCallbacks[assetBaseURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_assetBaseURL[assetSubPath];
|
|
16810
|
+
if (subPromiseCallback) {
|
|
16811
|
+
// Already rejected
|
|
16812
|
+
subPromiseCallback.reject(value);
|
|
16813
|
+
} else {
|
|
16814
|
+
var // Pending
|
|
16815
|
+
_this__subAssetPromiseCallbacks, _assetBaseURL;
|
|
16816
|
+
((_this__subAssetPromiseCallbacks = this._subAssetPromiseCallbacks)[_assetBaseURL = assetBaseURL] || (_this__subAssetPromiseCallbacks[_assetBaseURL] = {}))[assetSubPath] = {
|
|
16817
|
+
reject: value
|
|
16818
|
+
};
|
|
16819
|
+
}
|
|
16767
16820
|
};
|
|
16768
16821
|
/**
|
|
16769
16822
|
* @internal
|
|
@@ -16908,8 +16961,21 @@ var /** @internal */ PromiseState;
|
|
|
16908
16961
|
if (!loader) {
|
|
16909
16962
|
throw "loader not found: " + item.type;
|
|
16910
16963
|
}
|
|
16911
|
-
//
|
|
16964
|
+
// Check sub asset
|
|
16965
|
+
if (queryPath) {
|
|
16966
|
+
// Check whether load main asset
|
|
16967
|
+
var mainPromise = loadingPromises[assetBaseURL] || this._loadMainAsset(loader, item, assetBaseURL);
|
|
16968
|
+
mainPromise.catch(function(e) {
|
|
16969
|
+
_this._onSubAssetFail(assetBaseURL, queryPath, e);
|
|
16970
|
+
});
|
|
16971
|
+
return this._createSubAssetPromiseCallback(assetBaseURL, assetURL, queryPath);
|
|
16972
|
+
}
|
|
16973
|
+
return this._loadMainAsset(loader, item, assetBaseURL);
|
|
16974
|
+
};
|
|
16975
|
+
_proto._loadMainAsset = function _loadMainAsset(loader, item, assetBaseURL) {
|
|
16976
|
+
var _this = this;
|
|
16912
16977
|
item.url = assetBaseURL;
|
|
16978
|
+
var loadingPromises = this._loadingPromises;
|
|
16913
16979
|
var promise = loader.load(item, this);
|
|
16914
16980
|
loadingPromises[assetBaseURL] = promise;
|
|
16915
16981
|
promise.then(function(resource) {
|
|
@@ -16917,32 +16983,46 @@ var /** @internal */ PromiseState;
|
|
|
16917
16983
|
_this._addAsset(assetBaseURL, resource);
|
|
16918
16984
|
}
|
|
16919
16985
|
delete loadingPromises[assetBaseURL];
|
|
16986
|
+
_this._releaseSubAssetPromiseCallback(assetBaseURL);
|
|
16920
16987
|
}, function() {
|
|
16921
|
-
|
|
16988
|
+
delete loadingPromises[assetBaseURL];
|
|
16989
|
+
_this._releaseSubAssetPromiseCallback(assetBaseURL);
|
|
16922
16990
|
});
|
|
16923
|
-
|
|
16924
|
-
|
|
16925
|
-
|
|
16926
|
-
|
|
16927
|
-
|
|
16928
|
-
|
|
16991
|
+
return promise;
|
|
16992
|
+
};
|
|
16993
|
+
_proto._createSubAssetPromiseCallback = function _createSubAssetPromiseCallback(assetBaseURL, assetURL, assetSubPath) {
|
|
16994
|
+
var _this = this;
|
|
16995
|
+
var _this__subAssetPromiseCallbacks_assetBaseURL, _subPromiseCallback, _subPromiseCallback1;
|
|
16996
|
+
var loadingPromises = this._loadingPromises;
|
|
16997
|
+
var subPromiseCallback = (_this__subAssetPromiseCallbacks_assetBaseURL = this._subAssetPromiseCallbacks[assetBaseURL]) == null ? void 0 : _this__subAssetPromiseCallbacks_assetBaseURL[assetSubPath];
|
|
16998
|
+
var resolvedValue = (_subPromiseCallback = subPromiseCallback) == null ? void 0 : _subPromiseCallback.resolve;
|
|
16999
|
+
var rejectedValue = (_subPromiseCallback1 = subPromiseCallback) == null ? void 0 : _subPromiseCallback1.reject;
|
|
17000
|
+
var promise = new AssetPromise(function(resolve, reject) {
|
|
17001
|
+
if (resolvedValue) {
|
|
17002
|
+
// Already resolved
|
|
17003
|
+
resolve(resolvedValue);
|
|
17004
|
+
} else if (rejectedValue) {
|
|
17005
|
+
// Already rejected
|
|
17006
|
+
reject(rejectedValue);
|
|
17007
|
+
} else {
|
|
17008
|
+
var _this__subAssetPromiseCallbacks, _assetBaseURL;
|
|
17009
|
+
// Pending
|
|
17010
|
+
loadingPromises[assetURL] = promise;
|
|
17011
|
+
((_this__subAssetPromiseCallbacks = _this._subAssetPromiseCallbacks)[_assetBaseURL = assetBaseURL] || (_this__subAssetPromiseCallbacks[_assetBaseURL] = {}))[assetSubPath] = {
|
|
17012
|
+
resolve: resolve,
|
|
17013
|
+
reject: reject
|
|
17014
|
+
};
|
|
17015
|
+
}
|
|
17016
|
+
});
|
|
17017
|
+
if (!resolvedValue && !rejectedValue) {
|
|
17018
|
+
promise.then(function() {
|
|
16929
17019
|
delete loadingPromises[assetURL];
|
|
16930
17020
|
}, function() {
|
|
16931
17021
|
return delete loadingPromises[assetURL];
|
|
16932
17022
|
});
|
|
16933
|
-
promise.catch(function(e) {
|
|
16934
|
-
_this._onSubAssetFail(assetURL, e);
|
|
16935
|
-
});
|
|
16936
|
-
return subPromise;
|
|
16937
17023
|
}
|
|
16938
17024
|
return promise;
|
|
16939
17025
|
};
|
|
16940
|
-
_proto._pushSubAssetPromiseCallback = function _pushSubAssetPromiseCallback(assetURL, resolve, reject) {
|
|
16941
|
-
this._subAssetPromiseCallbacks[assetURL] = {
|
|
16942
|
-
resolve: resolve,
|
|
16943
|
-
reject: reject
|
|
16944
|
-
};
|
|
16945
|
-
};
|
|
16946
17026
|
_proto._gc = function _gc(forceDestroy) {
|
|
16947
17027
|
var objects = Utils.objectValues(this._referResourcePool);
|
|
16948
17028
|
for(var i = 0, n = objects.length; i < n; i++){
|
|
@@ -16999,6 +17079,9 @@ var /** @internal */ PromiseState;
|
|
|
16999
17079
|
});
|
|
17000
17080
|
return result;
|
|
17001
17081
|
};
|
|
17082
|
+
_proto._releaseSubAssetPromiseCallback = function _releaseSubAssetPromiseCallback(assetBaseURL) {
|
|
17083
|
+
delete this._subAssetPromiseCallbacks[assetBaseURL];
|
|
17084
|
+
};
|
|
17002
17085
|
/**
|
|
17003
17086
|
* @internal
|
|
17004
17087
|
* @beta Just for internal editor, not recommended for developers.
|
|
@@ -22958,6 +23041,14 @@ __decorate([
|
|
|
22958
23041
|
DepthTextureMode[DepthTextureMode[/* Generate depth texture by pre-pass rendering. */ "PrePass"] = 1] = "PrePass";
|
|
22959
23042
|
})(exports.DepthTextureMode || (exports.DepthTextureMode = {}));
|
|
22960
23043
|
|
|
23044
|
+
/**
|
|
23045
|
+
* The strategy to use when a shader replacement fails.
|
|
23046
|
+
*/ exports.ReplacementFailureStrategy = void 0;
|
|
23047
|
+
(function(ReplacementFailureStrategy) {
|
|
23048
|
+
ReplacementFailureStrategy[ReplacementFailureStrategy[/** Keep the original shader. */ "KeepOriginalShader"] = 0] = "KeepOriginalShader";
|
|
23049
|
+
ReplacementFailureStrategy[ReplacementFailureStrategy[/** Do not render. */ "DoNotRender"] = 1] = "DoNotRender";
|
|
23050
|
+
})(exports.ReplacementFailureStrategy || (exports.ReplacementFailureStrategy = {}));
|
|
23051
|
+
|
|
22961
23052
|
/**
|
|
22962
23053
|
* PipelinePass is a base class for all pipeline passes.
|
|
22963
23054
|
*/ var PipelinePass = function PipelinePass(engine) {
|
|
@@ -24394,13 +24485,15 @@ var /**
|
|
|
24394
24485
|
var replacementSubShaders = replacementShader.subShaders;
|
|
24395
24486
|
var replacementTag = context.replacementTag;
|
|
24396
24487
|
if (replacementTag) {
|
|
24488
|
+
var materialSubShaderTagValue = materialSubShader.getTagValue(replacementTag);
|
|
24397
24489
|
for(var i = 0, n = replacementSubShaders.length; i < n; i++){
|
|
24398
24490
|
var subShader = replacementSubShaders[i];
|
|
24399
|
-
if (subShader.getTagValue(replacementTag) ===
|
|
24491
|
+
if (subShader.getTagValue(replacementTag) === materialSubShaderTagValue) {
|
|
24400
24492
|
this.pushRenderDataWithShader(context, data, subShader.passes, renderStates);
|
|
24401
|
-
|
|
24493
|
+
return;
|
|
24402
24494
|
}
|
|
24403
24495
|
}
|
|
24496
|
+
context.replacementFailureStrategy === exports.ReplacementFailureStrategy.KeepOriginalShader && this.pushRenderDataWithShader(context, data, materialSubShader.passes, renderStates);
|
|
24404
24497
|
} else {
|
|
24405
24498
|
this.pushRenderDataWithShader(context, data, replacementSubShaders[0].passes, renderStates);
|
|
24406
24499
|
}
|
|
@@ -24561,6 +24654,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
24561
24654
|
/** @internal */ _this._virtualCamera = new VirtualCamera();
|
|
24562
24655
|
/** @internal */ _this._replacementShader = null;
|
|
24563
24656
|
/** @internal */ _this._replacementSubShaderTag = null;
|
|
24657
|
+
/** @internal */ _this._replacementFailureStrategy = null;
|
|
24564
24658
|
/** @internal */ _this._cameraIndex = -1;
|
|
24565
24659
|
_this._priority = 0;
|
|
24566
24660
|
_this._shaderData = new ShaderData(ShaderDataGroup.Camera);
|
|
@@ -24738,6 +24832,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
24738
24832
|
context.virtualCamera = virtualCamera;
|
|
24739
24833
|
context.replacementShader = this._replacementShader;
|
|
24740
24834
|
context.replacementTag = this._replacementSubShaderTag;
|
|
24835
|
+
context.replacementFailureStrategy = this._replacementFailureStrategy;
|
|
24741
24836
|
// compute cull frustum.
|
|
24742
24837
|
if (this.enableFrustumCulling && this._frustumChangeFlag.flag) {
|
|
24743
24838
|
this._frustum.calculateFromMatrix(virtualCamera.viewProjectionMatrix);
|
|
@@ -24757,15 +24852,18 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
24757
24852
|
this._renderPipeline.render(context, cubeFace, mipLevel, clearMask);
|
|
24758
24853
|
this._engine._renderCount++;
|
|
24759
24854
|
};
|
|
24760
|
-
_proto.setReplacementShader = function setReplacementShader(shader, replacementTag) {
|
|
24855
|
+
_proto.setReplacementShader = function setReplacementShader(shader, replacementTag, failureStrategy) {
|
|
24856
|
+
if (failureStrategy === void 0) failureStrategy = exports.ReplacementFailureStrategy.KeepOriginalShader;
|
|
24761
24857
|
this._replacementShader = shader;
|
|
24762
24858
|
this._replacementSubShaderTag = typeof replacementTag === "string" ? ShaderTagKey.getByName(replacementTag) : replacementTag;
|
|
24859
|
+
this._replacementFailureStrategy = failureStrategy;
|
|
24763
24860
|
};
|
|
24764
24861
|
/**
|
|
24765
24862
|
* Reset and clear the replacement shader.
|
|
24766
24863
|
*/ _proto.resetReplacementShader = function resetReplacementShader() {
|
|
24767
24864
|
this._replacementShader = null;
|
|
24768
24865
|
this._replacementSubShaderTag = null;
|
|
24866
|
+
this._replacementFailureStrategy = null;
|
|
24769
24867
|
};
|
|
24770
24868
|
/**
|
|
24771
24869
|
* @inheritdoc
|