three-stdlib 2.21.12 → 2.22.1
Sign up to get free protection for your applications and to get access to all the features.
- package/index.cjs.js +1 -1
- package/interactive/HTMLMesh.cjs.js +1 -1
- package/interactive/HTMLMesh.js +3 -2
- package/lights/LightProbeGenerator.cjs.js +1 -1
- package/lights/LightProbeGenerator.js +19 -20
- package/loaders/3MFLoader.cjs.js +1 -1
- package/loaders/3MFLoader.js +3 -2
- package/loaders/EXRLoader.cjs.js +1 -1
- package/loaders/EXRLoader.js +4 -4
- package/loaders/FBXLoader.cjs.js +1 -1
- package/loaders/FBXLoader.js +5 -5
- package/loaders/GLTFLoader.cjs.js +1 -1
- package/loaders/GLTFLoader.js +7 -6
- package/loaders/HDRCubeTextureLoader.cjs.js +1 -1
- package/loaders/HDRCubeTextureLoader.js +3 -8
- package/loaders/KTX2Loader.cjs.js +1 -1
- package/loaders/KTX2Loader.js +65 -21
- package/loaders/NodeMaterialLoader.cjs.js +1 -1
- package/loaders/RGBELoader.cjs.js +1 -1
- package/loaders/RGBELoader.js +3 -2
- package/misc/MD2Character.cjs.js +1 -1
- package/misc/MD2Character.js +2 -2
- package/misc/MD2CharacterComplex.cjs.js +1 -1
- package/misc/MD2CharacterComplex.js +2 -2
- package/nodes/Nodes.cjs.js +1 -1
- package/nodes/core/NodeBuilder.cjs.js +1 -1
- package/nodes/core/NodeBuilder.js +4 -4
- package/nodes/display/ColorSpaceNode.cjs.js +1 -1
- package/nodes/display/ColorSpaceNode.js +2 -3
- package/nodes/loaders/NodeLoader.cjs.js +1 -1
- package/nodes/loaders/NodeObjectLoader.cjs.js +1 -1
- package/objects/Reflector.cjs.js +1 -1
- package/objects/Reflector.js +1 -1
- package/objects/ReflectorForSSRPass.cjs.js +1 -1
- package/objects/ReflectorForSSRPass.js +1 -1
- package/objects/Refractor.cjs.js +1 -1
- package/objects/Refractor.js +1 -1
- package/objects/Water2.cjs.js +1 -1
- package/objects/Water2.js +2 -2
- package/package.json +1 -1
- package/postprocessing/SSRPass.cjs.js +1 -1
- package/postprocessing/SSRPass.js +4 -1
- package/renderers/webgpu/WebGPUTextures.cjs.js +1 -1
- package/renderers/webgpu/WebGPUTextures.js +6 -6
- /package/{Nodes-9aa16d74.js → Nodes-8d3adda1.js} +0 -0
- /package/{Nodes-4f766d71.js → Nodes-b3c0e6fc.js} +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { GPUTextureFormat, GPUAddressMode, GPUFilterMode, GPUTextureDimension } from './constants.js';
|
2
|
-
import { Texture, NearestFilter, CubeTexture, RGFormat, FloatType, HalfFloatType, UnsignedByteType, RedFormat, RGBAFormat, RGBA_S3TC_DXT5_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT1_Format, LinearFilter, RepeatWrapping, MirroredRepeatWrapping, NearestMipmapNearestFilter, NearestMipmapLinearFilter
|
2
|
+
import { Texture, NearestFilter, CubeTexture, RGFormat, FloatType, HalfFloatType, UnsignedByteType, RedFormat, RGBAFormat, RGBA_S3TC_DXT5_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT1_Format, LinearFilter, RepeatWrapping, MirroredRepeatWrapping, NearestMipmapNearestFilter, NearestMipmapLinearFilter } from 'three';
|
3
3
|
import WebGPUTextureUtils from './WebGPUTextureUtils.js';
|
4
4
|
|
5
5
|
class WebGPUTextures {
|
@@ -456,26 +456,26 @@ class WebGPUTextures {
|
|
456
456
|
_getFormat(texture) {
|
457
457
|
const format = texture.format;
|
458
458
|
const type = texture.type;
|
459
|
-
const
|
459
|
+
const isSRGB = 'colorSpace' in texture ? texture.colorSpace === 'srgb' : texture.encoding === 3001;
|
460
460
|
let formatGPU;
|
461
461
|
|
462
462
|
switch (format) {
|
463
463
|
case RGBA_S3TC_DXT1_Format:
|
464
|
-
formatGPU =
|
464
|
+
formatGPU = isSRGB ? GPUTextureFormat.BC1RGBAUnormSRGB : GPUTextureFormat.BC1RGBAUnorm;
|
465
465
|
break;
|
466
466
|
|
467
467
|
case RGBA_S3TC_DXT3_Format:
|
468
|
-
formatGPU =
|
468
|
+
formatGPU = isSRGB ? GPUTextureFormat.BC2RGBAUnormSRGB : GPUTextureFormat.BC2RGBAUnorm;
|
469
469
|
break;
|
470
470
|
|
471
471
|
case RGBA_S3TC_DXT5_Format:
|
472
|
-
formatGPU =
|
472
|
+
formatGPU = isSRGB ? GPUTextureFormat.BC3RGBAUnormSRGB : GPUTextureFormat.BC3RGBAUnorm;
|
473
473
|
break;
|
474
474
|
|
475
475
|
case RGBAFormat:
|
476
476
|
switch (type) {
|
477
477
|
case UnsignedByteType:
|
478
|
-
formatGPU =
|
478
|
+
formatGPU = isSRGB ? GPUTextureFormat.RGBA8UnormSRGB : GPUTextureFormat.RGBA8Unorm;
|
479
479
|
break;
|
480
480
|
|
481
481
|
case HalfFloatType:
|
File without changes
|
File without changes
|