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