@babylonjs/loaders 5.21.0 → 5.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. package/OBJ/mtlFileLoader.js +25 -27
  2. package/OBJ/mtlFileLoader.js.map +1 -1
  3. package/OBJ/objFileLoader.js +112 -124
  4. package/OBJ/objFileLoader.js.map +1 -1
  5. package/OBJ/solidParser.js +118 -125
  6. package/OBJ/solidParser.js.map +1 -1
  7. package/STL/stlFileLoader.js +81 -69
  8. package/STL/stlFileLoader.js.map +1 -1
  9. package/glTF/1.0/glTFBinaryExtension.js +26 -30
  10. package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
  11. package/glTF/1.0/glTFLoader.js +409 -432
  12. package/glTF/1.0/glTFLoader.js.map +1 -1
  13. package/glTF/1.0/glTFLoaderUtils.js +33 -37
  14. package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
  15. package/glTF/1.0/glTFMaterialsCommonExtension.js +27 -31
  16. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
  17. package/glTF/2.0/Extensions/EXT_lights_image_based.js +48 -59
  18. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
  19. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +24 -29
  20. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
  21. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +13 -16
  22. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
  23. package/glTF/2.0/Extensions/EXT_texture_webp.js +13 -16
  24. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
  25. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +22 -26
  26. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
  27. package/glTF/2.0/Extensions/KHR_animation_pointer.js +63 -76
  28. package/glTF/2.0/Extensions/KHR_animation_pointer.js.map +1 -1
  29. package/glTF/2.0/Extensions/KHR_animation_pointer.map.js +90 -120
  30. package/glTF/2.0/Extensions/KHR_animation_pointer.map.js.map +1 -1
  31. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +25 -28
  32. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
  33. package/glTF/2.0/Extensions/KHR_lights_punctual.js +27 -30
  34. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  35. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +25 -28
  36. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  37. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +15 -18
  38. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
  39. package/glTF/2.0/Extensions/KHR_materials_ior.js +21 -24
  40. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  41. package/glTF/2.0/Extensions/KHR_materials_iridescence.js +27 -31
  42. package/glTF/2.0/Extensions/KHR_materials_iridescence.js.map +1 -1
  43. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +24 -27
  44. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
  45. package/glTF/2.0/Extensions/KHR_materials_sheen.js +23 -26
  46. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  47. package/glTF/2.0/Extensions/KHR_materials_specular.js +23 -26
  48. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  49. package/glTF/2.0/Extensions/KHR_materials_translucency.js +20 -23
  50. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
  51. package/glTF/2.0/Extensions/KHR_materials_transmission.js +82 -86
  52. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  53. package/glTF/2.0/Extensions/KHR_materials_unlit.js +19 -22
  54. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  55. package/glTF/2.0/Extensions/KHR_materials_variants.js +79 -97
  56. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
  57. package/glTF/2.0/Extensions/KHR_materials_volume.js +20 -23
  58. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
  59. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +6 -8
  60. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
  61. package/glTF/2.0/Extensions/KHR_texture_basisu.js +13 -16
  62. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
  63. package/glTF/2.0/Extensions/KHR_texture_transform.js +12 -15
  64. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  65. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +12 -15
  66. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
  67. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +77 -95
  68. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
  69. package/glTF/2.0/Extensions/MSFT_lod.js +114 -139
  70. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
  71. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +12 -15
  72. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  73. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +12 -15
  74. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  75. package/glTF/2.0/glTFLoader.js +739 -823
  76. package/glTF/2.0/glTFLoader.js.map +1 -1
  77. package/glTF/glTFFileLoader.js +337 -404
  78. package/glTF/glTFFileLoader.js.map +1 -1
  79. package/glTF/glTFValidation.js +32 -39
  80. package/glTF/glTFValidation.js.map +1 -1
  81. package/legacy/legacy-glTF.js +3 -3
  82. package/legacy/legacy-glTF.js.map +1 -1
  83. package/legacy/legacy-glTF1.js +2 -2
  84. package/legacy/legacy-glTF1.js.map +1 -1
  85. package/legacy/legacy-glTF2.js +12 -12
  86. package/legacy/legacy-glTF2.js.map +1 -1
  87. package/legacy/legacy-objFileLoader.js +2 -2
  88. package/legacy/legacy-objFileLoader.js.map +1 -1
  89. package/legacy/legacy-stlFileLoader.js +2 -2
  90. package/legacy/legacy-stlFileLoader.js.map +1 -1
  91. package/package.json +5 -8
@@ -1 +1 @@
1
- {"version":3,"file":"MSFT_minecraftMesh.js","sourceRoot":"","sources":["../../../../../../../lts/loaders/generated/glTF/2.0/Extensions/MSFT_minecraftMesh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,qDAAuC;AAI7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,IAAM,IAAI,GAAG,oBAAoB,CAAC;AAElC,cAAc;AACd;IAMI,4BAAY,MAAkB;QALd,SAAI,GAAG,IAAI,CAAC;QAMxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEM,oCAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,wDAA2B,GAAlC,UAAmC,OAAe,EAAE,QAAmB,EAAE,eAAyB;QAAlG,iBAsBC;QArBG,OAAO,UAAU,CAAC,cAAc,CAAU,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,UAAC,YAAY,EAAE,KAAK;YACxF,IAAI,KAAK,EAAE;gBACP,IAAI,CAAC,CAAC,eAAe,YAAY,WAAW,CAAC,EAAE;oBAC3C,MAAM,IAAI,KAAK,CAAC,UAAG,YAAY,kCAA+B,CAAC,CAAC;iBACnE;gBAED,IAAM,OAAO,GAAG,KAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;gBAE7F,IAAI,eAAe,CAAC,iBAAiB,EAAE,EAAE;oBACrC,eAAe,CAAC,eAAe,GAAG,IAAI,CAAC;oBACvC,eAAe,CAAC,mBAAmB,GAAG,IAAI,CAAC;iBAC9C;gBAED,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC,eAAe,CAAC;gBAClE,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC;gBAExC,OAAO,OAAO,CAAC;aAClB;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;IACL,yBAAC;AAAD,CAAC,AAtCD,IAsCC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAA9B,CAA8B,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\r\n\r\nimport type { IMaterial } from \"../glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\n\r\nconst NAME = \"MSFT_minecraftMesh\";\r\n\r\n/** @hidden */\r\nexport class MSFT_minecraftMesh implements IGLTFLoaderExtension {\r\n public readonly name = NAME;\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = this._loader.isExtensionUsed(NAME);\r\n }\r\n\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtraAsync<boolean>(context, material, this.name, (extraContext, extra) => {\r\n if (extra) {\r\n if (!(babylonMaterial instanceof PBRMaterial)) {\r\n throw new Error(`${extraContext}: Material type not supported`);\r\n }\r\n\r\n const promise = this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial);\r\n\r\n if (babylonMaterial.needAlphaBlending()) {\r\n babylonMaterial.forceDepthWrite = true;\r\n babylonMaterial.separateCullingPass = true;\r\n }\r\n\r\n babylonMaterial.backFaceCulling = babylonMaterial.forceDepthWrite;\r\n babylonMaterial.twoSidedLighting = true;\r\n\r\n return promise;\r\n }\r\n\r\n return null;\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new MSFT_minecraftMesh(loader));\r\n"]}
1
+ {"version":3,"file":"MSFT_minecraftMesh.js","sourceRoot":"","sources":["../../../../../../../lts/loaders/generated/glTF/2.0/Extensions/MSFT_minecraftMesh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,qDAAuC;AAI7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAElC,cAAc;AACd,MAAM,OAAO,kBAAkB;IAM3B,YAAY,MAAkB;QALd,SAAI,GAAG,IAAI,CAAC;QAMxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEM,OAAO;QACT,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,2BAA2B,CAAC,OAAe,EAAE,QAAmB,EAAE,eAAyB;QAC9F,OAAO,UAAU,CAAC,cAAc,CAAU,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;YAC5F,IAAI,KAAK,EAAE;gBACP,IAAI,CAAC,CAAC,eAAe,YAAY,WAAW,CAAC,EAAE;oBAC3C,MAAM,IAAI,KAAK,CAAC,GAAG,YAAY,+BAA+B,CAAC,CAAC;iBACnE;gBAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;gBAE7F,IAAI,eAAe,CAAC,iBAAiB,EAAE,EAAE;oBACrC,eAAe,CAAC,eAAe,GAAG,IAAI,CAAC;oBACvC,eAAe,CAAC,mBAAmB,GAAG,IAAI,CAAC;iBAC9C;gBAED,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC,eAAe,CAAC;gBAClE,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC;gBAExC,OAAO,OAAO,CAAC;aAClB;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\r\n\r\nimport type { IMaterial } from \"../glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\n\r\nconst NAME = \"MSFT_minecraftMesh\";\r\n\r\n/** @hidden */\r\nexport class MSFT_minecraftMesh implements IGLTFLoaderExtension {\r\n public readonly name = NAME;\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = this._loader.isExtensionUsed(NAME);\r\n }\r\n\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtraAsync<boolean>(context, material, this.name, (extraContext, extra) => {\r\n if (extra) {\r\n if (!(babylonMaterial instanceof PBRMaterial)) {\r\n throw new Error(`${extraContext}: Material type not supported`);\r\n }\r\n\r\n const promise = this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial);\r\n\r\n if (babylonMaterial.needAlphaBlending()) {\r\n babylonMaterial.forceDepthWrite = true;\r\n babylonMaterial.separateCullingPass = true;\r\n }\r\n\r\n babylonMaterial.backFaceCulling = babylonMaterial.forceDepthWrite;\r\n babylonMaterial.twoSidedLighting = true;\r\n\r\n return promise;\r\n }\r\n\r\n return null;\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new MSFT_minecraftMesh(loader));\r\n"]}
@@ -1,24 +1,23 @@
1
1
  import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial.js";
2
2
  import { GLTFLoader } from "../glTFLoader.js";
3
- var NAME = "MSFT_sRGBFactors";
3
+ const NAME = "MSFT_sRGBFactors";
4
4
  /** @hidden */
5
- var MSFT_sRGBFactors = /** @class */ (function () {
6
- function MSFT_sRGBFactors(loader) {
5
+ export class MSFT_sRGBFactors {
6
+ constructor(loader) {
7
7
  this.name = NAME;
8
8
  this._loader = loader;
9
9
  this.enabled = this._loader.isExtensionUsed(NAME);
10
10
  }
11
- MSFT_sRGBFactors.prototype.dispose = function () {
11
+ dispose() {
12
12
  this._loader = null;
13
- };
14
- MSFT_sRGBFactors.prototype.loadMaterialPropertiesAsync = function (context, material, babylonMaterial) {
15
- var _this = this;
16
- return GLTFLoader.LoadExtraAsync(context, material, this.name, function (extraContext, extra) {
13
+ }
14
+ loadMaterialPropertiesAsync(context, material, babylonMaterial) {
15
+ return GLTFLoader.LoadExtraAsync(context, material, this.name, (extraContext, extra) => {
17
16
  if (extra) {
18
17
  if (!(babylonMaterial instanceof PBRMaterial)) {
19
- throw new Error("".concat(extraContext, ": Material type not supported"));
18
+ throw new Error(`${extraContext}: Material type not supported`);
20
19
  }
21
- var promise = _this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial);
20
+ const promise = this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial);
22
21
  if (!babylonMaterial.albedoTexture) {
23
22
  babylonMaterial.albedoColor.toLinearSpaceToRef(babylonMaterial.albedoColor);
24
23
  }
@@ -29,9 +28,7 @@ var MSFT_sRGBFactors = /** @class */ (function () {
29
28
  }
30
29
  return null;
31
30
  });
32
- };
33
- return MSFT_sRGBFactors;
34
- }());
35
- export { MSFT_sRGBFactors };
36
- GLTFLoader.RegisterExtension(NAME, function (loader) { return new MSFT_sRGBFactors(loader); });
31
+ }
32
+ }
33
+ GLTFLoader.RegisterExtension(NAME, (loader) => new MSFT_sRGBFactors(loader));
37
34
  //# sourceMappingURL=MSFT_sRGBFactors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MSFT_sRGBFactors.js","sourceRoot":"","sources":["../../../../../../../lts/loaders/generated/glTF/2.0/Extensions/MSFT_sRGBFactors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,qDAAuC;AAI7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,IAAM,IAAI,GAAG,kBAAkB,CAAC;AAEhC,cAAc;AACd;IAMI,0BAAY,MAAkB;QALd,SAAI,GAAG,IAAI,CAAC;QAMxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEM,kCAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,sDAA2B,GAAlC,UAAmC,OAAe,EAAE,QAAmB,EAAE,eAAyB;QAAlG,iBAsBC;QArBG,OAAO,UAAU,CAAC,cAAc,CAAU,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,UAAC,YAAY,EAAE,KAAK;YACxF,IAAI,KAAK,EAAE;gBACP,IAAI,CAAC,CAAC,eAAe,YAAY,WAAW,CAAC,EAAE;oBAC3C,MAAM,IAAI,KAAK,CAAC,UAAG,YAAY,kCAA+B,CAAC,CAAC;iBACnE;gBAED,IAAM,OAAO,GAAG,KAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;gBAE7F,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE;oBAChC,eAAe,CAAC,WAAW,CAAC,kBAAkB,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;iBAC/E;gBAED,IAAI,CAAC,eAAe,CAAC,mBAAmB,EAAE;oBACtC,eAAe,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;iBAC3F;gBAED,OAAO,OAAO,CAAC;aAClB;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;IACL,uBAAC;AAAD,CAAC,AAtCD,IAsCC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAA5B,CAA4B,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\r\n\r\nimport type { IMaterial } from \"../glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\n\r\nconst NAME = \"MSFT_sRGBFactors\";\r\n\r\n/** @hidden */\r\nexport class MSFT_sRGBFactors implements IGLTFLoaderExtension {\r\n public readonly name = NAME;\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = this._loader.isExtensionUsed(NAME);\r\n }\r\n\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtraAsync<boolean>(context, material, this.name, (extraContext, extra) => {\r\n if (extra) {\r\n if (!(babylonMaterial instanceof PBRMaterial)) {\r\n throw new Error(`${extraContext}: Material type not supported`);\r\n }\r\n\r\n const promise = this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial);\r\n\r\n if (!babylonMaterial.albedoTexture) {\r\n babylonMaterial.albedoColor.toLinearSpaceToRef(babylonMaterial.albedoColor);\r\n }\r\n\r\n if (!babylonMaterial.reflectivityTexture) {\r\n babylonMaterial.reflectivityColor.toLinearSpaceToRef(babylonMaterial.reflectivityColor);\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n return null;\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new MSFT_sRGBFactors(loader));\r\n"]}
1
+ {"version":3,"file":"MSFT_sRGBFactors.js","sourceRoot":"","sources":["../../../../../../../lts/loaders/generated/glTF/2.0/Extensions/MSFT_sRGBFactors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,qDAAuC;AAI7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAEhC,cAAc;AACd,MAAM,OAAO,gBAAgB;IAMzB,YAAY,MAAkB;QALd,SAAI,GAAG,IAAI,CAAC;QAMxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEM,OAAO;QACT,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,2BAA2B,CAAC,OAAe,EAAE,QAAmB,EAAE,eAAyB;QAC9F,OAAO,UAAU,CAAC,cAAc,CAAU,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;YAC5F,IAAI,KAAK,EAAE;gBACP,IAAI,CAAC,CAAC,eAAe,YAAY,WAAW,CAAC,EAAE;oBAC3C,MAAM,IAAI,KAAK,CAAC,GAAG,YAAY,+BAA+B,CAAC,CAAC;iBACnE;gBAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;gBAE7F,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE;oBAChC,eAAe,CAAC,WAAW,CAAC,kBAAkB,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;iBAC/E;gBAED,IAAI,CAAC,eAAe,CAAC,mBAAmB,EAAE;oBACtC,eAAe,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;iBAC3F;gBAED,OAAO,OAAO,CAAC;aAClB;YAED,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\r\n\r\nimport type { IMaterial } from \"../glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\n\r\nconst NAME = \"MSFT_sRGBFactors\";\r\n\r\n/** @hidden */\r\nexport class MSFT_sRGBFactors implements IGLTFLoaderExtension {\r\n public readonly name = NAME;\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = this._loader.isExtensionUsed(NAME);\r\n }\r\n\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtraAsync<boolean>(context, material, this.name, (extraContext, extra) => {\r\n if (extra) {\r\n if (!(babylonMaterial instanceof PBRMaterial)) {\r\n throw new Error(`${extraContext}: Material type not supported`);\r\n }\r\n\r\n const promise = this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial);\r\n\r\n if (!babylonMaterial.albedoTexture) {\r\n babylonMaterial.albedoColor.toLinearSpaceToRef(babylonMaterial.albedoColor);\r\n }\r\n\r\n if (!babylonMaterial.reflectivityTexture) {\r\n babylonMaterial.reflectivityColor.toLinearSpaceToRef(babylonMaterial.reflectivityColor);\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n return null;\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new MSFT_sRGBFactors(loader));\r\n"]}