@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/main.js +83 -70
- package/dist/main.js.map +1 -1
- package/dist/module.js +83 -70
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/base/Constant.d.ts +1 -0
- package/types/texture/Texture.d.ts +3 -1
- package/types/texture/Texture2D.d.ts +1 -1
- package/types/texture/Texture2DArray.d.ts +1 -1
- package/types/texture/TextureCube.d.ts +1 -1
- package/types/texture/enums/TextureFormat.d.ts +57 -47
package/dist/main.js
CHANGED
|
@@ -400,45 +400,50 @@ registerDefaultCloneMode(ReferResource, CloneMode.Assignment);
|
|
|
400
400
|
}({});
|
|
401
401
|
|
|
402
402
|
/**
|
|
403
|
-
*
|
|
403
|
+
* Pixel storage format for textures and render targets.
|
|
404
404
|
*/ var TextureFormat = /*#__PURE__*/ function(TextureFormat) {
|
|
405
|
-
/** RGB
|
|
406
|
-
/** RGBA
|
|
407
|
-
/** RGBA
|
|
408
|
-
/** RGBA
|
|
409
|
-
/** RGB
|
|
410
|
-
/** RGBA
|
|
411
|
-
/** RGBA
|
|
412
|
-
/** RGBA unsigned integer format
|
|
413
|
-
/** RGB unsigned float format
|
|
414
|
-
/** R
|
|
415
|
-
/** RG
|
|
416
|
-
/**
|
|
417
|
-
/**
|
|
418
|
-
/**
|
|
419
|
-
/**
|
|
420
|
-
/**
|
|
421
|
-
/** RGB compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["
|
|
422
|
-
/** RGBA compressed format,
|
|
423
|
-
/** RGB compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["
|
|
424
|
-
/** RGB compressed format,
|
|
425
|
-
/**
|
|
426
|
-
/** RGB compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["
|
|
427
|
-
/** RGBA compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["
|
|
428
|
-
/**
|
|
429
|
-
/** RGB
|
|
430
|
-
/**
|
|
431
|
-
/** RGB
|
|
432
|
-
/**
|
|
433
|
-
/** RGB(A) compressed format, 128 bits per
|
|
434
|
-
/**
|
|
435
|
-
/**
|
|
436
|
-
/**
|
|
437
|
-
/**
|
|
438
|
-
/**
|
|
439
|
-
/** 32-bit depth
|
|
440
|
-
/**
|
|
441
|
-
/** 32-bit depth + 8-bit stencil
|
|
405
|
+
/** RGB 8-bit unsigned normalized format. `getPixelBuffer` outputs RGBA `Uint8Array`. */ TextureFormat[TextureFormat["R8G8B8_UNorm"] = 0] = "R8G8B8_UNorm";
|
|
406
|
+
/** RGBA 8-bit unsigned normalized format. */ TextureFormat[TextureFormat["R8G8B8A8_UNorm"] = 1] = "R8G8B8A8_UNorm";
|
|
407
|
+
/** Packed RGBA 4-4-4-4 unsigned normalized format. */ TextureFormat[TextureFormat["R4G4B4A4_UNorm"] = 2] = "R4G4B4A4_UNorm";
|
|
408
|
+
/** Packed RGBA 5-5-5-1 unsigned normalized format. */ TextureFormat[TextureFormat["R5G5B5A1_UNorm"] = 3] = "R5G5B5A1_UNorm";
|
|
409
|
+
/** Packed RGB 5-6-5 unsigned normalized format. */ TextureFormat[TextureFormat["R5G6B5_UNorm"] = 4] = "R5G6B5_UNorm";
|
|
410
|
+
/** RGBA 16-bit signed float format (half-float `Uint16Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R16G16B16A16_SFloat"] = 7] = "R16G16B16A16_SFloat";
|
|
411
|
+
/** RGBA 32-bit signed float format (`Float32Array`). */ TextureFormat[TextureFormat["R32G32B32A32_SFloat"] = 8] = "R32G32B32A32_SFloat";
|
|
412
|
+
/** RGBA 32-bit unsigned integer format (`Uint32Array`, `TextureFilterMode.Point` only). */ TextureFormat[TextureFormat["R32G32B32A32_UInt"] = 9] = "R32G32B32A32_UInt";
|
|
413
|
+
/** Packed RGB 11-11-10 unsigned float format (`Float32Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R11G11B10_UFloat"] = 35] = "R11G11B10_UFloat";
|
|
414
|
+
/** R 8-bit unsigned normalized format. */ TextureFormat[TextureFormat["R8_UNorm"] = 36] = "R8_UNorm";
|
|
415
|
+
/** RG 8-bit unsigned normalized format. */ TextureFormat[TextureFormat["R8G8_UNorm"] = 37] = "R8G8_UNorm";
|
|
416
|
+
/** R 16-bit unsigned normalized format (`Uint16Array`). `getPixelBuffer` outputs RGBA `Uint16Array`. */ TextureFormat[TextureFormat["R16_UNorm"] = 38] = "R16_UNorm";
|
|
417
|
+
/** R 16-bit signed float format (half-float `Uint16Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R16_SFloat"] = 39] = "R16_SFloat";
|
|
418
|
+
/** RG 16-bit signed float format (half-float `Uint16Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R16G16_SFloat"] = 40] = "R16G16_SFloat";
|
|
419
|
+
/** R 32-bit signed float format (`Float32Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R32_SFloat"] = 41] = "R32_SFloat";
|
|
420
|
+
/** RG 32-bit signed float format (`Float32Array`). `getPixelBuffer` outputs RGBA `Float32Array`. */ TextureFormat[TextureFormat["R32G32_SFloat"] = 42] = "R32G32_SFloat";
|
|
421
|
+
/** RGB S3TC/DXT1 compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["BC1"] = 10] = "BC1";
|
|
422
|
+
/** RGBA S3TC/DXT5 compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["BC3"] = 11] = "BC3";
|
|
423
|
+
/** RGB(A) BPTC compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["BC7"] = 12] = "BC7";
|
|
424
|
+
/** RGB unsigned float HDR BPTC compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["BC6H"] = 100] = "BC6H";
|
|
425
|
+
/** RGB ETC1 compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["ETC1_RGB"] = 13] = "ETC1_RGB";
|
|
426
|
+
/** RGB ETC2 compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["ETC2_RGB"] = 14] = "ETC2_RGB";
|
|
427
|
+
/** RGBA ETC2 punchthrough-alpha compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["ETC2_RGBA5"] = 15] = "ETC2_RGBA5";
|
|
428
|
+
/** RGBA ETC2 EAC compressed format, 8 bits per pixel. */ TextureFormat[TextureFormat["ETC2_RGBA8"] = 16] = "ETC2_RGBA8";
|
|
429
|
+
/** RGB PVRTC compressed format, 2 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGB2"] = 17] = "PVRTC_RGB2";
|
|
430
|
+
/** RGBA PVRTC compressed format, 2 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGBA2"] = 18] = "PVRTC_RGBA2";
|
|
431
|
+
/** RGB PVRTC compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGB4"] = 19] = "PVRTC_RGB4";
|
|
432
|
+
/** RGBA PVRTC compressed format, 4 bits per pixel. */ TextureFormat[TextureFormat["PVRTC_RGBA4"] = 20] = "PVRTC_RGBA4";
|
|
433
|
+
/** RGB(A) ASTC compressed format, 128 bits per 4x4 block. */ TextureFormat[TextureFormat["ASTC_4x4"] = 21] = "ASTC_4x4";
|
|
434
|
+
/** RGB(A) ASTC compressed format, 128 bits per 5x5 block. */ TextureFormat[TextureFormat["ASTC_5x5"] = 22] = "ASTC_5x5";
|
|
435
|
+
/** RGB(A) ASTC compressed format, 128 bits per 6x6 block. */ TextureFormat[TextureFormat["ASTC_6x6"] = 23] = "ASTC_6x6";
|
|
436
|
+
/** RGB(A) ASTC compressed format, 128 bits per 8x8 block. */ TextureFormat[TextureFormat["ASTC_8x8"] = 24] = "ASTC_8x8";
|
|
437
|
+
/** RGB(A) ASTC compressed format, 128 bits per 10x10 block. */ TextureFormat[TextureFormat["ASTC_10x10"] = 25] = "ASTC_10x10";
|
|
438
|
+
/** RGB(A) ASTC compressed format, 128 bits per 12x12 block. */ TextureFormat[TextureFormat["ASTC_12x12"] = 26] = "ASTC_12x12";
|
|
439
|
+
/** Default depth format (32-bit float depth). */ TextureFormat[TextureFormat["Depth"] = 27] = "Depth";
|
|
440
|
+
/** 8-bit stencil format (for `RenderTarget` only). */ TextureFormat[TextureFormat["Stencil"] = 28] = "Stencil";
|
|
441
|
+
/** Default depth-stencil format (32-bit float depth + 8-bit stencil). */ TextureFormat[TextureFormat["DepthStencil"] = 29] = "DepthStencil";
|
|
442
|
+
/** 16-bit unsigned normalized depth format. */ TextureFormat[TextureFormat["Depth16"] = 30] = "Depth16";
|
|
443
|
+
/** 24-bit unsigned normalized depth format. */ TextureFormat[TextureFormat["Depth24"] = 31] = "Depth24";
|
|
444
|
+
/** 32-bit float depth format. */ TextureFormat[TextureFormat["Depth32"] = 32] = "Depth32";
|
|
445
|
+
/** 24-bit depth + 8-bit stencil format. */ TextureFormat[TextureFormat["Depth24Stencil8"] = 33] = "Depth24Stencil8";
|
|
446
|
+
/** 32-bit float depth + 8-bit stencil format. */ TextureFormat[TextureFormat["Depth32Stencil8"] = 34] = "Depth32Stencil8";
|
|
442
447
|
return TextureFormat;
|
|
443
448
|
}({});
|
|
444
449
|
|
|
@@ -1019,7 +1024,9 @@ SystemInfo._webpSupported = null;
|
|
|
1019
1024
|
key: "filterMode",
|
|
1020
1025
|
get: /**
|
|
1021
1026
|
* Sampling filter mode.
|
|
1022
|
-
* @remarks
|
|
1027
|
+
* @remarks
|
|
1028
|
+
* Integer formats (`TextureFormat.R32G32B32A32_UInt`) only accept `TextureFilterMode.Point`; other modes log a warning and are ignored.
|
|
1029
|
+
* 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.
|
|
1023
1030
|
*/ function get() {
|
|
1024
1031
|
return this._filterMode;
|
|
1025
1032
|
},
|
|
@@ -1088,12 +1095,12 @@ SystemInfo._webpSupported = null;
|
|
|
1088
1095
|
return TextureUtils.supportGenerateMipmaps(format, mipmap, isSRGBColorSpace);
|
|
1089
1096
|
};
|
|
1090
1097
|
TextureUtils.isHDRFormat = function isHDRFormat(format) {
|
|
1091
|
-
return format === TextureFormat.
|
|
1098
|
+
return format === TextureFormat.R16G16B16A16_SFloat || format === TextureFormat.R32G32B32A32_SFloat || format === TextureFormat.R11G11B10_UFloat;
|
|
1092
1099
|
};
|
|
1093
1100
|
TextureUtils.supportSRGB = function supportSRGB(format) {
|
|
1094
1101
|
switch(format){
|
|
1095
|
-
case TextureFormat.
|
|
1096
|
-
case TextureFormat.
|
|
1102
|
+
case TextureFormat.R8G8B8_UNorm:
|
|
1103
|
+
case TextureFormat.R8G8B8A8_UNorm:
|
|
1097
1104
|
case TextureFormat.BC1:
|
|
1098
1105
|
case TextureFormat.BC3:
|
|
1099
1106
|
case TextureFormat.BC7:
|
|
@@ -1113,7 +1120,7 @@ SystemInfo._webpSupported = null;
|
|
|
1113
1120
|
};
|
|
1114
1121
|
TextureUtils.supportGenerateMipmaps = function supportGenerateMipmaps(format, mipmap, isSRGBColorSpace) {
|
|
1115
1122
|
// Auto generating mipmaps for sRGB textures is only supported in [WebGL2 + RGBA]
|
|
1116
|
-
if (mipmap && isSRGBColorSpace && format !== TextureFormat.
|
|
1123
|
+
if (mipmap && isSRGBColorSpace && format !== TextureFormat.R8G8B8A8_UNorm) {
|
|
1117
1124
|
return false;
|
|
1118
1125
|
}
|
|
1119
1126
|
return true;
|
|
@@ -1130,22 +1137,27 @@ SystemInfo._webpSupported = null;
|
|
|
1130
1137
|
TextureUtils.getMipLevelByteCount = function getMipLevelByteCount(format, width, height) {
|
|
1131
1138
|
switch(format){
|
|
1132
1139
|
// Uncompressed formats
|
|
1133
|
-
case TextureFormat.
|
|
1140
|
+
case TextureFormat.R8_UNorm:
|
|
1134
1141
|
return width * height;
|
|
1135
|
-
case TextureFormat.
|
|
1142
|
+
case TextureFormat.R8G8_UNorm:
|
|
1143
|
+
case TextureFormat.R16_UNorm:
|
|
1144
|
+
case TextureFormat.R16_SFloat:
|
|
1136
1145
|
return width * height * 2;
|
|
1137
|
-
case TextureFormat.
|
|
1146
|
+
case TextureFormat.R8G8B8_UNorm:
|
|
1138
1147
|
return width * height * 3;
|
|
1139
|
-
case TextureFormat.
|
|
1148
|
+
case TextureFormat.R8G8B8A8_UNorm:
|
|
1140
1149
|
case TextureFormat.R11G11B10_UFloat:
|
|
1150
|
+
case TextureFormat.R16G16_SFloat:
|
|
1151
|
+
case TextureFormat.R32_SFloat:
|
|
1141
1152
|
return width * height * 4;
|
|
1142
|
-
case TextureFormat.
|
|
1143
|
-
case TextureFormat.
|
|
1144
|
-
case TextureFormat.
|
|
1153
|
+
case TextureFormat.R4G4B4A4_UNorm:
|
|
1154
|
+
case TextureFormat.R5G5B5A1_UNorm:
|
|
1155
|
+
case TextureFormat.R5G6B5_UNorm:
|
|
1145
1156
|
return width * height * 2;
|
|
1146
|
-
case TextureFormat.
|
|
1157
|
+
case TextureFormat.R16G16B16A16_SFloat:
|
|
1158
|
+
case TextureFormat.R32G32_SFloat:
|
|
1147
1159
|
return width * height * 8;
|
|
1148
|
-
case TextureFormat.
|
|
1160
|
+
case TextureFormat.R32G32B32A32_SFloat:
|
|
1149
1161
|
case TextureFormat.R32G32B32A32_UInt:
|
|
1150
1162
|
return width * height * 16;
|
|
1151
1163
|
// BC compressed (4x4 blocks)
|
|
@@ -1210,7 +1222,7 @@ SystemInfo._webpSupported = null;
|
|
|
1210
1222
|
*/ var TextureCube = /*#__PURE__*/ function(Texture) {
|
|
1211
1223
|
_inherits(TextureCube, Texture);
|
|
1212
1224
|
function TextureCube(engine, size, format, mipmap, isSRGBColorSpace) {
|
|
1213
|
-
if (format === void 0) format = TextureFormat.
|
|
1225
|
+
if (format === void 0) format = TextureFormat.R8G8B8A8_UNorm;
|
|
1214
1226
|
if (mipmap === void 0) mipmap = true;
|
|
1215
1227
|
if (isSRGBColorSpace === void 0) isSRGBColorSpace = true;
|
|
1216
1228
|
var _this;
|
|
@@ -1459,7 +1471,7 @@ SystemInfo._webpSupported = null;
|
|
|
1459
1471
|
*/ var Texture2D = /*#__PURE__*/ function(Texture) {
|
|
1460
1472
|
_inherits(Texture2D, Texture);
|
|
1461
1473
|
function Texture2D(engine, width, height, format, mipmap, isSRGBColorSpace, usage) {
|
|
1462
|
-
if (format === void 0) format = TextureFormat.
|
|
1474
|
+
if (format === void 0) format = TextureFormat.R8G8B8A8_UNorm;
|
|
1463
1475
|
if (mipmap === void 0) mipmap = true;
|
|
1464
1476
|
if (isSRGBColorSpace === void 0) isSRGBColorSpace = true;
|
|
1465
1477
|
if (usage === void 0) usage = TextureUsage.Static;
|
|
@@ -1536,7 +1548,7 @@ SystemInfo._webpSupported = null;
|
|
|
1536
1548
|
*/ var Texture2DArray = /*#__PURE__*/ function(Texture) {
|
|
1537
1549
|
_inherits(Texture2DArray, Texture);
|
|
1538
1550
|
function Texture2DArray(engine, width, height, length, format, mipmap, isSRGBColorSpace) {
|
|
1539
|
-
if (format === void 0) format = TextureFormat.
|
|
1551
|
+
if (format === void 0) format = TextureFormat.R8G8B8A8_UNorm;
|
|
1540
1552
|
if (mipmap === void 0) mipmap = true;
|
|
1541
1553
|
if (isSRGBColorSpace === void 0) isSRGBColorSpace = true;
|
|
1542
1554
|
var _this;
|
|
@@ -1627,7 +1639,7 @@ SystemInfo._webpSupported = null;
|
|
|
1627
1639
|
var _this;
|
|
1628
1640
|
_this = ReferResource.call(this, engine) || this, _this._charInfoMap = {}, _this._space = 1, _this._curX = 1, _this._curY = 1, _this._nextY = 1;
|
|
1629
1641
|
_this.isGCIgnored = true;
|
|
1630
|
-
var texture = new Texture2D(engine, 512, 512, TextureFormat.
|
|
1642
|
+
var texture = new Texture2D(engine, 512, 512, TextureFormat.R8_UNorm, false, false);
|
|
1631
1643
|
texture.filterMode = TextureFilterMode.Bilinear;
|
|
1632
1644
|
texture.isGCIgnored = true;
|
|
1633
1645
|
_this.texture = texture;
|
|
@@ -2932,6 +2944,7 @@ registerDefaultCloneMode(DataObject, CloneMode.Deep);
|
|
|
2932
2944
|
/**
|
|
2933
2945
|
* Optional GL capabilities.
|
|
2934
2946
|
* */ var GLCapabilityType = /*#__PURE__*/ function(GLCapabilityType) {
|
|
2947
|
+
GLCapabilityType["textureNorm16"] = "EXT_texture_norm16";
|
|
2935
2948
|
GLCapabilityType["textureFloatLinear"] = "OES_texture_float_linear";
|
|
2936
2949
|
GLCapabilityType["colorBufferFloat"] = "EXT_color_buffer_float";
|
|
2937
2950
|
GLCapabilityType["colorBufferHalfFloat"] = "EXT_color_buffer_half_float";
|
|
@@ -12357,7 +12370,7 @@ var PrefilteredDFG = /*#__PURE__*/ function() {
|
|
|
12357
12370
|
function PrefilteredDFG() {}
|
|
12358
12371
|
PrefilteredDFG.create = function create(engine) {
|
|
12359
12372
|
return new Promise(function(resolve, reject) {
|
|
12360
|
-
var texture = new Texture2D(engine, PrefilteredDFG._size, PrefilteredDFG._size, TextureFormat.
|
|
12373
|
+
var texture = new Texture2D(engine, PrefilteredDFG._size, PrefilteredDFG._size, TextureFormat.R8G8B8_UNorm, false, false);
|
|
12361
12374
|
texture.wrapModeU = texture.wrapModeV = TextureWrapMode.Clamp;
|
|
12362
12375
|
texture.isGCIgnored = true;
|
|
12363
12376
|
var image = new Image();
|
|
@@ -13419,7 +13432,7 @@ __decorate([
|
|
|
13419
13432
|
var blendShapeDataTexture = this._vertexTexture;
|
|
13420
13433
|
var blendShapeCount = this._blendShapes.length;
|
|
13421
13434
|
blendShapeDataTexture && blendShapeDataTexture.destroy();
|
|
13422
|
-
blendShapeDataTexture = new Texture2DArray(this._engine, textureWidth, textureHeight, blendShapeCount, TextureFormat.
|
|
13435
|
+
blendShapeDataTexture = new Texture2DArray(this._engine, textureWidth, textureHeight, blendShapeCount, TextureFormat.R32G32B32A32_SFloat, false, false);
|
|
13423
13436
|
blendShapeDataTexture.filterMode = TextureFilterMode.Point;
|
|
13424
13437
|
this._vertices = new Float32Array(blendShapeCount * textureWidth * textureHeight * 4);
|
|
13425
13438
|
this._vertexTexture = blendShapeDataTexture;
|
|
@@ -17818,7 +17831,7 @@ var SkinUpdateFlag = /*#__PURE__*/ function(SkinUpdateFlag) {
|
|
|
17818
17831
|
if (boneCountChange) {
|
|
17819
17832
|
var _this__jointTexture;
|
|
17820
17833
|
(_this__jointTexture = this._jointTexture) == null ? void 0 : _this__jointTexture.destroy();
|
|
17821
|
-
this._jointTexture = new Texture2D(this.engine, 4, boneCount, TextureFormat.
|
|
17834
|
+
this._jointTexture = new Texture2D(this.engine, 4, boneCount, TextureFormat.R32G32B32A32_SFloat, false, false);
|
|
17822
17835
|
this._jointTexture.filterMode = TextureFilterMode.Point;
|
|
17823
17836
|
this._jointTexture.isGCIgnored = true;
|
|
17824
17837
|
}
|
|
@@ -18181,9 +18194,9 @@ __decorate([
|
|
|
18181
18194
|
255,
|
|
18182
18195
|
255
|
|
18183
18196
|
]);
|
|
18184
|
-
this.whiteTexture2D = this._create1x1Texture(engine, 0, TextureFormat.
|
|
18185
|
-
this.whiteTextureCube = this._create1x1Texture(engine, 1, TextureFormat.
|
|
18186
|
-
this.whiteTexture2DArray = this._create1x1Texture(engine, 2, TextureFormat.
|
|
18197
|
+
this.whiteTexture2D = this._create1x1Texture(engine, 0, TextureFormat.R8G8B8A8_UNorm, whitePixel, true);
|
|
18198
|
+
this.whiteTextureCube = this._create1x1Texture(engine, 1, TextureFormat.R8G8B8A8_UNorm, whitePixel, true);
|
|
18199
|
+
this.whiteTexture2DArray = this._create1x1Texture(engine, 2, TextureFormat.R8G8B8A8_UNorm, whitePixel, true);
|
|
18187
18200
|
var whitePixel32 = new Uint32Array([
|
|
18188
18201
|
255,
|
|
18189
18202
|
255,
|
|
@@ -25756,7 +25769,7 @@ PostProcessUberPass.UBER_SHADER_NAME = "PostProcess/Uber";
|
|
|
25756
25769
|
this._inputRenderTarget = inputRenderTarget;
|
|
25757
25770
|
if (camera.antiAliasing === AntiAliasing.FXAA) {
|
|
25758
25771
|
var pixelViewport = camera.pixelViewport;
|
|
25759
|
-
this._srgbRenderTarget = PipelineUtils.recreateRenderTargetIfNeeded(this.engine, this._srgbRenderTarget, pixelViewport.width, pixelViewport.height, TextureFormat.
|
|
25772
|
+
this._srgbRenderTarget = PipelineUtils.recreateRenderTargetIfNeeded(this.engine, this._srgbRenderTarget, pixelViewport.width, pixelViewport.height, TextureFormat.R8G8B8A8_UNorm, null, false, false, false, 1, TextureWrapMode.Clamp, TextureFilterMode.Bilinear);
|
|
25760
25773
|
}
|
|
25761
25774
|
};
|
|
25762
25775
|
_proto.onRender = function onRender(context) {
|
|
@@ -29060,7 +29073,7 @@ exports.Camera = /*#__PURE__*/ function(Component) {
|
|
|
29060
29073
|
if (TextureUtils.isHDRFormat(internalColorFormat) || this.opaqueTextureEnabled) {
|
|
29061
29074
|
if (renderTarget) {
|
|
29062
29075
|
// If camera is HDR and format is same with renderTarget can reuse renderTarget if renderTarget is same HDR format
|
|
29063
|
-
// If camera is LDR and opaqueTextureEnabled is true, can reuse renderTarget if renderTarget is LDR format(Only
|
|
29076
|
+
// If camera is LDR and opaqueTextureEnabled is true, can reuse renderTarget if renderTarget is LDR format(Only R8G8B8A8_UNorm)
|
|
29064
29077
|
return internalColorFormat !== renderTarget.getColorTexture(0).format;
|
|
29065
29078
|
} else {
|
|
29066
29079
|
return true;
|
|
@@ -29076,11 +29089,11 @@ exports.Camera = /*#__PURE__*/ function(Component) {
|
|
|
29076
29089
|
if (!this.isAlphaOutputRequired && rhi.supportsRenderTargetColorFormat(TextureFormat.R11G11B10_UFloat)) {
|
|
29077
29090
|
return TextureFormat.R11G11B10_UFloat;
|
|
29078
29091
|
}
|
|
29079
|
-
if (rhi.supportsRenderTargetColorFormat(TextureFormat.
|
|
29080
|
-
return TextureFormat.
|
|
29092
|
+
if (rhi.supportsRenderTargetColorFormat(TextureFormat.R16G16B16A16_SFloat)) {
|
|
29093
|
+
return TextureFormat.R16G16B16A16_SFloat;
|
|
29081
29094
|
}
|
|
29082
29095
|
}
|
|
29083
|
-
return TextureFormat.
|
|
29096
|
+
return TextureFormat.R8G8B8A8_UNorm;
|
|
29084
29097
|
};
|
|
29085
29098
|
/**
|
|
29086
29099
|
* @internal
|
|
@@ -29097,7 +29110,7 @@ exports.Camera = /*#__PURE__*/ function(Component) {
|
|
|
29097
29110
|
* @internal
|
|
29098
29111
|
*/ _proto._getTargetColorTextureFormat = function _getTargetColorTextureFormat() {
|
|
29099
29112
|
var renderTarget = this._renderTarget;
|
|
29100
|
-
return renderTarget ? renderTarget.getColorTexture(0).format : TextureFormat.
|
|
29113
|
+
return renderTarget ? renderTarget.getColorTexture(0).format : TextureFormat.R8G8B8A8_UNorm;
|
|
29101
29114
|
};
|
|
29102
29115
|
/**
|
|
29103
29116
|
* @internal
|
|
@@ -29540,7 +29553,7 @@ exports.Camera = __decorate([
|
|
|
29540
29553
|
var engine = this.engine;
|
|
29541
29554
|
var _camera_pixelViewport = camera.pixelViewport, width = _camera_pixelViewport.width, height = _camera_pixelViewport.height;
|
|
29542
29555
|
this._depthRenderTarget = depthRenderTarget;
|
|
29543
|
-
var format = TextureFormat.
|
|
29556
|
+
var format = TextureFormat.R8G8B8_UNorm;
|
|
29544
29557
|
this._saoRenderTarget = PipelineUtils.recreateRenderTargetIfNeeded(engine, this._saoRenderTarget, width, height, format, null, false, false, false, 1, TextureWrapMode.Clamp, TextureFilterMode.Bilinear);
|
|
29545
29558
|
this._blurRenderTarget = PipelineUtils.recreateRenderTargetIfNeeded(engine, this._blurRenderTarget, width, height, format, null, false, false, false, 1, TextureWrapMode.Clamp, TextureFilterMode.Bilinear);
|
|
29546
29559
|
};
|
|
@@ -30551,7 +30564,7 @@ CascadedShadowCasterPass._tempMatrix0 = new engineMath.Matrix();
|
|
|
30551
30564
|
var _camera_renderTarget;
|
|
30552
30565
|
var colorTexture = (_camera_renderTarget = camera.renderTarget) == null ? void 0 : _camera_renderTarget.getColorTexture(0);
|
|
30553
30566
|
var _colorTexture_format, _colorTexture_isSRGBColorSpace;
|
|
30554
|
-
this._copyBackgroundTexture = pool.allocateTexture(viewport.width, viewport.height, (_colorTexture_format = colorTexture == null ? void 0 : colorTexture.format) != null ? _colorTexture_format : TextureFormat.
|
|
30567
|
+
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);
|
|
30555
30568
|
}
|
|
30556
30569
|
}
|
|
30557
30570
|
// Scalable ambient obscurance pass
|