three-stdlib 2.22.0 → 2.22.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/_polyfill/CompressedArrayTexture.cjs.js +1 -0
  2. package/_polyfill/CompressedArrayTexture.js +13 -0
  3. package/_polyfill/Data3DTexture.cjs.js +1 -0
  4. package/_polyfill/Data3DTexture.js +23 -0
  5. package/index.cjs.js +1 -1
  6. package/interactive/HTMLMesh.cjs.js +1 -1
  7. package/interactive/HTMLMesh.js +3 -2
  8. package/lights/LightProbeGenerator.cjs.js +1 -1
  9. package/lights/LightProbeGenerator.js +19 -20
  10. package/loaders/3MFLoader.cjs.js +1 -1
  11. package/loaders/3MFLoader.js +3 -2
  12. package/loaders/EXRLoader.cjs.js +1 -1
  13. package/loaders/EXRLoader.js +4 -4
  14. package/loaders/FBXLoader.cjs.js +1 -1
  15. package/loaders/FBXLoader.js +5 -5
  16. package/loaders/GLTFLoader.cjs.js +1 -1
  17. package/loaders/GLTFLoader.js +7 -6
  18. package/loaders/HDRCubeTextureLoader.cjs.js +1 -1
  19. package/loaders/HDRCubeTextureLoader.js +3 -8
  20. package/loaders/KTX2Loader.cjs.js +1 -1
  21. package/loaders/KTX2Loader.js +12 -16
  22. package/loaders/LUT3dlLoader.cjs.js +1 -1
  23. package/loaders/LUT3dlLoader.js +2 -1
  24. package/loaders/LUTCubeLoader.cjs.js +1 -1
  25. package/loaders/LUTCubeLoader.js +2 -1
  26. package/loaders/NodeMaterialLoader.cjs.js +1 -1
  27. package/loaders/RGBELoader.cjs.js +1 -1
  28. package/loaders/RGBELoader.js +3 -2
  29. package/loaders/VOXLoader.cjs.js +1 -1
  30. package/loaders/VOXLoader.js +2 -1
  31. package/misc/MD2Character.cjs.js +1 -1
  32. package/misc/MD2Character.js +2 -2
  33. package/misc/MD2CharacterComplex.cjs.js +1 -1
  34. package/misc/MD2CharacterComplex.js +2 -2
  35. package/nodes/Nodes.cjs.js +1 -1
  36. package/nodes/core/NodeBuilder.cjs.js +1 -1
  37. package/nodes/core/NodeBuilder.js +4 -4
  38. package/nodes/display/ColorSpaceNode.cjs.js +1 -1
  39. package/nodes/display/ColorSpaceNode.js +2 -3
  40. package/nodes/loaders/NodeLoader.cjs.js +1 -1
  41. package/nodes/loaders/NodeObjectLoader.cjs.js +1 -1
  42. package/objects/Reflector.cjs.js +1 -1
  43. package/objects/Reflector.js +1 -1
  44. package/objects/ReflectorForSSRPass.cjs.js +1 -1
  45. package/objects/ReflectorForSSRPass.js +1 -1
  46. package/objects/Refractor.cjs.js +1 -1
  47. package/objects/Refractor.js +1 -1
  48. package/objects/Water2.cjs.js +1 -1
  49. package/objects/Water2.js +2 -2
  50. package/package.json +1 -1
  51. package/postprocessing/SSRPass.cjs.js +1 -1
  52. package/postprocessing/SSRPass.js +8 -1
  53. package/renderers/webgpu/WebGPUTextures.cjs.js +1 -1
  54. package/renderers/webgpu/WebGPUTextures.js +6 -6
  55. /package/{Nodes-9aa16d74.js → Nodes-8d3adda1.js} +0 -0
  56. /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