@onerjs/loaders 8.26.3 → 8.26.4

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.
Files changed (69) hide show
  1. package/OBJ/solidParser.d.ts +7 -8
  2. package/OBJ/solidParser.js +53 -95
  3. package/OBJ/solidParser.js.map +1 -1
  4. package/glTF/2.0/Extensions/{KHR_materials_diffuse_roughness.d.ts → EXT_materials_diffuse_roughness.d.ts} +5 -5
  5. package/glTF/2.0/Extensions/{KHR_materials_diffuse_roughness.js → EXT_materials_diffuse_roughness.js} +18 -8
  6. package/glTF/2.0/Extensions/EXT_materials_diffuse_roughness.js.map +1 -0
  7. package/glTF/2.0/Extensions/KHR_materials_anisotropy.d.ts +1 -1
  8. package/glTF/2.0/Extensions/KHR_materials_anisotropy.js +10 -15
  9. package/glTF/2.0/Extensions/KHR_materials_anisotropy.js.map +1 -1
  10. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +28 -44
  11. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  12. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.js +31 -6
  13. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.js.map +1 -1
  14. package/glTF/2.0/Extensions/KHR_materials_dispersion.js +7 -3
  15. package/glTF/2.0/Extensions/KHR_materials_dispersion.js.map +1 -1
  16. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +9 -5
  17. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
  18. package/glTF/2.0/Extensions/KHR_materials_ior.js +10 -3
  19. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  20. package/glTF/2.0/Extensions/KHR_materials_iridescence.js +11 -13
  21. package/glTF/2.0/Extensions/KHR_materials_iridescence.js.map +1 -1
  22. package/glTF/2.0/Extensions/KHR_materials_sheen.js +22 -11
  23. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  24. package/glTF/2.0/Extensions/KHR_materials_specular.js +17 -9
  25. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  26. package/glTF/2.0/Extensions/KHR_materials_transmission.js +32 -21
  27. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  28. package/glTF/2.0/Extensions/KHR_materials_unlit.js +13 -7
  29. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  30. package/glTF/2.0/Extensions/KHR_materials_volume.js +22 -13
  31. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
  32. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +2 -1
  33. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  34. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +8 -5
  35. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  36. package/glTF/2.0/Extensions/dynamic.js +3 -3
  37. package/glTF/2.0/Extensions/dynamic.js.map +1 -1
  38. package/glTF/2.0/Extensions/index.d.ts +1 -4
  39. package/glTF/2.0/Extensions/index.js +1 -4
  40. package/glTF/2.0/Extensions/index.js.map +1 -1
  41. package/glTF/2.0/glTFLoader.d.ts +0 -17
  42. package/glTF/2.0/glTFLoader.js +50 -104
  43. package/glTF/2.0/glTFLoader.js.map +1 -1
  44. package/glTF/2.0/index.d.ts +0 -2
  45. package/glTF/2.0/index.js +0 -2
  46. package/glTF/2.0/index.js.map +1 -1
  47. package/glTF/glTFFileLoader.d.ts +0 -5
  48. package/glTF/glTFFileLoader.js +0 -6
  49. package/glTF/glTFFileLoader.js.map +1 -1
  50. package/package.json +3 -3
  51. package/glTF/2.0/Extensions/KHR_materials_clearcoat_anisotropy.d.ts +0 -42
  52. package/glTF/2.0/Extensions/KHR_materials_clearcoat_anisotropy.js +0 -66
  53. package/glTF/2.0/Extensions/KHR_materials_clearcoat_anisotropy.js.map +0 -1
  54. package/glTF/2.0/Extensions/KHR_materials_clearcoat_color.d.ts +0 -42
  55. package/glTF/2.0/Extensions/KHR_materials_clearcoat_color.js +0 -62
  56. package/glTF/2.0/Extensions/KHR_materials_clearcoat_color.js.map +0 -1
  57. package/glTF/2.0/Extensions/KHR_materials_clearcoat_darkening.d.ts +0 -43
  58. package/glTF/2.0/Extensions/KHR_materials_clearcoat_darkening.js +0 -62
  59. package/glTF/2.0/Extensions/KHR_materials_clearcoat_darkening.js.map +0 -1
  60. package/glTF/2.0/Extensions/KHR_materials_diffuse_roughness.js.map +0 -1
  61. package/glTF/2.0/materialLoadingAdapter.d.ts +0 -314
  62. package/glTF/2.0/materialLoadingAdapter.js +0 -2
  63. package/glTF/2.0/materialLoadingAdapter.js.map +0 -1
  64. package/glTF/2.0/openPbrMaterialLoadingAdapter.d.ts +0 -594
  65. package/glTF/2.0/openPbrMaterialLoadingAdapter.js +0 -902
  66. package/glTF/2.0/openPbrMaterialLoadingAdapter.js.map +0 -1
  67. package/glTF/2.0/pbrMaterialLoadingAdapter.d.ts +0 -612
  68. package/glTF/2.0/pbrMaterialLoadingAdapter.js +0 -973
  69. package/glTF/2.0/pbrMaterialLoadingAdapter.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"KHR_materials_clearcoat_anisotropy.js","sourceRoot":"","sources":["../../../../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_clearcoat_anisotropy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEhG,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAalD;;GAEG;AACH,gEAAgE;AAChE,MAAM,OAAO,kCAAkC;IAkB3C;;OAEG;IACH,YAAY,MAAkB;QApB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAO5B;;WAEG;QACI,UAAK,GAAG,GAAG,CAAC;QAQf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,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AAE,CAAC;QAC/C,IAAI,CAAC,UAAU,CAAC,gCAAgC,IAAI,CAAC,UAAU,CAAC,gCAAgC,CAAC,wBAAwB,EAAE,CAAC;YACxH,OAAO,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC;QAED,0BAA0B;QAC1B,IAAI,UAAU,CAAC,0BAA0B,EAAE,CAAC;YACvC,UAAU,CAAC,0BAA2C,CAAC,YAAY,GAAG,IAAI,CAAC;YAC5E,QAAQ,CAAC,IAAI,CACT,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,6BAA6B,EAAE,UAAU,CAAC,0BAA0B,EAAE,CAAC,OAAO,EAAE,EAAE;gBAC1H,OAAO,CAAC,IAAI,GAAG,GAAG,eAAe,CAAC,IAAI,yBAAyB,CAAC;gBAChE,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC;YACjD,CAAC,CAAC,CACL,CAAC;QACN,CAAC;QAED,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;CACJ;AAED,uBAAuB,CAAC,IAAI,CAAC,CAAC;AAC9B,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,kCAAkC,CAAC,MAAM,CAAC,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { IMaterial, ITextureInfo } from \"../glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\nimport type { IKHRMaterialsClearcoatAnisotropy } from \"babylonjs-gltf2interface\";\r\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\r\n\r\nconst NAME = \"KHR_materials_clearcoat_anisotropy\";\r\n\r\ndeclare module \"../../glTFFileLoader\" {\r\n // eslint-disable-next-line jsdoc/require-jsdoc, @typescript-eslint/naming-convention\r\n export interface GLTFLoaderExtensionOptions {\r\n /**\r\n * Defines options for the KHR_materials_clearcoat_anisotropy extension.\r\n */\r\n // NOTE: Don't use NAME here as it will break the UMD type declarations.\r\n [\"KHR_materials_clearcoat_anisotropy\"]: {};\r\n }\r\n}\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat_anisotropy)\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class KHR_materials_clearcoat_anisotropy implements IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n public readonly name = NAME;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n public enabled: boolean;\r\n\r\n /**\r\n * Defines a number that determines the order the extensions are applied.\r\n */\r\n public order = 195;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /**\r\n * @internal\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 /** @internal */\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line no-restricted-syntax\r\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtensionAsync<IKHRMaterialsClearcoatAnisotropy>(context, material, this.name, async (extensionContext, extension) => {\r\n const promises = new Array<Promise<any>>();\r\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\r\n promises.push(this._loadAnisotropyPropertiesAsync(extensionContext, extension, babylonMaterial));\r\n await Promise.all(promises);\r\n });\r\n }\r\n\r\n private async _loadAnisotropyPropertiesAsync(context: string, properties: IKHRMaterialsClearcoatAnisotropy, babylonMaterial: Material): Promise<void> {\r\n const adapter = this._loader._getOrCreateMaterialAdapter(babylonMaterial);\r\n const promises = new Array<Promise<any>>();\r\n\r\n // Set non-texture properties immediately\r\n const clearcoatAnisotropyWeight = properties.clearcoatAnisotropyStrength ?? 0;\r\n const clearcoatAnisotropyAngle = properties.clearcoatAnisotropyRotation ?? 0;\r\n\r\n adapter.coatRoughnessAnisotropy = clearcoatAnisotropyWeight;\r\n adapter.geometryCoatTangentAngle = clearcoatAnisotropyAngle;\r\n\r\n // Check if this is glTF-style anisotropy\r\n const extensions = properties.extensions ?? {};\r\n if (!extensions.EXT_materials_anisotropy_openpbr || !extensions.EXT_materials_anisotropy_openpbr.openPbrAnisotropyEnabled) {\r\n adapter.configureGltfStyleAnisotropy(true);\r\n }\r\n\r\n // Load texture if present\r\n if (properties.clearcoatAnisotropyTexture) {\r\n (properties.clearcoatAnisotropyTexture as ITextureInfo).nonColorData = true;\r\n promises.push(\r\n this._loader.loadTextureInfoAsync(`${context}/clearcoatAnisotropyTexture`, properties.clearcoatAnisotropyTexture, (texture) => {\r\n texture.name = `${babylonMaterial.name} (Clearcoat Anisotropy)`;\r\n adapter.geometryCoatTangentTexture = texture;\r\n })\r\n );\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n}\r\n\r\nunregisterGLTFExtension(NAME);\r\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_clearcoat_anisotropy(loader));\r\n"]}
@@ -1,42 +0,0 @@
1
- import type { Nullable } from "@onerjs/core/types.js";
2
- import type { Material } from "@onerjs/core/Materials/material.js";
3
- import type { IMaterial } from "../glTFLoaderInterfaces.js";
4
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
5
- import { GLTFLoader } from "../glTFLoader.js";
6
- declare module "../../glTFFileLoader.js" {
7
- interface GLTFLoaderExtensionOptions {
8
- /**
9
- * Defines options for the KHR_materials_clearcoat_color extension.
10
- */
11
- ["KHR_materials_clearcoat_color"]: {};
12
- }
13
- }
14
- /**
15
- * !!! Experimental Extension Subject to Changes !!!
16
- */
17
- export declare class KHR_materials_clearcoat_color implements IGLTFLoaderExtension {
18
- /**
19
- * The name of this extension.
20
- */
21
- readonly name = "KHR_materials_clearcoat_color";
22
- /**
23
- * Defines whether this extension is enabled.
24
- */
25
- enabled: boolean;
26
- /**
27
- * Defines a number that determines the order the extensions are applied.
28
- */
29
- order: number;
30
- private _loader;
31
- /**
32
- * @internal
33
- */
34
- constructor(loader: GLTFLoader);
35
- /** @internal */
36
- dispose(): void;
37
- /**
38
- * @internal
39
- */
40
- loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
41
- private _loadColorPropertiesAsync;
42
- }
@@ -1,62 +0,0 @@
1
- import { Color3 } from "@onerjs/core/Maths/math.color.js";
2
- import { GLTFLoader } from "../glTFLoader.js";
3
- import { registerGLTFExtension, unregisterGLTFExtension } from "../glTFLoaderExtensionRegistry.js";
4
- const NAME = "KHR_materials_clearcoat_color";
5
- /**
6
- * !!! Experimental Extension Subject to Changes !!!
7
- */
8
- // eslint-disable-next-line @typescript-eslint/naming-convention
9
- export class KHR_materials_clearcoat_color {
10
- /**
11
- * @internal
12
- */
13
- constructor(loader) {
14
- /**
15
- * The name of this extension.
16
- */
17
- this.name = NAME;
18
- /**
19
- * Defines a number that determines the order the extensions are applied.
20
- */
21
- this.order = 191;
22
- this._loader = loader;
23
- this.enabled = this._loader.isExtensionUsed(NAME);
24
- }
25
- /** @internal */
26
- dispose() {
27
- this._loader = null;
28
- }
29
- /**
30
- * @internal
31
- */
32
- // eslint-disable-next-line no-restricted-syntax
33
- loadMaterialPropertiesAsync(context, material, babylonMaterial) {
34
- return GLTFLoader.LoadExtensionAsync(context, material, this.name, async (extensionContext, extension) => {
35
- const promises = new Array();
36
- promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
37
- promises.push(this._loadColorPropertiesAsync(extensionContext, material, babylonMaterial, extension));
38
- return await Promise.all(promises).then(() => { });
39
- });
40
- }
41
- // eslint-disable-next-line no-restricted-syntax, @typescript-eslint/promise-function-async
42
- _loadColorPropertiesAsync(context, material, babylonMaterial, extension) {
43
- const adapter = this._loader._getOrCreateMaterialAdapter(babylonMaterial);
44
- const colorFactor = Color3.White();
45
- if (extension.clearcoatColorFactor !== undefined) {
46
- colorFactor.fromArray(extension.clearcoatColorFactor);
47
- }
48
- adapter.coatColor = colorFactor;
49
- let texturePromise = Promise.resolve();
50
- if (extension.clearcoatColorTexture) {
51
- extension.clearcoatColorTexture.nonColorData = true;
52
- texturePromise = this._loader.loadTextureInfoAsync(`${context}/clearcoatColorTexture`, extension.clearcoatColorTexture).then((texture) => {
53
- texture.name = `${babylonMaterial.name} (Clearcoat Color)`;
54
- adapter.coatColorTexture = texture;
55
- });
56
- }
57
- return texturePromise.then(() => { });
58
- }
59
- }
60
- unregisterGLTFExtension(NAME);
61
- registerGLTFExtension(NAME, true, (loader) => new KHR_materials_clearcoat_color(loader));
62
- //# sourceMappingURL=KHR_materials_clearcoat_color.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KHR_materials_clearcoat_color.js","sourceRoot":"","sources":["../../../../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_clearcoat_color.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,yCAA8B;AAG/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEhG,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAa7C;;GAEG;AACH,gEAAgE;AAChE,MAAM,OAAO,6BAA6B;IAkBtC;;OAEG;IACH,YAAY,MAAkB;QApB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAO5B;;WAEG;QACI,UAAK,GAAG,GAAG,CAAC;QAQf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,gBAAgB;IACT,OAAO;QACT,IAAI,CAAC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AAC;YACtE,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,wBAAwB,EAAE,SAAS,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAAC,OAAoB,EAAE,EAAE;gBAClJ,OAAO,CAAC,IAAI,GAAG,GAAG,eAAe,CAAC,IAAI,oBAAoB,CAAC;gBAC3D,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC;YACvC,CAAC,CAAC,CAAC;QACP,CAAC;QAED,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACzC,CAAC;CACJ;AAED,uBAAuB,CAAC,IAAI,CAAC,CAAC;AAC9B,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,6BAA6B,CAAC,MAAM,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable github/no-then */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { IMaterial, ITextureInfo } from \"../glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\nimport type { IKHRMaterialsClearcoatColor } from \"babylonjs-gltf2interface\";\r\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\r\n\r\nconst NAME = \"KHR_materials_clearcoat_color\";\r\n\r\ndeclare module \"../../glTFFileLoader\" {\r\n // eslint-disable-next-line jsdoc/require-jsdoc, @typescript-eslint/naming-convention\r\n export interface GLTFLoaderExtensionOptions {\r\n /**\r\n * Defines options for the KHR_materials_clearcoat_color extension.\r\n */\r\n // NOTE: Don't use NAME here as it will break the UMD type declarations.\r\n [\"KHR_materials_clearcoat_color\"]: {};\r\n }\r\n}\r\n\r\n/**\r\n * !!! Experimental Extension Subject to Changes !!!\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class KHR_materials_clearcoat_color implements IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n public readonly name = NAME;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n public enabled: boolean;\r\n\r\n /**\r\n * Defines a number that determines the order the extensions are applied.\r\n */\r\n public order = 191;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /**\r\n * @internal\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 /** @internal */\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line no-restricted-syntax\r\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtensionAsync<IKHRMaterialsClearcoatColor>(context, material, this.name, async (extensionContext, extension) => {\r\n const promises = new Array<Promise<any>>();\r\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\r\n promises.push(this._loadColorPropertiesAsync(extensionContext, material, babylonMaterial, extension));\r\n return await Promise.all(promises).then(() => {});\r\n });\r\n }\r\n\r\n // eslint-disable-next-line no-restricted-syntax, @typescript-eslint/promise-function-async\r\n private _loadColorPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material, extension: IKHRMaterialsClearcoatColor): Promise<void> {\r\n const adapter = this._loader._getOrCreateMaterialAdapter(babylonMaterial);\r\n\r\n const colorFactor = Color3.White();\r\n\r\n if (extension.clearcoatColorFactor !== undefined) {\r\n colorFactor.fromArray(extension.clearcoatColorFactor);\r\n }\r\n\r\n adapter.coatColor = colorFactor;\r\n\r\n let texturePromise = Promise.resolve();\r\n\r\n if (extension.clearcoatColorTexture) {\r\n (extension.clearcoatColorTexture as ITextureInfo).nonColorData = true;\r\n texturePromise = this._loader.loadTextureInfoAsync(`${context}/clearcoatColorTexture`, extension.clearcoatColorTexture).then((texture: BaseTexture) => {\r\n texture.name = `${babylonMaterial.name} (Clearcoat Color)`;\r\n adapter.coatColorTexture = texture;\r\n });\r\n }\r\n\r\n return texturePromise.then(() => {});\r\n }\r\n}\r\n\r\nunregisterGLTFExtension(NAME);\r\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_clearcoat_color(loader));\r\n"]}
@@ -1,43 +0,0 @@
1
- import type { Nullable } from "@onerjs/core/types.js";
2
- import type { Material } from "@onerjs/core/Materials/material.js";
3
- import type { IMaterial } from "../glTFLoaderInterfaces.js";
4
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
5
- import { GLTFLoader } from "../glTFLoader.js";
6
- declare module "../../glTFFileLoader.js" {
7
- interface GLTFLoaderExtensionOptions {
8
- /**
9
- * Defines options for the KHR_materials_clearcoat_darkening extension.
10
- */
11
- ["KHR_materials_clearcoat_darkening"]: {};
12
- }
13
- }
14
- /**
15
- * [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/2518)
16
- * !!! Experimental Extension Subject to Changes !!!
17
- */
18
- export declare class KHR_materials_clearcoat_darkening implements IGLTFLoaderExtension {
19
- /**
20
- * The name of this extension.
21
- */
22
- readonly name = "KHR_materials_clearcoat_darkening";
23
- /**
24
- * Defines whether this extension is enabled.
25
- */
26
- enabled: boolean;
27
- /**
28
- * Defines a number that determines the order the extensions are applied.
29
- */
30
- order: number;
31
- private _loader;
32
- /**
33
- * @internal
34
- */
35
- constructor(loader: GLTFLoader);
36
- /** @internal */
37
- dispose(): void;
38
- /**
39
- * @internal
40
- */
41
- loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
42
- private _loadDarkeningPropertiesAsync;
43
- }
@@ -1,62 +0,0 @@
1
- import { GLTFLoader } from "../glTFLoader.js";
2
- import { registerGLTFExtension, unregisterGLTFExtension } from "../glTFLoaderExtensionRegistry.js";
3
- const NAME = "KHR_materials_clearcoat_darkening";
4
- /**
5
- * [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/2518)
6
- * !!! Experimental Extension Subject to Changes !!!
7
- */
8
- // eslint-disable-next-line @typescript-eslint/naming-convention
9
- export class KHR_materials_clearcoat_darkening {
10
- /**
11
- * @internal
12
- */
13
- constructor(loader) {
14
- /**
15
- * The name of this extension.
16
- */
17
- this.name = NAME;
18
- /**
19
- * Defines a number that determines the order the extensions are applied.
20
- */
21
- this.order = 191;
22
- this._loader = loader;
23
- this.enabled = this._loader.isExtensionUsed(NAME);
24
- }
25
- /** @internal */
26
- dispose() {
27
- this._loader = null;
28
- }
29
- /**
30
- * @internal
31
- */
32
- // eslint-disable-next-line no-restricted-syntax
33
- loadMaterialPropertiesAsync(context, material, babylonMaterial) {
34
- return GLTFLoader.LoadExtensionAsync(context, material, this.name, async (extensionContext, extension) => {
35
- const promises = new Array();
36
- promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
37
- promises.push(this._loadDarkeningPropertiesAsync(extensionContext, material, babylonMaterial, extension));
38
- return await Promise.all(promises).then(() => { });
39
- });
40
- }
41
- // eslint-disable-next-line no-restricted-syntax, @typescript-eslint/promise-function-async
42
- _loadDarkeningPropertiesAsync(context, material, babylonMaterial, extension) {
43
- const adapter = this._loader._getOrCreateMaterialAdapter(babylonMaterial);
44
- let darkeningFactor = 1.0;
45
- if (extension.clearcoatDarkeningFactor !== undefined) {
46
- darkeningFactor = extension.clearcoatDarkeningFactor;
47
- }
48
- adapter.coatDarkening = darkeningFactor;
49
- let texturePromise = Promise.resolve();
50
- if (extension.clearcoatDarkeningTexture) {
51
- extension.clearcoatDarkeningTexture.nonColorData = true;
52
- texturePromise = this._loader.loadTextureInfoAsync(`${context}/clearcoatDarkeningTexture`, extension.clearcoatDarkeningTexture).then((texture) => {
53
- texture.name = `${babylonMaterial.name} (Clearcoat Darkening)`;
54
- adapter.coatDarkeningTexture = texture;
55
- });
56
- }
57
- return texturePromise.then(() => { });
58
- }
59
- }
60
- unregisterGLTFExtension(NAME);
61
- registerGLTFExtension(NAME, true, (loader) => new KHR_materials_clearcoat_darkening(loader));
62
- //# sourceMappingURL=KHR_materials_clearcoat_darkening.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KHR_materials_clearcoat_darkening.js","sourceRoot":"","sources":["../../../../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_clearcoat_darkening.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEhG,MAAM,IAAI,GAAG,mCAAmC,CAAC;AAajD;;;GAGG;AACH,gEAAgE;AAChE,MAAM,OAAO,iCAAiC;IAkB1C;;OAEG;IACH,YAAY,MAAkB;QApB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAO5B;;WAEG;QACI,UAAK,GAAG,GAAG,CAAC;QAQf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,gBAAgB;IACT,OAAO;QACT,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,gDAAgD;IACzC,2BAA2B,CAAC,OAAe,EAAE,QAAmB,EAAE,eAAyB;QAC9F,OAAO,UAAU,CAAC,kBAAkB,CAAkC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE;YACtI,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAgB,CAAC;YAC3C,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC,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B,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,iCAAiC,CAAC,MAAM,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable github/no-then */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { IMaterial, ITextureInfo } from \"../glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\nimport type { IKHRMaterialsClearcoatDarkening } from \"babylonjs-gltf2interface\";\r\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\r\n\r\nconst NAME = \"KHR_materials_clearcoat_darkening\";\r\n\r\ndeclare module \"../../glTFFileLoader\" {\r\n // eslint-disable-next-line jsdoc/require-jsdoc, @typescript-eslint/naming-convention\r\n export interface GLTFLoaderExtensionOptions {\r\n /**\r\n * Defines options for the KHR_materials_clearcoat_darkening extension.\r\n */\r\n // NOTE: Don't use NAME here as it will break the UMD type declarations.\r\n [\"KHR_materials_clearcoat_darkening\"]: {};\r\n }\r\n}\r\n\r\n/**\r\n * [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/2518)\r\n * !!! Experimental Extension Subject to Changes !!!\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class KHR_materials_clearcoat_darkening implements IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n public readonly name = NAME;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n public enabled: boolean;\r\n\r\n /**\r\n * Defines a number that determines the order the extensions are applied.\r\n */\r\n public order = 191;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /**\r\n * @internal\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 /** @internal */\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line no-restricted-syntax\r\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtensionAsync<IKHRMaterialsClearcoatDarkening>(context, material, this.name, async (extensionContext, extension) => {\r\n const promises = new Array<Promise<any>>();\r\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\r\n promises.push(this._loadDarkeningPropertiesAsync(extensionContext, material, babylonMaterial, extension));\r\n return await Promise.all(promises).then(() => {});\r\n });\r\n }\r\n\r\n // eslint-disable-next-line no-restricted-syntax, @typescript-eslint/promise-function-async\r\n private _loadDarkeningPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material, extension: IKHRMaterialsClearcoatDarkening): Promise<void> {\r\n const adapter = this._loader._getOrCreateMaterialAdapter(babylonMaterial);\r\n\r\n let darkeningFactor = 1.0;\r\n\r\n if (extension.clearcoatDarkeningFactor !== undefined) {\r\n darkeningFactor = extension.clearcoatDarkeningFactor;\r\n }\r\n\r\n adapter.coatDarkening = darkeningFactor;\r\n\r\n let texturePromise = Promise.resolve();\r\n\r\n if (extension.clearcoatDarkeningTexture) {\r\n (extension.clearcoatDarkeningTexture as ITextureInfo).nonColorData = true;\r\n texturePromise = this._loader.loadTextureInfoAsync(`${context}/clearcoatDarkeningTexture`, extension.clearcoatDarkeningTexture).then((texture: BaseTexture) => {\r\n texture.name = `${babylonMaterial.name} (Clearcoat Darkening)`;\r\n adapter.coatDarkeningTexture = texture;\r\n });\r\n }\r\n\r\n return texturePromise.then(() => {});\r\n }\r\n}\r\n\r\nunregisterGLTFExtension(NAME);\r\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_clearcoat_darkening(loader));\r\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"KHR_materials_diffuse_roughness.js","sourceRoot":"","sources":["../../../../../../dev/loaders/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,CAAC,CAAC;IACP,CAAC;IAED,2FAA2F;IACnF,oCAAoC,CAAC,OAAe,EAAE,UAAyC,EAAE,eAAyB;QAC9H,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,eAAe,CAAC,CAAC;QAC1E,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAgB,CAAC;QAE3C,OAAO,CAAC,oBAAoB,GAAG,UAAU,CAAC,sBAAsB,IAAI,CAAC,CAAC;QAEtE,IAAI,UAAU,CAAC,uBAAuB,EAAE,CAAC;YACrC,QAAQ,CAAC,IAAI,CACT,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,0BAA0B,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC,OAAO,EAAE,EAAE;gBACpH,OAAO,CAAC,IAAI,GAAG,GAAG,eAAe,CAAC,IAAI,sBAAsB,CAAC;gBAC7D,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC;YAClD,CAAC,CAAC,CACL,CAAC;QACN,CAAC;QAED,0CAA0C;QAC1C,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAChD,CAAC;CACJ;AAED,uBAAuB,CAAC,IAAI,CAAC,CAAC;AAC9B,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,+BAA+B,CAAC,MAAM,CAAC,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Material } from \"core/Materials/material\";\r\n\r\nimport type { IMaterial } from \"../glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\nimport type { IKHRMaterialsDiffuseRoughness } from \"babylonjs-gltf2interface\";\r\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\r\n\r\nconst NAME = \"KHR_materials_diffuse_roughness\";\r\n\r\ndeclare module \"../../glTFFileLoader\" {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n export interface GLTFLoaderExtensionOptions {\r\n /**\r\n * Defines options for the KHR_materials_diffuse_roughness extension.\r\n */\r\n // NOTE: Don't use NAME here as it will break the UMD type declarations.\r\n [\"KHR_materials_diffuse_roughness\"]: {};\r\n }\r\n}\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/blob/fdee35425ae560ea378092e38977216d63a094ec/extensions/2.0/Khronos/KHR_materials_diffuse_roughness/README.md)\r\n * @experimental\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class KHR_materials_diffuse_roughness implements IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n public readonly name = NAME;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n public enabled: boolean;\r\n\r\n /**\r\n * Defines a number that determines the order the extensions are applied.\r\n */\r\n public order = 190;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /**\r\n * @internal\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 /** @internal */\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtensionAsync<IKHRMaterialsDiffuseRoughness>(context, material, this.name, async (extensionContext, extension) => {\r\n const promises = new Array<Promise<any>>();\r\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\r\n promises.push(this._loadDiffuseRoughnessPropertiesAsync(extensionContext, extension, babylonMaterial));\r\n // eslint-disable-next-line github/no-then\r\n return await Promise.all(promises).then(() => {});\r\n });\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n private _loadDiffuseRoughnessPropertiesAsync(context: string, properties: IKHRMaterialsDiffuseRoughness, babylonMaterial: Material): Promise<void> {\r\n const adapter = this._loader._getOrCreateMaterialAdapter(babylonMaterial);\r\n const promises = new Array<Promise<any>>();\r\n\r\n adapter.baseDiffuseRoughness = properties.diffuseRoughnessFactor ?? 0;\r\n\r\n if (properties.diffuseRoughnessTexture) {\r\n promises.push(\r\n this._loader.loadTextureInfoAsync(`${context}/diffuseRoughnessTexture`, properties.diffuseRoughnessTexture, (texture) => {\r\n texture.name = `${babylonMaterial.name} (Diffuse Roughness)`;\r\n adapter.baseDiffuseRoughnessTexture = texture;\r\n })\r\n );\r\n }\r\n\r\n // eslint-disable-next-line github/no-then\r\n return Promise.all(promises).then(() => {});\r\n }\r\n}\r\n\r\nunregisterGLTFExtension(NAME);\r\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_diffuse_roughness(loader));\r\n"]}
@@ -1,314 +0,0 @@
1
- import type { Material } from "@onerjs/core/Materials/material.js";
2
- import type { BaseTexture } from "@onerjs/core/Materials/Textures/baseTexture.js";
3
- import type { Nullable } from "@onerjs/core/types.js";
4
- import type { Color3 } from "@onerjs/core/Maths/math.color.js";
5
- /**
6
- * Interface for material loading adapters that provides a unified OpenPBR-like interface
7
- * for both OpenPBR and PBR materials, eliminating conditional branches in extensions.
8
- */
9
- export interface IMaterialLoadingAdapter {
10
- /**
11
- * Gets the underlying material
12
- */
13
- readonly material: Material;
14
- /**
15
- * Whether the material should be treated as unlit
16
- */
17
- isUnlit: boolean;
18
- /**
19
- * Sets/gets the back face culling
20
- */
21
- backFaceCulling: boolean;
22
- /**
23
- * Sets/gets the two sided lighting
24
- */
25
- twoSidedLighting: boolean;
26
- /**
27
- * Sets/gets the alpha cutoff value (used for alpha test mode)
28
- */
29
- alphaCutOff: number;
30
- /**
31
- * Sets/gets whether to use alpha from albedo/base color texture
32
- */
33
- useAlphaFromBaseColorTexture: boolean;
34
- /**
35
- * Sets/Gets whether the transparency is treated as alpha coverage
36
- */
37
- transparencyAsAlphaCoverage: boolean;
38
- /**
39
- * Sets/gets the base color (OpenPBR: baseColor, PBR: albedoColor)
40
- */
41
- baseColor: Color3;
42
- /**
43
- * Sets/gets the base color texture (OpenPBR: baseColorTexture, PBR: albedoTexture)
44
- */
45
- baseColorTexture: Nullable<BaseTexture>;
46
- /**
47
- * Sets/gets the base diffuse roughness (OpenPBR: baseDiffuseRoughness, PBR: baseDiffuseRoughness)
48
- */
49
- baseDiffuseRoughness: number;
50
- /**
51
- * Sets/gets the base diffuse roughness texture (OpenPBR: baseDiffuseRoughnessTexture, PBR: baseDiffuseRoughnessTexture)
52
- */
53
- baseDiffuseRoughnessTexture: Nullable<BaseTexture>;
54
- /**
55
- * Sets/gets the base metalness (OpenPBR: baseMetalness, PBR: metallic)
56
- */
57
- baseMetalness: number;
58
- /**
59
- * Sets/gets the base metalness texture (OpenPBR: baseMetalnessTexture, PBR: metallicTexture)
60
- */
61
- baseMetalnessTexture: Nullable<BaseTexture>;
62
- /**
63
- * Sets whether to use roughness from metallic texture green channel
64
- */
65
- useRoughnessFromMetallicTextureGreen: boolean;
66
- /**
67
- * Sets whether to use metallic from metallic texture blue channel
68
- */
69
- useMetallicFromMetallicTextureBlue: boolean;
70
- /**
71
- * Configures specular properties and enables OpenPBR BRDF model for edge color support
72
- * @param enableEdgeColor - Whether to enable edge color support
73
- */
74
- enableSpecularEdgeColor(enableEdgeColor?: boolean): void;
75
- /**
76
- * Sets/gets the specular weight (OpenPBR: specularWeight, PBR: metallicF0Factor)
77
- */
78
- specularWeight: number;
79
- /**
80
- * Sets/gets the specular weight texture (OpenPBR: specularWeightTexture, PBR: metallicReflectanceTexture)
81
- */
82
- specularWeightTexture: Nullable<BaseTexture>;
83
- /**
84
- * Sets/gets the specular color (OpenPBR: specularColor, PBR: reflectance)
85
- */
86
- specularColor: Color3;
87
- /**
88
- * Sets/gets the specular color texture (OpenPBR: specularColorTexture, PBR: reflectanceTexture)
89
- */
90
- specularColorTexture: Nullable<BaseTexture>;
91
- /**
92
- * Sets/gets the specular roughness (OpenPBR: specularRoughness, PBR: roughness)
93
- */
94
- specularRoughness: number;
95
- /**
96
- * Sets/gets the specular roughness texture
97
- */
98
- specularRoughnessTexture: Nullable<BaseTexture>;
99
- /**
100
- * Sets/gets the specular IOR (OpenPBR: specularIor, PBR: indexOfRefraction)
101
- */
102
- specularIor: number;
103
- /**
104
- * Sets/gets the emissive color (OpenPBR: emissionColor, PBR: emissiveColor)
105
- */
106
- emissionColor: Color3;
107
- /**
108
- * Sets/gets the emissive luminance (OpenPBR: emissionLuminance, PBR: emissiveIntensity)
109
- */
110
- emissionLuminance: number;
111
- /**
112
- * Sets/gets the emissive texture
113
- */
114
- emissionColorTexture: Nullable<BaseTexture>;
115
- /**
116
- * Sets/gets the ambient occlusion texture (OpenPBR: ambientOcclusionTexture, PBR: ambientTexture)
117
- */
118
- ambientOcclusionTexture: Nullable<BaseTexture>;
119
- /**
120
- * Sets/gets the ambient occlusion texture strength/level
121
- */
122
- ambientOcclusionTextureStrength: number;
123
- /**
124
- * Configures clear coat for PBR material
125
- */
126
- configureCoat(): void;
127
- /**
128
- * Sets/gets the coat weight (OpenPBR: coatWeight, PBR: clearCoat.intensity)
129
- */
130
- coatWeight: number;
131
- /**
132
- * Sets/gets the coat weight texture (OpenPBR: coatWeightTexture, PBR: clearCoat.texture)
133
- */
134
- coatWeightTexture: Nullable<BaseTexture>;
135
- /**
136
- * Sets the coat color (OpenPBR: coatColor, no PBR equivalent)
137
- */
138
- coatColor: Color3;
139
- /**
140
- * Sets the coat color texture (OpenPBR: coatColorTexture, no PBR equivalent)
141
- */
142
- coatColorTexture: Nullable<BaseTexture>;
143
- /**
144
- * Sets/gets the coat roughness (OpenPBR: coatRoughness, PBR: clearCoat.roughness)
145
- */
146
- coatRoughness: number;
147
- /**
148
- * Sets/gets the coat roughness texture (OpenPBR: coatRoughnessTexture, PBR: clearCoat.textureRoughness)
149
- */
150
- coatRoughnessTexture: Nullable<BaseTexture>;
151
- /**
152
- * Sets the coat darkening (OpenPBR: coatDarkening, no PBR equivalent)
153
- */
154
- coatDarkening: number;
155
- /**
156
- * Sets the coat darkening texture (OpenPBR: coatDarkeningTexture, no PBR equivalent)
157
- */
158
- coatDarkeningTexture: Nullable<BaseTexture>;
159
- /**
160
- * Sets/gets the coat roughness anisotropy (OpenPBR: coatRoughnessAnisotropy, PBR: clearCoat.anisotropy.intensity)
161
- */
162
- coatRoughnessAnisotropy: number;
163
- /**
164
- * Sets the coat tangent angle for anisotropy (OpenPBR: geometryCoatTangentAngle, PBR: clearCoat.anisotropy.angle)
165
- */
166
- geometryCoatTangentAngle: number;
167
- /**
168
- * Sets the coat tangent texture for anisotropy (OpenPBR: geometryCoatTangentTexture, PBR: clearCoat.anisotropy.texture)
169
- */
170
- geometryCoatTangentTexture: Nullable<BaseTexture>;
171
- /**
172
- * Sets the transmission weight (OpenPBR: transmissionWeight, PBR: subSurface.refractionIntensity)
173
- */
174
- transmissionWeight: number;
175
- /**
176
- * Sets the transmission weight texture (OpenPBR: transmissionWeightTexture, PBR: subSurface.refractionIntensityTexture)
177
- */
178
- transmissionWeightTexture: Nullable<BaseTexture>;
179
- /**
180
- * Sets the attenuation distance (OpenPBR: attenuationDistance, PBR: subSurface.volumeIndexOfRefraction)
181
- */
182
- transmissionDepth: number;
183
- /**
184
- * Sets the attenuation color (OpenPBR: attenuationColor, PBR: subSurface.tintColor)
185
- */
186
- transmissionColor: Color3;
187
- /**
188
- * Sets the dispersion Abbe number
189
- */
190
- transmissionDispersionAbbeNumber: number;
191
- /**
192
- * Configures transmission for thin-surface transmission (KHR_materials_transmission)
193
- */
194
- configureTransmission(): void;
195
- /**
196
- * Sets the thickness texture (OpenPBR: thicknessTexture, PBR: subSurface.thicknessTexture)
197
- */
198
- volumeThicknessTexture: Nullable<BaseTexture>;
199
- /**
200
- * Sets the thickness factor (OpenPBR: thickness, PBR: subSurface.maximumThickness)
201
- */
202
- volumeThickness: number;
203
- /**
204
- * Configures subsurface properties for PBR material
205
- */
206
- configureSubsurface(): void;
207
- /**
208
- * Sets/gets the subsurface weight
209
- */
210
- subsurfaceWeight: number;
211
- /**
212
- * Sets/gets the subsurface weight texture
213
- */
214
- subsurfaceWeightTexture: Nullable<BaseTexture>;
215
- /**
216
- * Sets/gets the subsurface color (OpenPBR: subsurfaceColor, PBR: subSurface.tintColor)
217
- */
218
- subsurfaceColor: Color3;
219
- /**
220
- * Sets/gets the subsurface color texture (OpenPBR: subsurfaceColorTexture, PBR: subSurface.tintColorTexture)
221
- */
222
- subsurfaceColorTexture: Nullable<BaseTexture>;
223
- /**
224
- * Configures initial settings for fuzz for material.
225
- */
226
- configureFuzz(): void;
227
- /**
228
- * Sets the fuzz weight (OpenPBR: fuzzWeight, PBR: fuzz.intensity)
229
- */
230
- fuzzWeight: number;
231
- /**
232
- * Sets the fuzz color (OpenPBR: fuzzColor, PBR: fuzz.color)
233
- */
234
- fuzzColor: Color3;
235
- /**
236
- * Sets the fuzz color texture (OpenPBR: fuzzColorTexture, PBR: fuzz.texture)
237
- */
238
- fuzzColorTexture: Nullable<BaseTexture>;
239
- /**
240
- * Sets the fuzz roughness (OpenPBR: fuzzRoughness, PBR: fuzz.roughness)
241
- */
242
- fuzzRoughness: number;
243
- /**
244
- * Sets the fuzz roughness texture (OpenPBR: fuzzRoughnessTexture, PBR: fuzz.textureRoughness)
245
- */
246
- fuzzRoughnessTexture: Nullable<BaseTexture>;
247
- /**
248
- * Sets/gets the specular roughness anisotropy (OpenPBR: specularRoughnessAnisotropy, PBR: anisotropy.intensity)
249
- */
250
- specularRoughnessAnisotropy: number;
251
- /**
252
- * Sets the anisotropy rotation (OpenPBR: anisotropyRotation, PBR: anisotropy.angle)
253
- */
254
- geometryTangentAngle: number;
255
- /**
256
- * Sets/gets the anisotropy texture (OpenPBR: geometryTangentTexture, PBR: anisotropy.texture)
257
- */
258
- geometryTangentTexture: Nullable<BaseTexture>;
259
- /**
260
- * Configures glTF-style anisotropy for OpenPBR materials
261
- * @param useGltfStyle - Whether to use glTF-style anisotropy (default: true)
262
- */
263
- configureGltfStyleAnisotropy(useGltfStyle?: boolean): void;
264
- /**
265
- * Sets the iridescence weight (OpenPBR: iridescenceWeight, PBR: iridescence.intensity)
266
- */
267
- iridescenceWeight: number;
268
- /**
269
- * Sets the iridescence IOR (OpenPBR: iridescenceIor, PBR: iridescence.indexOfRefraction)
270
- */
271
- iridescenceIor: number;
272
- /**
273
- * Sets the iridescence thickness minimum (OpenPBR: iridescenceThicknessMinimum, PBR: iridescence.minimumThickness)
274
- */
275
- iridescenceThicknessMinimum: number;
276
- /**
277
- * Sets the iridescence thickness maximum (OpenPBR: iridescenceThicknessMaximum, PBR: iridescence.maximumThickness)
278
- */
279
- iridescenceThicknessMaximum: number;
280
- /**
281
- * Sets the iridescence texture (OpenPBR: iridescenceTexture, PBR: iridescence.intensityTexture)
282
- */
283
- iridescenceTexture: Nullable<BaseTexture>;
284
- /**
285
- * Sets the iridescence thickness texture (OpenPBR: iridescenceThicknessTexture, PBR: iridescence.thicknessTexture)
286
- */
287
- iridescenceThicknessTexture: Nullable<BaseTexture>;
288
- /**
289
- * Sets the unlit flag (OpenPBR: unlit, PBR: unlit)
290
- */
291
- unlit: boolean;
292
- /**
293
- * Sets/gets the geometry opacity (OpenPBR: geometryOpacity, PBR: alpha)
294
- */
295
- geometryOpacity: number;
296
- /**
297
- * Sets/gets the geometry normal texture (OpenPBR: geometryNormalTexture, PBR: bumpTexture)
298
- */
299
- geometryNormalTexture: Nullable<BaseTexture>;
300
- /**
301
- * Sets the normal map inversions for PBR material only
302
- * @param invertX - Whether to invert the normal map on the X axis
303
- * @param invertY - Whether to invert the normal map on the Y axis
304
- */
305
- setNormalMapInversions(invertX: boolean, invertY: boolean): void;
306
- /**
307
- * Sets/gets the coat normal texture (OpenPBR: geometryCoatNormalTexture, PBR: clearCoat.bumpTexture)
308
- */
309
- geometryCoatNormalTexture: Nullable<BaseTexture>;
310
- /**
311
- * Sets the coat normal texture scale
312
- */
313
- geometryCoatNormalTextureScale: number;
314
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=materialLoadingAdapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"materialLoadingAdapter.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/materialLoadingAdapter.ts"],"names":[],"mappings":"","sourcesContent":["import type { Material } from \"core/Materials/material\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Color3 } from \"core/Maths/math.color\";\r\n\r\n/**\r\n * Interface for material loading adapters that provides a unified OpenPBR-like interface\r\n * for both OpenPBR and PBR materials, eliminating conditional branches in extensions.\r\n */\r\nexport interface IMaterialLoadingAdapter {\r\n /**\r\n * Gets the underlying material\r\n */\r\n readonly material: Material;\r\n\r\n /**\r\n * Whether the material should be treated as unlit\r\n */\r\n isUnlit: boolean;\r\n\r\n // ========================================\r\n // CULLING PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets/gets the back face culling\r\n */\r\n backFaceCulling: boolean;\r\n\r\n /**\r\n * Sets/gets the two sided lighting\r\n */\r\n twoSidedLighting: boolean;\r\n\r\n // ========================================\r\n // ALPHA PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets/gets the alpha cutoff value (used for alpha test mode)\r\n */\r\n alphaCutOff: number;\r\n\r\n /**\r\n * Sets/gets whether to use alpha from albedo/base color texture\r\n */\r\n useAlphaFromBaseColorTexture: boolean;\r\n\r\n /**\r\n * Sets/Gets whether the transparency is treated as alpha coverage\r\n */\r\n transparencyAsAlphaCoverage: boolean;\r\n\r\n // ========================================\r\n // BASE PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets/gets the base color (OpenPBR: baseColor, PBR: albedoColor)\r\n */\r\n baseColor: Color3;\r\n\r\n /**\r\n * Sets/gets the base color texture (OpenPBR: baseColorTexture, PBR: albedoTexture)\r\n */\r\n baseColorTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets/gets the base diffuse roughness (OpenPBR: baseDiffuseRoughness, PBR: baseDiffuseRoughness)\r\n */\r\n baseDiffuseRoughness: number;\r\n\r\n /**\r\n * Sets/gets the base diffuse roughness texture (OpenPBR: baseDiffuseRoughnessTexture, PBR: baseDiffuseRoughnessTexture)\r\n */\r\n baseDiffuseRoughnessTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets/gets the base metalness (OpenPBR: baseMetalness, PBR: metallic)\r\n */\r\n baseMetalness: number;\r\n\r\n /**\r\n * Sets/gets the base metalness texture (OpenPBR: baseMetalnessTexture, PBR: metallicTexture)\r\n */\r\n baseMetalnessTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets whether to use roughness from metallic texture green channel\r\n */\r\n useRoughnessFromMetallicTextureGreen: boolean;\r\n\r\n /**\r\n * Sets whether to use metallic from metallic texture blue channel\r\n */\r\n useMetallicFromMetallicTextureBlue: boolean;\r\n\r\n // ========================================\r\n // SPECULAR PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Configures specular properties and enables OpenPBR BRDF model for edge color support\r\n * @param enableEdgeColor - Whether to enable edge color support\r\n */\r\n enableSpecularEdgeColor(enableEdgeColor?: boolean): void;\r\n\r\n /**\r\n * Sets/gets the specular weight (OpenPBR: specularWeight, PBR: metallicF0Factor)\r\n */\r\n specularWeight: number;\r\n\r\n /**\r\n * Sets/gets the specular weight texture (OpenPBR: specularWeightTexture, PBR: metallicReflectanceTexture)\r\n */\r\n specularWeightTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets/gets the specular color (OpenPBR: specularColor, PBR: reflectance)\r\n */\r\n specularColor: Color3;\r\n\r\n /**\r\n * Sets/gets the specular color texture (OpenPBR: specularColorTexture, PBR: reflectanceTexture)\r\n */\r\n specularColorTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets/gets the specular roughness (OpenPBR: specularRoughness, PBR: roughness)\r\n */\r\n specularRoughness: number;\r\n\r\n /**\r\n * Sets/gets the specular roughness texture\r\n */\r\n specularRoughnessTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets/gets the specular IOR (OpenPBR: specularIor, PBR: indexOfRefraction)\r\n */\r\n specularIor: number;\r\n\r\n // ========================================\r\n // EMISSION PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets/gets the emissive color (OpenPBR: emissionColor, PBR: emissiveColor)\r\n */\r\n emissionColor: Color3;\r\n\r\n /**\r\n * Sets/gets the emissive luminance (OpenPBR: emissionLuminance, PBR: emissiveIntensity)\r\n */\r\n emissionLuminance: number;\r\n\r\n /**\r\n * Sets/gets the emissive texture\r\n */\r\n emissionColorTexture: Nullable<BaseTexture>;\r\n\r\n // ========================================\r\n // AMBIENT OCCLUSION\r\n // ========================================\r\n\r\n /**\r\n * Sets/gets the ambient occlusion texture (OpenPBR: ambientOcclusionTexture, PBR: ambientTexture)\r\n */\r\n ambientOcclusionTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets/gets the ambient occlusion texture strength/level\r\n */\r\n ambientOcclusionTextureStrength: number;\r\n\r\n // ========================================\r\n // COAT PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Configures clear coat for PBR material\r\n */\r\n configureCoat(): void;\r\n\r\n /**\r\n * Sets/gets the coat weight (OpenPBR: coatWeight, PBR: clearCoat.intensity)\r\n */\r\n coatWeight: number;\r\n\r\n /**\r\n * Sets/gets the coat weight texture (OpenPBR: coatWeightTexture, PBR: clearCoat.texture)\r\n */\r\n coatWeightTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets the coat color (OpenPBR: coatColor, no PBR equivalent)\r\n */\r\n coatColor: Color3;\r\n\r\n /**\r\n * Sets the coat color texture (OpenPBR: coatColorTexture, no PBR equivalent)\r\n */\r\n coatColorTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets/gets the coat roughness (OpenPBR: coatRoughness, PBR: clearCoat.roughness)\r\n */\r\n coatRoughness: number;\r\n\r\n /**\r\n * Sets/gets the coat roughness texture (OpenPBR: coatRoughnessTexture, PBR: clearCoat.textureRoughness)\r\n */\r\n coatRoughnessTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets the coat darkening (OpenPBR: coatDarkening, no PBR equivalent)\r\n */\r\n coatDarkening: number;\r\n\r\n /**\r\n * Sets the coat darkening texture (OpenPBR: coatDarkeningTexture, no PBR equivalent)\r\n */\r\n coatDarkeningTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets/gets the coat roughness anisotropy (OpenPBR: coatRoughnessAnisotropy, PBR: clearCoat.anisotropy.intensity)\r\n */\r\n coatRoughnessAnisotropy: number;\r\n\r\n /**\r\n * Sets the coat tangent angle for anisotropy (OpenPBR: geometryCoatTangentAngle, PBR: clearCoat.anisotropy.angle)\r\n */\r\n geometryCoatTangentAngle: number;\r\n\r\n /**\r\n * Sets the coat tangent texture for anisotropy (OpenPBR: geometryCoatTangentTexture, PBR: clearCoat.anisotropy.texture)\r\n */\r\n geometryCoatTangentTexture: Nullable<BaseTexture>;\r\n\r\n // ========================================\r\n // TRANSMISSION LAYER\r\n // ========================================\r\n\r\n /**\r\n * Sets the transmission weight (OpenPBR: transmissionWeight, PBR: subSurface.refractionIntensity)\r\n */\r\n transmissionWeight: number;\r\n\r\n /**\r\n * Sets the transmission weight texture (OpenPBR: transmissionWeightTexture, PBR: subSurface.refractionIntensityTexture)\r\n */\r\n transmissionWeightTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets the attenuation distance (OpenPBR: attenuationDistance, PBR: subSurface.volumeIndexOfRefraction)\r\n */\r\n transmissionDepth: number;\r\n\r\n /**\r\n * Sets the attenuation color (OpenPBR: attenuationColor, PBR: subSurface.tintColor)\r\n */\r\n transmissionColor: Color3;\r\n\r\n /**\r\n * Sets the dispersion Abbe number\r\n */\r\n transmissionDispersionAbbeNumber: number;\r\n\r\n /**\r\n * Configures transmission for thin-surface transmission (KHR_materials_transmission)\r\n */\r\n configureTransmission(): void;\r\n\r\n // ========================================\r\n // VOLUME PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets the thickness texture (OpenPBR: thicknessTexture, PBR: subSurface.thicknessTexture)\r\n */\r\n volumeThicknessTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets the thickness factor (OpenPBR: thickness, PBR: subSurface.maximumThickness)\r\n */\r\n volumeThickness: number;\r\n\r\n // ========================================\r\n // SUBSURFACE PROPERTIES (Subsurface Scattering)\r\n // ========================================\r\n\r\n /**\r\n * Configures subsurface properties for PBR material\r\n */\r\n configureSubsurface(): void;\r\n\r\n /**\r\n * Sets/gets the subsurface weight\r\n */\r\n subsurfaceWeight: number;\r\n\r\n /**\r\n * Sets/gets the subsurface weight texture\r\n */\r\n subsurfaceWeightTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets/gets the subsurface color (OpenPBR: subsurfaceColor, PBR: subSurface.tintColor)\r\n */\r\n subsurfaceColor: Color3;\r\n\r\n /**\r\n * Sets/gets the subsurface color texture (OpenPBR: subsurfaceColorTexture, PBR: subSurface.tintColorTexture)\r\n */\r\n subsurfaceColorTexture: Nullable<BaseTexture>;\r\n\r\n // ========================================\r\n // FUZZ LAYER (Sheen)\r\n // ========================================\r\n\r\n /**\r\n * Configures initial settings for fuzz for material.\r\n */\r\n configureFuzz(): void;\r\n\r\n /**\r\n * Sets the fuzz weight (OpenPBR: fuzzWeight, PBR: fuzz.intensity)\r\n */\r\n fuzzWeight: number;\r\n\r\n /**\r\n * Sets the fuzz color (OpenPBR: fuzzColor, PBR: fuzz.color)\r\n */\r\n fuzzColor: Color3;\r\n\r\n /**\r\n * Sets the fuzz color texture (OpenPBR: fuzzColorTexture, PBR: fuzz.texture)\r\n */\r\n fuzzColorTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets the fuzz roughness (OpenPBR: fuzzRoughness, PBR: fuzz.roughness)\r\n */\r\n fuzzRoughness: number;\r\n\r\n /**\r\n * Sets the fuzz roughness texture (OpenPBR: fuzzRoughnessTexture, PBR: fuzz.textureRoughness)\r\n */\r\n fuzzRoughnessTexture: Nullable<BaseTexture>;\r\n\r\n // ========================================\r\n // ANISOTROPY\r\n // ========================================\r\n\r\n /**\r\n * Sets/gets the specular roughness anisotropy (OpenPBR: specularRoughnessAnisotropy, PBR: anisotropy.intensity)\r\n */\r\n specularRoughnessAnisotropy: number;\r\n\r\n /**\r\n * Sets the anisotropy rotation (OpenPBR: anisotropyRotation, PBR: anisotropy.angle)\r\n */\r\n geometryTangentAngle: number;\r\n\r\n /**\r\n * Sets/gets the anisotropy texture (OpenPBR: geometryTangentTexture, PBR: anisotropy.texture)\r\n */\r\n geometryTangentTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Configures glTF-style anisotropy for OpenPBR materials\r\n * @param useGltfStyle - Whether to use glTF-style anisotropy (default: true)\r\n */\r\n configureGltfStyleAnisotropy(useGltfStyle?: boolean): void;\r\n\r\n // ========================================\r\n // THIN FILM IRIDESCENCE\r\n // ========================================\r\n\r\n /**\r\n * Sets the iridescence weight (OpenPBR: iridescenceWeight, PBR: iridescence.intensity)\r\n */\r\n iridescenceWeight: number;\r\n\r\n /**\r\n * Sets the iridescence IOR (OpenPBR: iridescenceIor, PBR: iridescence.indexOfRefraction)\r\n */\r\n iridescenceIor: number;\r\n\r\n /**\r\n * Sets the iridescence thickness minimum (OpenPBR: iridescenceThicknessMinimum, PBR: iridescence.minimumThickness)\r\n */\r\n iridescenceThicknessMinimum: number;\r\n\r\n /**\r\n * Sets the iridescence thickness maximum (OpenPBR: iridescenceThicknessMaximum, PBR: iridescence.maximumThickness)\r\n */\r\n iridescenceThicknessMaximum: number;\r\n\r\n /**\r\n * Sets the iridescence texture (OpenPBR: iridescenceTexture, PBR: iridescence.intensityTexture)\r\n */\r\n iridescenceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets the iridescence thickness texture (OpenPBR: iridescenceThicknessTexture, PBR: iridescence.thicknessTexture)\r\n */\r\n iridescenceThicknessTexture: Nullable<BaseTexture>;\r\n\r\n // ========================================\r\n // UNLIT MATERIALS\r\n // ========================================\r\n\r\n /**\r\n * Sets the unlit flag (OpenPBR: unlit, PBR: unlit)\r\n */\r\n unlit: boolean;\r\n\r\n // ========================================\r\n // GEOMETRY PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets/gets the geometry opacity (OpenPBR: geometryOpacity, PBR: alpha)\r\n */\r\n geometryOpacity: number;\r\n\r\n /**\r\n * Sets/gets the geometry normal texture (OpenPBR: geometryNormalTexture, PBR: bumpTexture)\r\n */\r\n geometryNormalTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets the normal map inversions for PBR material only\r\n * @param invertX - Whether to invert the normal map on the X axis\r\n * @param invertY - Whether to invert the normal map on the Y axis\r\n */\r\n setNormalMapInversions(invertX: boolean, invertY: boolean): void;\r\n\r\n /**\r\n * Sets/gets the coat normal texture (OpenPBR: geometryCoatNormalTexture, PBR: clearCoat.bumpTexture)\r\n */\r\n geometryCoatNormalTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Sets the coat normal texture scale\r\n */\r\n geometryCoatNormalTextureScale: number;\r\n}\r\n"]}