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.
Files changed (46) hide show
  1. package/index.cjs.js +1 -1
  2. package/interactive/HTMLMesh.cjs.js +1 -1
  3. package/interactive/HTMLMesh.js +3 -2
  4. package/lights/LightProbeGenerator.cjs.js +1 -1
  5. package/lights/LightProbeGenerator.js +19 -20
  6. package/loaders/3MFLoader.cjs.js +1 -1
  7. package/loaders/3MFLoader.js +3 -2
  8. package/loaders/EXRLoader.cjs.js +1 -1
  9. package/loaders/EXRLoader.js +4 -4
  10. package/loaders/FBXLoader.cjs.js +1 -1
  11. package/loaders/FBXLoader.js +5 -5
  12. package/loaders/GLTFLoader.cjs.js +1 -1
  13. package/loaders/GLTFLoader.js +7 -6
  14. package/loaders/HDRCubeTextureLoader.cjs.js +1 -1
  15. package/loaders/HDRCubeTextureLoader.js +3 -8
  16. package/loaders/KTX2Loader.cjs.js +1 -1
  17. package/loaders/KTX2Loader.js +65 -21
  18. package/loaders/NodeMaterialLoader.cjs.js +1 -1
  19. package/loaders/RGBELoader.cjs.js +1 -1
  20. package/loaders/RGBELoader.js +3 -2
  21. package/misc/MD2Character.cjs.js +1 -1
  22. package/misc/MD2Character.js +2 -2
  23. package/misc/MD2CharacterComplex.cjs.js +1 -1
  24. package/misc/MD2CharacterComplex.js +2 -2
  25. package/nodes/Nodes.cjs.js +1 -1
  26. package/nodes/core/NodeBuilder.cjs.js +1 -1
  27. package/nodes/core/NodeBuilder.js +4 -4
  28. package/nodes/display/ColorSpaceNode.cjs.js +1 -1
  29. package/nodes/display/ColorSpaceNode.js +2 -3
  30. package/nodes/loaders/NodeLoader.cjs.js +1 -1
  31. package/nodes/loaders/NodeObjectLoader.cjs.js +1 -1
  32. package/objects/Reflector.cjs.js +1 -1
  33. package/objects/Reflector.js +1 -1
  34. package/objects/ReflectorForSSRPass.cjs.js +1 -1
  35. package/objects/ReflectorForSSRPass.js +1 -1
  36. package/objects/Refractor.cjs.js +1 -1
  37. package/objects/Refractor.js +1 -1
  38. package/objects/Water2.cjs.js +1 -1
  39. package/objects/Water2.js +2 -2
  40. package/package.json +1 -1
  41. package/postprocessing/SSRPass.cjs.js +1 -1
  42. package/postprocessing/SSRPass.js +4 -1
  43. package/renderers/webgpu/WebGPUTextures.cjs.js +1 -1
  44. package/renderers/webgpu/WebGPUTextures.js +6 -6
  45. /package/{Nodes-9aa16d74.js → Nodes-8d3adda1.js} +0 -0
  46. /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, sRGBEncoding } from 'three';
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 encoding = texture.encoding;
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 = encoding === sRGBEncoding ? GPUTextureFormat.BC1RGBAUnormSRGB : GPUTextureFormat.BC1RGBAUnorm;
464
+ formatGPU = isSRGB ? GPUTextureFormat.BC1RGBAUnormSRGB : GPUTextureFormat.BC1RGBAUnorm;
465
465
  break;
466
466
 
467
467
  case RGBA_S3TC_DXT3_Format:
468
- formatGPU = encoding === sRGBEncoding ? GPUTextureFormat.BC2RGBAUnormSRGB : GPUTextureFormat.BC2RGBAUnorm;
468
+ formatGPU = isSRGB ? GPUTextureFormat.BC2RGBAUnormSRGB : GPUTextureFormat.BC2RGBAUnorm;
469
469
  break;
470
470
 
471
471
  case RGBA_S3TC_DXT5_Format:
472
- formatGPU = encoding === sRGBEncoding ? GPUTextureFormat.BC3RGBAUnormSRGB : GPUTextureFormat.BC3RGBAUnorm;
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 = encoding === sRGBEncoding ? GPUTextureFormat.RGBA8UnormSRGB : GPUTextureFormat.RGBA8Unorm;
478
+ formatGPU = isSRGB ? GPUTextureFormat.RGBA8UnormSRGB : GPUTextureFormat.RGBA8Unorm;
479
479
  break;
480
480
 
481
481
  case HalfFloatType:
File without changes
File without changes