@galacean/engine-core 1.2.0-alpha.5 → 1.2.0-alpha.9

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.
@@ -3531,16 +3531,6 @@ var ShaderFactory = /*#__PURE__*/ function() {
3531
3531
  return ShaderPart;
3532
3532
  }();
3533
3533
 
3534
- /**
3535
- * Shader data grouping.
3536
- */ var ShaderDataGroup;
3537
- (function(ShaderDataGroup) {
3538
- ShaderDataGroup[ShaderDataGroup[/** Scene group. */ "Scene"] = 0] = "Scene";
3539
- ShaderDataGroup[ShaderDataGroup[/** Camera group. */ "Camera"] = 1] = "Camera";
3540
- ShaderDataGroup[ShaderDataGroup[/** Renderer group. */ "Renderer"] = 2] = "Renderer";
3541
- ShaderDataGroup[ShaderDataGroup[/** material group. */ "Material"] = 3] = "Material";
3542
- })(ShaderDataGroup || (ShaderDataGroup = {}));
3543
-
3544
3534
  /**
3545
3535
  * Color Space.
3546
3536
  */ exports.ColorSpace = void 0;
@@ -3750,6 +3740,16 @@ var ShaderFactory = /*#__PURE__*/ function() {
3750
3740
  this.textureUniforms = [];
3751
3741
  };
3752
3742
 
3743
+ /**
3744
+ * Shader data grouping.
3745
+ */ var ShaderDataGroup;
3746
+ (function(ShaderDataGroup) {
3747
+ ShaderDataGroup[ShaderDataGroup[/** Scene group. */ "Scene"] = 0] = "Scene";
3748
+ ShaderDataGroup[ShaderDataGroup[/** Camera group. */ "Camera"] = 1] = "Camera";
3749
+ ShaderDataGroup[ShaderDataGroup[/** Renderer group. */ "Renderer"] = 2] = "Renderer";
3750
+ ShaderDataGroup[ShaderDataGroup[/** material group. */ "Material"] = 3] = "Material";
3751
+ })(ShaderDataGroup || (ShaderDataGroup = {}));
3752
+
3753
3753
  /**
3754
3754
  * Shader program, corresponding to the GPU shader program.
3755
3755
  * @internal
@@ -4045,6 +4045,7 @@ var ShaderFactory = /*#__PURE__*/ function() {
4045
4045
  break;
4046
4046
  case gl.SAMPLER_2D:
4047
4047
  case gl.SAMPLER_CUBE:
4048
+ case gl.UNSIGNED_INT_SAMPLER_2D:
4048
4049
  case gl.SAMPLER_2D_ARRAY:
4049
4050
  case gl.SAMPLER_2D_SHADOW:
4050
4051
  var defaultTexture;
@@ -4055,6 +4056,9 @@ var ShaderFactory = /*#__PURE__*/ function() {
4055
4056
  case gl.SAMPLER_CUBE:
4056
4057
  defaultTexture = _this._engine._magentaTextureCube;
4057
4058
  break;
4059
+ case gl.UNSIGNED_INT_SAMPLER_2D:
4060
+ defaultTexture = _this._engine._uintMagentaTexture2D;
4061
+ break;
4058
4062
  case gl.SAMPLER_2D_ARRAY:
4059
4063
  defaultTexture = _this._engine._magentaTexture2DArray;
4060
4064
  break;
@@ -5144,6 +5148,57 @@ var GraphicsResource = /*#__PURE__*/ function(ReferResource1) {
5144
5148
  return GraphicsResource;
5145
5149
  }(ReferResource);
5146
5150
 
5151
+ /**
5152
+ * The filter mode of the texture.
5153
+ */ exports.TextureFilterMode = void 0;
5154
+ (function(TextureFilterMode) {
5155
+ TextureFilterMode[TextureFilterMode[/** Point filtering. */ "Point"] = 0] = "Point";
5156
+ TextureFilterMode[TextureFilterMode[/** Bilinear filtering. */ "Bilinear"] = 1] = "Bilinear";
5157
+ TextureFilterMode[TextureFilterMode[/** Trilinear filtering. */ "Trilinear"] = 2] = "Trilinear";
5158
+ })(exports.TextureFilterMode || (exports.TextureFilterMode = {}));
5159
+
5160
+ /**
5161
+ * Texture format enumeration.
5162
+ */ exports.TextureFormat = void 0;
5163
+ (function(TextureFormat) {
5164
+ TextureFormat[TextureFormat[/** RGB format, 8 bits per channel. */ "R8G8B8"] = 0] = "R8G8B8";
5165
+ TextureFormat[TextureFormat[/** RGBA format, 8 bits per channel. */ "R8G8B8A8"] = 1] = "R8G8B8A8";
5166
+ TextureFormat[TextureFormat[/** RGBA format, 4 bits per channel. */ "R4G4B4A4"] = 2] = "R4G4B4A4";
5167
+ TextureFormat[TextureFormat[/** RGBA format, 5 bits in R channel, 5 bits in G channel, 5 bits in B channel, 1 bit in A channel. */ "R5G5B5A1"] = 3] = "R5G5B5A1";
5168
+ TextureFormat[TextureFormat[/** RGB format, 5 bits in R channel, 6 bits in G channel, 5 bits in B channel. */ "R5G6B5"] = 4] = "R5G6B5";
5169
+ TextureFormat[TextureFormat[/** Transparent format, 8 bits. */ "Alpha8"] = 5] = "Alpha8";
5170
+ TextureFormat[TextureFormat[/** Luminance/alpha in RGB channel, alpha in A channel. */ "LuminanceAlpha"] = 6] = "LuminanceAlpha";
5171
+ TextureFormat[TextureFormat[/** RGBA format, 16 bits per channel. */ "R16G16B16A16"] = 7] = "R16G16B16A16";
5172
+ TextureFormat[TextureFormat[/** RGBA format, 32 bits per channel. */ "R32G32B32A32"] = 8] = "R32G32B32A32";
5173
+ TextureFormat[TextureFormat[/** RGBA unsigned integer format, 32 bits per channel. */ "R32G32B32A32_UInt"] = 9] = "R32G32B32A32_UInt";
5174
+ TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "BC1"] = 10] = "BC1";
5175
+ TextureFormat[TextureFormat[/** RGBA compressed format, 8 bits per pixel. */ "BC3"] = 11] = "BC3";
5176
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ "BC7"] = 12] = "BC7";
5177
+ TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "ETC1_RGB"] = 13] = "ETC1_RGB";
5178
+ TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "ETC2_RGB"] = 14] = "ETC2_RGB";
5179
+ TextureFormat[TextureFormat[/** RGBA compressed format, 5 bits per pixel, 4 bit in RGB, 1 bit in A. */ "ETC2_RGBA5"] = 15] = "ETC2_RGBA5";
5180
+ TextureFormat[TextureFormat[/** RGB compressed format, 8 bits per pixel. */ "ETC2_RGBA8"] = 16] = "ETC2_RGBA8";
5181
+ TextureFormat[TextureFormat[/** RGB compressed format, 2 bits per pixel. */ "PVRTC_RGB2"] = 17] = "PVRTC_RGB2";
5182
+ TextureFormat[TextureFormat[/** RGBA compressed format, 2 bits per pixel. */ "PVRTC_RGBA2"] = 18] = "PVRTC_RGBA2";
5183
+ TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "PVRTC_RGB4"] = 19] = "PVRTC_RGB4";
5184
+ TextureFormat[TextureFormat[/** RGBA compressed format, 4 bits per pixel. */ "PVRTC_RGBA4"] = 20] = "PVRTC_RGBA4";
5185
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ "ASTC_4x4"] = 21] = "ASTC_4x4";
5186
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 5x5 pixel block. */ "ASTC_5x5"] = 22] = "ASTC_5x5";
5187
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 6x6 pixel block. */ "ASTC_6x6"] = 23] = "ASTC_6x6";
5188
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 8x8 pixel block. */ "ASTC_8x8"] = 24] = "ASTC_8x8";
5189
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 10x10 pixel block. */ "ASTC_10x10"] = 25] = "ASTC_10x10";
5190
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 12x12 pixel block. */ "ASTC_12x12"] = 26] = "ASTC_12x12";
5191
+ TextureFormat[TextureFormat[/** Automatic depth format, engine will automatically select the supported precision. */ "Depth"] = 27] = "Depth";
5192
+ TextureFormat[TextureFormat[/** Automatic depth stencil format, engine will automatically select the supported precision. */ "DepthStencil"] = 28] = "DepthStencil";
5193
+ TextureFormat[TextureFormat[/** 16-bit depth format. */ "Depth16"] = 29] = "Depth16";
5194
+ TextureFormat[TextureFormat[/** 24-bit depth format. */ "Depth24"] = 30] = "Depth24";
5195
+ TextureFormat[TextureFormat[/** 32-bit depth format. */ "Depth32"] = 31] = "Depth32";
5196
+ TextureFormat[TextureFormat[/** 16-bit depth + 8-bit stencil format. */ "Depth24Stencil8"] = 32] = "Depth24Stencil8";
5197
+ TextureFormat[TextureFormat[/** 32-bit depth + 8-bit stencil format. */ "Depth32Stencil8"] = 33] = "Depth32Stencil8";
5198
+ TextureFormat[TextureFormat[/** @deprecated Use `TextureFormat.BC1` instead. */ "DXT1"] = 34] = "DXT1";
5199
+ TextureFormat[TextureFormat[/** @deprecated Use `TextureFormat.BC3` instead. */ "DXT5"] = 35] = "DXT5";
5200
+ })(exports.TextureFormat || (exports.TextureFormat = {}));
5201
+
5147
5202
  /**
5148
5203
  * The base class of texture, contains some common functions of texture-related classes.
5149
5204
  */ var Texture = /*#__PURE__*/ function(GraphicsResource1) {
@@ -5200,6 +5255,12 @@ var GraphicsResource = /*#__PURE__*/ function(ReferResource1) {
5200
5255
  _proto._getMipmapCount = function _getMipmapCount() {
5201
5256
  return this._mipmap ? Math.floor(Math.log2(Math.max(this._width, this._height))) + 1 : 1;
5202
5257
  };
5258
+ _proto._isIntFormat = function _isIntFormat() {
5259
+ if (exports.TextureFormat.R32G32B32A32_UInt === this._format) {
5260
+ return true;
5261
+ }
5262
+ return false;
5263
+ };
5203
5264
  _create_class(Texture, [
5204
5265
  {
5205
5266
  key: "format",
@@ -5276,6 +5337,11 @@ var GraphicsResource = /*#__PURE__*/ function(ReferResource1) {
5276
5337
  },
5277
5338
  set: function set(value) {
5278
5339
  if (value === this._filterMode) return;
5340
+ if (value !== exports.TextureFilterMode.Point && this._isIntFormat()) {
5341
+ value = exports.TextureFilterMode.Point;
5342
+ Logger.warn("Int or UInt format texture only support TextureFilterMode.Point");
5343
+ return;
5344
+ }
5279
5345
  this._filterMode = value;
5280
5346
  this._platformTexture.filterMode = value;
5281
5347
  }
@@ -7579,56 +7645,6 @@ var /**
7579
7645
  TextureDepthCompareFunction[TextureDepthCompareFunction[/** always pass. */ "Always"] = 7] = "Always";
7580
7646
  })(exports.TextureDepthCompareFunction || (exports.TextureDepthCompareFunction = {}));
7581
7647
 
7582
- /**
7583
- * The filter mode of the texture.
7584
- */ exports.TextureFilterMode = void 0;
7585
- (function(TextureFilterMode) {
7586
- TextureFilterMode[TextureFilterMode[/** Point filtering. */ "Point"] = 0] = "Point";
7587
- TextureFilterMode[TextureFilterMode[/** Bilinear filtering. */ "Bilinear"] = 1] = "Bilinear";
7588
- TextureFilterMode[TextureFilterMode[/** Trilinear filtering. */ "Trilinear"] = 2] = "Trilinear";
7589
- })(exports.TextureFilterMode || (exports.TextureFilterMode = {}));
7590
-
7591
- /**
7592
- * Texture format enumeration.
7593
- */ exports.TextureFormat = void 0;
7594
- (function(TextureFormat) {
7595
- TextureFormat[TextureFormat[/** RGB format, 8 bits per channel. */ "R8G8B8"] = 0] = "R8G8B8";
7596
- TextureFormat[TextureFormat[/** RGBA format, 8 bits per channel. */ "R8G8B8A8"] = 1] = "R8G8B8A8";
7597
- TextureFormat[TextureFormat[/** RGBA format, 4 bits per channel. */ "R4G4B4A4"] = 2] = "R4G4B4A4";
7598
- TextureFormat[TextureFormat[/** RGBA format, 5 bits in R channel, 5 bits in G channel, 5 bits in B channel, 1 bit in A channel. */ "R5G5B5A1"] = 3] = "R5G5B5A1";
7599
- TextureFormat[TextureFormat[/** RGB format, 5 bits in R channel, 6 bits in G channel, 5 bits in B channel. */ "R5G6B5"] = 4] = "R5G6B5";
7600
- TextureFormat[TextureFormat[/** Transparent format, 8 bits. */ "Alpha8"] = 5] = "Alpha8";
7601
- TextureFormat[TextureFormat[/** Luminance/alpha in RGB channel, alpha in A channel. */ "LuminanceAlpha"] = 6] = "LuminanceAlpha";
7602
- TextureFormat[TextureFormat[/** RGBA format, 16 bits per channel. */ "R16G16B16A16"] = 7] = "R16G16B16A16";
7603
- TextureFormat[TextureFormat[/** RGBA format, 32 bits per channel. */ "R32G32B32A32"] = 8] = "R32G32B32A32";
7604
- TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "BC1"] = 9] = "BC1";
7605
- TextureFormat[TextureFormat[/** RGBA compressed format, 8 bits per pixel. */ "BC3"] = 10] = "BC3";
7606
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ "BC7"] = 11] = "BC7";
7607
- TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "ETC1_RGB"] = 12] = "ETC1_RGB";
7608
- TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "ETC2_RGB"] = 13] = "ETC2_RGB";
7609
- TextureFormat[TextureFormat[/** RGBA compressed format, 5 bits per pixel, 4 bit in RGB, 1 bit in A. */ "ETC2_RGBA5"] = 14] = "ETC2_RGBA5";
7610
- TextureFormat[TextureFormat[/** RGB compressed format, 8 bits per pixel. */ "ETC2_RGBA8"] = 15] = "ETC2_RGBA8";
7611
- TextureFormat[TextureFormat[/** RGB compressed format, 2 bits per pixel. */ "PVRTC_RGB2"] = 16] = "PVRTC_RGB2";
7612
- TextureFormat[TextureFormat[/** RGBA compressed format, 2 bits per pixel. */ "PVRTC_RGBA2"] = 17] = "PVRTC_RGBA2";
7613
- TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "PVRTC_RGB4"] = 18] = "PVRTC_RGB4";
7614
- TextureFormat[TextureFormat[/** RGBA compressed format, 4 bits per pixel. */ "PVRTC_RGBA4"] = 19] = "PVRTC_RGBA4";
7615
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ "ASTC_4x4"] = 20] = "ASTC_4x4";
7616
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 5x5 pixel block. */ "ASTC_5x5"] = 21] = "ASTC_5x5";
7617
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 6x6 pixel block. */ "ASTC_6x6"] = 22] = "ASTC_6x6";
7618
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 8x8 pixel block. */ "ASTC_8x8"] = 23] = "ASTC_8x8";
7619
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 10x10 pixel block. */ "ASTC_10x10"] = 24] = "ASTC_10x10";
7620
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 12x12 pixel block. */ "ASTC_12x12"] = 25] = "ASTC_12x12";
7621
- TextureFormat[TextureFormat[/** Automatic depth format, engine will automatically select the supported precision. */ "Depth"] = 26] = "Depth";
7622
- TextureFormat[TextureFormat[/** Automatic depth stencil format, engine will automatically select the supported precision. */ "DepthStencil"] = 27] = "DepthStencil";
7623
- TextureFormat[TextureFormat[/** 16-bit depth format. */ "Depth16"] = 28] = "Depth16";
7624
- TextureFormat[TextureFormat[/** 24-bit depth format. */ "Depth24"] = 29] = "Depth24";
7625
- TextureFormat[TextureFormat[/** 32-bit depth format. */ "Depth32"] = 30] = "Depth32";
7626
- TextureFormat[TextureFormat[/** 16-bit depth + 8-bit stencil format. */ "Depth24Stencil8"] = 31] = "Depth24Stencil8";
7627
- TextureFormat[TextureFormat[/** 32-bit depth + 8-bit stencil format. */ "Depth32Stencil8"] = 32] = "Depth32Stencil8";
7628
- TextureFormat[TextureFormat[/** @deprecated Use `TextureFormat.BC1` instead. */ "DXT1"] = 33] = "DXT1";
7629
- TextureFormat[TextureFormat[/** @deprecated Use `TextureFormat.BC3` instead. */ "DXT5"] = 34] = "DXT5";
7630
- })(exports.TextureFormat || (exports.TextureFormat = {}));
7631
-
7632
7648
  /**
7633
7649
  * Texture usage.
7634
7650
  */ exports.TextureUsage = void 0;
@@ -7812,7 +7828,7 @@ var /**
7812
7828
  _this._mipmapCount = _this._getMipmapCount();
7813
7829
  _this._isDepthTexture = format == exports.TextureFormat.Depth || format == exports.TextureFormat.DepthStencil || format == exports.TextureFormat.Depth16 || format == exports.TextureFormat.Depth24 || format == exports.TextureFormat.Depth32 || format == exports.TextureFormat.Depth24Stencil8 || format == exports.TextureFormat.Depth32Stencil8;
7814
7830
  _this._platformTexture = engine._hardwareRenderer.createPlatformTexture2D(_assert_this_initialized(_this));
7815
- _this.filterMode = exports.TextureFilterMode.Bilinear;
7831
+ _this.filterMode = _this._isIntFormat() ? exports.TextureFilterMode.Point : exports.TextureFilterMode.Bilinear;
7816
7832
  _this.wrapModeU = _this.wrapModeV = exports.TextureWrapMode.Repeat;
7817
7833
  return _this;
7818
7834
  }
@@ -19346,6 +19362,26 @@ ShaderPool.init();
19346
19362
  this._magentaTexture2D = magentaTexture2D;
19347
19363
  this._magentaTextureCube = magentaTextureCube;
19348
19364
  if (hardwareRenderer.isWebGL2) {
19365
+ var magentaPixel32 = new Uint32Array([
19366
+ 255,
19367
+ 0,
19368
+ 255,
19369
+ 255
19370
+ ]);
19371
+ var uintMagentaTexture2D = new Texture2D(this, 1, 1, exports.TextureFormat.R32G32B32A32_UInt, false);
19372
+ uintMagentaTexture2D.setPixelBuffer(magentaPixel32);
19373
+ uintMagentaTexture2D.isGCIgnored = true;
19374
+ this.resourceManager.addContentRestorer(new /*#__PURE__*/ (function(ContentRestorer) {
19375
+ _inherits(_class, ContentRestorer);
19376
+ function _class() {
19377
+ return ContentRestorer.call(this, uintMagentaTexture2D);
19378
+ }
19379
+ var _proto = _class.prototype;
19380
+ _proto.restoreContent = function restoreContent() {
19381
+ this.resource.setPixelBuffer(magentaPixel32);
19382
+ };
19383
+ return _class;
19384
+ }(ContentRestorer))());
19349
19385
  var magentaTexture2DArray = new Texture2DArray(this, 1, 1, 1, exports.TextureFormat.R8G8B8A8, false);
19350
19386
  magentaTexture2DArray.setPixelBuffer(0, magentaPixel);
19351
19387
  magentaTexture2DArray.isGCIgnored = true;
@@ -19360,6 +19396,7 @@ ShaderPool.init();
19360
19396
  };
19361
19397
  return _class;
19362
19398
  }(ContentRestorer))());
19399
+ this._uintMagentaTexture2D = uintMagentaTexture2D;
19363
19400
  this._magentaTexture2DArray = magentaTexture2DArray;
19364
19401
  }
19365
19402
  };
@@ -19592,8 +19629,8 @@ ShaderPool.init();
19592
19629
  set: function set(value) {
19593
19630
  if (this._width !== value) {
19594
19631
  this._width = value;
19632
+ this._onWidthChanged(value);
19595
19633
  this._sizeUpdateFlagManager.dispatch();
19596
- this._onSizeChanged(value, this._width);
19597
19634
  }
19598
19635
  }
19599
19636
  },
@@ -19607,8 +19644,8 @@ ShaderPool.init();
19607
19644
  set: function set(value) {
19608
19645
  if (this._height !== value) {
19609
19646
  this._height = value;
19647
+ this._onHeightChange(value);
19610
19648
  this._sizeUpdateFlagManager.dispatch();
19611
- this._onSizeChanged(this._width, value);
19612
19649
  }
19613
19650
  }
19614
19651
  }
@@ -29962,7 +29999,8 @@ __decorate([
29962
29999
  var transform = this._renderer.entity.transform;
29963
30000
  var shape = this.emission.shape;
29964
30001
  for(var i = 0; i < count; i++){
29965
- if (shape) {
30002
+ var _shape;
30003
+ if ((_shape = shape) == null ? void 0 : _shape.enabled) {
29966
30004
  shape._generatePositionAndDirection(this.emission._shapeRand, time, position, direction);
29967
30005
  var positionScale = this.main._getPositionScale();
29968
30006
  position.multiply(positionScale);
@@ -30542,7 +30580,7 @@ __decorate([
30542
30580
  * Base class for all particle shapes.
30543
30581
  */ var BaseShape = /*#__PURE__*/ function() {
30544
30582
  function BaseShape() {
30545
- /** Specifies whether the ShapeModule is enabled or disabled. */ this.enable = true;
30583
+ /** Specifies whether the ShapeModule is enabled or disabled. */ this.enabled = true;
30546
30584
  /** Randomizes the starting direction of particles. */ this.randomDirectionAmount = 0;
30547
30585
  }
30548
30586
  var _proto = BaseShape.prototype;
package/dist/module.js CHANGED
@@ -3526,16 +3526,6 @@ var ShaderFactory = /*#__PURE__*/ function() {
3526
3526
  return ShaderPart;
3527
3527
  }();
3528
3528
 
3529
- /**
3530
- * Shader data grouping.
3531
- */ var ShaderDataGroup;
3532
- (function(ShaderDataGroup) {
3533
- ShaderDataGroup[ShaderDataGroup[/** Scene group. */ "Scene"] = 0] = "Scene";
3534
- ShaderDataGroup[ShaderDataGroup[/** Camera group. */ "Camera"] = 1] = "Camera";
3535
- ShaderDataGroup[ShaderDataGroup[/** Renderer group. */ "Renderer"] = 2] = "Renderer";
3536
- ShaderDataGroup[ShaderDataGroup[/** material group. */ "Material"] = 3] = "Material";
3537
- })(ShaderDataGroup || (ShaderDataGroup = {}));
3538
-
3539
3529
  /**
3540
3530
  * Color Space.
3541
3531
  */ var ColorSpace;
@@ -3745,6 +3735,16 @@ var ShaderFactory = /*#__PURE__*/ function() {
3745
3735
  this.textureUniforms = [];
3746
3736
  };
3747
3737
 
3738
+ /**
3739
+ * Shader data grouping.
3740
+ */ var ShaderDataGroup;
3741
+ (function(ShaderDataGroup) {
3742
+ ShaderDataGroup[ShaderDataGroup[/** Scene group. */ "Scene"] = 0] = "Scene";
3743
+ ShaderDataGroup[ShaderDataGroup[/** Camera group. */ "Camera"] = 1] = "Camera";
3744
+ ShaderDataGroup[ShaderDataGroup[/** Renderer group. */ "Renderer"] = 2] = "Renderer";
3745
+ ShaderDataGroup[ShaderDataGroup[/** material group. */ "Material"] = 3] = "Material";
3746
+ })(ShaderDataGroup || (ShaderDataGroup = {}));
3747
+
3748
3748
  /**
3749
3749
  * Shader program, corresponding to the GPU shader program.
3750
3750
  * @internal
@@ -4040,6 +4040,7 @@ var ShaderFactory = /*#__PURE__*/ function() {
4040
4040
  break;
4041
4041
  case gl.SAMPLER_2D:
4042
4042
  case gl.SAMPLER_CUBE:
4043
+ case gl.UNSIGNED_INT_SAMPLER_2D:
4043
4044
  case gl.SAMPLER_2D_ARRAY:
4044
4045
  case gl.SAMPLER_2D_SHADOW:
4045
4046
  var defaultTexture;
@@ -4050,6 +4051,9 @@ var ShaderFactory = /*#__PURE__*/ function() {
4050
4051
  case gl.SAMPLER_CUBE:
4051
4052
  defaultTexture = _this._engine._magentaTextureCube;
4052
4053
  break;
4054
+ case gl.UNSIGNED_INT_SAMPLER_2D:
4055
+ defaultTexture = _this._engine._uintMagentaTexture2D;
4056
+ break;
4053
4057
  case gl.SAMPLER_2D_ARRAY:
4054
4058
  defaultTexture = _this._engine._magentaTexture2DArray;
4055
4059
  break;
@@ -5139,6 +5143,57 @@ var GraphicsResource = /*#__PURE__*/ function(ReferResource1) {
5139
5143
  return GraphicsResource;
5140
5144
  }(ReferResource);
5141
5145
 
5146
+ /**
5147
+ * The filter mode of the texture.
5148
+ */ var TextureFilterMode;
5149
+ (function(TextureFilterMode) {
5150
+ TextureFilterMode[TextureFilterMode[/** Point filtering. */ "Point"] = 0] = "Point";
5151
+ TextureFilterMode[TextureFilterMode[/** Bilinear filtering. */ "Bilinear"] = 1] = "Bilinear";
5152
+ TextureFilterMode[TextureFilterMode[/** Trilinear filtering. */ "Trilinear"] = 2] = "Trilinear";
5153
+ })(TextureFilterMode || (TextureFilterMode = {}));
5154
+
5155
+ /**
5156
+ * Texture format enumeration.
5157
+ */ var TextureFormat;
5158
+ (function(TextureFormat) {
5159
+ TextureFormat[TextureFormat[/** RGB format, 8 bits per channel. */ "R8G8B8"] = 0] = "R8G8B8";
5160
+ TextureFormat[TextureFormat[/** RGBA format, 8 bits per channel. */ "R8G8B8A8"] = 1] = "R8G8B8A8";
5161
+ TextureFormat[TextureFormat[/** RGBA format, 4 bits per channel. */ "R4G4B4A4"] = 2] = "R4G4B4A4";
5162
+ TextureFormat[TextureFormat[/** RGBA format, 5 bits in R channel, 5 bits in G channel, 5 bits in B channel, 1 bit in A channel. */ "R5G5B5A1"] = 3] = "R5G5B5A1";
5163
+ TextureFormat[TextureFormat[/** RGB format, 5 bits in R channel, 6 bits in G channel, 5 bits in B channel. */ "R5G6B5"] = 4] = "R5G6B5";
5164
+ TextureFormat[TextureFormat[/** Transparent format, 8 bits. */ "Alpha8"] = 5] = "Alpha8";
5165
+ TextureFormat[TextureFormat[/** Luminance/alpha in RGB channel, alpha in A channel. */ "LuminanceAlpha"] = 6] = "LuminanceAlpha";
5166
+ TextureFormat[TextureFormat[/** RGBA format, 16 bits per channel. */ "R16G16B16A16"] = 7] = "R16G16B16A16";
5167
+ TextureFormat[TextureFormat[/** RGBA format, 32 bits per channel. */ "R32G32B32A32"] = 8] = "R32G32B32A32";
5168
+ TextureFormat[TextureFormat[/** RGBA unsigned integer format, 32 bits per channel. */ "R32G32B32A32_UInt"] = 9] = "R32G32B32A32_UInt";
5169
+ TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "BC1"] = 10] = "BC1";
5170
+ TextureFormat[TextureFormat[/** RGBA compressed format, 8 bits per pixel. */ "BC3"] = 11] = "BC3";
5171
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ "BC7"] = 12] = "BC7";
5172
+ TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "ETC1_RGB"] = 13] = "ETC1_RGB";
5173
+ TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "ETC2_RGB"] = 14] = "ETC2_RGB";
5174
+ TextureFormat[TextureFormat[/** RGBA compressed format, 5 bits per pixel, 4 bit in RGB, 1 bit in A. */ "ETC2_RGBA5"] = 15] = "ETC2_RGBA5";
5175
+ TextureFormat[TextureFormat[/** RGB compressed format, 8 bits per pixel. */ "ETC2_RGBA8"] = 16] = "ETC2_RGBA8";
5176
+ TextureFormat[TextureFormat[/** RGB compressed format, 2 bits per pixel. */ "PVRTC_RGB2"] = 17] = "PVRTC_RGB2";
5177
+ TextureFormat[TextureFormat[/** RGBA compressed format, 2 bits per pixel. */ "PVRTC_RGBA2"] = 18] = "PVRTC_RGBA2";
5178
+ TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "PVRTC_RGB4"] = 19] = "PVRTC_RGB4";
5179
+ TextureFormat[TextureFormat[/** RGBA compressed format, 4 bits per pixel. */ "PVRTC_RGBA4"] = 20] = "PVRTC_RGBA4";
5180
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ "ASTC_4x4"] = 21] = "ASTC_4x4";
5181
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 5x5 pixel block. */ "ASTC_5x5"] = 22] = "ASTC_5x5";
5182
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 6x6 pixel block. */ "ASTC_6x6"] = 23] = "ASTC_6x6";
5183
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 8x8 pixel block. */ "ASTC_8x8"] = 24] = "ASTC_8x8";
5184
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 10x10 pixel block. */ "ASTC_10x10"] = 25] = "ASTC_10x10";
5185
+ TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 12x12 pixel block. */ "ASTC_12x12"] = 26] = "ASTC_12x12";
5186
+ TextureFormat[TextureFormat[/** Automatic depth format, engine will automatically select the supported precision. */ "Depth"] = 27] = "Depth";
5187
+ TextureFormat[TextureFormat[/** Automatic depth stencil format, engine will automatically select the supported precision. */ "DepthStencil"] = 28] = "DepthStencil";
5188
+ TextureFormat[TextureFormat[/** 16-bit depth format. */ "Depth16"] = 29] = "Depth16";
5189
+ TextureFormat[TextureFormat[/** 24-bit depth format. */ "Depth24"] = 30] = "Depth24";
5190
+ TextureFormat[TextureFormat[/** 32-bit depth format. */ "Depth32"] = 31] = "Depth32";
5191
+ TextureFormat[TextureFormat[/** 16-bit depth + 8-bit stencil format. */ "Depth24Stencil8"] = 32] = "Depth24Stencil8";
5192
+ TextureFormat[TextureFormat[/** 32-bit depth + 8-bit stencil format. */ "Depth32Stencil8"] = 33] = "Depth32Stencil8";
5193
+ TextureFormat[TextureFormat[/** @deprecated Use `TextureFormat.BC1` instead. */ "DXT1"] = 34] = "DXT1";
5194
+ TextureFormat[TextureFormat[/** @deprecated Use `TextureFormat.BC3` instead. */ "DXT5"] = 35] = "DXT5";
5195
+ })(TextureFormat || (TextureFormat = {}));
5196
+
5142
5197
  /**
5143
5198
  * The base class of texture, contains some common functions of texture-related classes.
5144
5199
  */ var Texture = /*#__PURE__*/ function(GraphicsResource1) {
@@ -5195,6 +5250,12 @@ var GraphicsResource = /*#__PURE__*/ function(ReferResource1) {
5195
5250
  _proto._getMipmapCount = function _getMipmapCount() {
5196
5251
  return this._mipmap ? Math.floor(Math.log2(Math.max(this._width, this._height))) + 1 : 1;
5197
5252
  };
5253
+ _proto._isIntFormat = function _isIntFormat() {
5254
+ if (TextureFormat.R32G32B32A32_UInt === this._format) {
5255
+ return true;
5256
+ }
5257
+ return false;
5258
+ };
5198
5259
  _create_class(Texture, [
5199
5260
  {
5200
5261
  key: "format",
@@ -5271,6 +5332,11 @@ var GraphicsResource = /*#__PURE__*/ function(ReferResource1) {
5271
5332
  },
5272
5333
  set: function set(value) {
5273
5334
  if (value === this._filterMode) return;
5335
+ if (value !== TextureFilterMode.Point && this._isIntFormat()) {
5336
+ value = TextureFilterMode.Point;
5337
+ Logger.warn("Int or UInt format texture only support TextureFilterMode.Point");
5338
+ return;
5339
+ }
5274
5340
  this._filterMode = value;
5275
5341
  this._platformTexture.filterMode = value;
5276
5342
  }
@@ -7574,56 +7640,6 @@ var /**
7574
7640
  TextureDepthCompareFunction[TextureDepthCompareFunction[/** always pass. */ "Always"] = 7] = "Always";
7575
7641
  })(TextureDepthCompareFunction || (TextureDepthCompareFunction = {}));
7576
7642
 
7577
- /**
7578
- * The filter mode of the texture.
7579
- */ var TextureFilterMode;
7580
- (function(TextureFilterMode) {
7581
- TextureFilterMode[TextureFilterMode[/** Point filtering. */ "Point"] = 0] = "Point";
7582
- TextureFilterMode[TextureFilterMode[/** Bilinear filtering. */ "Bilinear"] = 1] = "Bilinear";
7583
- TextureFilterMode[TextureFilterMode[/** Trilinear filtering. */ "Trilinear"] = 2] = "Trilinear";
7584
- })(TextureFilterMode || (TextureFilterMode = {}));
7585
-
7586
- /**
7587
- * Texture format enumeration.
7588
- */ var TextureFormat;
7589
- (function(TextureFormat) {
7590
- TextureFormat[TextureFormat[/** RGB format, 8 bits per channel. */ "R8G8B8"] = 0] = "R8G8B8";
7591
- TextureFormat[TextureFormat[/** RGBA format, 8 bits per channel. */ "R8G8B8A8"] = 1] = "R8G8B8A8";
7592
- TextureFormat[TextureFormat[/** RGBA format, 4 bits per channel. */ "R4G4B4A4"] = 2] = "R4G4B4A4";
7593
- TextureFormat[TextureFormat[/** RGBA format, 5 bits in R channel, 5 bits in G channel, 5 bits in B channel, 1 bit in A channel. */ "R5G5B5A1"] = 3] = "R5G5B5A1";
7594
- TextureFormat[TextureFormat[/** RGB format, 5 bits in R channel, 6 bits in G channel, 5 bits in B channel. */ "R5G6B5"] = 4] = "R5G6B5";
7595
- TextureFormat[TextureFormat[/** Transparent format, 8 bits. */ "Alpha8"] = 5] = "Alpha8";
7596
- TextureFormat[TextureFormat[/** Luminance/alpha in RGB channel, alpha in A channel. */ "LuminanceAlpha"] = 6] = "LuminanceAlpha";
7597
- TextureFormat[TextureFormat[/** RGBA format, 16 bits per channel. */ "R16G16B16A16"] = 7] = "R16G16B16A16";
7598
- TextureFormat[TextureFormat[/** RGBA format, 32 bits per channel. */ "R32G32B32A32"] = 8] = "R32G32B32A32";
7599
- TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "BC1"] = 9] = "BC1";
7600
- TextureFormat[TextureFormat[/** RGBA compressed format, 8 bits per pixel. */ "BC3"] = 10] = "BC3";
7601
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ "BC7"] = 11] = "BC7";
7602
- TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "ETC1_RGB"] = 12] = "ETC1_RGB";
7603
- TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "ETC2_RGB"] = 13] = "ETC2_RGB";
7604
- TextureFormat[TextureFormat[/** RGBA compressed format, 5 bits per pixel, 4 bit in RGB, 1 bit in A. */ "ETC2_RGBA5"] = 14] = "ETC2_RGBA5";
7605
- TextureFormat[TextureFormat[/** RGB compressed format, 8 bits per pixel. */ "ETC2_RGBA8"] = 15] = "ETC2_RGBA8";
7606
- TextureFormat[TextureFormat[/** RGB compressed format, 2 bits per pixel. */ "PVRTC_RGB2"] = 16] = "PVRTC_RGB2";
7607
- TextureFormat[TextureFormat[/** RGBA compressed format, 2 bits per pixel. */ "PVRTC_RGBA2"] = 17] = "PVRTC_RGBA2";
7608
- TextureFormat[TextureFormat[/** RGB compressed format, 4 bits per pixel. */ "PVRTC_RGB4"] = 18] = "PVRTC_RGB4";
7609
- TextureFormat[TextureFormat[/** RGBA compressed format, 4 bits per pixel. */ "PVRTC_RGBA4"] = 19] = "PVRTC_RGBA4";
7610
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ "ASTC_4x4"] = 20] = "ASTC_4x4";
7611
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 5x5 pixel block. */ "ASTC_5x5"] = 21] = "ASTC_5x5";
7612
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 6x6 pixel block. */ "ASTC_6x6"] = 22] = "ASTC_6x6";
7613
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 8x8 pixel block. */ "ASTC_8x8"] = 23] = "ASTC_8x8";
7614
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 10x10 pixel block. */ "ASTC_10x10"] = 24] = "ASTC_10x10";
7615
- TextureFormat[TextureFormat[/** RGB(A) compressed format, 128 bits per 12x12 pixel block. */ "ASTC_12x12"] = 25] = "ASTC_12x12";
7616
- TextureFormat[TextureFormat[/** Automatic depth format, engine will automatically select the supported precision. */ "Depth"] = 26] = "Depth";
7617
- TextureFormat[TextureFormat[/** Automatic depth stencil format, engine will automatically select the supported precision. */ "DepthStencil"] = 27] = "DepthStencil";
7618
- TextureFormat[TextureFormat[/** 16-bit depth format. */ "Depth16"] = 28] = "Depth16";
7619
- TextureFormat[TextureFormat[/** 24-bit depth format. */ "Depth24"] = 29] = "Depth24";
7620
- TextureFormat[TextureFormat[/** 32-bit depth format. */ "Depth32"] = 30] = "Depth32";
7621
- TextureFormat[TextureFormat[/** 16-bit depth + 8-bit stencil format. */ "Depth24Stencil8"] = 31] = "Depth24Stencil8";
7622
- TextureFormat[TextureFormat[/** 32-bit depth + 8-bit stencil format. */ "Depth32Stencil8"] = 32] = "Depth32Stencil8";
7623
- TextureFormat[TextureFormat[/** @deprecated Use `TextureFormat.BC1` instead. */ "DXT1"] = 33] = "DXT1";
7624
- TextureFormat[TextureFormat[/** @deprecated Use `TextureFormat.BC3` instead. */ "DXT5"] = 34] = "DXT5";
7625
- })(TextureFormat || (TextureFormat = {}));
7626
-
7627
7643
  /**
7628
7644
  * Texture usage.
7629
7645
  */ var TextureUsage;
@@ -7807,7 +7823,7 @@ var /**
7807
7823
  _this._mipmapCount = _this._getMipmapCount();
7808
7824
  _this._isDepthTexture = format == TextureFormat.Depth || format == TextureFormat.DepthStencil || format == TextureFormat.Depth16 || format == TextureFormat.Depth24 || format == TextureFormat.Depth32 || format == TextureFormat.Depth24Stencil8 || format == TextureFormat.Depth32Stencil8;
7809
7825
  _this._platformTexture = engine._hardwareRenderer.createPlatformTexture2D(_assert_this_initialized(_this));
7810
- _this.filterMode = TextureFilterMode.Bilinear;
7826
+ _this.filterMode = _this._isIntFormat() ? TextureFilterMode.Point : TextureFilterMode.Bilinear;
7811
7827
  _this.wrapModeU = _this.wrapModeV = TextureWrapMode.Repeat;
7812
7828
  return _this;
7813
7829
  }
@@ -19341,6 +19357,26 @@ ShaderPool.init();
19341
19357
  this._magentaTexture2D = magentaTexture2D;
19342
19358
  this._magentaTextureCube = magentaTextureCube;
19343
19359
  if (hardwareRenderer.isWebGL2) {
19360
+ var magentaPixel32 = new Uint32Array([
19361
+ 255,
19362
+ 0,
19363
+ 255,
19364
+ 255
19365
+ ]);
19366
+ var uintMagentaTexture2D = new Texture2D(this, 1, 1, TextureFormat.R32G32B32A32_UInt, false);
19367
+ uintMagentaTexture2D.setPixelBuffer(magentaPixel32);
19368
+ uintMagentaTexture2D.isGCIgnored = true;
19369
+ this.resourceManager.addContentRestorer(new /*#__PURE__*/ (function(ContentRestorer) {
19370
+ _inherits(_class, ContentRestorer);
19371
+ function _class() {
19372
+ return ContentRestorer.call(this, uintMagentaTexture2D);
19373
+ }
19374
+ var _proto = _class.prototype;
19375
+ _proto.restoreContent = function restoreContent() {
19376
+ this.resource.setPixelBuffer(magentaPixel32);
19377
+ };
19378
+ return _class;
19379
+ }(ContentRestorer))());
19344
19380
  var magentaTexture2DArray = new Texture2DArray(this, 1, 1, 1, TextureFormat.R8G8B8A8, false);
19345
19381
  magentaTexture2DArray.setPixelBuffer(0, magentaPixel);
19346
19382
  magentaTexture2DArray.isGCIgnored = true;
@@ -19355,6 +19391,7 @@ ShaderPool.init();
19355
19391
  };
19356
19392
  return _class;
19357
19393
  }(ContentRestorer))());
19394
+ this._uintMagentaTexture2D = uintMagentaTexture2D;
19358
19395
  this._magentaTexture2DArray = magentaTexture2DArray;
19359
19396
  }
19360
19397
  };
@@ -19587,8 +19624,8 @@ ShaderPool.init();
19587
19624
  set: function set(value) {
19588
19625
  if (this._width !== value) {
19589
19626
  this._width = value;
19627
+ this._onWidthChanged(value);
19590
19628
  this._sizeUpdateFlagManager.dispatch();
19591
- this._onSizeChanged(value, this._width);
19592
19629
  }
19593
19630
  }
19594
19631
  },
@@ -19602,8 +19639,8 @@ ShaderPool.init();
19602
19639
  set: function set(value) {
19603
19640
  if (this._height !== value) {
19604
19641
  this._height = value;
19642
+ this._onHeightChange(value);
19605
19643
  this._sizeUpdateFlagManager.dispatch();
19606
- this._onSizeChanged(this._width, value);
19607
19644
  }
19608
19645
  }
19609
19646
  }
@@ -29957,7 +29994,8 @@ __decorate([
29957
29994
  var transform = this._renderer.entity.transform;
29958
29995
  var shape = this.emission.shape;
29959
29996
  for(var i = 0; i < count; i++){
29960
- if (shape) {
29997
+ var _shape;
29998
+ if ((_shape = shape) == null ? void 0 : _shape.enabled) {
29961
29999
  shape._generatePositionAndDirection(this.emission._shapeRand, time, position, direction);
29962
30000
  var positionScale = this.main._getPositionScale();
29963
30001
  position.multiply(positionScale);
@@ -30537,7 +30575,7 @@ __decorate([
30537
30575
  * Base class for all particle shapes.
30538
30576
  */ var BaseShape = /*#__PURE__*/ function() {
30539
30577
  function BaseShape() {
30540
- /** Specifies whether the ShapeModule is enabled or disabled. */ this.enable = true;
30578
+ /** Specifies whether the ShapeModule is enabled or disabled. */ this.enabled = true;
30541
30579
  /** Randomizes the starting direction of particles. */ this.randomDirectionAmount = 0;
30542
30580
  }
30543
30581
  var _proto = BaseShape.prototype;