@galacean/engine-core 2.0.0-alpha.60 → 2.0.0-alpha.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -396,45 +396,50 @@ registerDefaultCloneMode(ReferResource, CloneMode.Assignment);
396
396
  }({});
397
397
 
398
398
  /**
399
- * Texture format enumeration.
399
+ * Pixel storage format for textures and render targets.
400
400
  */ var TextureFormat = /*#__PURE__*/ function(TextureFormat) {
401
- /** RGB format, 8 bits per channel. */ TextureFormat[TextureFormat["R8G8B8"] = 0] = "R8G8B8";
402
- /** RGBA format, 8 bits per channel. */ TextureFormat[TextureFormat["R8G8B8A8"] = 1] = "R8G8B8A8";
403
- /** RGBA format, 4 bits per channel. */ TextureFormat[TextureFormat["R4G4B4A4"] = 2] = "R4G4B4A4";
404
- /** RGBA format, 5 bits in R channel, 5 bits in G channel, 5 bits in B channel, 1 bit in A channel. */ TextureFormat[TextureFormat["R5G5B5A1"] = 3] = "R5G5B5A1";
405
- /** RGB format, 5 bits in R channel, 6 bits in G channel, 5 bits in B channel. */ TextureFormat[TextureFormat["R5G6B5"] = 4] = "R5G6B5";
406
- /** RGBA format, 16 bits per channel. */ TextureFormat[TextureFormat["R16G16B16A16"] = 7] = "R16G16B16A16";
407
- /** RGBA format, 32 bits per channel. */ TextureFormat[TextureFormat["R32G32B32A32"] = 8] = "R32G32B32A32";
408
- /** RGBA unsigned integer format, 32 bits per channel. */ TextureFormat[TextureFormat["R32G32B32A32_UInt"] = 9] = "R32G32B32A32_UInt";
409
- /** RGB unsigned float format, 11 bits in R channel, 11 bits in G channel, 10 bits in B channel. */ TextureFormat[TextureFormat["R11G11B10_UFloat"] = 35] = "R11G11B10_UFloat";
410
- /** R float format, 8 bits. */ TextureFormat[TextureFormat["R8"] = 36] = "R8";
411
- /** RG float format, 8 bits per channel. */ TextureFormat[TextureFormat["R8G8"] = 37] = "R8G8";
412
- /** RGB compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["BC1"] = 10] = "BC1";
413
- /** RGBA compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["BC3"] = 11] = "BC3";
414
- /** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ TextureFormat[TextureFormat["BC7"] = 12] = "BC7";
415
- /** RGB HDR compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["BC6H"] = 100] = "BC6H";
416
- /** RGB compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["ETC1_RGB"] = 13] = "ETC1_RGB";
417
- /** RGB compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["ETC2_RGB"] = 14] = "ETC2_RGB";
418
- /** RGBA compressed format, 5 bits per pixel, 4 bit in RGB, 1 bit in A. */ TextureFormat[TextureFormat["ETC2_RGBA5"] = 15] = "ETC2_RGBA5";
419
- /** RGB compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["ETC2_RGBA8"] = 16] = "ETC2_RGBA8";
420
- /** RGB compressed format, 2 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGB2"] = 17] = "PVRTC_RGB2";
421
- /** RGBA compressed format, 2 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGBA2"] = 18] = "PVRTC_RGBA2";
422
- /** RGB compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGB4"] = 19] = "PVRTC_RGB4";
423
- /** RGBA compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGBA4"] = 20] = "PVRTC_RGBA4";
424
- /** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ TextureFormat[TextureFormat["ASTC_4x4"] = 21] = "ASTC_4x4";
425
- /** RGB(A) compressed format, 128 bits per 5x5 pixel block. */ TextureFormat[TextureFormat["ASTC_5x5"] = 22] = "ASTC_5x5";
426
- /** RGB(A) compressed format, 128 bits per 6x6 pixel block. */ TextureFormat[TextureFormat["ASTC_6x6"] = 23] = "ASTC_6x6";
427
- /** RGB(A) compressed format, 128 bits per 8x8 pixel block. */ TextureFormat[TextureFormat["ASTC_8x8"] = 24] = "ASTC_8x8";
428
- /** RGB(A) compressed format, 128 bits per 10x10 pixel block. */ TextureFormat[TextureFormat["ASTC_10x10"] = 25] = "ASTC_10x10";
429
- /** RGB(A) compressed format, 128 bits per 12x12 pixel block. */ TextureFormat[TextureFormat["ASTC_12x12"] = 26] = "ASTC_12x12";
430
- /** Automatic depth format, engine will automatically select the supported precision. */ TextureFormat[TextureFormat["Depth"] = 27] = "Depth";
431
- /** Render to stencil buffer. */ TextureFormat[TextureFormat["Stencil"] = 28] = "Stencil";
432
- /** Automatic depth stencil format, engine will automatically select the supported precision. */ TextureFormat[TextureFormat["DepthStencil"] = 29] = "DepthStencil";
433
- /** 16-bit depth format. */ TextureFormat[TextureFormat["Depth16"] = 30] = "Depth16";
434
- /** 24-bit depth format. */ TextureFormat[TextureFormat["Depth24"] = 31] = "Depth24";
435
- /** 32-bit depth format. */ TextureFormat[TextureFormat["Depth32"] = 32] = "Depth32";
436
- /** 16-bit depth + 8-bit stencil format. */ TextureFormat[TextureFormat["Depth24Stencil8"] = 33] = "Depth24Stencil8";
437
- /** 32-bit depth + 8-bit stencil format. */ TextureFormat[TextureFormat["Depth32Stencil8"] = 34] = "Depth32Stencil8";
401
+ /** RGB 8-bit unsigned normalized format. `getPixelBuffer` outputs RGBA `Uint8Array`. */ TextureFormat[TextureFormat["R8G8B8_UNorm"] = 0] = "R8G8B8_UNorm";
402
+ /** RGBA 8-bit unsigned normalized format. */ TextureFormat[TextureFormat["R8G8B8A8_UNorm"] = 1] = "R8G8B8A8_UNorm";
403
+ /** Packed RGBA 4-4-4-4 unsigned normalized format. */ TextureFormat[TextureFormat["R4G4B4A4_UNorm"] = 2] = "R4G4B4A4_UNorm";
404
+ /** Packed RGBA 5-5-5-1 unsigned normalized format. */ TextureFormat[TextureFormat["R5G5B5A1_UNorm"] = 3] = "R5G5B5A1_UNorm";
405
+ /** Packed RGB 5-6-5 unsigned normalized format. */ TextureFormat[TextureFormat["R5G6B5_UNorm"] = 4] = "R5G6B5_UNorm";
406
+ /** RGBA 16-bit signed float format (half-float `Uint16Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R16G16B16A16_SFloat"] = 7] = "R16G16B16A16_SFloat";
407
+ /** RGBA 32-bit signed float format (`Float32Array`). */ TextureFormat[TextureFormat["R32G32B32A32_SFloat"] = 8] = "R32G32B32A32_SFloat";
408
+ /** RGBA 32-bit unsigned integer format (`Uint32Array`, `TextureFilterMode.Point` only). */ TextureFormat[TextureFormat["R32G32B32A32_UInt"] = 9] = "R32G32B32A32_UInt";
409
+ /** Packed RGB 11-11-10 unsigned float format (`Float32Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R11G11B10_UFloat"] = 35] = "R11G11B10_UFloat";
410
+ /** R 8-bit unsigned normalized format. */ TextureFormat[TextureFormat["R8_UNorm"] = 36] = "R8_UNorm";
411
+ /** RG 8-bit unsigned normalized format. */ TextureFormat[TextureFormat["R8G8_UNorm"] = 37] = "R8G8_UNorm";
412
+ /** R 16-bit unsigned normalized format (`Uint16Array`). `getPixelBuffer` outputs RGBA `Uint16Array`. */ TextureFormat[TextureFormat["R16_UNorm"] = 38] = "R16_UNorm";
413
+ /** R 16-bit signed float format (half-float `Uint16Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R16_SFloat"] = 39] = "R16_SFloat";
414
+ /** RG 16-bit signed float format (half-float `Uint16Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R16G16_SFloat"] = 40] = "R16G16_SFloat";
415
+ /** R 32-bit signed float format (`Float32Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R32_SFloat"] = 41] = "R32_SFloat";
416
+ /** RG 32-bit signed float format (`Float32Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R32G32_SFloat"] = 42] = "R32G32_SFloat";
417
+ /** RGB S3TC/DXT1 compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["BC1"] = 10] = "BC1";
418
+ /** RGBA S3TC/DXT5 compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["BC3"] = 11] = "BC3";
419
+ /** RGB(A) BPTC compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["BC7"] = 12] = "BC7";
420
+ /** RGB unsigned float HDR BPTC compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["BC6H"] = 100] = "BC6H";
421
+ /** RGB ETC1 compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["ETC1_RGB"] = 13] = "ETC1_RGB";
422
+ /** RGB ETC2 compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["ETC2_RGB"] = 14] = "ETC2_RGB";
423
+ /** RGBA ETC2 punchthrough-alpha compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["ETC2_RGBA5"] = 15] = "ETC2_RGBA5";
424
+ /** RGBA ETC2 EAC compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["ETC2_RGBA8"] = 16] = "ETC2_RGBA8";
425
+ /** RGB PVRTC compressed format, 2 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGB2"] = 17] = "PVRTC_RGB2";
426
+ /** RGBA PVRTC compressed format, 2 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGBA2"] = 18] = "PVRTC_RGBA2";
427
+ /** RGB PVRTC compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGB4"] = 19] = "PVRTC_RGB4";
428
+ /** RGBA PVRTC compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGBA4"] = 20] = "PVRTC_RGBA4";
429
+ /** RGB(A) ASTC compressed format, 128 bits per 4x4 block. */ TextureFormat[TextureFormat["ASTC_4x4"] = 21] = "ASTC_4x4";
430
+ /** RGB(A) ASTC compressed format, 128 bits per 5x5 block. */ TextureFormat[TextureFormat["ASTC_5x5"] = 22] = "ASTC_5x5";
431
+ /** RGB(A) ASTC compressed format, 128 bits per 6x6 block. */ TextureFormat[TextureFormat["ASTC_6x6"] = 23] = "ASTC_6x6";
432
+ /** RGB(A) ASTC compressed format, 128 bits per 8x8 block. */ TextureFormat[TextureFormat["ASTC_8x8"] = 24] = "ASTC_8x8";
433
+ /** RGB(A) ASTC compressed format, 128 bits per 10x10 block. */ TextureFormat[TextureFormat["ASTC_10x10"] = 25] = "ASTC_10x10";
434
+ /** RGB(A) ASTC compressed format, 128 bits per 12x12 block. */ TextureFormat[TextureFormat["ASTC_12x12"] = 26] = "ASTC_12x12";
435
+ /** Default depth format (32-bit float depth). */ TextureFormat[TextureFormat["Depth"] = 27] = "Depth";
436
+ /** 8-bit stencil format (for `RenderTarget` only). */ TextureFormat[TextureFormat["Stencil"] = 28] = "Stencil";
437
+ /** Default depth-stencil format (32-bit float depth + 8-bit stencil). */ TextureFormat[TextureFormat["DepthStencil"] = 29] = "DepthStencil";
438
+ /** 16-bit unsigned normalized depth format. */ TextureFormat[TextureFormat["Depth16"] = 30] = "Depth16";
439
+ /** 24-bit unsigned normalized depth format. */ TextureFormat[TextureFormat["Depth24"] = 31] = "Depth24";
440
+ /** 32-bit float depth format. */ TextureFormat[TextureFormat["Depth32"] = 32] = "Depth32";
441
+ /** 24-bit depth + 8-bit stencil format. */ TextureFormat[TextureFormat["Depth24Stencil8"] = 33] = "Depth24Stencil8";
442
+ /** 32-bit float depth + 8-bit stencil format. */ TextureFormat[TextureFormat["Depth32Stencil8"] = 34] = "Depth32Stencil8";
438
443
  return TextureFormat;
439
444
  }({});
440
445
 
@@ -1015,7 +1020,9 @@ SystemInfo._webpSupported = null;
1015
1020
  key: "filterMode",
1016
1021
  get: /**
1017
1022
  * Sampling filter mode.
1018
- * @remarks Integer formats (`TextureFormat.R32G32B32A32_UInt`) only accept `TextureFilterMode.Point`; other modes log a warning and are ignored.
1023
+ * @remarks
1024
+ * Integer formats (`TextureFormat.R32G32B32A32_UInt`) only accept `TextureFilterMode.Point`; other modes log a warning and are ignored.
1025
+ * For 32-bit float formats, linear modes are kept on this property and fall back to `TextureFilterMode.Point` when sampling if the device does not support linear float filtering.
1019
1026
  */ function get() {
1020
1027
  return this._filterMode;
1021
1028
  },
@@ -1084,12 +1091,12 @@ SystemInfo._webpSupported = null;
1084
1091
  return TextureUtils.supportGenerateMipmaps(format, mipmap, isSRGBColorSpace);
1085
1092
  };
1086
1093
  TextureUtils.isHDRFormat = function isHDRFormat(format) {
1087
- return format === TextureFormat.R16G16B16A16 || format === TextureFormat.R32G32B32A32 || format === TextureFormat.R11G11B10_UFloat;
1094
+ return format === TextureFormat.R16G16B16A16_SFloat || format === TextureFormat.R32G32B32A32_SFloat || format === TextureFormat.R11G11B10_UFloat;
1088
1095
  };
1089
1096
  TextureUtils.supportSRGB = function supportSRGB(format) {
1090
1097
  switch(format){
1091
- case TextureFormat.R8G8B8:
1092
- case TextureFormat.R8G8B8A8:
1098
+ case TextureFormat.R8G8B8_UNorm:
1099
+ case TextureFormat.R8G8B8A8_UNorm:
1093
1100
  case TextureFormat.BC1:
1094
1101
  case TextureFormat.BC3:
1095
1102
  case TextureFormat.BC7:
@@ -1109,7 +1116,7 @@ SystemInfo._webpSupported = null;
1109
1116
  };
1110
1117
  TextureUtils.supportGenerateMipmaps = function supportGenerateMipmaps(format, mipmap, isSRGBColorSpace) {
1111
1118
  // Auto generating mipmaps for sRGB textures is only supported in [WebGL2 + RGBA]
1112
- if (mipmap && isSRGBColorSpace && format !== TextureFormat.R8G8B8A8) {
1119
+ if (mipmap && isSRGBColorSpace && format !== TextureFormat.R8G8B8A8_UNorm) {
1113
1120
  return false;
1114
1121
  }
1115
1122
  return true;
@@ -1126,22 +1133,27 @@ SystemInfo._webpSupported = null;
1126
1133
  TextureUtils.getMipLevelByteCount = function getMipLevelByteCount(format, width, height) {
1127
1134
  switch(format){
1128
1135
  // Uncompressed formats
1129
- case TextureFormat.R8:
1136
+ case TextureFormat.R8_UNorm:
1130
1137
  return width * height;
1131
- case TextureFormat.R8G8:
1138
+ case TextureFormat.R8G8_UNorm:
1139
+ case TextureFormat.R16_UNorm:
1140
+ case TextureFormat.R16_SFloat:
1132
1141
  return width * height * 2;
1133
- case TextureFormat.R8G8B8:
1142
+ case TextureFormat.R8G8B8_UNorm:
1134
1143
  return width * height * 3;
1135
- case TextureFormat.R8G8B8A8:
1144
+ case TextureFormat.R8G8B8A8_UNorm:
1136
1145
  case TextureFormat.R11G11B10_UFloat:
1146
+ case TextureFormat.R16G16_SFloat:
1147
+ case TextureFormat.R32_SFloat:
1137
1148
  return width * height * 4;
1138
- case TextureFormat.R4G4B4A4:
1139
- case TextureFormat.R5G5B5A1:
1140
- case TextureFormat.R5G6B5:
1149
+ case TextureFormat.R4G4B4A4_UNorm:
1150
+ case TextureFormat.R5G5B5A1_UNorm:
1151
+ case TextureFormat.R5G6B5_UNorm:
1141
1152
  return width * height * 2;
1142
- case TextureFormat.R16G16B16A16:
1153
+ case TextureFormat.R16G16B16A16_SFloat:
1154
+ case TextureFormat.R32G32_SFloat:
1143
1155
  return width * height * 8;
1144
- case TextureFormat.R32G32B32A32:
1156
+ case TextureFormat.R32G32B32A32_SFloat:
1145
1157
  case TextureFormat.R32G32B32A32_UInt:
1146
1158
  return width * height * 16;
1147
1159
  // BC compressed (4x4 blocks)
@@ -1206,7 +1218,7 @@ SystemInfo._webpSupported = null;
1206
1218
  */ var TextureCube = /*#__PURE__*/ function(Texture) {
1207
1219
  _inherits(TextureCube, Texture);
1208
1220
  function TextureCube(engine, size, format, mipmap, isSRGBColorSpace) {
1209
- if (format === void 0) format = TextureFormat.R8G8B8A8;
1221
+ if (format === void 0) format = TextureFormat.R8G8B8A8_UNorm;
1210
1222
  if (mipmap === void 0) mipmap = true;
1211
1223
  if (isSRGBColorSpace === void 0) isSRGBColorSpace = true;
1212
1224
  var _this;
@@ -1455,7 +1467,7 @@ SystemInfo._webpSupported = null;
1455
1467
  */ var Texture2D = /*#__PURE__*/ function(Texture) {
1456
1468
  _inherits(Texture2D, Texture);
1457
1469
  function Texture2D(engine, width, height, format, mipmap, isSRGBColorSpace, usage) {
1458
- if (format === void 0) format = TextureFormat.R8G8B8A8;
1470
+ if (format === void 0) format = TextureFormat.R8G8B8A8_UNorm;
1459
1471
  if (mipmap === void 0) mipmap = true;
1460
1472
  if (isSRGBColorSpace === void 0) isSRGBColorSpace = true;
1461
1473
  if (usage === void 0) usage = TextureUsage.Static;
@@ -1532,7 +1544,7 @@ SystemInfo._webpSupported = null;
1532
1544
  */ var Texture2DArray = /*#__PURE__*/ function(Texture) {
1533
1545
  _inherits(Texture2DArray, Texture);
1534
1546
  function Texture2DArray(engine, width, height, length, format, mipmap, isSRGBColorSpace) {
1535
- if (format === void 0) format = TextureFormat.R8G8B8A8;
1547
+ if (format === void 0) format = TextureFormat.R8G8B8A8_UNorm;
1536
1548
  if (mipmap === void 0) mipmap = true;
1537
1549
  if (isSRGBColorSpace === void 0) isSRGBColorSpace = true;
1538
1550
  var _this;
@@ -1623,7 +1635,7 @@ SystemInfo._webpSupported = null;
1623
1635
  var _this;
1624
1636
  _this = ReferResource.call(this, engine) || this, _this._charInfoMap = {}, _this._space = 1, _this._curX = 1, _this._curY = 1, _this._nextY = 1;
1625
1637
  _this.isGCIgnored = true;
1626
- var texture = new Texture2D(engine, 512, 512, TextureFormat.R8, false, false);
1638
+ var texture = new Texture2D(engine, 512, 512, TextureFormat.R8_UNorm, false, false);
1627
1639
  texture.filterMode = TextureFilterMode.Bilinear;
1628
1640
  texture.isGCIgnored = true;
1629
1641
  _this.texture = texture;
@@ -2928,6 +2940,7 @@ registerDefaultCloneMode(DataObject, CloneMode.Deep);
2928
2940
  /**
2929
2941
  * Optional GL capabilities.
2930
2942
  * */ var GLCapabilityType = /*#__PURE__*/ function(GLCapabilityType) {
2943
+ GLCapabilityType["textureNorm16"] = "EXT_texture_norm16";
2931
2944
  GLCapabilityType["textureFloatLinear"] = "OES_texture_float_linear";
2932
2945
  GLCapabilityType["colorBufferFloat"] = "EXT_color_buffer_float";
2933
2946
  GLCapabilityType["colorBufferHalfFloat"] = "EXT_color_buffer_half_float";
@@ -12353,7 +12366,7 @@ var PrefilteredDFG = /*#__PURE__*/ function() {
12353
12366
  function PrefilteredDFG() {}
12354
12367
  PrefilteredDFG.create = function create(engine) {
12355
12368
  return new Promise(function(resolve, reject) {
12356
- var texture = new Texture2D(engine, PrefilteredDFG._size, PrefilteredDFG._size, TextureFormat.R8G8B8, false, false);
12369
+ var texture = new Texture2D(engine, PrefilteredDFG._size, PrefilteredDFG._size, TextureFormat.R8G8B8_UNorm, false, false);
12357
12370
  texture.wrapModeU = texture.wrapModeV = TextureWrapMode.Clamp;
12358
12371
  texture.isGCIgnored = true;
12359
12372
  var image = new Image();
@@ -13415,7 +13428,7 @@ __decorate([
13415
13428
  var blendShapeDataTexture = this._vertexTexture;
13416
13429
  var blendShapeCount = this._blendShapes.length;
13417
13430
  blendShapeDataTexture && blendShapeDataTexture.destroy();
13418
- blendShapeDataTexture = new Texture2DArray(this._engine, textureWidth, textureHeight, blendShapeCount, TextureFormat.R32G32B32A32, false, false);
13431
+ blendShapeDataTexture = new Texture2DArray(this._engine, textureWidth, textureHeight, blendShapeCount, TextureFormat.R32G32B32A32_SFloat, false, false);
13419
13432
  blendShapeDataTexture.filterMode = TextureFilterMode.Point;
13420
13433
  this._vertices = new Float32Array(blendShapeCount * textureWidth * textureHeight * 4);
13421
13434
  this._vertexTexture = blendShapeDataTexture;
@@ -17814,7 +17827,7 @@ var SkinUpdateFlag = /*#__PURE__*/ function(SkinUpdateFlag) {
17814
17827
  if (boneCountChange) {
17815
17828
  var _this__jointTexture;
17816
17829
  (_this__jointTexture = this._jointTexture) == null ? void 0 : _this__jointTexture.destroy();
17817
- this._jointTexture = new Texture2D(this.engine, 4, boneCount, TextureFormat.R32G32B32A32, false, false);
17830
+ this._jointTexture = new Texture2D(this.engine, 4, boneCount, TextureFormat.R32G32B32A32_SFloat, false, false);
17818
17831
  this._jointTexture.filterMode = TextureFilterMode.Point;
17819
17832
  this._jointTexture.isGCIgnored = true;
17820
17833
  }
@@ -18177,9 +18190,9 @@ __decorate([
18177
18190
  255,
18178
18191
  255
18179
18192
  ]);
18180
- this.whiteTexture2D = this._create1x1Texture(engine, 0, TextureFormat.R8G8B8A8, whitePixel, true);
18181
- this.whiteTextureCube = this._create1x1Texture(engine, 1, TextureFormat.R8G8B8A8, whitePixel, true);
18182
- this.whiteTexture2DArray = this._create1x1Texture(engine, 2, TextureFormat.R8G8B8A8, whitePixel, true);
18193
+ this.whiteTexture2D = this._create1x1Texture(engine, 0, TextureFormat.R8G8B8A8_UNorm, whitePixel, true);
18194
+ this.whiteTextureCube = this._create1x1Texture(engine, 1, TextureFormat.R8G8B8A8_UNorm, whitePixel, true);
18195
+ this.whiteTexture2DArray = this._create1x1Texture(engine, 2, TextureFormat.R8G8B8A8_UNorm, whitePixel, true);
18183
18196
  var whitePixel32 = new Uint32Array([
18184
18197
  255,
18185
18198
  255,
@@ -25752,7 +25765,7 @@ PostProcessUberPass.UBER_SHADER_NAME = "PostProcess/Uber";
25752
25765
  this._inputRenderTarget = inputRenderTarget;
25753
25766
  if (camera.antiAliasing === AntiAliasing.FXAA) {
25754
25767
  var pixelViewport = camera.pixelViewport;
25755
- this._srgbRenderTarget = PipelineUtils.recreateRenderTargetIfNeeded(this.engine, this._srgbRenderTarget, pixelViewport.width, pixelViewport.height, TextureFormat.R8G8B8A8, null, false, false, false, 1, TextureWrapMode.Clamp, TextureFilterMode.Bilinear);
25768
+ this._srgbRenderTarget = PipelineUtils.recreateRenderTargetIfNeeded(this.engine, this._srgbRenderTarget, pixelViewport.width, pixelViewport.height, TextureFormat.R8G8B8A8_UNorm, null, false, false, false, 1, TextureWrapMode.Clamp, TextureFilterMode.Bilinear);
25756
25769
  }
25757
25770
  };
25758
25771
  _proto.onRender = function onRender(context) {
@@ -29056,7 +29069,7 @@ var Camera = /*#__PURE__*/ function(Component) {
29056
29069
  if (TextureUtils.isHDRFormat(internalColorFormat) || this.opaqueTextureEnabled) {
29057
29070
  if (renderTarget) {
29058
29071
  // If camera is HDR and format is same with renderTarget can reuse renderTarget if renderTarget is same HDR format
29059
- // If camera is LDR and opaqueTextureEnabled is true, can reuse renderTarget if renderTarget is LDR format(Only R8G8B8A8)
29072
+ // If camera is LDR and opaqueTextureEnabled is true, can reuse renderTarget if renderTarget is LDR format(Only R8G8B8A8_UNorm)
29060
29073
  return internalColorFormat !== renderTarget.getColorTexture(0).format;
29061
29074
  } else {
29062
29075
  return true;
@@ -29072,11 +29085,11 @@ var Camera = /*#__PURE__*/ function(Component) {
29072
29085
  if (!this.isAlphaOutputRequired && rhi.supportsRenderTargetColorFormat(TextureFormat.R11G11B10_UFloat)) {
29073
29086
  return TextureFormat.R11G11B10_UFloat;
29074
29087
  }
29075
- if (rhi.supportsRenderTargetColorFormat(TextureFormat.R16G16B16A16)) {
29076
- return TextureFormat.R16G16B16A16;
29088
+ if (rhi.supportsRenderTargetColorFormat(TextureFormat.R16G16B16A16_SFloat)) {
29089
+ return TextureFormat.R16G16B16A16_SFloat;
29077
29090
  }
29078
29091
  }
29079
- return TextureFormat.R8G8B8A8;
29092
+ return TextureFormat.R8G8B8A8_UNorm;
29080
29093
  };
29081
29094
  /**
29082
29095
  * @internal
@@ -29093,7 +29106,7 @@ var Camera = /*#__PURE__*/ function(Component) {
29093
29106
  * @internal
29094
29107
  */ _proto._getTargetColorTextureFormat = function _getTargetColorTextureFormat() {
29095
29108
  var renderTarget = this._renderTarget;
29096
- return renderTarget ? renderTarget.getColorTexture(0).format : TextureFormat.R8G8B8A8;
29109
+ return renderTarget ? renderTarget.getColorTexture(0).format : TextureFormat.R8G8B8A8_UNorm;
29097
29110
  };
29098
29111
  /**
29099
29112
  * @internal
@@ -29536,7 +29549,7 @@ Camera = __decorate([
29536
29549
  var engine = this.engine;
29537
29550
  var _camera_pixelViewport = camera.pixelViewport, width = _camera_pixelViewport.width, height = _camera_pixelViewport.height;
29538
29551
  this._depthRenderTarget = depthRenderTarget;
29539
- var format = TextureFormat.R8G8B8;
29552
+ var format = TextureFormat.R8G8B8_UNorm;
29540
29553
  this._saoRenderTarget = PipelineUtils.recreateRenderTargetIfNeeded(engine, this._saoRenderTarget, width, height, format, null, false, false, false, 1, TextureWrapMode.Clamp, TextureFilterMode.Bilinear);
29541
29554
  this._blurRenderTarget = PipelineUtils.recreateRenderTargetIfNeeded(engine, this._blurRenderTarget, width, height, format, null, false, false, false, 1, TextureWrapMode.Clamp, TextureFilterMode.Bilinear);
29542
29555
  };
@@ -30547,7 +30560,7 @@ CascadedShadowCasterPass._tempMatrix0 = new Matrix();
30547
30560
  var _camera_renderTarget;
30548
30561
  var colorTexture = (_camera_renderTarget = camera.renderTarget) == null ? void 0 : _camera_renderTarget.getColorTexture(0);
30549
30562
  var _colorTexture_format, _colorTexture_isSRGBColorSpace;
30550
- this._copyBackgroundTexture = pool.allocateTexture(viewport.width, viewport.height, (_colorTexture_format = colorTexture == null ? void 0 : colorTexture.format) != null ? _colorTexture_format : TextureFormat.R8G8B8A8, false, (_colorTexture_isSRGBColorSpace = colorTexture == null ? void 0 : colorTexture.isSRGBColorSpace) != null ? _colorTexture_isSRGBColorSpace : false, TextureWrapMode.Clamp, TextureFilterMode.Bilinear);
30563
+ this._copyBackgroundTexture = pool.allocateTexture(viewport.width, viewport.height, (_colorTexture_format = colorTexture == null ? void 0 : colorTexture.format) != null ? _colorTexture_format : TextureFormat.R8G8B8A8_UNorm, false, (_colorTexture_isSRGBColorSpace = colorTexture == null ? void 0 : colorTexture.isSRGBColorSpace) != null ? _colorTexture_isSRGBColorSpace : false, TextureWrapMode.Clamp, TextureFilterMode.Bilinear);
30551
30564
  }
30552
30565
  }
30553
30566
  // Scalable ambient obscurance pass