@galacean/engine-core 1.0.0-beta.0 → 1.0.0-beta.3

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.
Files changed (54) hide show
  1. package/dist/main.js +124 -265
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +124 -265
  4. package/dist/module.js +124 -265
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/atlas/SpriteAtlas.d.ts +1 -0
  8. package/types/2d/data/RenderData2D.d.ts +1 -0
  9. package/types/2d/sprite/Sprite.d.ts +2 -1
  10. package/types/2d/sprite/SpriteMask.d.ts +2 -7
  11. package/types/2d/sprite/SpriteRenderer.d.ts +2 -11
  12. package/types/2d/text/Font.d.ts +1 -0
  13. package/types/2d/text/TextRenderer.d.ts +3 -11
  14. package/types/Camera.d.ts +0 -3
  15. package/types/Component.d.ts +1 -0
  16. package/types/Entity.d.ts +1 -1
  17. package/types/RenderPipeline/MeshRenderElement.d.ts +17 -0
  18. package/types/RenderPipeline/SpriteElement.d.ts +13 -0
  19. package/types/RenderPipeline/SpriteMaskElement.d.ts +10 -0
  20. package/types/RenderPipeline/TextRenderElement.d.ts +6 -0
  21. package/types/Renderer.d.ts +1 -1
  22. package/types/Scene.d.ts +1 -1
  23. package/types/Script.d.ts +1 -0
  24. package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +0 -1
  25. package/types/asset/GraphicsResource.d.ts +0 -3
  26. package/types/asset/IRefObject.d.ts +2 -0
  27. package/types/asset/RefObject.d.ts +27 -0
  28. package/types/asset/ReferResource.d.ts +0 -4
  29. package/types/base/Event.d.ts +24 -0
  30. package/types/base/Util.d.ts +14 -0
  31. package/types/env-probe/CubeProbe.d.ts +0 -6
  32. package/types/env-probe/Probe.d.ts +0 -6
  33. package/types/graphic/Buffer.d.ts +1 -3
  34. package/types/graphic/Mesh.d.ts +0 -6
  35. package/types/material/BaseMaterial.d.ts +0 -2
  36. package/types/material/BlinnPhongMaterial.d.ts +0 -3
  37. package/types/material/Material.d.ts +1 -4
  38. package/types/material/PBRMaterial.d.ts +1 -1
  39. package/types/material/PBRSpecularMaterial.d.ts +1 -1
  40. package/types/material/UnlitMaterial.d.ts +1 -1
  41. package/types/mesh/MeshRenderer.d.ts +3 -8
  42. package/types/mesh/ModelMesh.d.ts +1 -0
  43. package/types/mesh/SkinnedMeshRenderer.d.ts +0 -9
  44. package/types/physics/CharacterController.d.ts +0 -2
  45. package/types/physics/Collider.d.ts +1 -0
  46. package/types/physics/joint/HingeJoint.d.ts +2 -2
  47. package/types/physics/joint/SpringJoint.d.ts +1 -1
  48. package/types/sky/SkyBoxMaterial.d.ts +0 -3
  49. package/types/sky/SkyProceduralMaterial.d.ts +1 -1
  50. package/types/texture/RenderTarget.d.ts +0 -3
  51. package/types/texture/Texture.d.ts +1 -0
  52. package/types/texture/Texture2DArray.d.ts +0 -4
  53. package/types/texture/TextureCube.d.ts +0 -4
  54. package/types/trail/TrailRenderer.d.ts +1 -4
package/dist/main.js CHANGED
@@ -656,7 +656,6 @@ __decorate([
656
656
  }
657
657
  var _proto = ReferResource.prototype;
658
658
  /**
659
- * @override
660
659
  * Destroy self.
661
660
  * @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
662
661
  * @returns Whether the release was successful.
@@ -683,9 +682,7 @@ __decorate([
683
682
  */ _proto._addToResourceManager = function _addToResourceManager(path) {
684
683
  this._engine.resourceManager._addAsset(path, this);
685
684
  };
686
- /**
687
- * @override
688
- */ _proto._onDestroy = function _onDestroy() {
685
+ _proto._onDestroy = function _onDestroy() {
689
686
  EngineObject.prototype._onDestroy.call(this);
690
687
  this._engine.resourceManager._deleteReferResource(this);
691
688
  var refCount = this._getReferCount();
@@ -817,9 +814,7 @@ var GraphicsResource = /*#__PURE__*/ function(ReferResource) {
817
814
  return _this;
818
815
  }
819
816
  var _proto = GraphicsResource.prototype;
820
- /**
821
- * @override
822
- */ _proto._onDestroy = function _onDestroy() {
817
+ _proto._onDestroy = function _onDestroy() {
823
818
  ReferResource.prototype._onDestroy.call(this);
824
819
  this.engine.resourceManager._deleteGraphicResource(this);
825
820
  };
@@ -888,7 +883,6 @@ var Logger = {
888
883
  }
889
884
  };
890
885
  /**
891
- * @override
892
886
  * @internal
893
887
  */ _proto._rebuild = function _rebuild() {
894
888
  var platformTexture = this._platformTexture;
@@ -899,10 +893,7 @@ var Logger = {
899
893
  platformTexture.depthCompareFunction = this._depthCompareFunction;
900
894
  platformTexture.setUseDepthCompareMode(this._useDepthCompareMode);
901
895
  };
902
- /**
903
- * @override
904
- * @internal
905
- */ _proto._onDestroy = function _onDestroy() {
896
+ _proto._onDestroy = function _onDestroy() {
906
897
  GraphicsResource.prototype._onDestroy.call(this);
907
898
  this._platformTexture.destroy();
908
899
  this._platformTexture = null;
@@ -1090,9 +1081,7 @@ var Logger = {
1090
1081
  this._depthTexture && this._depthTexture.generateMipmaps();
1091
1082
  }
1092
1083
  };
1093
- /**
1094
- * @override
1095
- */ _proto._onDestroy = function _onDestroy() {
1084
+ _proto._onDestroy = function _onDestroy() {
1096
1085
  GraphicsResource.prototype._onDestroy.call(this);
1097
1086
  this._platformRenderTarget.destroy();
1098
1087
  this._colorTextures.length = 0;
@@ -1110,7 +1099,6 @@ var Logger = {
1110
1099
  this._platformRenderTarget.blitRenderTarget();
1111
1100
  };
1112
1101
  /**
1113
- * @override
1114
1102
  * @internal
1115
1103
  */ _proto._rebuild = function _rebuild() {
1116
1104
  this._platformRenderTarget = this._engine._hardwareRenderer.createPlatformRenderTarget(this);
@@ -1313,7 +1301,7 @@ var Logger = {
1313
1301
  }
1314
1302
  };
1315
1303
  /**
1316
- * @override
1304
+ * @internal
1317
1305
  */ _proto._rebuild = function _rebuild() {
1318
1306
  this._platformTexture = this._engine._hardwareRenderer.createPlatformTexture2DArray(this);
1319
1307
  Texture.prototype._rebuild.call(this);
@@ -1397,7 +1385,7 @@ var Logger = {
1397
1385
  }
1398
1386
  };
1399
1387
  /**
1400
- * @override
1388
+ * @internal
1401
1389
  */ _proto._rebuild = function _rebuild() {
1402
1390
  this._platformTexture = this._engine._hardwareRenderer.createPlatformTextureCube(this);
1403
1391
  Texture.prototype._rebuild.call(this);
@@ -1471,10 +1459,7 @@ var Logger = {
1471
1459
  _proto.getCharInfo = function getCharInfo(char) {
1472
1460
  return this._charInfoMap[char.charCodeAt(0)];
1473
1461
  };
1474
- /**
1475
- * @override
1476
- * @internal
1477
- */ _proto._onDestroy = function _onDestroy() {
1462
+ _proto._onDestroy = function _onDestroy() {
1478
1463
  ReferResource.prototype._onDestroy.call(this);
1479
1464
  this.texture.destroy();
1480
1465
  this.texture = null;
@@ -2037,10 +2022,7 @@ var Logger = {
2037
2022
  subFontMap[key] = subFont;
2038
2023
  return subFont;
2039
2024
  };
2040
- /**
2041
- * @override
2042
- * @internal
2043
- */ _proto._onDestroy = function _onDestroy() {
2025
+ _proto._onDestroy = function _onDestroy() {
2044
2026
  ReferResource.prototype._onDestroy.call(this);
2045
2027
  var subFontMap = this._subFontMap;
2046
2028
  for(var k in subFontMap){
@@ -3212,54 +3194,6 @@ exports.GLCapabilityType = void 0;
3212
3194
  return ComponentsManager;
3213
3195
  }();
3214
3196
 
3215
- var ComponentCloner = /*#__PURE__*/ function() {
3216
- function ComponentCloner() {}
3217
- /**
3218
- * Clone component.
3219
- * @param source - Clone source
3220
- * @param target - Clone target
3221
- */ ComponentCloner.cloneComponent = function cloneComponent(source, target) {
3222
- var cloneModes = CloneManager.getCloneMode(source.constructor);
3223
- var keys = Object.keys(source);
3224
- for(var i = 0, n = keys.length; i < n; i++){
3225
- var k = keys[i];
3226
- var cloneMode = cloneModes[k];
3227
- switch(cloneMode){
3228
- case undefined:
3229
- case CloneMode.Assignment:
3230
- target[k] = source[k];
3231
- break;
3232
- case CloneMode.Shallow:
3233
- var sourcePropS = source[k];
3234
- if (_instanceof(sourcePropS, Object)) {
3235
- var tarProp = target[k];
3236
- tarProp == null && (tarProp = target[k] = sourcePropS.constructor());
3237
- Object.assign(tarProp, sourcePropS);
3238
- } else {
3239
- // Null or undefined and primitive type.
3240
- target[k] = sourcePropS;
3241
- }
3242
- break;
3243
- case CloneMode.Deep:
3244
- var sourcePropD = source[k];
3245
- if (_instanceof(sourcePropD, Object)) {
3246
- var tarProp1 = target[k];
3247
- tarProp1 == null && (tarProp1 = target[k] = sourcePropD.constructor());
3248
- CloneManager.deepCloneObject(sourcePropD, tarProp1);
3249
- } else {
3250
- // Null or undefined and primitive type.
3251
- target[k] = sourcePropD;
3252
- }
3253
- break;
3254
- }
3255
- }
3256
- if (source._cloneTo) {
3257
- source._cloneTo(target);
3258
- }
3259
- };
3260
- return ComponentCloner;
3261
- }();
3262
-
3263
3197
  /**
3264
3198
  * The base class of the components.
3265
3199
  */ var Component = /*#__PURE__*/ function(EngineObject) {
@@ -3307,10 +3241,7 @@ var ComponentCloner = /*#__PURE__*/ function() {
3307
3241
  }
3308
3242
  }
3309
3243
  };
3310
- /**
3311
- * @override
3312
- * @internal
3313
- */ _proto._onDestroy = function _onDestroy() {
3244
+ _proto._onDestroy = function _onDestroy() {
3314
3245
  EngineObject.prototype._onDestroy.call(this);
3315
3246
  this._entity._removeComponent(this);
3316
3247
  if (this._entity.isActiveInHierarchy) {
@@ -4542,6 +4473,54 @@ var TransformModifyFlags;
4542
4473
  TransformModifyFlags[TransformModifyFlags[/** WorldMatrix | WorldPosition | WorldEuler | WorldQuat | WorldScale */ "WmWpWeWqWs"] = 0xbc] = "WmWpWeWqWs";
4543
4474
  })(TransformModifyFlags || (TransformModifyFlags = {}));
4544
4475
 
4476
+ var ComponentCloner = /*#__PURE__*/ function() {
4477
+ function ComponentCloner() {}
4478
+ /**
4479
+ * Clone component.
4480
+ * @param source - Clone source
4481
+ * @param target - Clone target
4482
+ */ ComponentCloner.cloneComponent = function cloneComponent(source, target) {
4483
+ var cloneModes = CloneManager.getCloneMode(source.constructor);
4484
+ var keys = Object.keys(source);
4485
+ for(var i = 0, n = keys.length; i < n; i++){
4486
+ var k = keys[i];
4487
+ var cloneMode = cloneModes[k];
4488
+ switch(cloneMode){
4489
+ case undefined:
4490
+ case CloneMode.Assignment:
4491
+ target[k] = source[k];
4492
+ break;
4493
+ case CloneMode.Shallow:
4494
+ var sourcePropS = source[k];
4495
+ if (_instanceof(sourcePropS, Object)) {
4496
+ var tarProp = target[k];
4497
+ tarProp == null && (tarProp = target[k] = sourcePropS.constructor());
4498
+ Object.assign(tarProp, sourcePropS);
4499
+ } else {
4500
+ // Null or undefined and primitive type.
4501
+ target[k] = sourcePropS;
4502
+ }
4503
+ break;
4504
+ case CloneMode.Deep:
4505
+ var sourcePropD = source[k];
4506
+ if (_instanceof(sourcePropD, Object)) {
4507
+ var tarProp1 = target[k];
4508
+ tarProp1 == null && (tarProp1 = target[k] = sourcePropD.constructor());
4509
+ CloneManager.deepCloneObject(sourcePropD, tarProp1);
4510
+ } else {
4511
+ // Null or undefined and primitive type.
4512
+ target[k] = sourcePropD;
4513
+ }
4514
+ break;
4515
+ }
4516
+ }
4517
+ if (source._cloneTo) {
4518
+ source._cloneTo(target);
4519
+ }
4520
+ };
4521
+ return ComponentCloner;
4522
+ }();
4523
+
4545
4524
  /**
4546
4525
  * Entity, be used as components container.
4547
4526
  */ var Entity = /*#__PURE__*/ function(EngineObject) {
@@ -6026,21 +6005,16 @@ exports.Collider = /*#__PURE__*/ function(Component) {
6026
6005
  * @internal
6027
6006
  */ _proto._onLateUpdate = function _onLateUpdate() {};
6028
6007
  /**
6029
- * @override
6030
6008
  * @internal
6031
6009
  */ _proto._onEnable = function _onEnable() {
6032
6010
  this.engine.physicsManager._addCollider(this);
6033
6011
  };
6034
6012
  /**
6035
- * @override
6036
6013
  * @internal
6037
6014
  */ _proto._onDisable = function _onDisable() {
6038
6015
  this.engine.physicsManager._removeCollider(this);
6039
6016
  };
6040
- /**
6041
- * @override
6042
- * @internal
6043
- */ _proto._onDestroy = function _onDestroy() {
6017
+ _proto._onDestroy = function _onDestroy() {
6044
6018
  Component.prototype._onDestroy.call(this);
6045
6019
  this.clearShapes();
6046
6020
  this._nativeCollider.destroy();
@@ -6079,7 +6053,6 @@ exports.Collider = __decorate([
6079
6053
  function CharacterController(entity) {
6080
6054
  var _this;
6081
6055
  _this = Collider.call(this, entity) || this;
6082
- /** @internal */ _this._index = -1;
6083
6056
  _this._stepOffset = 0.5;
6084
6057
  _this._nonWalkableMode = exports.ControllerNonWalkableMode.PreventClimbing;
6085
6058
  _this._upDirection = new engineMath.Vector3(0, 1, 0);
@@ -6103,7 +6076,6 @@ exports.Collider = __decorate([
6103
6076
  /**
6104
6077
  * Add collider shape on this controller.
6105
6078
  * @param shape - Collider shape
6106
- * @override
6107
6079
  */ _proto.addShape = function addShape(shape) {
6108
6080
  if (this._shapes.length > 0) {
6109
6081
  throw "only allow single shape on controller!";
@@ -6113,7 +6085,6 @@ exports.Collider = __decorate([
6113
6085
  };
6114
6086
  /**
6115
6087
  * Remove all shape attached.
6116
- * @override
6117
6088
  */ _proto.clearShapes = function clearShapes() {
6118
6089
  if (this._shapes.length > 0) {
6119
6090
  Collider.prototype.removeShape.call(this, this._shapes[0]);
@@ -6121,7 +6092,6 @@ exports.Collider = __decorate([
6121
6092
  };
6122
6093
  /**
6123
6094
  * @internal
6124
- * @override
6125
6095
  */ _proto._onUpdate = function _onUpdate() {
6126
6096
  if (this._updateFlag.flag) {
6127
6097
  var transform = this.entity.transform;
@@ -6136,7 +6106,6 @@ exports.Collider = __decorate([
6136
6106
  };
6137
6107
  /**
6138
6108
  * @internal
6139
- * @override
6140
6109
  */ _proto._onLateUpdate = function _onLateUpdate() {
6141
6110
  var position = this.entity.transform.worldPosition;
6142
6111
  this._nativeCollider.getWorldPosition(position);
@@ -6144,13 +6113,11 @@ exports.Collider = __decorate([
6144
6113
  this._updateFlag.flag = false;
6145
6114
  };
6146
6115
  /**
6147
- * @override
6148
6116
  * @internal
6149
6117
  */ _proto._onEnable = function _onEnable() {
6150
6118
  this.engine.physicsManager._addCharacterController(this);
6151
6119
  };
6152
6120
  /**
6153
- * @override
6154
6121
  * @internal
6155
6122
  */ _proto._onDisable = function _onDisable() {
6156
6123
  this.engine.physicsManager._removeCharacterController(this);
@@ -6643,7 +6610,6 @@ exports.Joint = __decorate([
6643
6610
  }
6644
6611
  var _proto = FixedJoint.prototype;
6645
6612
  /**
6646
- * @override
6647
6613
  * @internal
6648
6614
  */ _proto._onAwake = function _onAwake() {
6649
6615
  var collider = this._collider;
@@ -6677,7 +6643,6 @@ exports.Joint = __decorate([
6677
6643
  }
6678
6644
  var _proto = HingeJoint.prototype;
6679
6645
  /**
6680
- * @override
6681
6646
  * @internal
6682
6647
  */ _proto._onAwake = function _onAwake() {
6683
6648
  var collider = this._collider;
@@ -6829,7 +6794,6 @@ exports.Joint = __decorate([
6829
6794
  }
6830
6795
  var _proto = SpringJoint.prototype;
6831
6796
  /**
6832
- * @override
6833
6797
  * @internal
6834
6798
  */ _proto._onAwake = function _onAwake() {
6835
6799
  var collider = this._collider;
@@ -7034,7 +6998,6 @@ exports.Joint = __decorate([
7034
6998
  this._nativeCollider.wakeUp();
7035
6999
  };
7036
7000
  /**
7037
- * @override
7038
7001
  * @internal
7039
7002
  */ _proto._onLateUpdate = function _onLateUpdate() {
7040
7003
  var transform = this.entity.transform;
@@ -7987,14 +7950,12 @@ __decorate([
7987
7950
  /**
7988
7951
  * Mount to the current Scene.
7989
7952
  * @internal
7990
- * @override
7991
7953
  */ _proto._onEnable = function _onEnable() {
7992
7954
  this.engine._lightManager._attachDirectLight(this);
7993
7955
  };
7994
7956
  /**
7995
7957
  * Unmount from the current Scene.
7996
7958
  * @internal
7997
- * @override
7998
7959
  */ _proto._onDisable = function _onDisable() {
7999
7960
  this.engine._lightManager._detachDirectLight(this);
8000
7961
  };
@@ -8028,7 +7989,6 @@ __decorate([
8028
7989
  key: "_shadowProjectionMatrix",
8029
7990
  get: /**
8030
7991
  * @internal
8031
- * @override
8032
7992
  */ function get() {
8033
7993
  throw "Unknown!";
8034
7994
  }
@@ -8088,14 +8048,12 @@ __decorate([
8088
8048
  /**
8089
8049
  * Mount to the current Scene.
8090
8050
  * @internal
8091
- * @override
8092
8051
  */ _proto._onEnable = function _onEnable() {
8093
8052
  this.engine._lightManager._attachPointLight(this);
8094
8053
  };
8095
8054
  /**
8096
8055
  * Unmount from the current Scene.
8097
8056
  * @internal
8098
- * @override
8099
8057
  */ _proto._onDisable = function _onDisable() {
8100
8058
  this.engine._lightManager._detachPointLight(this);
8101
8059
  };
@@ -8121,7 +8079,6 @@ __decorate([
8121
8079
  key: "_shadowProjectionMatrix",
8122
8080
  get: /**
8123
8081
  * @internal
8124
- * @override
8125
8082
  */ function get() {
8126
8083
  throw "Unknown!";
8127
8084
  }
@@ -8198,14 +8155,12 @@ __decorate([
8198
8155
  /**
8199
8156
  * Mount to the current Scene.
8200
8157
  * @internal
8201
- * @override
8202
8158
  */ _proto._onEnable = function _onEnable() {
8203
8159
  this.engine._lightManager._attachSpotLight(this);
8204
8160
  };
8205
8161
  /**
8206
8162
  * Unmount from the current Scene.
8207
8163
  * @internal
8208
- * @override
8209
8164
  */ _proto._onDisable = function _onDisable() {
8210
8165
  this.engine._lightManager._detachSpotLight(this);
8211
8166
  };
@@ -8251,7 +8206,6 @@ __decorate([
8251
8206
  key: "_shadowProjectionMatrix",
8252
8207
  get: /**
8253
8208
  * @internal
8254
- * @override
8255
8209
  */ function get() {
8256
8210
  var matrix = this._projectMatrix;
8257
8211
  var fov = Math.min(Math.PI / 2, this.angle * 2 * Math.sqrt(2));
@@ -9420,9 +9374,7 @@ __decorate([
9420
9374
  this.shaderData.cloneTo(target.shaderData);
9421
9375
  CloneManager.deepCloneObject(this.renderStates, target.renderStates);
9422
9376
  };
9423
- /**
9424
- * @override
9425
- */ _proto._addReferCount = function _addReferCount(value) {
9377
+ _proto._addReferCount = function _addReferCount(value) {
9426
9378
  ReferResource.prototype._addReferCount.call(this, value);
9427
9379
  this.shaderData._addReferCount(value);
9428
9380
  };
@@ -9557,11 +9509,11 @@ var FogFragmentDeclaration = "#define GLSLIFY 1\n#if SCENE_FOG_MODE != 0\nvaryin
9557
9509
 
9558
9510
  var FogVertexDeclaration = "#define GLSLIFY 1\n#if SCENE_FOG_MODE != 0\nvarying vec3 v_positionVS;\n#endif\n"; // eslint-disable-line
9559
9511
 
9560
- var normal_share = "#define GLSLIFY 1\n#ifndef MATERIAL_OMIT_NORMAL\n#ifdef RENDERER_HAS_NORMAL\nvarying vec3 v_normal;\n#if defined(RENDERER_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEARCOATNORMALTEXTURE) )\nvarying mat3 v_TBN;\n#endif\n#endif\n#endif\n"; // eslint-disable-line
9512
+ var normal_share = "#define GLSLIFY 1\n#ifndef MATERIAL_OMIT_NORMAL\n#ifdef RENDERER_HAS_NORMAL\nvarying vec3 v_normal;\n#if defined(RENDERER_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\nvarying mat3 v_TBN;\n#endif\n#endif\n#endif\n"; // eslint-disable-line
9561
9513
 
9562
9514
  var uv_share = "#define GLSLIFY 1\nvarying vec2 v_uv;\n#ifdef RENDERER_HAS_UV1\nvarying vec2 v_uv1;\n#endif\n"; // eslint-disable-line
9563
9515
 
9564
- var worldpos_share = "#define GLSLIFY 1\n#ifdef MATERIAL_NEED_WORLDPOS\nvarying vec3 v_pos;\n#endif\n"; // eslint-disable-line
9516
+ var worldpos_share = "#define GLSLIFY 1\n#ifdef MATERIAL_NEED_WORLD_POS\nvarying vec3 v_pos;\n#endif\n"; // eslint-disable-line
9565
9517
 
9566
9518
  var begin_normal_vert = "#define GLSLIFY 1\n#ifndef MATERIAL_OMIT_NORMAL\n#ifdef RENDERER_HAS_NORMAL\nvec3 normal=vec3(NORMAL);\n#endif\n#ifdef RENDERER_HAS_TANGENT\nvec4 tangent=vec4(TANGENT);\n#endif\n#endif\n"; // eslint-disable-line
9567
9519
 
@@ -9569,21 +9521,21 @@ var begin_position_vert = "#define GLSLIFY 1\nvec4 position=vec4(POSITION,1.0);"
9569
9521
 
9570
9522
  var blendShape_input = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_BLENDSHAPE\n#ifdef RENDERER_BLENDSHAPE_USE_TEXTURE\nuniform mediump sampler2DArray renderer_BlendShapeTexture;uniform ivec3 renderer_BlendShapeTextureInfo;uniform float renderer_BlendShapeWeights[RENDERER_BLENDSHAPE_COUNT];\n#else\nattribute vec3 POSITION_BS0;attribute vec3 POSITION_BS1;\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) && defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\nattribute vec3 NORMAL_BS0;attribute vec3 NORMAL_BS1;attribute vec3 TANGENT_BS0;attribute vec3 TANGENT_BS1;uniform float renderer_BlendShapeWeights[2];\n#else\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) || defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\nattribute vec3 POSITION_BS2;attribute vec3 POSITION_BS3;\n#ifdef RENDERER_BLENDSHAPE_HAS_NORMAL\nattribute vec3 NORMAL_BS0;attribute vec3 NORMAL_BS1;attribute vec3 NORMAL_BS2;attribute vec3 NORMAL_BS3;\n#endif\n#ifdef RENDERER_BLENDSHAPE_HAS_TANGENT\nattribute vec3 TANGENT_BS0;attribute vec3 TANGENT_BS1;attribute vec3 TANGENT_BS2;attribute vec3 TANGENT_BS3;\n#endif\nuniform float renderer_BlendShapeWeights[4];\n#else\nattribute vec3 POSITION_BS2;attribute vec3 POSITION_BS3;attribute vec3 POSITION_BS4;attribute vec3 POSITION_BS5;attribute vec3 POSITION_BS6;attribute vec3 POSITION_BS7;uniform float renderer_BlendShapeWeights[8];\n#endif\n#endif\n#endif\n#ifdef RENDERER_BLENDSHAPE_USE_TEXTURE\nvec3 getBlendShapeVertexElement(int blendShapeIndex,int vertexElementIndex){int y=vertexElementIndex/renderer_BlendShapeTextureInfo.y;int x=vertexElementIndex-y*renderer_BlendShapeTextureInfo.y;ivec3 uv=ivec3(x,y,blendShapeIndex);return texelFetch(renderer_BlendShapeTexture,uv,0).xyz;}\n#endif\n#endif\n"; // eslint-disable-line
9571
9523
 
9572
- var blendShape_vert = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_BLENDSHAPE\n#ifdef RENDERER_BLENDSHAPE_USE_TEXTURE\nint vertexOffset=gl_VertexID*renderer_BlendShapeTextureInfo.x;for(int i=0;i<RENDERER_BLENDSHAPE_COUNT;i++){int vertexElementOffset=vertexOffset;float weight=renderer_BlendShapeWeights[i];position.xyz+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#ifndef MATERIAL_OMIT_NORMAL\n#if defined( RENDERER_HAS_NORMAL ) && defined( RENDERER_BLENDSHAPE_HAS_NORMAL )\nvertexElementOffset+=1;normal+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#endif\n#if defined( RENDERER_HAS_TANGENT ) && defined(RENDERER_BLENDSHAPE_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEARCOATNORMALTEXTURE) )\nvertexElementOffset+=1;tangent.xyz+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#endif\n#endif\n}\n#else\nposition.xyz+=POSITION_BS0*renderer_BlendShapeWeights[0];position.xyz+=POSITION_BS1*renderer_BlendShapeWeights[1];\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) && defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\n#ifndef MATERIAL_OMIT_NORMAL\n#ifdef RENDERER_HAS_NORMAL\nnormal+=NORMAL_BS0*renderer_BlendShapeWeights[0];normal+=NORMAL_BS1*renderer_BlendShapeWeights[1];\n#endif\n#if defined( RENDERER_HAS_TANGENT ) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEARCOATNORMALTEXTURE) )\ntangent.xyz+=TANGENT_BS0*renderer_BlendShapeWeights[0];tangent.xyz+=TANGENT_BS1*renderer_BlendShapeWeights[1];\n#endif\n#endif\n#else\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) || defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\n#ifndef MATERIAL_OMIT_NORMAL\nposition.xyz+=POSITION_BS2*renderer_BlendShapeWeights[2];position.xyz+=POSITION_BS3*renderer_BlendShapeWeights[3];\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) && defined( RENDERER_HAS_NORMAL )\nnormal+=NORMAL_BS0*renderer_BlendShapeWeights[0];normal+=NORMAL_BS1*renderer_BlendShapeWeights[1];normal+=NORMAL_BS2*renderer_BlendShapeWeights[2];normal+=NORMAL_BS3*renderer_BlendShapeWeights[3];\n#endif\n#if defined(RENDERER_BLENDSHAPE_HAS_TANGENT) && defined( RENDERER_HAS_TANGENT ) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEARCOATNORMALTEXTURE) )\ntangent.xyz+=TANGENT_BS0*renderer_BlendShapeWeights[0];tangent.xyz+=TANGENT_BS1*renderer_BlendShapeWeights[1];tangent.xyz+=TANGENT_BS2*renderer_BlendShapeWeights[2];tangent.xyz+=TANGENT_BS3*renderer_BlendShapeWeights[3];\n#endif\n#endif\n#else\nposition.xyz+=POSITION_BS2*renderer_BlendShapeWeights[2];position.xyz+=POSITION_BS3*renderer_BlendShapeWeights[3];position.xyz+=POSITION_BS4*renderer_BlendShapeWeights[4];position.xyz+=POSITION_BS5*renderer_BlendShapeWeights[5];position.xyz+=POSITION_BS6*renderer_BlendShapeWeights[6];position.xyz+=POSITION_BS7*renderer_BlendShapeWeights[7];\n#endif\n#endif\n#endif\n#endif\n"; // eslint-disable-line
9524
+ var blendShape_vert = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_BLENDSHAPE\n#ifdef RENDERER_BLENDSHAPE_USE_TEXTURE\nint vertexOffset=gl_VertexID*renderer_BlendShapeTextureInfo.x;for(int i=0;i<RENDERER_BLENDSHAPE_COUNT;i++){int vertexElementOffset=vertexOffset;float weight=renderer_BlendShapeWeights[i];position.xyz+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#ifndef MATERIAL_OMIT_NORMAL\n#if defined( RENDERER_HAS_NORMAL ) && defined( RENDERER_BLENDSHAPE_HAS_NORMAL )\nvertexElementOffset+=1;normal+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#endif\n#if defined( RENDERER_HAS_TANGENT ) && defined(RENDERER_BLENDSHAPE_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\nvertexElementOffset+=1;tangent.xyz+=getBlendShapeVertexElement(i,vertexElementOffset)*weight;\n#endif\n#endif\n}\n#else\nposition.xyz+=POSITION_BS0*renderer_BlendShapeWeights[0];position.xyz+=POSITION_BS1*renderer_BlendShapeWeights[1];\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) && defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\n#ifndef MATERIAL_OMIT_NORMAL\n#ifdef RENDERER_HAS_NORMAL\nnormal+=NORMAL_BS0*renderer_BlendShapeWeights[0];normal+=NORMAL_BS1*renderer_BlendShapeWeights[1];\n#endif\n#if defined( RENDERER_HAS_TANGENT ) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\ntangent.xyz+=TANGENT_BS0*renderer_BlendShapeWeights[0];tangent.xyz+=TANGENT_BS1*renderer_BlendShapeWeights[1];\n#endif\n#endif\n#else\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) || defined( RENDERER_BLENDSHAPE_HAS_TANGENT )\n#ifndef MATERIAL_OMIT_NORMAL\nposition.xyz+=POSITION_BS2*renderer_BlendShapeWeights[2];position.xyz+=POSITION_BS3*renderer_BlendShapeWeights[3];\n#if defined( RENDERER_BLENDSHAPE_HAS_NORMAL ) && defined( RENDERER_HAS_NORMAL )\nnormal+=NORMAL_BS0*renderer_BlendShapeWeights[0];normal+=NORMAL_BS1*renderer_BlendShapeWeights[1];normal+=NORMAL_BS2*renderer_BlendShapeWeights[2];normal+=NORMAL_BS3*renderer_BlendShapeWeights[3];\n#endif\n#if defined(RENDERER_BLENDSHAPE_HAS_TANGENT) && defined( RENDERER_HAS_TANGENT ) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\ntangent.xyz+=TANGENT_BS0*renderer_BlendShapeWeights[0];tangent.xyz+=TANGENT_BS1*renderer_BlendShapeWeights[1];tangent.xyz+=TANGENT_BS2*renderer_BlendShapeWeights[2];tangent.xyz+=TANGENT_BS3*renderer_BlendShapeWeights[3];\n#endif\n#endif\n#else\nposition.xyz+=POSITION_BS2*renderer_BlendShapeWeights[2];position.xyz+=POSITION_BS3*renderer_BlendShapeWeights[3];position.xyz+=POSITION_BS4*renderer_BlendShapeWeights[4];position.xyz+=POSITION_BS5*renderer_BlendShapeWeights[5];position.xyz+=POSITION_BS6*renderer_BlendShapeWeights[6];position.xyz+=POSITION_BS7*renderer_BlendShapeWeights[7];\n#endif\n#endif\n#endif\n#endif\n"; // eslint-disable-line
9573
9525
 
9574
9526
  var color_vert = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_VERTEXCOLOR\nv_color=COLOR_0;\n#endif\n"; // eslint-disable-line
9575
9527
 
9576
9528
  var FogVertex = "#define GLSLIFY 1\n#if SCENE_FOG_MODE != 0\nvec4 positionVS=renderer_MVMat*position;v_positionVS=positionVS.xyz/positionVS.w;\n#endif\n"; // eslint-disable-line
9577
9529
 
9578
- var normal_vert = "#define GLSLIFY 1\n#ifndef MATERIAL_OMIT_NORMAL\n#ifdef RENDERER_HAS_NORMAL\nv_normal=normalize(mat3(renderer_NormalMat)*normal);\n#if defined(RENDERER_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEARCOATNORMALTEXTURE) )\nvec3 normalW=normalize(mat3(renderer_NormalMat)*normal.xyz);vec3 tangentW=normalize(mat3(renderer_NormalMat)*tangent.xyz);vec3 bitangentW=cross(normalW,tangentW)*tangent.w;v_TBN=mat3(tangentW,bitangentW,normalW);\n#endif\n#endif\n#endif\n"; // eslint-disable-line
9530
+ var normal_vert = "#define GLSLIFY 1\n#ifndef MATERIAL_OMIT_NORMAL\n#ifdef RENDERER_HAS_NORMAL\nv_normal=normalize(mat3(renderer_NormalMat)*normal);\n#if defined(RENDERER_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\nvec3 normalW=normalize(mat3(renderer_NormalMat)*normal.xyz);vec3 tangentW=normalize(mat3(renderer_NormalMat)*tangent.xyz);vec3 bitangentW=cross(normalW,tangentW)*tangent.w;v_TBN=mat3(tangentW,bitangentW,normalW);\n#endif\n#endif\n#endif\n"; // eslint-disable-line
9579
9531
 
9580
9532
  var position_vert = "#define GLSLIFY 1\ngl_Position=renderer_MVPMat*position;"; // eslint-disable-line
9581
9533
 
9582
- var skinning_vert = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_SKIN\n#ifdef RENDERER_USE_JOINT_TEXTURE\nmat4 skinMatrix=WEIGHTS_0.x*getJointMatrix(renderer_JointSampler,JOINTS_0.x)+WEIGHTS_0.y*getJointMatrix(renderer_JointSampler,JOINTS_0.y)+WEIGHTS_0.z*getJointMatrix(renderer_JointSampler,JOINTS_0.z)+WEIGHTS_0.w*getJointMatrix(renderer_JointSampler,JOINTS_0.w);\n#else\nmat4 skinMatrix=WEIGHTS_0.x*renderer_JointMatrix[int(JOINTS_0.x)]+WEIGHTS_0.y*renderer_JointMatrix[int(JOINTS_0.y)]+WEIGHTS_0.z*renderer_JointMatrix[int(JOINTS_0.z)]+WEIGHTS_0.w*renderer_JointMatrix[int(JOINTS_0.w)];\n#endif\nposition=skinMatrix*position;\n#if defined(RENDERER_HAS_NORMAL) && !defined(MATERIAL_OMIT_NORMAL)\nmat3 skinNormalMatrix=INVERSE_MAT(mat3(skinMatrix));normal=normal*skinNormalMatrix;\n#if defined(RENDERER_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEARCOATNORMALTEXTURE) )\ntangent.xyz=tangent.xyz*skinNormalMatrix;\n#endif\n#endif\n#endif\n"; // eslint-disable-line
9534
+ var skinning_vert = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_SKIN\n#ifdef RENDERER_USE_JOINT_TEXTURE\nmat4 skinMatrix=WEIGHTS_0.x*getJointMatrix(renderer_JointSampler,JOINTS_0.x)+WEIGHTS_0.y*getJointMatrix(renderer_JointSampler,JOINTS_0.y)+WEIGHTS_0.z*getJointMatrix(renderer_JointSampler,JOINTS_0.z)+WEIGHTS_0.w*getJointMatrix(renderer_JointSampler,JOINTS_0.w);\n#else\nmat4 skinMatrix=WEIGHTS_0.x*renderer_JointMatrix[int(JOINTS_0.x)]+WEIGHTS_0.y*renderer_JointMatrix[int(JOINTS_0.y)]+WEIGHTS_0.z*renderer_JointMatrix[int(JOINTS_0.z)]+WEIGHTS_0.w*renderer_JointMatrix[int(JOINTS_0.w)];\n#endif\nposition=skinMatrix*position;\n#if defined(RENDERER_HAS_NORMAL) && !defined(MATERIAL_OMIT_NORMAL)\nmat3 skinNormalMatrix=INVERSE_MAT(mat3(skinMatrix));normal=normal*skinNormalMatrix;\n#if defined(RENDERER_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\ntangent.xyz=tangent.xyz*skinNormalMatrix;\n#endif\n#endif\n#endif\n"; // eslint-disable-line
9583
9535
 
9584
- var uv_vert = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_UV\nv_uv=TEXCOORD_0;\n#else\nv_uv=vec2(0.,0.);\n#endif\n#ifdef RENDERER_HAS_UV1\nv_uv1=TEXCOORD_1;\n#endif\n#ifdef MATERIAL_NEED_TILINGOFFSET\nv_uv=v_uv*material_TilingOffset.xy+material_TilingOffset.zw;\n#endif\n"; // eslint-disable-line
9536
+ var uv_vert = "#define GLSLIFY 1\n#ifdef RENDERER_HAS_UV\nv_uv=TEXCOORD_0;\n#else\nv_uv=vec2(0.,0.);\n#endif\n#ifdef RENDERER_HAS_UV1\nv_uv1=TEXCOORD_1;\n#endif\n#ifdef MATERIAL_NEED_TILING_OFFSET\nv_uv=v_uv*material_TilingOffset.xy+material_TilingOffset.zw;\n#endif\n"; // eslint-disable-line
9585
9537
 
9586
- var worldpos_vert = "#define GLSLIFY 1\n#ifdef MATERIAL_NEED_WORLDPOS\nvec4 temp_pos=renderer_ModelMat*position;v_pos=temp_pos.xyz/temp_pos.w;\n#endif\n"; // eslint-disable-line
9538
+ var worldpos_vert = "#define GLSLIFY 1\n#ifdef MATERIAL_NEED_WORLD_POS\nvec4 temp_pos=renderer_ModelMat*position;v_pos=temp_pos.xyz/temp_pos.w;\n#endif\n"; // eslint-disable-line
9587
9539
 
9588
9540
  var FogFragment = "#define GLSLIFY 1\n#if SCENE_FOG_MODE != 0\nfloat fogIntensity=ComputeFogIntensity(length(v_positionVS));gl_FragColor.rgb=mix(scene_FogColor.rgb,gl_FragColor.rgb,fogIntensity);\n#endif\n"; // eslint-disable-line
9589
9541
 
@@ -9593,7 +9545,7 @@ var mobile_material_frag = "#define GLSLIFY 1\nuniform vec4 material_EmissiveCol
9593
9545
 
9594
9546
  var begin_mobile_frag = "#define GLSLIFY 1\nvec4 ambient=vec4(0.0);vec4 emission=material_EmissiveColor;vec4 diffuse=material_BaseColor;vec4 specular=material_SpecularColor;\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\nvec4 emissiveTextureColor=texture2D(material_EmissiveTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nemissiveTextureColor=gammaToLinear(emissiveTextureColor);\n#endif\nemission*=emissiveTextureColor;\n#endif\n#ifdef MATERIAL_HAS_BASETEXTURE\nvec4 diffuseTextureColor=texture2D(material_BaseTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\ndiffuseTextureColor=gammaToLinear(diffuseTextureColor);\n#endif\ndiffuse*=diffuseTextureColor;\n#endif\n#ifdef RENDERER_HAS_VERTEXCOLOR\ndiffuse*=v_color;\n#endif\n#ifdef MATERIAL_HAS_SPECULAR_TEXTURE\nvec4 specularTextureColor=texture2D(material_SpecularTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nspecularTextureColor=gammaToLinear(specularTextureColor);\n#endif\nspecular*=specularTextureColor;\n#endif\nambient=vec4(scene_EnvMapLight.diffuse*scene_EnvMapLight.diffuseIntensity,1.0)*diffuse;"; // eslint-disable-line
9595
9547
 
9596
- var begin_viewdir_frag = "#define GLSLIFY 1\n#ifdef MATERIAL_NEED_WORLDPOS\nvec3 V=normalize(camera_Position-v_pos);\n#endif\n"; // eslint-disable-line
9548
+ var begin_viewdir_frag = "#define GLSLIFY 1\n#ifdef MATERIAL_NEED_WORLD_POS\nvec3 V=normalize(camera_Position-v_pos);\n#endif\n"; // eslint-disable-line
9597
9549
 
9598
9550
  var mobile_blinnphong_frag = "#define GLSLIFY 1\n#ifdef MATERIAL_HAS_NORMALTEXTURE\nmat3 tbn=getTBN();vec3 N=getNormalByNormalTexture(tbn,material_NormalTexture,material_NormalIntensity,v_uv);\n#else\nvec3 N=getNormal();\n#endif\nvec3 lightDiffuse=vec3(0.0,0.0,0.0);vec3 lightSpecular=vec3(0.0,0.0,0.0);float shadowAttenuation=1.0;\n#ifdef SCENE_DIRECT_LIGHT_COUNT\nshadowAttenuation=1.0;\n#ifdef SCENE_IS_CALCULATE_SHADOWS\nshadowAttenuation*=sampleShadowMap();int sunIndex=int(scene_ShadowInfo.z);\n#endif\nDirectLight directionalLight;for(int i=0;i<SCENE_DIRECT_LIGHT_COUNT;i++){if(isRendererCulledByLight(renderer_Layer.xy,scene_DirectLightCullingMask[i]))continue;directionalLight.color=scene_DirectLightColor[i];\n#ifdef SCENE_IS_CALCULATE_SHADOWS\nif(i==sunIndex){directionalLight.color*=shadowAttenuation;}\n#endif\ndirectionalLight.direction=scene_DirectLightDirection[i];float d=max(dot(N,-directionalLight.direction),0.0);lightDiffuse+=directionalLight.color*d;vec3 halfDir=normalize(V-directionalLight.direction);float s=pow(clamp(dot(N,halfDir),0.0,1.0),material_Shininess);lightSpecular+=directionalLight.color*s;}\n#endif\n#ifdef SCENE_POINT_LIGHT_COUNT\nPointLight pointLight;for(int i=0;i<SCENE_POINT_LIGHT_COUNT;i++){if(isRendererCulledByLight(renderer_Layer.xy,scene_PointLightCullingMask[i]))continue;pointLight.color=scene_PointLightColor[i];pointLight.position=scene_PointLightPosition[i];pointLight.distance=scene_PointLightDistance[i];vec3 direction=v_pos-pointLight.position;float dist=length(direction);direction/=dist;float decay=clamp(1.0-pow(dist/pointLight.distance,4.0),0.0,1.0);float d=max(dot(N,-direction),0.0)*decay;lightDiffuse+=pointLight.color*d;vec3 halfDir=normalize(V-direction);float s=pow(clamp(dot(N,halfDir),0.0,1.0),material_Shininess)*decay;lightSpecular+=pointLight.color*s;}\n#endif\n#ifdef SCENE_SPOT_LIGHT_COUNT\nSpotLight spotLight;for(int i=0;i<SCENE_SPOT_LIGHT_COUNT;i++){if(isRendererCulledByLight(renderer_Layer.xy,scene_SpotLightCullingMask[i]))continue;spotLight.color=scene_SpotLightColor[i];spotLight.position=scene_SpotLightPosition[i];spotLight.direction=scene_SpotLightDirection[i];spotLight.distance=scene_SpotLightDistance[i];spotLight.angleCos=scene_SpotLightAngleCos[i];spotLight.penumbraCos=scene_SpotLightPenumbraCos[i];vec3 direction=spotLight.position-v_pos;float lightDistance=length(direction);direction/=lightDistance;float angleCos=dot(direction,-spotLight.direction);float decay=clamp(1.0-pow(lightDistance/spotLight.distance,4.0),0.0,1.0);float spotEffect=smoothstep(spotLight.penumbraCos,spotLight.angleCos,angleCos);float decayTotal=decay*spotEffect;float d=max(dot(N,direction),0.0)*decayTotal;lightDiffuse+=spotLight.color*d;vec3 halfDir=normalize(V+direction);float s=pow(clamp(dot(N,halfDir),0.0,1.0),material_Shininess)*decayTotal;lightSpecular+=spotLight.color*s;}\n#endif\ndiffuse*=vec4(lightDiffuse,1.0);specular*=vec4(lightSpecular,1.0);\n#ifdef MATERIAL_IS_ALPHA_CUTOFF\nif(diffuse.a<material_AlphaCutoff){discard;}\n#endif\n"; // eslint-disable-line
9599
9551
 
@@ -9629,17 +9581,17 @@ var noise_simplex_3D_grad = "#define GLSLIFY 1\nfloat simplex(vec3 v,out vec3 gr
9629
9581
 
9630
9582
  var noise_simplex_4D = "#define GLSLIFY 1\nvec4 grad4(float j,vec4 ip){const vec4 ones=vec4(1.0,1.0,1.0,-1.0);vec4 p,s;p.xyz=floor(fract(vec3(j)*ip.xyz)*7.0)*ip.z-1.0;p.w=1.5-dot(abs(p.xyz),ones.xyz);s=vec4(lessThan(p,vec4(0.0)));p.xyz=p.xyz+(s.xyz*2.0-1.0)*s.www;return p;}\n#define F4 0.309016994374947451\nfloat simplex(vec4 v){const vec4 C=vec4(0.138196601125011,0.276393202250021,0.414589803375032,-0.447213595499958);vec4 i=floor(v+dot(v,vec4(F4)));vec4 x0=v-i+dot(i,C.xxxx);vec4 i0;vec3 isX=step(x0.yzw,x0.xxx);vec3 isYZ=step(x0.zww,x0.yyz);i0.x=isX.x+isX.y+isX.z;i0.yzw=1.0-isX;i0.y+=isYZ.x+isYZ.y;i0.zw+=1.0-isYZ.xy;i0.z+=isYZ.z;i0.w+=1.0-isYZ.z;vec4 i3=clamp(i0,0.0,1.0);vec4 i2=clamp(i0-1.0,0.0,1.0);vec4 i1=clamp(i0-2.0,0.0,1.0);vec4 x1=x0-i1+C.xxxx;vec4 x2=x0-i2+C.yyyy;vec4 x3=x0-i3+C.zzzz;vec4 x4=x0+C.wwww;i=mod289(i);float j0=permute(permute(permute(permute(i.w)+i.z)+i.y)+i.x);vec4 j1=permute(permute(permute(permute(i.w+vec4(i1.w,i2.w,i3.w,1.0))+i.z+vec4(i1.z,i2.z,i3.z,1.0))+i.y+vec4(i1.y,i2.y,i3.y,1.0))+i.x+vec4(i1.x,i2.x,i3.x,1.0));vec4 ip=vec4(1.0/294.0,1.0/49.0,1.0/7.0,0.0);vec4 p0=grad4(j0,ip);vec4 p1=grad4(j1.x,ip);vec4 p2=grad4(j1.y,ip);vec4 p3=grad4(j1.z,ip);vec4 p4=grad4(j1.w,ip);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;p4*=taylorInvSqrt(dot(p4,p4));vec3 m0=max(0.6-vec3(dot(x0,x0),dot(x1,x1),dot(x2,x2)),0.0);vec2 m1=max(0.6-vec2(dot(x3,x3),dot(x4,x4)),0.0);m0=m0*m0;m1=m1*m1;return 49.0*(dot(m0*m0,vec3(dot(p0,x0),dot(p1,x1),dot(p2,x2)))+dot(m1*m1,vec2(dot(p3,x3),dot(p4,x4))));}"; // eslint-disable-line
9631
9583
 
9632
- var pbr_frag_define = "#define GLSLIFY 1\nuniform float material_AlphaCutoff;uniform vec4 material_BaseColor;uniform float material_Metal;uniform float material_Roughness;uniform vec3 material_PBRSpecularColor;uniform float material_Glossiness;uniform vec3 material_EmissiveColor;\n#ifdef MATERIAL_CLEARCOAT\nuniform float material_ClearCoat;uniform float material_ClearCoatRoughness;\n#endif\nuniform float material_NormalIntensity;uniform float material_OcclusionIntensity;uniform float material_OcclusionTextureCoord;\n#ifdef MATERIAL_HAS_BASETEXTURE\nuniform sampler2D material_BaseTexture;\n#endif\n#ifdef MATERIAL_HAS_NORMALTEXTURE\nuniform sampler2D material_NormalTexture;\n#endif\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\nuniform sampler2D MATERIAL_HAS_EMISSIVETEXTURE;\n#endif\n#ifdef MATERIAL_ROUGHNESSMETALLICTEXTURE\nuniform sampler2D material_RoughnessMetallicTexture;\n#endif\n#ifdef MATERIAL_HAS_SPECULARGLOSSINESSTEXTURE\nuniform sampler2D material_SpecularGlossinessTexture;\n#endif\n#ifdef MATERIAL_OCCLUSIONTEXTURE\nuniform sampler2D material_OcclusionTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEARCOATTEXTURE\nuniform sampler2D material_ClearCoatTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEARCOATROUGHNESSTEXTURE\nuniform sampler2D material_ClearCoatRoughnessTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEARCOATNORMALTEXTURE\nuniform sampler2D material_ClearCoatNormalTexture;\n#endif\nstruct ReflectedLight{vec3 directDiffuse;vec3 directSpecular;vec3 indirectDiffuse;vec3 indirectSpecular;};struct Geometry{vec3 position;vec3 normal;vec3 viewDir;float dotNV;\n#ifdef MATERIAL_CLEARCOAT\nvec3 clearCoatNormal;float clearCoatDotNV;\n#endif\n};struct Material{vec3 diffuseColor;float roughness;vec3 specularColor;float opacity;\n#ifdef MATERIAL_CLEARCOAT\nfloat clearCoat;float clearCoatRoughness;\n#endif\n};"; // eslint-disable-line
9584
+ var pbr_frag_define = "#define GLSLIFY 1\nuniform float material_AlphaCutoff;uniform vec4 material_BaseColor;uniform float material_Metal;uniform float material_Roughness;uniform vec3 material_PBRSpecularColor;uniform float material_Glossiness;uniform vec3 material_EmissiveColor;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nuniform float material_ClearCoat;uniform float material_ClearCoatRoughness;\n#endif\nuniform float material_NormalIntensity;uniform float material_OcclusionIntensity;uniform float material_OcclusionTextureCoord;\n#ifdef MATERIAL_HAS_BASETEXTURE\nuniform sampler2D material_BaseTexture;\n#endif\n#ifdef MATERIAL_HAS_NORMALTEXTURE\nuniform sampler2D material_NormalTexture;\n#endif\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\nuniform sampler2D material_EmissiveTexture;\n#endif\n#ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\nuniform sampler2D material_RoughnessMetallicTexture;\n#endif\n#ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\nuniform sampler2D material_SpecularGlossinessTexture;\n#endif\n#ifdef MATERIAL_HAS_OCCLUSION_TEXTURE\nuniform sampler2D material_OcclusionTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\nuniform sampler2D material_ClearCoatTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\nuniform sampler2D material_ClearCoatRoughnessTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\nuniform sampler2D material_ClearCoatNormalTexture;\n#endif\nstruct ReflectedLight{vec3 directDiffuse;vec3 directSpecular;vec3 indirectDiffuse;vec3 indirectSpecular;};struct Geometry{vec3 position;vec3 normal;vec3 viewDir;float dotNV;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nvec3 clearCoatNormal;float clearCoatDotNV;\n#endif\n};struct Material{vec3 diffuseColor;float roughness;vec3 specularColor;float opacity;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nfloat clearCoat;float clearCoatRoughness;\n#endif\n};"; // eslint-disable-line
9633
9585
 
9634
- var pbr_helper = "#define GLSLIFY 1\n#include <normal_get>\nfloat computeSpecularOcclusion(float ambientOcclusion,float roughness,float dotNV){return saturate(pow(dotNV+ambientOcclusion,exp2(-16.0*roughness-1.0))-1.0+ambientOcclusion);}float getAARoughnessFactor(vec3 normal){\n#ifdef HAS_DERIVATIVES\nvec3 dxy=max(abs(dFdx(normal)),abs(dFdy(normal)));return 0.04+max(max(dxy.x,dxy.y),dxy.z);\n#else\nreturn 0.04;\n#endif\n}void initGeometry(out Geometry geometry){geometry.position=v_pos;geometry.viewDir=normalize(camera_Position-v_pos);\n#if defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEARCOATNORMALTEXTURE)\nmat3 tbn=getTBN();\n#endif\n#ifdef MATERIAL_HAS_NORMALTEXTURE\ngeometry.normal=getNormalByNormalTexture(tbn,material_NormalTexture,material_NormalIntensity,v_uv);\n#else\ngeometry.normal=getNormal();\n#endif\ngeometry.dotNV=saturate(dot(geometry.normal,geometry.viewDir));\n#ifdef MATERIAL_CLEARCOAT\n#ifdef MATERIAL_HAS_CLEARCOATNORMALTEXTURE\ngeometry.clearCoatNormal=getNormalByNormalTexture(tbn,material_ClearCoatNormalTexture,material_NormalIntensity,v_uv);\n#else\ngeometry.clearCoatNormal=getNormal();\n#endif\ngeometry.clearCoatDotNV=saturate(dot(geometry.clearCoatNormal,geometry.viewDir));\n#endif\n}void initMaterial(out Material material,const in Geometry geometry){vec4 baseColor=material_BaseColor;float metal=material_Metal;float roughness=material_Roughness;vec3 specularColor=material_PBRSpecularColor;float glossiness=material_Glossiness;float alphaCutoff=material_AlphaCutoff;\n#ifdef MATERIAL_HAS_BASETEXTURE\nvec4 baseTextureColor=texture2D(material_BaseTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nbaseTextureColor=gammaToLinear(baseTextureColor);\n#endif\nbaseColor*=baseTextureColor;\n#endif\n#ifdef RENDERER_HAS_VERTEXCOLOR\nbaseColor*=v_color;\n#endif\n#ifdef MATERIAL_IS_ALPHA_CUTOFF\nif(baseColor.a<alphaCutoff){discard;}\n#endif\n#ifdef MATERIAL_ROUGHNESSMETALLICTEXTURE\nvec4 metalRoughMapColor=texture2D(material_RoughnessMetallicTexture,v_uv);roughness*=metalRoughMapColor.g;metal*=metalRoughMapColor.b;\n#endif\n#ifdef MATERIAL_HAS_SPECULARGLOSSINESSTEXTURE\nvec4 specularGlossinessColor=texture2D(material_SpecularGlossinessTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nspecularGlossinessColor=gammaToLinear(specularGlossinessColor);\n#endif\nspecularColor*=specularGlossinessColor.rgb;glossiness*=specularGlossinessColor.a;\n#endif\n#ifdef IS_METALLIC_WORKFLOW\nmaterial.diffuseColor=baseColor.rgb*(1.0-metal);material.specularColor=mix(vec3(0.04),baseColor.rgb,metal);material.roughness=roughness;\n#else\nfloat specularStrength=max(max(specularColor.r,specularColor.g),specularColor.b);material.diffuseColor=baseColor.rgb*(1.0-specularStrength);material.specularColor=specularColor;material.roughness=1.0-glossiness;\n#endif\nmaterial.roughness=max(material.roughness,getAARoughnessFactor(geometry.normal));\n#ifdef MATERIAL_CLEARCOAT\nmaterial.clearCoat=material_ClearCoat;material.clearCoatRoughness=material_ClearCoatRoughness;\n#ifdef MATERIAL_HAS_CLEARCOATTEXTURE\nmaterial.clearCoat*=texture2D(material_ClearCoatTexture,v_uv).r;\n#endif\n#ifdef MATERIAL_HAS_CLEARCOATROUGHNESSTEXTURE\nmaterial.clearCoatRoughness*=texture2D(material_ClearCoatRoughnessTexture,v_uv).g;\n#endif\nmaterial.clearCoat=saturate(material.clearCoat);material.clearCoatRoughness=max(material.clearCoatRoughness,getAARoughnessFactor(geometry.clearCoatNormal));\n#endif\n#ifdef MATERIAL_IS_TRANSPARENT\nmaterial.opacity=baseColor.a;\n#else\nmaterial.opacity=1.0;\n#endif\n}\n#include <brdf>\n#include <direct_irradiance_frag_define>\n#include <ibl_frag_define>\n"; // eslint-disable-line
9586
+ var pbr_helper = "#define GLSLIFY 1\n#include <normal_get>\nfloat computeSpecularOcclusion(float ambientOcclusion,float roughness,float dotNV){return saturate(pow(dotNV+ambientOcclusion,exp2(-16.0*roughness-1.0))-1.0+ambientOcclusion);}float getAARoughnessFactor(vec3 normal){\n#ifdef HAS_DERIVATIVES\nvec3 dxy=max(abs(dFdx(normal)),abs(dFdy(normal)));return 0.04+max(max(dxy.x,dxy.y),dxy.z);\n#else\nreturn 0.04;\n#endif\n}void initGeometry(out Geometry geometry){geometry.position=v_pos;geometry.viewDir=normalize(camera_Position-v_pos);\n#if defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE)\nmat3 tbn=getTBN();\n#endif\n#ifdef MATERIAL_HAS_NORMALTEXTURE\ngeometry.normal=getNormalByNormalTexture(tbn,material_NormalTexture,material_NormalIntensity,v_uv);\n#else\ngeometry.normal=getNormal();\n#endif\ngeometry.dotNV=saturate(dot(geometry.normal,geometry.viewDir));\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\n#ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\ngeometry.clearCoatNormal=getNormalByNormalTexture(tbn,material_ClearCoatNormalTexture,material_NormalIntensity,v_uv);\n#else\ngeometry.clearCoatNormal=getNormal();\n#endif\ngeometry.clearCoatDotNV=saturate(dot(geometry.clearCoatNormal,geometry.viewDir));\n#endif\n}void initMaterial(out Material material,const in Geometry geometry){vec4 baseColor=material_BaseColor;float metal=material_Metal;float roughness=material_Roughness;vec3 specularColor=material_PBRSpecularColor;float glossiness=material_Glossiness;float alphaCutoff=material_AlphaCutoff;\n#ifdef MATERIAL_HAS_BASETEXTURE\nvec4 baseTextureColor=texture2D(material_BaseTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nbaseTextureColor=gammaToLinear(baseTextureColor);\n#endif\nbaseColor*=baseTextureColor;\n#endif\n#ifdef RENDERER_HAS_VERTEXCOLOR\nbaseColor*=v_color;\n#endif\n#ifdef MATERIAL_IS_ALPHA_CUTOFF\nif(baseColor.a<alphaCutoff){discard;}\n#endif\n#ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\nvec4 metalRoughMapColor=texture2D(material_RoughnessMetallicTexture,v_uv);roughness*=metalRoughMapColor.g;metal*=metalRoughMapColor.b;\n#endif\n#ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\nvec4 specularGlossinessColor=texture2D(material_SpecularGlossinessTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nspecularGlossinessColor=gammaToLinear(specularGlossinessColor);\n#endif\nspecularColor*=specularGlossinessColor.rgb;glossiness*=specularGlossinessColor.a;\n#endif\n#ifdef IS_METALLIC_WORKFLOW\nmaterial.diffuseColor=baseColor.rgb*(1.0-metal);material.specularColor=mix(vec3(0.04),baseColor.rgb,metal);material.roughness=roughness;\n#else\nfloat specularStrength=max(max(specularColor.r,specularColor.g),specularColor.b);material.diffuseColor=baseColor.rgb*(1.0-specularStrength);material.specularColor=specularColor;material.roughness=1.0-glossiness;\n#endif\nmaterial.roughness=max(material.roughness,getAARoughnessFactor(geometry.normal));\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nmaterial.clearCoat=material_ClearCoat;material.clearCoatRoughness=material_ClearCoatRoughness;\n#ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\nmaterial.clearCoat*=texture2D(material_ClearCoatTexture,v_uv).r;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\nmaterial.clearCoatRoughness*=texture2D(material_ClearCoatRoughnessTexture,v_uv).g;\n#endif\nmaterial.clearCoat=saturate(material.clearCoat);material.clearCoatRoughness=max(material.clearCoatRoughness,getAARoughnessFactor(geometry.clearCoatNormal));\n#endif\n#ifdef MATERIAL_IS_TRANSPARENT\nmaterial.opacity=baseColor.a;\n#else\nmaterial.opacity=1.0;\n#endif\n}\n#include <brdf>\n#include <direct_irradiance_frag_define>\n#include <ibl_frag_define>\n"; // eslint-disable-line
9635
9587
 
9636
9588
  var brdf = "#define GLSLIFY 1\nfloat F_Schlick(float dotLH){return 0.04+0.96*(pow(1.0-dotLH,5.0));}vec3 F_Schlick(vec3 specularColor,float dotLH){float fresnel=exp2((-5.55473*dotLH-6.98316)*dotLH);return(1.0-specularColor)*fresnel+specularColor;}float G_GGX_SmithCorrelated(float alpha,float dotNL,float dotNV){float a2=pow2(alpha);float gv=dotNL*sqrt(a2+(1.0-a2)*pow2(dotNV));float gl=dotNV*sqrt(a2+(1.0-a2)*pow2(dotNL));return 0.5/max(gv+gl,EPSILON);}float D_GGX(float alpha,float dotNH){float a2=pow2(alpha);float denom=pow2(dotNH)*(a2-1.0)+1.0;return RECIPROCAL_PI*a2/pow2(denom);}vec3 BRDF_Specular_GGX(vec3 incidentDirection,vec3 viewDir,vec3 normal,vec3 specularColor,float roughness){float alpha=pow2(roughness);vec3 halfDir=normalize(incidentDirection+viewDir);float dotNL=saturate(dot(normal,incidentDirection));float dotNV=saturate(dot(normal,viewDir));float dotNH=saturate(dot(normal,halfDir));float dotLH=saturate(dot(incidentDirection,halfDir));vec3 F=F_Schlick(specularColor,dotLH);float G=G_GGX_SmithCorrelated(alpha,dotNL,dotNV);float D=D_GGX(alpha,dotNH);return F*(G*D);}vec3 BRDF_Diffuse_Lambert(vec3 diffuseColor){return RECIPROCAL_PI*diffuseColor;}"; // eslint-disable-line
9637
9589
 
9638
- var direct_irradiance_frag_define = "#define GLSLIFY 1\n#include <ShadowFragmentDeclaration>\nvoid addDirectRadiance(vec3 incidentDirection,vec3 color,Geometry geometry,Material material,inout ReflectedLight reflectedLight){float attenuation=1.0;\n#ifdef MATERIAL_CLEARCOAT\nfloat clearCoatDotNL=saturate(dot(geometry.clearCoatNormal,incidentDirection));vec3 clearCoatIrradiance=clearCoatDotNL*color;reflectedLight.directSpecular+=material.clearCoat*clearCoatIrradiance*BRDF_Specular_GGX(incidentDirection,geometry.viewDir,geometry.clearCoatNormal,vec3(0.04),material.clearCoatRoughness);attenuation-=material.clearCoat*F_Schlick(geometry.clearCoatDotNV);\n#endif\nfloat dotNL=saturate(dot(geometry.normal,incidentDirection));vec3 irradiance=dotNL*color*PI;reflectedLight.directSpecular+=attenuation*irradiance*BRDF_Specular_GGX(incidentDirection,geometry.viewDir,geometry.normal,material.specularColor,material.roughness);reflectedLight.directDiffuse+=attenuation*irradiance*BRDF_Diffuse_Lambert(material.diffuseColor);}\n#ifdef SCENE_DIRECT_LIGHT_COUNT\nvoid addDirectionalDirectLightRadiance(DirectLight directionalLight,Geometry geometry,Material material,inout ReflectedLight reflectedLight){vec3 color=directionalLight.color;vec3 direction=-directionalLight.direction;addDirectRadiance(direction,color,geometry,material,reflectedLight);}\n#endif\n#ifdef SCENE_POINT_LIGHT_COUNT\nvoid addPointDirectLightRadiance(PointLight pointLight,Geometry geometry,Material material,inout ReflectedLight reflectedLight){vec3 lVector=pointLight.position-geometry.position;vec3 direction=normalize(lVector);float lightDistance=length(lVector);vec3 color=pointLight.color;color*=clamp(1.0-pow(lightDistance/pointLight.distance,4.0),0.0,1.0);addDirectRadiance(direction,color,geometry,material,reflectedLight);}\n#endif\n#ifdef SCENE_SPOT_LIGHT_COUNT\nvoid addSpotDirectLightRadiance(SpotLight spotLight,Geometry geometry,Material material,inout ReflectedLight reflectedLight){vec3 lVector=spotLight.position-geometry.position;vec3 direction=normalize(lVector);float lightDistance=length(lVector);float angleCos=dot(direction,-spotLight.direction);float spotEffect=smoothstep(spotLight.penumbraCos,spotLight.angleCos,angleCos);float decayEffect=clamp(1.0-pow(lightDistance/spotLight.distance,4.0),0.0,1.0);vec3 color=spotLight.color;color*=spotEffect*decayEffect;addDirectRadiance(direction,color,geometry,material,reflectedLight);}\n#endif\nvoid addTotalDirectRadiance(Geometry geometry,Material material,inout ReflectedLight reflectedLight){float shadowAttenuation=1.0;\n#ifdef SCENE_DIRECT_LIGHT_COUNT\nshadowAttenuation=1.0;\n#ifdef SCENE_IS_CALCULATE_SHADOWS\nshadowAttenuation*=sampleShadowMap();int sunIndex=int(scene_ShadowInfo.z);\n#endif\nDirectLight directionalLight;for(int i=0;i<SCENE_DIRECT_LIGHT_COUNT;i++){if(isRendererCulledByLight(renderer_Layer.xy,scene_DirectLightCullingMask[i]))continue;directionalLight.color=scene_DirectLightColor[i];\n#ifdef SCENE_IS_CALCULATE_SHADOWS\nif(i==sunIndex){directionalLight.color*=shadowAttenuation;}\n#endif\ndirectionalLight.direction=scene_DirectLightDirection[i];addDirectionalDirectLightRadiance(directionalLight,geometry,material,reflectedLight);}\n#endif\n#ifdef SCENE_POINT_LIGHT_COUNT\nPointLight pointLight;for(int i=0;i<SCENE_POINT_LIGHT_COUNT;i++){if(isRendererCulledByLight(renderer_Layer.xy,scene_PointLightCullingMask[i]))continue;pointLight.color=scene_PointLightColor[i];pointLight.position=scene_PointLightPosition[i];pointLight.distance=scene_PointLightDistance[i];addPointDirectLightRadiance(pointLight,geometry,material,reflectedLight);}\n#endif\n#ifdef SCENE_SPOT_LIGHT_COUNT\nSpotLight spotLight;for(int i=0;i<SCENE_SPOT_LIGHT_COUNT;i++){if(isRendererCulledByLight(renderer_Layer.xy,scene_SpotLightCullingMask[i]))continue;spotLight.color=scene_SpotLightColor[i];spotLight.position=scene_SpotLightPosition[i];spotLight.direction=scene_SpotLightDirection[i];spotLight.distance=scene_SpotLightDistance[i];spotLight.angleCos=scene_SpotLightAngleCos[i];spotLight.penumbraCos=scene_SpotLightPenumbraCos[i];addSpotDirectLightRadiance(spotLight,geometry,material,reflectedLight);}\n#endif\n}"; // eslint-disable-line
9590
+ var direct_irradiance_frag_define = "#define GLSLIFY 1\n#include <ShadowFragmentDeclaration>\nvoid addDirectRadiance(vec3 incidentDirection,vec3 color,Geometry geometry,Material material,inout ReflectedLight reflectedLight){float attenuation=1.0;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nfloat clearCoatDotNL=saturate(dot(geometry.clearCoatNormal,incidentDirection));vec3 clearCoatIrradiance=clearCoatDotNL*color;reflectedLight.directSpecular+=material.clearCoat*clearCoatIrradiance*BRDF_Specular_GGX(incidentDirection,geometry.viewDir,geometry.clearCoatNormal,vec3(0.04),material.clearCoatRoughness);attenuation-=material.clearCoat*F_Schlick(geometry.clearCoatDotNV);\n#endif\nfloat dotNL=saturate(dot(geometry.normal,incidentDirection));vec3 irradiance=dotNL*color*PI;reflectedLight.directSpecular+=attenuation*irradiance*BRDF_Specular_GGX(incidentDirection,geometry.viewDir,geometry.normal,material.specularColor,material.roughness);reflectedLight.directDiffuse+=attenuation*irradiance*BRDF_Diffuse_Lambert(material.diffuseColor);}\n#ifdef SCENE_DIRECT_LIGHT_COUNT\nvoid addDirectionalDirectLightRadiance(DirectLight directionalLight,Geometry geometry,Material material,inout ReflectedLight reflectedLight){vec3 color=directionalLight.color;vec3 direction=-directionalLight.direction;addDirectRadiance(direction,color,geometry,material,reflectedLight);}\n#endif\n#ifdef SCENE_POINT_LIGHT_COUNT\nvoid addPointDirectLightRadiance(PointLight pointLight,Geometry geometry,Material material,inout ReflectedLight reflectedLight){vec3 lVector=pointLight.position-geometry.position;vec3 direction=normalize(lVector);float lightDistance=length(lVector);vec3 color=pointLight.color;color*=clamp(1.0-pow(lightDistance/pointLight.distance,4.0),0.0,1.0);addDirectRadiance(direction,color,geometry,material,reflectedLight);}\n#endif\n#ifdef SCENE_SPOT_LIGHT_COUNT\nvoid addSpotDirectLightRadiance(SpotLight spotLight,Geometry geometry,Material material,inout ReflectedLight reflectedLight){vec3 lVector=spotLight.position-geometry.position;vec3 direction=normalize(lVector);float lightDistance=length(lVector);float angleCos=dot(direction,-spotLight.direction);float spotEffect=smoothstep(spotLight.penumbraCos,spotLight.angleCos,angleCos);float decayEffect=clamp(1.0-pow(lightDistance/spotLight.distance,4.0),0.0,1.0);vec3 color=spotLight.color;color*=spotEffect*decayEffect;addDirectRadiance(direction,color,geometry,material,reflectedLight);}\n#endif\nvoid addTotalDirectRadiance(Geometry geometry,Material material,inout ReflectedLight reflectedLight){float shadowAttenuation=1.0;\n#ifdef SCENE_DIRECT_LIGHT_COUNT\nshadowAttenuation=1.0;\n#ifdef SCENE_IS_CALCULATE_SHADOWS\nshadowAttenuation*=sampleShadowMap();int sunIndex=int(scene_ShadowInfo.z);\n#endif\nDirectLight directionalLight;for(int i=0;i<SCENE_DIRECT_LIGHT_COUNT;i++){if(isRendererCulledByLight(renderer_Layer.xy,scene_DirectLightCullingMask[i]))continue;directionalLight.color=scene_DirectLightColor[i];\n#ifdef SCENE_IS_CALCULATE_SHADOWS\nif(i==sunIndex){directionalLight.color*=shadowAttenuation;}\n#endif\ndirectionalLight.direction=scene_DirectLightDirection[i];addDirectionalDirectLightRadiance(directionalLight,geometry,material,reflectedLight);}\n#endif\n#ifdef SCENE_POINT_LIGHT_COUNT\nPointLight pointLight;for(int i=0;i<SCENE_POINT_LIGHT_COUNT;i++){if(isRendererCulledByLight(renderer_Layer.xy,scene_PointLightCullingMask[i]))continue;pointLight.color=scene_PointLightColor[i];pointLight.position=scene_PointLightPosition[i];pointLight.distance=scene_PointLightDistance[i];addPointDirectLightRadiance(pointLight,geometry,material,reflectedLight);}\n#endif\n#ifdef SCENE_SPOT_LIGHT_COUNT\nSpotLight spotLight;for(int i=0;i<SCENE_SPOT_LIGHT_COUNT;i++){if(isRendererCulledByLight(renderer_Layer.xy,scene_SpotLightCullingMask[i]))continue;spotLight.color=scene_SpotLightColor[i];spotLight.position=scene_SpotLightPosition[i];spotLight.direction=scene_SpotLightDirection[i];spotLight.distance=scene_SpotLightDistance[i];spotLight.angleCos=scene_SpotLightAngleCos[i];spotLight.penumbraCos=scene_SpotLightPenumbraCos[i];addSpotDirectLightRadiance(spotLight,geometry,material,reflectedLight);}\n#endif\n}"; // eslint-disable-line
9639
9591
 
9640
9592
  var ibl_frag_define = "#define GLSLIFY 1\nvec3 getLightProbeIrradiance(vec3 sh[9],vec3 normal){normal.x=-normal.x;vec3 result=sh[0]+sh[1]*(normal.y)+sh[2]*(normal.z)+sh[3]*(normal.x)+sh[4]*(normal.y*normal.x)+sh[5]*(normal.y*normal.z)+sh[6]*(3.0*normal.z*normal.z-1.0)+sh[7]*(normal.z*normal.x)+sh[8]*(normal.x*normal.x-normal.y*normal.y);return max(result,vec3(0.0));}vec3 envBRDFApprox(vec3 specularColor,float roughness,float dotNV){const vec4 c0=vec4(-1,-0.0275,-0.572,0.022);const vec4 c1=vec4(1,0.0425,1.04,-0.04);vec4 r=roughness*c0+c1;float a004=min(r.x*r.x,exp2(-9.28*dotNV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}float getSpecularMIPLevel(float roughness,int maxMIPLevel){return roughness*float(maxMIPLevel);}vec3 getLightProbeRadiance(vec3 viewDir,vec3 normal,float roughness,int maxMIPLevel,float specularIntensity){\n#ifndef SCENE_USE_SPECULAR_ENV\nreturn vec3(0);\n#else\nvec3 reflectVec=reflect(-viewDir,normal);reflectVec.x=-reflectVec.x;float specularMIPLevel=getSpecularMIPLevel(roughness,maxMIPLevel);\n#ifdef HAS_TEX_LOD\nvec4 envMapColor=textureCubeLodEXT(scene_EnvSpecularSampler,reflectVec,specularMIPLevel);\n#else\nvec4 envMapColor=textureCube(scene_EnvSpecularSampler,reflectVec,specularMIPLevel);\n#endif\n#ifdef SCENE_IS_DECODE_ENV_RGBM\nenvMapColor.rgb=RGBMToLinear(envMapColor,5.0).rgb;\n#ifdef ENGINE_IS_COLORSPACE_GAMMA\nenvMapColor=linearToGamma(envMapColor);\n#endif\n#else\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nenvMapColor=gammaToLinear(envMapColor);\n#endif\n#endif\nreturn envMapColor.rgb*specularIntensity;\n#endif\n}"; // eslint-disable-line
9641
9593
 
9642
- var pbr_frag = "#define GLSLIFY 1\nGeometry geometry;Material material;ReflectedLight reflectedLight=ReflectedLight(vec3(0.0),vec3(0.0),vec3(0.0),vec3(0.0));initGeometry(geometry);initMaterial(material,geometry);addTotalDirectRadiance(geometry,material,reflectedLight);\n#ifdef SCENE_USE_SH\nvec3 irradiance=getLightProbeIrradiance(scene_EnvSH,geometry.normal);\n#ifdef ENGINE_IS_COLORSPACE_GAMMA\nirradiance=linearToGamma(vec4(irradiance,1.0)).rgb;\n#endif\nirradiance*=scene_EnvMapLight.diffuseIntensity;\n#else\nvec3 irradiance=scene_EnvMapLight.diffuse*scene_EnvMapLight.diffuseIntensity;irradiance*=PI;\n#endif\nreflectedLight.indirectDiffuse+=irradiance*BRDF_Diffuse_Lambert(material.diffuseColor);vec3 radiance=getLightProbeRadiance(geometry.viewDir,geometry.normal,material.roughness,int(scene_EnvMapLight.mipMapLevel),scene_EnvMapLight.specularIntensity);float radianceAttenuation=1.0;\n#ifdef MATERIAL_CLEARCOAT\nvec3 clearCoatRadiance=getLightProbeRadiance(geometry.viewDir,geometry.clearCoatNormal,material.clearCoatRoughness,int(scene_EnvMapLight.mipMapLevel),scene_EnvMapLight.specularIntensity);reflectedLight.indirectSpecular+=clearCoatRadiance*material.clearCoat*envBRDFApprox(vec3(0.04),material.clearCoatRoughness,geometry.clearCoatDotNV);radianceAttenuation-=material.clearCoat*F_Schlick(geometry.clearCoatDotNV);\n#endif\nreflectedLight.indirectSpecular+=radianceAttenuation*radiance*envBRDFApprox(material.specularColor,material.roughness,geometry.dotNV);\n#ifdef MATERIAL_OCCLUSIONTEXTURE\nvec2 aoUV=v_uv;\n#ifdef RENDERER_HAS_UV1\nif(material_OcclusionTextureCoord==1.0){aoUV=v_uv1;}\n#endif\nfloat ambientOcclusion=(texture2D(material_OcclusionTexture,aoUV).r-1.0)*material_OcclusionIntensity+1.0;reflectedLight.indirectDiffuse*=ambientOcclusion;\n#ifdef SCENE_USE_SPECULAR_ENV\nreflectedLight.indirectSpecular*=computeSpecularOcclusion(ambientOcclusion,material.roughness,geometry.dotNV);\n#endif\n#endif\nvec3 emissiveRadiance=material_EmissiveColor;\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\nvec4 emissiveColor=texture2D(material_EmissiveTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nemissiveColor=gammaToLinear(emissiveColor);\n#endif\nemissiveRadiance*=emissiveColor.rgb;\n#endif\nvec3 totalRadiance=reflectedLight.directDiffuse+reflectedLight.indirectDiffuse+reflectedLight.directSpecular+reflectedLight.indirectSpecular+emissiveRadiance;vec4 targetColor=vec4(totalRadiance,material.opacity);gl_FragColor=targetColor;"; // eslint-disable-line
9594
+ var pbr_frag = "#define GLSLIFY 1\nGeometry geometry;Material material;ReflectedLight reflectedLight=ReflectedLight(vec3(0.0),vec3(0.0),vec3(0.0),vec3(0.0));initGeometry(geometry);initMaterial(material,geometry);addTotalDirectRadiance(geometry,material,reflectedLight);\n#ifdef SCENE_USE_SH\nvec3 irradiance=getLightProbeIrradiance(scene_EnvSH,geometry.normal);\n#ifdef ENGINE_IS_COLORSPACE_GAMMA\nirradiance=linearToGamma(vec4(irradiance,1.0)).rgb;\n#endif\nirradiance*=scene_EnvMapLight.diffuseIntensity;\n#else\nvec3 irradiance=scene_EnvMapLight.diffuse*scene_EnvMapLight.diffuseIntensity;irradiance*=PI;\n#endif\nreflectedLight.indirectDiffuse+=irradiance*BRDF_Diffuse_Lambert(material.diffuseColor);vec3 radiance=getLightProbeRadiance(geometry.viewDir,geometry.normal,material.roughness,int(scene_EnvMapLight.mipMapLevel),scene_EnvMapLight.specularIntensity);float radianceAttenuation=1.0;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nvec3 clearCoatRadiance=getLightProbeRadiance(geometry.viewDir,geometry.clearCoatNormal,material.clearCoatRoughness,int(scene_EnvMapLight.mipMapLevel),scene_EnvMapLight.specularIntensity);reflectedLight.indirectSpecular+=clearCoatRadiance*material.clearCoat*envBRDFApprox(vec3(0.04),material.clearCoatRoughness,geometry.clearCoatDotNV);radianceAttenuation-=material.clearCoat*F_Schlick(geometry.clearCoatDotNV);\n#endif\nreflectedLight.indirectSpecular+=radianceAttenuation*radiance*envBRDFApprox(material.specularColor,material.roughness,geometry.dotNV);\n#ifdef MATERIAL_HAS_OCCLUSION_TEXTURE\nvec2 aoUV=v_uv;\n#ifdef RENDERER_HAS_UV1\nif(material_OcclusionTextureCoord==1.0){aoUV=v_uv1;}\n#endif\nfloat ambientOcclusion=(texture2D(material_OcclusionTexture,aoUV).r-1.0)*material_OcclusionIntensity+1.0;reflectedLight.indirectDiffuse*=ambientOcclusion;\n#ifdef SCENE_USE_SPECULAR_ENV\nreflectedLight.indirectSpecular*=computeSpecularOcclusion(ambientOcclusion,material.roughness,geometry.dotNV);\n#endif\n#endif\nvec3 emissiveRadiance=material_EmissiveColor;\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\nvec4 emissiveColor=texture2D(material_EmissiveTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nemissiveColor=gammaToLinear(emissiveColor);\n#endif\nemissiveRadiance*=emissiveColor.rgb;\n#endif\nvec3 totalRadiance=reflectedLight.directDiffuse+reflectedLight.indirectDiffuse+reflectedLight.directSpecular+reflectedLight.indirectSpecular+emissiveRadiance;vec4 targetColor=vec4(totalRadiance,material.opacity);gl_FragColor=targetColor;"; // eslint-disable-line
9643
9595
 
9644
9596
  var PBRShaderLib = {
9645
9597
  pbr_frag_define: pbr_frag_define,
@@ -9668,7 +9620,7 @@ var ShadowLib = {
9668
9620
  ShadowVertex: ShadowVertex
9669
9621
  };
9670
9622
 
9671
- var normal_get = "#define GLSLIFY 1\nvec3 getNormal(){\n#ifdef RENDERER_HAS_NORMAL\nvec3 normal=normalize(v_normal);\n#elif defined(HAS_DERIVATIVES)\nvec3 pos_dx=dFdx(v_pos);vec3 pos_dy=dFdy(v_pos);vec3 normal=normalize(cross(pos_dx,pos_dy));\n#else\nvec3 normal=vec3(0,0,1);\n#endif\nnormal*=float(gl_FrontFacing)*2.0-1.0;return normal;}vec3 getNormalByNormalTexture(mat3 tbn,sampler2D normalTexture,float normalIntensity,vec2 uv){vec3 normal=texture2D(normalTexture,uv).rgb;normal=normalize(tbn*((2.0*normal-1.0)*vec3(normalIntensity,normalIntensity,1.0)));normal*=float(gl_FrontFacing)*2.0-1.0;return normal;}mat3 getTBN(){\n#if defined(RENDERER_HAS_NORMAL) && defined(RENDERER_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEARCOATNORMALTEXTURE) )\nmat3 tbn=v_TBN;\n#else\nvec3 normal=getNormal();vec3 position=v_pos;vec2 uv=gl_FrontFacing? v_uv:-v_uv;\n#ifdef HAS_DERIVATIVES\nvec3 dp1=dFdx(position);vec3 dp2=dFdy(position);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;float invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));mat3 tbn=mat3(tangent*invmax,binormal*invmax,normal);\n#else\nmat3 tbn=mat3(vec3(0.0),vec3(0.0),normal);\n#endif\n#endif\nreturn tbn;}"; // eslint-disable-line
9623
+ var normal_get = "#define GLSLIFY 1\nvec3 getNormal(){\n#ifdef RENDERER_HAS_NORMAL\nvec3 normal=normalize(v_normal);\n#elif defined(HAS_DERIVATIVES)\nvec3 pos_dx=dFdx(v_pos);vec3 pos_dy=dFdy(v_pos);vec3 normal=normalize(cross(pos_dx,pos_dy));\n#else\nvec3 normal=vec3(0,0,1);\n#endif\nnormal*=float(gl_FrontFacing)*2.0-1.0;return normal;}vec3 getNormalByNormalTexture(mat3 tbn,sampler2D normalTexture,float normalIntensity,vec2 uv){vec3 normal=texture2D(normalTexture,uv).rgb;normal=normalize(tbn*((2.0*normal-1.0)*vec3(normalIntensity,normalIntensity,1.0)));normal*=float(gl_FrontFacing)*2.0-1.0;return normal;}mat3 getTBN(){\n#if defined(RENDERER_HAS_NORMAL) && defined(RENDERER_HAS_TANGENT) && ( defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) )\nmat3 tbn=v_TBN;\n#else\nvec3 normal=getNormal();vec3 position=v_pos;vec2 uv=gl_FrontFacing? v_uv:-v_uv;\n#ifdef HAS_DERIVATIVES\nvec3 dp1=dFdx(position);vec3 dp2=dFdy(position);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;float invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));mat3 tbn=mat3(tangent*invmax,binormal*invmax,normal);\n#else\nmat3 tbn=mat3(vec3(0.0),vec3(0.0),normal);\n#endif\n#endif\nreturn tbn;}"; // eslint-disable-line
9672
9624
 
9673
9625
  var ShaderLib = _extends({
9674
9626
  common: common,
@@ -10783,7 +10735,6 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10783
10735
  };
10784
10736
  _proto.update = function update(deltaTime) {};
10785
10737
  /**
10786
- * @override
10787
10738
  * @internal
10788
10739
  */ _proto._onEnable = function _onEnable() {
10789
10740
  var componentsManager = this.engine._componentsManager;
@@ -10793,7 +10744,6 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10793
10744
  componentsManager.addRenderer(this);
10794
10745
  };
10795
10746
  /**
10796
- * @override
10797
10747
  * @internal
10798
10748
  */ _proto._onDisable = function _onDisable() {
10799
10749
  var componentsManager = this.engine._componentsManager;
@@ -10820,7 +10770,6 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10820
10770
  ShaderMacroCollection.unionCollection(context.camera._globalShaderMacro, this.shaderData._macroCollection, this._globalShaderMacro);
10821
10771
  };
10822
10772
  /**
10823
- * @override
10824
10773
  * @internal
10825
10774
  */ _proto._onDestroy = function _onDestroy() {
10826
10775
  Component.prototype._onDestroy.call(this);
@@ -11213,9 +11162,7 @@ SimpleSpriteAssembler = __decorate([
11213
11162
  */ _proto._cloneTo = function _cloneTo(target) {
11214
11163
  target.sprite = this._sprite;
11215
11164
  };
11216
- /**
11217
- * @override
11218
- */ _proto._updateBounds = function _updateBounds(worldBounds) {
11165
+ _proto._updateBounds = function _updateBounds(worldBounds) {
11219
11166
  var _this_sprite;
11220
11167
  if (!((_this_sprite = this.sprite) == null ? void 0 : _this_sprite.texture) || !this.width || !this.height) {
11221
11168
  worldBounds.min.set(0, 0, 0);
@@ -11225,7 +11172,6 @@ SimpleSpriteAssembler = __decorate([
11225
11172
  }
11226
11173
  };
11227
11174
  /**
11228
- * @override
11229
11175
  * @inheritdoc
11230
11176
  */ _proto._render = function _render(context) {
11231
11177
  var _this_sprite;
@@ -11251,7 +11197,6 @@ SimpleSpriteAssembler = __decorate([
11251
11197
  this._maskElement = renderElement;
11252
11198
  };
11253
11199
  /**
11254
- * @override
11255
11200
  * @inheritdoc
11256
11201
  */ _proto._onDestroy = function _onDestroy() {
11257
11202
  var _this__sprite;
@@ -11672,16 +11617,11 @@ var BufferUtil = /*#__PURE__*/ function() {
11672
11617
  if (dataOffset === void 0) dataOffset = 0;
11673
11618
  this._platformBuffer.getData(data, bufferByteOffset, dataOffset, dataLength);
11674
11619
  };
11675
- /**
11676
- * @override
11677
- */ _proto._rebuild = function _rebuild() {
11620
+ _proto._rebuild = function _rebuild() {
11678
11621
  var platformBuffer = this._engine._hardwareRenderer.createPlatformBuffer(this._type, this._byteLength, this._bufferUsage);
11679
11622
  this._platformBuffer = platformBuffer;
11680
11623
  };
11681
- /**
11682
- * @override
11683
- * @internal
11684
- */ _proto._onDestroy = function _onDestroy() {
11624
+ _proto._onDestroy = function _onDestroy() {
11685
11625
  GraphicsResource.prototype._onDestroy.call(this);
11686
11626
  this._platformBuffer.destroy();
11687
11627
  };
@@ -11874,22 +11814,17 @@ var BufferUtil = /*#__PURE__*/ function() {
11874
11814
  this._platformPrimitive.draw(shaderProgram, subMesh);
11875
11815
  this._bufferStructChanged = false;
11876
11816
  };
11877
- /**
11878
- * @override
11879
- */ _proto._addReferCount = function _addReferCount(value) {
11817
+ _proto._addReferCount = function _addReferCount(value) {
11880
11818
  GraphicsResource.prototype._addReferCount.call(this, value);
11881
11819
  var vertexBufferBindings = this._vertexBufferBindings;
11882
11820
  for(var i = 0, n = vertexBufferBindings.length; i < n; i++){
11883
11821
  vertexBufferBindings[i]._buffer._addReferCount(value);
11884
11822
  }
11885
11823
  };
11886
- /**
11887
- * @override
11888
- */ _proto._rebuild = function _rebuild() {
11824
+ _proto._rebuild = function _rebuild() {
11889
11825
  this._engine._hardwareRenderer.createPlatformPrimitive(this);
11890
11826
  };
11891
11827
  /**
11892
- * @override
11893
11828
  * @internal
11894
11829
  */ _proto._onDestroy = function _onDestroy() {
11895
11830
  GraphicsResource.prototype._onDestroy.call(this);
@@ -13043,10 +12978,7 @@ var MeshModifyFlags;
13043
12978
  }
13044
12979
  this.setTangents(tangents);
13045
12980
  };
13046
- /**
13047
- * @override
13048
- * @internal
13049
- */ _proto._onDestroy = function _onDestroy() {
12981
+ _proto._onDestroy = function _onDestroy() {
13050
12982
  Mesh.prototype._onDestroy.call(this);
13051
12983
  this._readable && this._releaseCache();
13052
12984
  };
@@ -13521,10 +13453,7 @@ var VertexChangedFlags;
13521
13453
  return _this;
13522
13454
  }
13523
13455
  var _proto = MeshRenderer.prototype;
13524
- /**
13525
- * @internal
13526
- * @override
13527
- */ _proto._onDestroy = function _onDestroy() {
13456
+ _proto._onDestroy = function _onDestroy() {
13528
13457
  Renderer.prototype._onDestroy.call(this);
13529
13458
  var mesh = this._mesh;
13530
13459
  if (mesh && !mesh.destroyed) {
@@ -13537,9 +13466,7 @@ var VertexChangedFlags;
13537
13466
  */ _proto._cloneTo = function _cloneTo(target) {
13538
13467
  target.mesh = this._mesh;
13539
13468
  };
13540
- /**
13541
- * @override
13542
- */ _proto._updateBounds = function _updateBounds(worldBounds) {
13469
+ _proto._updateBounds = function _updateBounds(worldBounds) {
13543
13470
  var mesh = this._mesh;
13544
13471
  if (mesh) {
13545
13472
  var localBounds = mesh.bounds;
@@ -13550,9 +13477,7 @@ var VertexChangedFlags;
13550
13477
  worldBounds.max.set(0, 0, 0);
13551
13478
  }
13552
13479
  };
13553
- /**
13554
- * @override
13555
- */ _proto._render = function _render(context) {
13480
+ _proto._render = function _render(context) {
13556
13481
  var mesh = this._mesh;
13557
13482
  if (mesh) {
13558
13483
  if (this._dirtyUpdateFlag & 0x2) {
@@ -13713,9 +13638,7 @@ var /**
13713
13638
  }
13714
13639
  }
13715
13640
  };
13716
- /**
13717
- * @override
13718
- */ _proto._updateShaderData = function _updateShaderData(context) {
13641
+ _proto._updateShaderData = function _updateShaderData(context) {
13719
13642
  var entity = this.entity;
13720
13643
  var worldMatrix = this._rootBone ? this._rootBone.transform.worldMatrix : entity.transform.worldMatrix;
13721
13644
  this._updateTransformShaderData(context, worldMatrix);
@@ -13770,14 +13693,10 @@ var /**
13770
13693
  MeshRenderer.prototype._cloneTo.call(this, target);
13771
13694
  this._blendShapeWeights && (target._blendShapeWeights = this._blendShapeWeights.slice());
13772
13695
  };
13773
- /**
13774
- * @override
13775
- */ _proto._registerEntityTransformListener = function _registerEntityTransformListener() {
13696
+ _proto._registerEntityTransformListener = function _registerEntityTransformListener() {
13776
13697
  // Cancel register listener to entity transform.
13777
13698
  };
13778
- /**
13779
- * @override
13780
- */ _proto._updateBounds = function _updateBounds(worldBounds) {
13699
+ _proto._updateBounds = function _updateBounds(worldBounds) {
13781
13700
  if (this._rootBone) {
13782
13701
  var localBounds = this._localBounds;
13783
13702
  var worldMatrix = this._rootBone.transform.worldMatrix;
@@ -13997,9 +13916,7 @@ __decorate([
13997
13916
  return _this;
13998
13917
  }
13999
13918
  var _proto = PrimitiveMeshRestorer.prototype;
14000
- /**
14001
- * @override
14002
- */ _proto.restoreContent = function restoreContent() {
13919
+ _proto.restoreContent = function restoreContent() {
14003
13920
  var primitiveInfo = this.primitiveInfo;
14004
13921
  switch(primitiveInfo.type){
14005
13922
  case 0:
@@ -14059,7 +13976,6 @@ var PrimitiveType;
14059
13976
  _this = PrimitiveRestoreInfo.call(this, 0, noLongerAccessible) || this;
14060
13977
  _this.radius = radius;
14061
13978
  _this.segments = segments;
14062
- _this.noLongerAccessible = noLongerAccessible;
14063
13979
  return _this;
14064
13980
  }
14065
13981
  return SphereRestoreInfo;
@@ -14074,7 +13990,6 @@ var PrimitiveType;
14074
13990
  _this.width = width;
14075
13991
  _this.height = height;
14076
13992
  _this.depth = depth;
14077
- _this.noLongerAccessible = noLongerAccessible;
14078
13993
  return _this;
14079
13994
  }
14080
13995
  return CuboidRestoreInfo;
@@ -14090,7 +14005,6 @@ var PrimitiveType;
14090
14005
  _this.height = height;
14091
14006
  _this.horizontalSegments = horizontalSegments;
14092
14007
  _this.verticalSegments = verticalSegments;
14093
- _this.noLongerAccessible = noLongerAccessible;
14094
14008
  return _this;
14095
14009
  }
14096
14010
  return PlaneRestoreInfo;
@@ -14107,7 +14021,6 @@ var PrimitiveType;
14107
14021
  _this.height = height;
14108
14022
  _this.radialSegments = radialSegments;
14109
14023
  _this.heightSegments = heightSegments;
14110
- _this.noLongerAccessible = noLongerAccessible;
14111
14024
  return _this;
14112
14025
  }
14113
14026
  return CylinderRestoreInfo;
@@ -14124,7 +14037,6 @@ var PrimitiveType;
14124
14037
  _this.radialSegments = radialSegments;
14125
14038
  _this.tubularSegments = tubularSegments;
14126
14039
  _this.arc = arc;
14127
- _this.noLongerAccessible = noLongerAccessible;
14128
14040
  return _this;
14129
14041
  }
14130
14042
  return TorusRestoreInfo;
@@ -14140,7 +14052,6 @@ var PrimitiveType;
14140
14052
  _this.height = height;
14141
14053
  _this.radialSegments = radialSegments;
14142
14054
  _this.heightSegments = heightSegments;
14143
- _this.noLongerAccessible = noLongerAccessible;
14144
14055
  return _this;
14145
14056
  }
14146
14057
  return ConeRestoreInfo;
@@ -14156,7 +14067,6 @@ var PrimitiveType;
14156
14067
  _this.height = height;
14157
14068
  _this.radialSegments = radialSegments;
14158
14069
  _this.heightSegments = heightSegments;
14159
- _this.noLongerAccessible = noLongerAccessible;
14160
14070
  return _this;
14161
14071
  }
14162
14072
  return CapsuleRestoreInfo;
@@ -17150,14 +17060,12 @@ ShaderPool.init();
17150
17060
  /**
17151
17061
  * @internal
17152
17062
  * @inheritDoc
17153
- * @override
17154
17063
  */ _proto._onAwake = function _onAwake() {
17155
17064
  this.onAwake();
17156
17065
  };
17157
17066
  /**
17158
17067
  * @internal
17159
17068
  * @inheritDoc
17160
- * @override
17161
17069
  */ _proto._onEnable = function _onEnable() {
17162
17070
  if (this._waitHandlingInValid) {
17163
17071
  this._waitHandlingInValid = false;
@@ -17183,7 +17091,6 @@ ShaderPool.init();
17183
17091
  /**
17184
17092
  * @internal
17185
17093
  * @inheritDoc
17186
- * @override
17187
17094
  */ _proto._onDisable = function _onDisable() {
17188
17095
  this._waitHandlingInValid = true;
17189
17096
  this._engine._componentsManager.addDisableScript(this);
@@ -17206,10 +17113,7 @@ ShaderPool.init();
17206
17113
  this._entity._removeScript(this);
17207
17114
  this._waitHandlingInValid = false;
17208
17115
  };
17209
- /**
17210
- * @override
17211
- * @internal
17212
- */ _proto._onDestroy = function _onDestroy() {
17116
+ _proto._onDestroy = function _onDestroy() {
17213
17117
  Component.prototype._onDestroy.call(this);
17214
17118
  this._engine._componentsManager.addPendingDestroyScript(this);
17215
17119
  };
@@ -18882,19 +18786,16 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
18882
18786
  this._replacementSubShaderTag = null;
18883
18787
  };
18884
18788
  /**
18885
- * @override
18886
18789
  * @inheritdoc
18887
18790
  */ _proto._onEnable = function _onEnable() {
18888
18791
  this.entity.scene._attachRenderCamera(this);
18889
18792
  };
18890
18793
  /**
18891
- * @override
18892
18794
  * @inheritdoc
18893
18795
  */ _proto._onDisable = function _onDisable() {
18894
18796
  this.entity.scene._detachRenderCamera(this);
18895
18797
  };
18896
18798
  /**
18897
- * @override
18898
18799
  * @inheritdoc
18899
18800
  */ _proto._onDestroy = function _onDestroy() {
18900
18801
  var _this__renderPipeline;
@@ -19458,7 +19359,6 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
19458
19359
  }
19459
19360
  };
19460
19361
  /**
19461
- * @override
19462
19362
  * Clone and return the instance.
19463
19363
  */ _proto.clone = function clone() {
19464
19364
  var dest = new BaseMaterial(this._engine, this.shader);
@@ -19466,7 +19366,6 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
19466
19366
  return dest;
19467
19367
  };
19468
19368
  /**
19469
- * @override
19470
19369
  * Clone to the target material.
19471
19370
  * @param target - target material
19472
19371
  */ _proto.cloneTo = function cloneTo(target) {
@@ -19627,8 +19526,8 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
19627
19526
  var _this;
19628
19527
  _this = BaseMaterial.call(this, engine, Shader.find("blinn-phong")) || this;
19629
19528
  var shaderData = _this.shaderData;
19630
- shaderData.enableMacro("MATERIAL_NEED_WORLDPOS");
19631
- shaderData.enableMacro("MATERIAL_NEED_TILINGOFFSET");
19529
+ shaderData.enableMacro("MATERIAL_NEED_WORLD_POS");
19530
+ shaderData.enableMacro("MATERIAL_NEED_TILING_OFFSET");
19632
19531
  shaderData.setColor(BlinnPhongMaterial._baseColorProp, new engineMath.Color(1, 1, 1, 1));
19633
19532
  shaderData.setColor(BlinnPhongMaterial._specularColorProp, new engineMath.Color(1, 1, 1, 1));
19634
19533
  shaderData.setColor(BlinnPhongMaterial._emissiveColorProp, new engineMath.Color(0, 0, 0, 1));
@@ -19638,9 +19537,7 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
19638
19537
  return _this;
19639
19538
  }
19640
19539
  var _proto = BlinnPhongMaterial.prototype;
19641
- /**
19642
- * @override
19643
- */ _proto.clone = function clone() {
19540
+ _proto.clone = function clone() {
19644
19541
  var dest = new BlinnPhongMaterial(this._engine);
19645
19542
  this.cloneTo(dest);
19646
19543
  return dest;
@@ -19823,8 +19720,8 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
19823
19720
  var _this;
19824
19721
  _this = BaseMaterial.call(this, engine, shader) || this;
19825
19722
  var shaderData = _this.shaderData;
19826
- shaderData.enableMacro("MATERIAL_NEED_WORLDPOS");
19827
- shaderData.enableMacro("MATERIAL_NEED_TILINGOFFSET");
19723
+ shaderData.enableMacro("MATERIAL_NEED_WORLD_POS");
19724
+ shaderData.enableMacro("MATERIAL_NEED_TILING_OFFSET");
19828
19725
  shaderData.setColor(PBRBaseMaterial._baseColorProp, new engineMath.Color(1, 1, 1, 1));
19829
19726
  shaderData.setColor(PBRBaseMaterial._emissiveColorProp, new engineMath.Color(0, 0, 0, 1));
19830
19727
  shaderData.setVector4(PBRBaseMaterial._tilingOffsetProp, new engineMath.Vector4(1, 1, 0, 0));
@@ -19933,9 +19830,9 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
19933
19830
  set: function set(value) {
19934
19831
  this.shaderData.setTexture(PBRBaseMaterial._occlusionTextureProp, value);
19935
19832
  if (value) {
19936
- this.shaderData.enableMacro("OCCLUSIONTEXTURE");
19833
+ this.shaderData.enableMacro("MATERIAL_HAS_OCCLUSION_TEXTURE");
19937
19834
  } else {
19938
- this.shaderData.disableMacro("OCCLUSIONTEXTURE");
19835
+ this.shaderData.disableMacro("MATERIAL_HAS_OCCLUSION_TEXTURE");
19939
19836
  }
19940
19837
  }
19941
19838
  },
@@ -19989,9 +19886,9 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
19989
19886
  set: function set(value) {
19990
19887
  if (!!this.shaderData.getFloat(PBRBaseMaterial._clearCoatProp) !== !!value) {
19991
19888
  if (value === 0) {
19992
- this.shaderData.disableMacro("CLEARCOAT");
19889
+ this.shaderData.disableMacro("MATERIAL_ENABLE_CLEAR_COAT");
19993
19890
  } else {
19994
- this.shaderData.enableMacro("CLEARCOAT");
19891
+ this.shaderData.enableMacro("MATERIAL_ENABLE_CLEAR_COAT");
19995
19892
  }
19996
19893
  }
19997
19894
  this.shaderData.setFloat(PBRBaseMaterial._clearCoatProp, value);
@@ -20007,9 +19904,9 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20007
19904
  set: function set(value) {
20008
19905
  this.shaderData.setTexture(PBRBaseMaterial._clearCoatTextureProp, value);
20009
19906
  if (value) {
20010
- this.shaderData.enableMacro("HAS_CLEARCOATTEXTURE");
19907
+ this.shaderData.enableMacro("MATERIAL_HAS_CLEAR_COAT_TEXTURE");
20011
19908
  } else {
20012
- this.shaderData.disableMacro("HAS_CLEARCOATTEXTURE");
19909
+ this.shaderData.disableMacro("MATERIAL_HAS_CLEAR_COAT_TEXTURE");
20013
19910
  }
20014
19911
  }
20015
19912
  },
@@ -20034,9 +19931,9 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20034
19931
  set: function set(value) {
20035
19932
  this.shaderData.setTexture(PBRBaseMaterial._clearCoatRoughnessTextureProp, value);
20036
19933
  if (value) {
20037
- this.shaderData.enableMacro("HAS_CLEARCOATROUGHNESSTEXTURE");
19934
+ this.shaderData.enableMacro("MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE");
20038
19935
  } else {
20039
- this.shaderData.disableMacro("HAS_CLEARCOATROUGHNESSTEXTURE");
19936
+ this.shaderData.disableMacro("MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE");
20040
19937
  }
20041
19938
  }
20042
19939
  },
@@ -20050,9 +19947,9 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20050
19947
  set: function set(value) {
20051
19948
  this.shaderData.setTexture(PBRBaseMaterial._clearCoatNormalTextureProp, value);
20052
19949
  if (value) {
20053
- this.shaderData.enableMacro("HAS_CLEARCOATNORMALTEXTURE");
19950
+ this.shaderData.enableMacro("MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE");
20054
19951
  } else {
20055
- this.shaderData.disableMacro("HAS_CLEARCOATNORMALTEXTURE");
19952
+ this.shaderData.disableMacro("MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE");
20056
19953
  }
20057
19954
  }
20058
19955
  }
@@ -20097,7 +19994,7 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20097
19994
  }
20098
19995
  var _proto = PBRMaterial.prototype;
20099
19996
  /**
20100
- * @override
19997
+ * @inheritdoc
20101
19998
  */ _proto.clone = function clone() {
20102
19999
  var dest = new PBRMaterial(this._engine);
20103
20000
  this.cloneTo(dest);
@@ -20137,9 +20034,9 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20137
20034
  set: function set(value) {
20138
20035
  this.shaderData.setTexture(PBRMaterial._roughnessMetallicTextureProp, value);
20139
20036
  if (value) {
20140
- this.shaderData.enableMacro("MATERIAL_ROUGHNESSMETALLICTEXTURE");
20037
+ this.shaderData.enableMacro("MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE");
20141
20038
  } else {
20142
- this.shaderData.disableMacro("MATERIAL_ROUGHNESSMETALLICTEXTURE");
20039
+ this.shaderData.disableMacro("MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE");
20143
20040
  }
20144
20041
  }
20145
20042
  }
@@ -20169,7 +20066,7 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20169
20066
  }
20170
20067
  var _proto = PBRSpecularMaterial.prototype;
20171
20068
  /**
20172
- * @override
20069
+ * @inheritdoc
20173
20070
  */ _proto.clone = function clone() {
20174
20071
  var dest = new PBRSpecularMaterial(this._engine);
20175
20072
  this.cloneTo(dest);
@@ -20231,7 +20128,7 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20231
20128
  PBRSpecularMaterial._specularGlossinessTextureProp = ShaderProperty.getByName("material_SpecularGlossinessTexture");
20232
20129
  })();
20233
20130
  (function() {
20234
- PBRSpecularMaterial._specularGlossinessTextureMacro = ShaderMacro.getByName("MATERIAL_HAS_SPECULARGLOSSINESSTEXTURE");
20131
+ PBRSpecularMaterial._specularGlossinessTextureMacro = ShaderMacro.getByName("MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE");
20235
20132
  })();
20236
20133
 
20237
20134
  /**
@@ -20243,14 +20140,14 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20243
20140
  _this = BaseMaterial.call(this, engine, Shader.find("unlit")) || this;
20244
20141
  var shaderData = _this.shaderData;
20245
20142
  shaderData.enableMacro("MATERIAL_OMIT_NORMAL");
20246
- shaderData.enableMacro("MATERIAL_NEED_TILINGOFFSET");
20143
+ shaderData.enableMacro("MATERIAL_NEED_TILING_OFFSET");
20247
20144
  shaderData.setColor(UnlitMaterial._baseColorProp, new engineMath.Color(1, 1, 1, 1));
20248
20145
  shaderData.setVector4(UnlitMaterial._tilingOffsetProp, new engineMath.Vector4(1, 1, 0, 0));
20249
20146
  return _this;
20250
20147
  }
20251
20148
  var _proto = UnlitMaterial.prototype;
20252
20149
  /**
20253
- * @override
20150
+ * @inheritdoc
20254
20151
  */ _proto.clone = function clone() {
20255
20152
  var dest = new UnlitMaterial(this._engine);
20256
20153
  this.cloneTo(dest);
@@ -20367,10 +20264,7 @@ exports.TextVerticalAlignment = void 0;
20367
20264
  */ _proto._addSprite = function _addSprite(sprite) {
20368
20265
  this._spriteNamesToIndex[sprite.name] = this._sprites.push(sprite) - 1;
20369
20266
  };
20370
- /**
20371
- * @override
20372
- * @internal
20373
- */ _proto._onDestroy = function _onDestroy() {
20267
+ _proto._onDestroy = function _onDestroy() {
20374
20268
  ReferResource.prototype._onDestroy.call(this);
20375
20269
  this._sprites = null;
20376
20270
  this._spriteNamesToIndex = null;
@@ -20479,10 +20373,7 @@ exports.TextVerticalAlignment = void 0;
20479
20373
  this._dirtyUpdateFlag & 0x1 && this._updatePositions();
20480
20374
  return this._bounds;
20481
20375
  };
20482
- /**
20483
- * @override
20484
- * @internal
20485
- */ _proto._onDestroy = function _onDestroy() {
20376
+ _proto._onDestroy = function _onDestroy() {
20486
20377
  ReferResource.prototype._onDestroy.call(this);
20487
20378
  this._texture = null;
20488
20379
  };
@@ -21220,15 +21111,11 @@ var TiledType;
21220
21111
  target._assembler.resetData(target);
21221
21112
  target.sprite = this._sprite;
21222
21113
  };
21223
- /**
21224
- * @override
21225
- */ _proto._updateShaderData = function _updateShaderData(context) {
21114
+ _proto._updateShaderData = function _updateShaderData(context) {
21226
21115
  // @ts-ignore
21227
21116
  this._updateTransformShaderData(context, engineMath.Matrix._identity);
21228
21117
  };
21229
- /**
21230
- * @override
21231
- */ _proto._updateBounds = function _updateBounds(worldBounds) {
21118
+ _proto._updateBounds = function _updateBounds(worldBounds) {
21232
21119
  var _this_sprite;
21233
21120
  if (!((_this_sprite = this.sprite) == null ? void 0 : _this_sprite.texture) || !this.width || !this.height) {
21234
21121
  worldBounds.min.set(0, 0, 0);
@@ -21237,9 +21124,7 @@ var TiledType;
21237
21124
  this._assembler.updatePositions(this);
21238
21125
  }
21239
21126
  };
21240
- /**
21241
- * @override
21242
- */ _proto._render = function _render(context) {
21127
+ _proto._render = function _render(context) {
21243
21128
  var _this_sprite;
21244
21129
  if (!((_this_sprite = this.sprite) == null ? void 0 : _this_sprite.texture) || !this.width || !this.height) {
21245
21130
  return;
@@ -21262,7 +21147,6 @@ var TiledType;
21262
21147
  context.camera._renderPipeline.pushRenderData(context, renderData);
21263
21148
  };
21264
21149
  /**
21265
- * @override
21266
21150
  * @internal
21267
21151
  */ _proto._onDestroy = function _onDestroy() {
21268
21152
  var _this__sprite;
@@ -21651,9 +21535,7 @@ var /**
21651
21535
  this._font._addReferCount(1);
21652
21536
  this.setMaterial(engine._spriteDefaultMaterial);
21653
21537
  };
21654
- /**
21655
- * @internal
21656
- */ _proto._onDestroy = function _onDestroy() {
21538
+ _proto._onDestroy = function _onDestroy() {
21657
21539
  Renderer.prototype._onDestroy.call(this);
21658
21540
  // Clear render data.
21659
21541
  var charRenderDatas = this._charRenderDatas;
@@ -21688,20 +21570,14 @@ var /**
21688
21570
  */ _proto._setDirtyFlagFalse = function _setDirtyFlagFalse(type) {
21689
21571
  this._dirtyFlag &= ~type;
21690
21572
  };
21691
- /**
21692
- * @override
21693
- */ _proto._updateShaderData = function _updateShaderData(context) {
21573
+ _proto._updateShaderData = function _updateShaderData(context) {
21694
21574
  // @ts-ignore
21695
21575
  this._updateTransformShaderData(context, engineMath.Matrix._identity);
21696
21576
  };
21697
- /**
21698
- * @override
21699
- */ _proto._updateBounds = function _updateBounds(worldBounds) {
21577
+ _proto._updateBounds = function _updateBounds(worldBounds) {
21700
21578
  engineMath.BoundingBox.transform(this._localBounds, this._entity.transform.worldMatrix, worldBounds);
21701
21579
  };
21702
- /**
21703
- * @override
21704
- */ _proto._render = function _render(context) {
21580
+ _proto._render = function _render(context) {
21705
21581
  if (this._text === "" || this.enableWrapping && this.width <= 0 || this.overflowMode === exports.OverflowMode.Truncate && this.height <= 0) {
21706
21582
  return;
21707
21583
  }
@@ -22936,7 +22812,6 @@ exports.AnimationFloatArrayCurve = (_AnimationFloatArrayCurve = /*#__PURE__*/ fu
22936
22812
  var _proto = AnimationFloatArrayCurve.prototype;
22937
22813
  /**
22938
22814
  * @inheritdoc
22939
- * @override
22940
22815
  */ _proto.addKey = function addKey(key) {
22941
22816
  AnimationCurve.prototype.addKey.call(this, key);
22942
22817
  var evaluateData = this._evaluateData;
@@ -23718,7 +23593,6 @@ exports.AnimatorLayerBlendingMode = void 0;
23718
23593
  return this._getAnimatorStateInfo(stateName, layerIndex).state;
23719
23594
  };
23720
23595
  /**
23721
- * @override
23722
23596
  * @internal
23723
23597
  */ _proto._onEnable = function _onEnable() {
23724
23598
  this.engine._componentsManager.addOnUpdateAnimations(this);
@@ -23726,7 +23600,6 @@ exports.AnimatorLayerBlendingMode = void 0;
23726
23600
  this._entity.getComponentsIncludeChildren(exports.Renderer, this._controlledRenderers);
23727
23601
  };
23728
23602
  /**
23729
- * @override
23730
23603
  * @internal
23731
23604
  */ _proto._onDisable = function _onDisable() {
23732
23605
  this.engine._componentsManager.removeOnUpdateAnimations(this);
@@ -24551,9 +24424,7 @@ exports.AnimatorConditionMode = void 0;
24551
24424
  return _this;
24552
24425
  }
24553
24426
  var _proto = SkyBoxMaterial.prototype;
24554
- /**
24555
- * @override
24556
- */ _proto.clone = function clone() {
24427
+ _proto.clone = function clone() {
24557
24428
  var dest = new SkyBoxMaterial(this._engine);
24558
24429
  this.cloneTo(dest);
24559
24430
  return dest;
@@ -24666,7 +24537,7 @@ exports.SunMode = void 0;
24666
24537
  }
24667
24538
  var _proto = SkyProceduralMaterial.prototype;
24668
24539
  /**
24669
- * @override
24540
+ * @inheritDoc
24670
24541
  */ _proto.clone = function clone() {
24671
24542
  var dest = new SkyProceduralMaterial(this._engine);
24672
24543
  this.cloneTo(dest);
@@ -24864,7 +24735,6 @@ exports.ParticleRendererBlendMode = void 0;
24864
24735
  }
24865
24736
  var _proto = ParticleRenderer.prototype;
24866
24737
  /**
24867
- * @override
24868
24738
  * @internal
24869
24739
  */ _proto.update = function update(deltaTime) {
24870
24740
  if (!this._isInit || !this._isStart) {
@@ -24882,7 +24752,6 @@ exports.ParticleRendererBlendMode = void 0;
24882
24752
  this.shaderData.setFloat("u_time", this._time);
24883
24753
  };
24884
24754
  /**
24885
- * @override
24886
24755
  * @internal
24887
24756
  */ _proto._onEnable = function _onEnable() {
24888
24757
  MeshRenderer.prototype._onEnable.call(this);
@@ -25661,9 +25530,7 @@ var _tempVector3 = new engineMath.Vector3();
25661
25530
  this.getMaterial().shaderData.setTexture("u_texture", texture);
25662
25531
  }
25663
25532
  };
25664
- /**
25665
- * @override
25666
- */ _proto._render = function _render(context) {
25533
+ _proto._render = function _render(context) {
25667
25534
  this._updateStrapVertices(context.camera, this._points);
25668
25535
  this._updateStrapCoords();
25669
25536
  this._vertexBuffer.setData(this._vertices);
@@ -25809,9 +25676,7 @@ var _tempVector3 = new engineMath.Vector3();
25809
25676
  * Provide hooks for users to exchange Texture.
25810
25677
  * @remarks Prevent issue: Feedback Loops Between Textures and the Framebuffer.
25811
25678
  */ _proto.onTextureChange = function onTextureChange(renderColorTexture) {};
25812
- /**
25813
- * @override
25814
- */ _proto.onBeginRender = function onBeginRender(camera) {
25679
+ _proto.onBeginRender = function onBeginRender(camera) {
25815
25680
  if (!this.enabled) return;
25816
25681
  this._camera = camera;
25817
25682
  this._oriCameraCullingMask = camera.cullingMask;
@@ -25824,9 +25689,7 @@ var _tempVector3 = new engineMath.Vector3();
25824
25689
  this._oriCameraRenderTarget = camera.renderTarget;
25825
25690
  camera.renderTarget = this._activeRenderTarget;
25826
25691
  };
25827
- /**
25828
- * @override
25829
- */ _proto.onEndRender = function onEndRender(camera) {
25692
+ _proto.onEndRender = function onEndRender(camera) {
25830
25693
  if (!this.enabled) return;
25831
25694
  this.onTextureChange && this.onTextureChange(this._texture);
25832
25695
  this._activeRenderTarget = this._activeRenderTarget === this._renderTarget ? this._renderTargetSwap : this._renderTarget;
@@ -25861,16 +25724,12 @@ var cacheDir = new engineMath.Vector3();
25861
25724
  /**
25862
25725
  * The position of the probe can be set, the default is the origin [0,0,0].
25863
25726
  */ _this.position = new engineMath.Vector3(0, 0, 0);
25864
- /**
25865
- * @override
25866
- */ _this._isCube = true;
25727
+ _this._isCube = true;
25867
25728
  _this.oriViewMatrix = new engineMath.Matrix();
25868
25729
  return _this;
25869
25730
  }
25870
25731
  var _proto = CubeProbe.prototype;
25871
- /**
25872
- * @override
25873
- */ _proto.onBeginRender = function onBeginRender(camera) {
25732
+ _proto.onBeginRender = function onBeginRender(camera) {
25874
25733
  if (!this.enabled) return;
25875
25734
  Probe.prototype.onBeginRender.call(this, camera);
25876
25735
  this._storeCamera(camera);