@babylonjs/loaders 8.29.0 → 8.29.2

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 (29) hide show
  1. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +3 -0
  2. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +74 -24
  3. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  4. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +1 -1
  5. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  6. package/glTF/2.0/Extensions/index.d.ts +0 -3
  7. package/glTF/2.0/Extensions/index.js +0 -3
  8. package/glTF/2.0/Extensions/index.js.map +1 -1
  9. package/glTF/2.0/glTFLoader.d.ts +5 -7
  10. package/glTF/2.0/glTFLoader.js +43 -42
  11. package/glTF/2.0/glTFLoader.js.map +1 -1
  12. package/glTF/2.0/materialLoadingAdapter.d.ts +4 -0
  13. package/glTF/2.0/materialLoadingAdapter.js.map +1 -1
  14. package/glTF/2.0/openPbrMaterialLoadingAdapter.d.ts +4 -0
  15. package/glTF/2.0/openPbrMaterialLoadingAdapter.js +6 -0
  16. package/glTF/2.0/openPbrMaterialLoadingAdapter.js.map +1 -1
  17. package/glTF/2.0/pbrMaterialLoadingAdapter.d.ts +4 -0
  18. package/glTF/2.0/pbrMaterialLoadingAdapter.js +6 -0
  19. package/glTF/2.0/pbrMaterialLoadingAdapter.js.map +1 -1
  20. package/package.json +3 -3
  21. package/glTF/2.0/Extensions/KHR_materials_clearcoat_anisotropy.d.ts +0 -42
  22. package/glTF/2.0/Extensions/KHR_materials_clearcoat_anisotropy.js +0 -66
  23. package/glTF/2.0/Extensions/KHR_materials_clearcoat_anisotropy.js.map +0 -1
  24. package/glTF/2.0/Extensions/KHR_materials_clearcoat_color.d.ts +0 -42
  25. package/glTF/2.0/Extensions/KHR_materials_clearcoat_color.js +0 -62
  26. package/glTF/2.0/Extensions/KHR_materials_clearcoat_color.js.map +0 -1
  27. package/glTF/2.0/Extensions/KHR_materials_clearcoat_darkening.d.ts +0 -43
  28. package/glTF/2.0/Extensions/KHR_materials_clearcoat_darkening.js +0 -62
  29. package/glTF/2.0/Extensions/KHR_materials_clearcoat_darkening.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"pbrMaterialLoadingAdapter.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/pbrMaterialLoadingAdapter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,SAAS,EAAE,6CAA+B;AAGnD;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAGlC;;;OAGG;IACH,YAAY,QAAkB;QAC1B,IAAI,CAAC,SAAS,GAAG,QAAuB,CAAC;QACzC,IAAI,CAAC,SAAS,CAAC,0BAA0B,GAAG,IAAI,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAW,OAAO,CAAC,KAAc;QAC7B,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;IACjC,CAAC;IAED,2CAA2C;IAC3C,qBAAqB;IACrB,2CAA2C;IAE3C;;;OAGG;IACH,IAAW,eAAe,CAAC,KAAc;QACrC,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,KAAK,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACH,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,IAAW,gBAAgB,CAAC,KAAc;QACtC,IAAI,CAAC,SAAS,CAAC,gBAAgB,GAAG,KAAK,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH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AC,SAAS,CAAC,yBAAyB,GAAG,IAAI,CAAC;IACpD,CAAC;IAED;;;OAGG;IACH,IAAW,qBAAqB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACI,sBAAsB,CAAC,OAAgB,EAAE,OAAgB;QAC5D,IAAI,CAAC,SAAS,CAAC,gBAAgB,GAAG,OAAO,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,gBAAgB,GAAG,OAAO,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,IAAW,yBAAyB,CAAC,KAA4B;QAC7D,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,GAAG,KAAK,CAAC;IACjD,CAAC;IAED;;;OAGG;IACH,IAAW,yBAAyB;QAChC,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC;IAChD,CAAC;IAED;;;OAGG;IACH,IAAW,8BAA8B,CAAC,KAAa;QACnD,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;YACvC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;QACvD,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport type { IMaterialLoadingAdapter } from \"./materialLoadingAdapter\";\r\n\r\n/**\r\n * Material Loading Adapter for PBR materials that provides a unified OpenPBR-like interface.\r\n */\r\nexport class PBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {\r\n private _material: PBRMaterial;\r\n\r\n /**\r\n * Creates a new instance of the PBRMaterialLoadingAdapter.\r\n * @param material - The PBR material to adapt.\r\n */\r\n constructor(material: Material) {\r\n this._material = material as PBRMaterial;\r\n this._material.enableSpecularAntiAliasing = true;\r\n }\r\n\r\n /**\r\n * Gets the underlying material\r\n */\r\n public get material(): PBRMaterial {\r\n return this._material;\r\n }\r\n\r\n /**\r\n * Whether the material should be treated as unlit\r\n */\r\n public get isUnlit(): boolean {\r\n return this._material.unlit;\r\n }\r\n\r\n /**\r\n * Sets whether the material should be treated as unlit\r\n */\r\n public set isUnlit(value: boolean) {\r\n this._material.unlit = value;\r\n }\r\n\r\n // ========================================\r\n // CULLING PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets whether back face culling is enabled.\r\n * @param value True to enable back face culling\r\n */\r\n public set backFaceCulling(value: boolean) {\r\n this._material.backFaceCulling = value;\r\n }\r\n\r\n /**\r\n * Gets whether back face culling is enabled.\r\n * @returns True if back face culling is enabled\r\n */\r\n public get backFaceCulling(): boolean {\r\n return this._material.backFaceCulling;\r\n }\r\n\r\n /**\r\n * Sets whether two-sided lighting is enabled.\r\n * @param value True to enable two-sided lighting\r\n */\r\n public set twoSidedLighting(value: boolean) {\r\n this._material.twoSidedLighting = value;\r\n }\r\n\r\n /**\r\n * Gets whether two-sided lighting is enabled.\r\n * @returns True if two-sided lighting is enabled\r\n */\r\n public get twoSidedLighting(): boolean {\r\n return this._material.twoSidedLighting;\r\n }\r\n\r\n // ========================================\r\n // ALPHA PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets the alpha cutoff value for alpha testing.\r\n * @param value The alpha cutoff threshold (0-1)\r\n */\r\n public set alphaCutOff(value: number) {\r\n this._material.alphaCutOff = value;\r\n }\r\n\r\n /**\r\n * Gets the alpha cutoff value.\r\n * @returns The alpha cutoff threshold (0-1)\r\n */\r\n public get alphaCutOff(): number {\r\n return this._material.alphaCutOff;\r\n }\r\n\r\n /**\r\n * Sets whether to use alpha from the albedo texture.\r\n * @param value True to use alpha from albedo texture\r\n */\r\n public set useAlphaFromBaseColorTexture(value: boolean) {\r\n this._material.useAlphaFromAlbedoTexture = value;\r\n }\r\n\r\n /**\r\n * Gets whether alpha is used from the albedo texture.\r\n * @returns True if using alpha from albedo texture\r\n */\r\n public get useAlphaFromBaseColorTexture(): boolean {\r\n return this._material.useAlphaFromAlbedoTexture;\r\n }\r\n\r\n /**\r\n * Gets whether the transparency is treated as alpha coverage.\r\n */\r\n public get transparencyAsAlphaCoverage(): boolean {\r\n return this._material.useRadianceOverAlpha || this._material.useSpecularOverAlpha;\r\n }\r\n\r\n /**\r\n * Sets/Gets whether the transparency is treated as alpha coverage\r\n */\r\n public set transparencyAsAlphaCoverage(value: boolean) {\r\n this._material.useRadianceOverAlpha = !value;\r\n this._material.useSpecularOverAlpha = !value;\r\n }\r\n\r\n // ========================================\r\n // BASE PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the base color of the material (mapped to PBR albedoColor).\r\n * @param value The base color as a Color3\r\n */\r\n public set baseColor(value: Color3) {\r\n this._material.albedoColor = value;\r\n }\r\n\r\n /**\r\n * Gets the base color of the material.\r\n * @returns The base color as a Color3\r\n */\r\n public get baseColor(): Color3 {\r\n return this._material.albedoColor;\r\n }\r\n\r\n /**\r\n * Sets the base color texture of the material (mapped to PBR albedoTexture).\r\n * @param value The base color texture or null\r\n */\r\n public set baseColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.albedoTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base color texture of the material.\r\n * @returns The base color texture or null\r\n */\r\n public get baseColorTexture(): Nullable<BaseTexture> {\r\n return this._material.albedoTexture;\r\n }\r\n\r\n /**\r\n * Sets the base diffuse roughness of the material.\r\n * @param value The diffuse roughness value (0-1)\r\n */\r\n public set baseDiffuseRoughness(value: number) {\r\n this._material.baseDiffuseRoughness = value;\r\n if (value > 0) {\r\n this._material.brdf.baseDiffuseModel = Constants.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the base diffuse roughness of the material.\r\n * @returns The diffuse roughness value (0-1), defaults to 0 if not set\r\n */\r\n public get baseDiffuseRoughness(): number {\r\n return this._material.baseDiffuseRoughness ?? 0;\r\n }\r\n\r\n /**\r\n * Sets the base diffuse roughness texture of the material.\r\n * @param value The diffuse roughness texture or null\r\n */\r\n public set baseDiffuseRoughnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.baseDiffuseRoughnessTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base diffuse roughness texture of the material.\r\n * @returns The diffuse roughness texture or null\r\n */\r\n public get baseDiffuseRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.baseDiffuseRoughnessTexture;\r\n }\r\n\r\n /**\r\n * Sets the base metalness value of the material (mapped to PBR metallic).\r\n * @param value The metalness value (0-1)\r\n */\r\n public set baseMetalness(value: number) {\r\n this._material.metallic = value;\r\n }\r\n\r\n /**\r\n * Gets the base metalness value of the material.\r\n * @returns The metalness value (0-1), defaults to 1 if not set\r\n */\r\n public get baseMetalness(): number {\r\n return this._material.metallic ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the base metalness texture of the material (mapped to PBR metallicTexture).\r\n * @param value The metalness texture or null\r\n */\r\n public set baseMetalnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.metallicTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base metalness texture of the material.\r\n * @returns The metalness texture or null\r\n */\r\n public get baseMetalnessTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicTexture;\r\n }\r\n\r\n /**\r\n * Sets whether to use roughness from the metallic texture's green channel.\r\n * Also disables using roughness from the alpha channel when enabled.\r\n * @param value True to use green channel for roughness\r\n */\r\n public set useRoughnessFromMetallicTextureGreen(value: boolean) {\r\n this._material.useRoughnessFromMetallicTextureGreen = value;\r\n this._material.useRoughnessFromMetallicTextureAlpha = !value;\r\n }\r\n\r\n /**\r\n * Sets whether to use metalness from the metallic texture's blue channel.\r\n * @param value True to use blue channel for metalness\r\n */\r\n public set useMetallicFromMetallicTextureBlue(value: boolean) {\r\n this._material.useMetallnessFromMetallicTextureBlue = value;\r\n }\r\n\r\n // ========================================\r\n // SPECULAR PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Configures specular properties and optionally enables OpenPBR BRDF model for edge color support.\r\n * @param enableEdgeColor Whether to enable OpenPBR BRDF models for edge color support\r\n */\r\n public enableSpecularEdgeColor(enableEdgeColor: boolean = false): void {\r\n if (enableEdgeColor) {\r\n this._material.brdf.dielectricSpecularModel = Constants.MATERIAL_DIELECTRIC_SPECULAR_MODEL_OPENPBR;\r\n this._material.brdf.conductorSpecularModel = Constants.MATERIAL_CONDUCTOR_SPECULAR_MODEL_OPENPBR;\r\n }\r\n }\r\n\r\n /**\r\n * Sets the specular weight (mapped to PBR metallicF0Factor).\r\n * @param value The specular weight value\r\n */\r\n public set specularWeight(value: number) {\r\n this._material.metallicF0Factor = value;\r\n }\r\n\r\n /**\r\n * Gets the specular weight.\r\n * @returns The specular weight value, defaults to 1 if not set\r\n */\r\n public get specularWeight(): number {\r\n return this._material.metallicF0Factor ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the specular weight texture (mapped to PBR metallicReflectanceTexture).\r\n * Configures the material to use only metalness from this texture when set.\r\n * @param value The specular weight texture or null\r\n */\r\n public set specularWeightTexture(value: Nullable<BaseTexture>) {\r\n if (value) {\r\n this._material.metallicReflectanceTexture = value;\r\n this._material.useOnlyMetallicFromMetallicReflectanceTexture = true;\r\n } else {\r\n this._material.metallicReflectanceTexture = null;\r\n this._material.useOnlyMetallicFromMetallicReflectanceTexture = false;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the specular weight texture.\r\n * @returns The specular weight texture or null\r\n */\r\n public get specularWeightTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicReflectanceTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular color (mapped to PBR metallicReflectanceColor).\r\n * @param value The specular color as a Color3\r\n */\r\n public set specularColor(value: Color3) {\r\n this._material.metallicReflectanceColor = value;\r\n }\r\n\r\n /**\r\n * Gets the specular color.\r\n * @returns The specular color as a Color3\r\n */\r\n public get specularColor(): Color3 {\r\n return this._material.metallicReflectanceColor;\r\n }\r\n\r\n /**\r\n * Sets the specular color texture (mapped to PBR reflectanceTexture).\r\n * @param value The specular color texture or null\r\n */\r\n public set specularColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.reflectanceTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the specular color texture.\r\n * @returns The specular color texture or null\r\n */\r\n public get specularColorTexture(): Nullable<BaseTexture> {\r\n return this._material.reflectanceTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular roughness (mapped to PBR roughness).\r\n * @param value The roughness value (0-1)\r\n */\r\n public set specularRoughness(value: number) {\r\n this._material.roughness = value;\r\n }\r\n\r\n /**\r\n * Gets the specular roughness.\r\n * @returns The roughness value (0-1), defaults to 1 if not set\r\n */\r\n public get specularRoughness(): number {\r\n return this._material.roughness ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the specular roughness texture.\r\n * Note: PBR uses the same texture for both metallic and roughness,\r\n * so this only sets the texture if no base metalness texture exists.\r\n * @param value The roughness texture or null\r\n */\r\n public set specularRoughnessTexture(value: Nullable<BaseTexture>) {\r\n // PBR uses the same texture for both metallic and roughness\r\n if (!this.baseMetalnessTexture) {\r\n this._material.metallicTexture = value;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the specular roughness texture.\r\n * @returns The roughness texture (same as metallic texture for PBR) or null\r\n */\r\n public get specularRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular index of refraction (mapped to PBR indexOfRefraction).\r\n * @param value The IOR value\r\n */\r\n public set specularIor(value: number) {\r\n this._material.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Gets the specular index of refraction.\r\n * @returns The IOR value\r\n */\r\n public get specularIor(): number {\r\n return this._material.indexOfRefraction;\r\n }\r\n\r\n // ========================================\r\n // EMISSION PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the emission color (mapped to PBR emissiveColor).\r\n * @param value The emission color as a Color3\r\n */\r\n public set emissionColor(value: Color3) {\r\n this._material.emissiveColor = value;\r\n }\r\n\r\n /**\r\n * Gets the emission color.\r\n * @returns The emission color as a Color3\r\n */\r\n public get emissionColor(): Color3 {\r\n return this._material.emissiveColor;\r\n }\r\n\r\n /**\r\n * Sets the emission luminance/intensity (mapped to PBR emissiveIntensity).\r\n * @param value The emission intensity value\r\n */\r\n public set emissionLuminance(value: number) {\r\n this._material.emissiveIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the emission luminance/intensity.\r\n * @returns The emission intensity value\r\n */\r\n public get emissionLuminance(): number {\r\n return this._material.emissiveIntensity;\r\n }\r\n\r\n /**\r\n * Sets the emission color texture (mapped to PBR emissiveTexture).\r\n * @param value The emission texture or null\r\n */\r\n public set emissionColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.emissiveTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the emission color texture.\r\n * @returns The emission texture or null\r\n */\r\n public get emissionColorTexture(): Nullable<BaseTexture> {\r\n return this._material.emissiveTexture;\r\n }\r\n\r\n // ========================================\r\n // AMBIENT OCCLUSION\r\n // ========================================\r\n\r\n /**\r\n * Sets the ambient occlusion texture (mapped to PBR ambientTexture).\r\n * Automatically enables grayscale mode when set.\r\n * @param value The ambient occlusion texture or null\r\n */\r\n public set ambientOcclusionTexture(value: Nullable<BaseTexture>) {\r\n this._material.ambientTexture = value;\r\n if (value) {\r\n this._material.useAmbientInGrayScale = true;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the ambient occlusion texture.\r\n * @returns The ambient occlusion texture or null\r\n */\r\n public get ambientOcclusionTexture(): Nullable<BaseTexture> {\r\n return this._material.ambientTexture;\r\n }\r\n\r\n /**\r\n * Sets the ambient occlusion texture strength.\r\n * @param value The strength value (typically 0-1)\r\n */\r\n public set ambientOcclusionTextureStrength(value: number) {\r\n this._material.ambientTextureStrength = value;\r\n }\r\n\r\n /**\r\n * Gets the ambient occlusion texture strength.\r\n * @returns The strength value, defaults to 1.0 if not set\r\n */\r\n public get ambientOcclusionTextureStrength(): number {\r\n return this._material.ambientTextureStrength ?? 1.0;\r\n }\r\n\r\n // ========================================\r\n // COAT PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Configures clear coat for PBR material.\r\n * Enables clear coat and sets up proper configuration.\r\n */\r\n public configureCoat(): void {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.useRoughnessFromMainTexture = false;\r\n this._material.clearCoat.remapF0OnInterfaceChange = false;\r\n }\r\n\r\n /**\r\n * Sets the coat weight (mapped to PBR clearCoat.intensity).\r\n * Automatically enables clear coat.\r\n * @param value The coat weight value (0-1)\r\n */\r\n public set coatWeight(value: number) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the coat weight.\r\n * @returns The coat weight value\r\n */\r\n public get coatWeight(): number {\r\n return this._material.clearCoat.intensity;\r\n }\r\n\r\n /**\r\n * Sets the coat weight texture (mapped to PBR clearCoat.texture).\r\n * Automatically enables clear coat.\r\n * @param value The coat weight texture or null\r\n */\r\n public set coatWeightTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.texture = value;\r\n }\r\n\r\n /**\r\n * Gets the coat weight texture.\r\n * @returns The coat weight texture or null\r\n */\r\n public get coatWeightTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.texture;\r\n }\r\n\r\n /**\r\n * Sets the coat color (mapped to PBR clearCoat.tintColor).\r\n * @param value The coat tint color as a Color3\r\n */\r\n public set coatColor(value: Color3) {\r\n this._material.clearCoat.isTintEnabled = value != Color3.White();\r\n this._material.clearCoat.tintColor = value;\r\n }\r\n\r\n /**\r\n * Sets the coat color texture (mapped to PBR clearCoat.tintTexture).\r\n * @param value The coat color texture or null\r\n */\r\n public set coatColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.tintTexture = value;\r\n }\r\n\r\n /**\r\n * Sets the coat roughness (mapped to PBR clearCoat.roughness).\r\n * Automatically enables clear coat.\r\n * @param value The coat roughness value (0-1)\r\n */\r\n public set coatRoughness(value: number) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.roughness = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness.\r\n * @returns The coat roughness value, defaults to 0 if not set\r\n */\r\n public get coatRoughness(): number {\r\n return this._material.clearCoat.roughness ?? 0;\r\n }\r\n\r\n /**\r\n * Sets the coat roughness texture (mapped to PBR clearCoat.textureRoughness).\r\n * Automatically enables clear coat and disables using roughness from main texture.\r\n * @param value The coat roughness texture or null\r\n */\r\n public set coatRoughnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.useRoughnessFromMainTexture = false;\r\n this._material.clearCoat.textureRoughness = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness texture.\r\n * @returns The coat roughness texture or null\r\n */\r\n public get coatRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.textureRoughness;\r\n }\r\n\r\n /**\r\n * Sets the coat darkening value.\r\n * Note: PBR doesn't have a direct coat darkening property, so this is a no-op.\r\n * @param value The coat darkening value (ignored for PBR)\r\n */\r\n public set coatDarkening(value: number) {\r\n // PBR doesn't have a coat darkening property\r\n }\r\n\r\n /**\r\n * Sets the coat darkening texture\r\n * @param value The coat darkening texture or null\r\n */\r\n public set coatDarkeningTexture(value: Nullable<BaseTexture>) {\r\n // PBR doesn't have a coat darkening property\r\n }\r\n\r\n /**\r\n * Sets the coat roughness anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.\r\n * @param value The coat anisotropy intensity value (currently ignored)\r\n */\r\n public set coatRoughnessAnisotropy(value: number) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropy = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this returns 0.\r\n * @returns Currently returns 0 as clearCoat anisotropy is not yet available\r\n */\r\n public get coatRoughnessAnisotropy(): number {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // return this._material.clearCoat.anisotropy ?? 0;\r\n return 0;\r\n }\r\n\r\n /**\r\n * Sets the coat tangent angle for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.\r\n * @param value The coat anisotropy rotation angle in radians (currently ignored)\r\n */\r\n public set geometryCoatTangentAngle(value: number) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropyAngle = value;\r\n }\r\n\r\n /**\r\n * Sets the coat tangent texture for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy textures yet, so this is a placeholder.\r\n * @param value The coat anisotropy texture (currently ignored)\r\n */\r\n public set geometryCoatTangentTexture(value: Nullable<BaseTexture>) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropyTangentTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the coat tangent texture for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy textures yet, so this returns null.\r\n * @returns Currently returns null as clearCoat anisotropy is not yet available\r\n */\r\n public get geometryCoatTangentTexture(): Nullable<BaseTexture> {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // return this._material.clearCoat.anisotropyTangentTexture;\r\n return null;\r\n }\r\n\r\n // ========================================\r\n // TRANSMISSION LAYER\r\n // ========================================\r\n\r\n /**\r\n * Sets the transmission weight (mapped to PBR subSurface.refractionIntensity).\r\n * Enables refraction when value \\> 0.\r\n * @param value The transmission weight value (0-1)\r\n */\r\n public set transmissionWeight(value: number) {\r\n this._material.subSurface.isRefractionEnabled = value > 0;\r\n this._material.subSurface.refractionIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the transmission weight.\r\n * @returns The transmission weight value\r\n */\r\n public get transmissionWeight(): number {\r\n return this._material.subSurface.refractionIntensity;\r\n }\r\n\r\n /**\r\n * Sets the transmission weight texture (mapped to PBR subSurface.refractionIntensityTexture).\r\n * Automatically enables refraction and glTF-style textures.\r\n * @param value The transmission weight texture or null\r\n */\r\n public set transmissionWeightTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.isRefractionEnabled = true;\r\n this._material.subSurface.refractionIntensityTexture = value;\r\n this._material.subSurface.useGltfStyleTextures = true;\r\n }\r\n\r\n /**\r\n * Sets the attenuation distance for volume scattering.\r\n * @param value The attenuation distance value\r\n */\r\n public set transmissionDepth(value: number) {\r\n this._material.subSurface.tintColorAtDistance = value;\r\n }\r\n\r\n /**\r\n * Sets the attenuation color (mapped to PBR subSurface.tintColor).\r\n * @param value The attenuation color as a Color3\r\n */\r\n public set transmissionColor(value: Color3) {\r\n this._material.subSurface.tintColor = value;\r\n }\r\n\r\n /**\r\n * Gets the transmission dispersion Abbe number.\r\n * @param value The Abbe number value\r\n */\r\n public set transmissionDispersionAbbeNumber(value: number) {\r\n if (value > 0) {\r\n this._material.subSurface.isDispersionEnabled = true;\r\n this._material.subSurface.dispersion = 20.0 / value;\r\n } else {\r\n this._material.subSurface.isDispersionEnabled = false;\r\n this._material.subSurface.dispersion = 0;\r\n }\r\n }\r\n\r\n /**\r\n * Configures transmission for thin-surface transmission (KHR_materials_transmission).\r\n * Sets up the material for proper thin-surface transmission behavior.\r\n */\r\n public configureTransmission(): void {\r\n // Since this extension models thin-surface transmission only, we must make IOR = 1.0\r\n this._material.subSurface.volumeIndexOfRefraction = 1.0;\r\n // Albedo colour will tint transmission.\r\n this._material.subSurface.useAlbedoToTintRefraction = true;\r\n this._material.subSurface.minimumThickness = 0.0;\r\n this._material.subSurface.maximumThickness = 0.0;\r\n }\r\n\r\n // ========================================\r\n // VOLUME PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets the thickness texture (mapped to PBR subSurface.thicknessTexture).\r\n * Automatically enables refraction.\r\n * @param value The thickness texture or null\r\n */\r\n public set volumeThicknessTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.thicknessTexture = value;\r\n this._material.subSurface.useGltfStyleTextures = true;\r\n }\r\n\r\n /**\r\n * Sets the thickness factor (mapped to PBR subSurface.maximumThickness).\r\n * Automatically enables refraction.\r\n * @param value The thickness value\r\n */\r\n public set volumeThickness(value: number) {\r\n this._material.subSurface.minimumThickness = 0.0;\r\n this._material.subSurface.maximumThickness = value;\r\n this._material.subSurface.useThicknessAsDepth = true;\r\n if (value > 0) {\r\n this._material.subSurface.volumeIndexOfRefraction = this._material.indexOfRefraction;\r\n }\r\n }\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 public configureSubsurface(): void {\r\n this._material.subSurface.useGltfStyleTextures = true;\r\n\r\n // Since this extension models thin-surface transmission only, we must make the\r\n // internal IOR == 1.0 and set the thickness to 0.\r\n this._material.subSurface.volumeIndexOfRefraction = 1.0;\r\n this._material.subSurface.minimumThickness = 0.0;\r\n this._material.subSurface.maximumThickness = 0.0;\r\n\r\n // Tint color will be used for transmission.\r\n this._material.subSurface.useAlbedoToTintTranslucency = false;\r\n }\r\n\r\n /**\r\n * Sets the subsurface weight\r\n */\r\n public set subsurfaceWeight(value: number) {\r\n this._material.subSurface.isTranslucencyEnabled = value > 0;\r\n this._material.subSurface.translucencyIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the subsurface weight\r\n * @returns The subsurface weight value\r\n */\r\n public get subsurfaceWeight(): number {\r\n return this._material.subSurface.isTranslucencyEnabled ? this._material.subSurface.translucencyIntensity : 0;\r\n }\r\n\r\n /**\r\n * Sets the subsurface weight texture\r\n */\r\n public set subsurfaceWeightTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.translucencyIntensityTexture = value;\r\n }\r\n\r\n /**\r\n * Sets the subsurface color.\r\n * @param value The subsurface tint color as a Color3\r\n */\r\n public set subsurfaceColor(value: Color3) {\r\n this._material.subSurface.tintColor = value;\r\n }\r\n\r\n /**\r\n * Sets the subsurface color texture.\r\n * @param value The subsurface tint texture or null\r\n */\r\n public set subsurfaceColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.translucencyColorTexture = value;\r\n }\r\n\r\n // ========================================\r\n // FUZZ LAYER (Sheen)\r\n // ========================================\r\n\r\n /**\r\n * Configures sheen for PBR material.\r\n * Enables sheen and sets up proper configuration.\r\n */\r\n public configureFuzz(): void {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.useRoughnessFromMainTexture = false;\r\n this._material.sheen.albedoScaling = true;\r\n }\r\n\r\n /**\r\n * Sets the sheen weight (mapped to PBR sheen.intensity).\r\n * Automatically enables sheen.\r\n * @param value The sheen weight value\r\n */\r\n public set fuzzWeight(value: number) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.intensity = value;\r\n }\r\n\r\n /**\r\n * Sets the sheen color (mapped to PBR sheen.color).\r\n * Automatically enables sheen.\r\n * @param value The sheen color as a Color3\r\n */\r\n public set fuzzColor(value: Color3) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.color = value;\r\n }\r\n\r\n /**\r\n * Sets the sheen color texture (mapped to PBR sheen.texture).\r\n * Automatically enables sheen.\r\n * @param value The sheen color texture or null\r\n */\r\n public set fuzzColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.texture = value;\r\n }\r\n\r\n /**\r\n * Sets the sheen roughness (mapped to PBR sheen.roughness).\r\n * Automatically enables sheen.\r\n * @param value The sheen roughness value (0-1)\r\n */\r\n public set fuzzRoughness(value: number) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.roughness = value;\r\n }\r\n\r\n /**\r\n * Sets the sheen roughness texture (mapped to PBR sheen.textureRoughness).\r\n * Automatically enables sheen.\r\n * @param value The sheen roughness texture or null\r\n */\r\n public set fuzzRoughnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.textureRoughness = value;\r\n }\r\n\r\n // ========================================\r\n // ANISOTROPY\r\n // ========================================\r\n\r\n /**\r\n * Sets the specular roughness anisotropy (mapped to PBR anisotropy.intensity).\r\n * Automatically enables anisotropy.\r\n * @param value The anisotropy intensity value\r\n */\r\n public set specularRoughnessAnisotropy(value: number) {\r\n this._material.anisotropy.isEnabled = true;\r\n this._material.anisotropy.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the specular roughness anisotropy.\r\n * @returns The anisotropy intensity value\r\n */\r\n public get specularRoughnessAnisotropy(): number {\r\n return this._material.anisotropy.intensity;\r\n }\r\n\r\n /**\r\n * Sets the anisotropy rotation (mapped to PBR anisotropy.angle).\r\n * Automatically enables anisotropy.\r\n * @param value The anisotropy rotation angle in radians\r\n */\r\n public set geometryTangentAngle(value: number) {\r\n this._material.anisotropy.isEnabled = true;\r\n this._material.anisotropy.angle = value;\r\n }\r\n\r\n /**\r\n * Sets the geometry tangent texture (mapped to PBR anisotropy.texture).\r\n * Automatically enables anisotropy.\r\n * @param value The anisotropy texture or null\r\n */\r\n public set geometryTangentTexture(value: Nullable<BaseTexture>) {\r\n this._material.anisotropy.isEnabled = true;\r\n this._material.anisotropy.texture = value;\r\n }\r\n\r\n /**\r\n * Gets the geometry tangent texture.\r\n * @returns The anisotropy texture or null\r\n */\r\n public get geometryTangentTexture(): Nullable<BaseTexture> {\r\n return this._material.anisotropy.texture;\r\n }\r\n\r\n /**\r\n * Configures glTF-style anisotropy for the material.\r\n * Note: PBR materials don't need this configuration, so this is a no-op.\r\n * @param useGltfStyle Whether to use glTF-style anisotropy (ignored for PBR)\r\n */\r\n public configureGltfStyleAnisotropy(useGltfStyle: boolean = true): void {\r\n // PBR materials don't need this configuration\r\n }\r\n\r\n // ========================================\r\n // THIN FILM IRIDESCENCE\r\n // ========================================\r\n\r\n /**\r\n * Sets the iridescence weight (mapped to PBR iridescence.intensity).\r\n * Automatically enables iridescence.\r\n * @param value The iridescence intensity value\r\n */\r\n public set iridescenceWeight(value: number) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.intensity = value;\r\n }\r\n\r\n /**\r\n * Sets the iridescence IOR (mapped to PBR iridescence.indexOfRefraction).\r\n * Automatically enables iridescence.\r\n * @param value The iridescence IOR value\r\n */\r\n public set iridescenceIor(value: number) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Sets the iridescence thickness minimum (mapped to PBR iridescence.minimumThickness).\r\n * Automatically enables iridescence.\r\n * @param value The minimum thickness value in nanometers\r\n */\r\n public set iridescenceThicknessMinimum(value: number) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.minimumThickness = value;\r\n }\r\n\r\n /**\r\n * Sets the iridescence thickness maximum (mapped to PBR iridescence.maximumThickness).\r\n * Automatically enables iridescence.\r\n * @param value The maximum thickness value in nanometers\r\n */\r\n public set iridescenceThicknessMaximum(value: number) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.maximumThickness = value;\r\n }\r\n\r\n /**\r\n * Sets the iridescence texture (mapped to PBR iridescence.texture).\r\n * Automatically enables iridescence.\r\n * @param value The iridescence intensity texture or null\r\n */\r\n public set iridescenceTexture(value: Nullable<BaseTexture>) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.texture = value;\r\n }\r\n\r\n /**\r\n * Sets the iridescence thickness texture (mapped to PBR iridescence.thicknessTexture).\r\n * Automatically enables iridescence.\r\n * @param value The iridescence thickness texture or null\r\n */\r\n public set iridescenceThicknessTexture(value: Nullable<BaseTexture>) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.thicknessTexture = value;\r\n }\r\n\r\n // ========================================\r\n // DISPERSION\r\n // ========================================\r\n\r\n /**\r\n * Sets the transmission dispersion value.\r\n * Note: PBR doesn't have direct dispersion support, so this stores it as metadata.\r\n * @param value The dispersion value (stored as metadata)\r\n */\r\n public set transmissionDispersion(value: number) {\r\n // PBR doesn't have a direct dispersion property, this would need custom shader modification\r\n // For now, we'll store it as metadata\r\n (this._material as any)._dispersion = value;\r\n }\r\n\r\n // ========================================\r\n // UNLIT MATERIALS\r\n // ========================================\r\n\r\n /**\r\n * Sets whether the material is unlit.\r\n * @param value True to make the material unlit\r\n */\r\n public set unlit(value: boolean) {\r\n this._material.unlit = value;\r\n }\r\n\r\n // ========================================\r\n // GEOMETRY PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the geometry opacity (mapped to PBR alpha).\r\n * @param value The opacity value (0-1)\r\n */\r\n public set geometryOpacity(value: number) {\r\n this._material.alpha = value;\r\n }\r\n\r\n /**\r\n * Gets the geometry opacity.\r\n * @returns The opacity value (0-1)\r\n */\r\n public get geometryOpacity(): number {\r\n return this._material.alpha;\r\n }\r\n\r\n /**\r\n * Sets the geometry normal texture (mapped to PBR bumpTexture).\r\n * Also forces irradiance computation in fragment shader for better lighting.\r\n * @param value The normal texture or null\r\n */\r\n public set geometryNormalTexture(value: Nullable<BaseTexture>) {\r\n this._material.bumpTexture = value;\r\n this._material.forceIrradianceInFragment = true;\r\n }\r\n\r\n /**\r\n * Gets the geometry normal texture.\r\n * @returns The normal texture or null\r\n */\r\n public get geometryNormalTexture(): Nullable<BaseTexture> {\r\n return this._material.bumpTexture;\r\n }\r\n\r\n /**\r\n * Sets the normal map inversions for the material.\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 public setNormalMapInversions(invertX: boolean, invertY: boolean): void {\r\n this._material.invertNormalMapX = invertX;\r\n this._material.invertNormalMapY = invertY;\r\n }\r\n\r\n /**\r\n * Sets the geometry coat normal texture (mapped to PBR clearCoat.bumpTexture).\r\n * Automatically enables clear coat.\r\n * @param value The coat normal texture or null\r\n */\r\n public set geometryCoatNormalTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.bumpTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the geometry coat normal texture.\r\n * @returns The coat normal texture or null\r\n */\r\n public get geometryCoatNormalTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.bumpTexture;\r\n }\r\n\r\n /**\r\n * Sets the geometry coat normal texture scale.\r\n * @param value The scale value for the coat normal texture\r\n */\r\n public set geometryCoatNormalTextureScale(value: number) {\r\n if (this._material.clearCoat.bumpTexture) {\r\n this._material.clearCoat.bumpTexture.level = value;\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"pbrMaterialLoadingAdapter.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/pbrMaterialLoadingAdapter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,SAAS,EAAE,6CAA+B;AAGnD;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAGlC;;;OAGG;IACH,YAAY,QAAkB;QAC1B,IAAI,CAAC,SAAS,GAAG,QAAuB,CAAC;QACzC,IAAI,CAAC,SAAS,CAAC,0BAA0B,GAAG,IAAI,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAW,OAAO,CAAC,KAAc;QAC7B,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;IACjC,CAAC;IAED,2CAA2C;IAC3C,qBAAqB;IACrB,2CAA2C;IAE3C;;;OAGG;IACH,IAAW,eAAe,CAAC,KAAc;QACrC,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,KAAK,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ial } from \"core/Materials/PBR/pbrMaterial\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport type { IMaterialLoadingAdapter } from \"./materialLoadingAdapter\";\r\n\r\n/**\r\n * Material Loading Adapter for PBR materials that provides a unified OpenPBR-like interface.\r\n */\r\nexport class PBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {\r\n private _material: PBRMaterial;\r\n\r\n /**\r\n * Creates a new instance of the PBRMaterialLoadingAdapter.\r\n * @param material - The PBR material to adapt.\r\n */\r\n constructor(material: Material) {\r\n this._material = material as PBRMaterial;\r\n this._material.enableSpecularAntiAliasing = true;\r\n }\r\n\r\n /**\r\n * Gets the underlying material\r\n */\r\n public get material(): PBRMaterial {\r\n return this._material;\r\n }\r\n\r\n /**\r\n * Whether the material should be treated as unlit\r\n */\r\n public get isUnlit(): boolean {\r\n return this._material.unlit;\r\n }\r\n\r\n /**\r\n * Sets whether the material should be treated as unlit\r\n */\r\n public set isUnlit(value: boolean) {\r\n this._material.unlit = value;\r\n }\r\n\r\n // ========================================\r\n // CULLING PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets whether back face culling is enabled.\r\n * @param value True to enable back face culling\r\n */\r\n public set backFaceCulling(value: boolean) {\r\n this._material.backFaceCulling = value;\r\n }\r\n\r\n /**\r\n * Gets whether back face culling is enabled.\r\n * @returns True if back face culling is enabled\r\n */\r\n public get backFaceCulling(): boolean {\r\n return this._material.backFaceCulling;\r\n }\r\n\r\n /**\r\n * Sets whether two-sided lighting is enabled.\r\n * @param value True to enable two-sided lighting\r\n */\r\n public set twoSidedLighting(value: boolean) {\r\n this._material.twoSidedLighting = value;\r\n }\r\n\r\n /**\r\n * Gets whether two-sided lighting is enabled.\r\n * @returns True if two-sided lighting is enabled\r\n */\r\n public get twoSidedLighting(): boolean {\r\n return this._material.twoSidedLighting;\r\n }\r\n\r\n // ========================================\r\n // ALPHA PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets the alpha cutoff value for alpha testing.\r\n * @param value The alpha cutoff threshold (0-1)\r\n */\r\n public set alphaCutOff(value: number) {\r\n this._material.alphaCutOff = value;\r\n }\r\n\r\n /**\r\n * Gets the alpha cutoff value.\r\n * @returns The alpha cutoff threshold (0-1)\r\n */\r\n public get alphaCutOff(): number {\r\n return this._material.alphaCutOff;\r\n }\r\n\r\n /**\r\n * Sets whether to use alpha from the albedo texture.\r\n * @param value True to use alpha from albedo texture\r\n */\r\n public set useAlphaFromBaseColorTexture(value: boolean) {\r\n this._material.useAlphaFromAlbedoTexture = value;\r\n }\r\n\r\n /**\r\n * Gets whether alpha is used from the albedo texture.\r\n * @returns True if using alpha from albedo texture\r\n */\r\n public get useAlphaFromBaseColorTexture(): boolean {\r\n return this._material.useAlphaFromAlbedoTexture;\r\n }\r\n\r\n /**\r\n * Gets whether the transparency is treated as alpha coverage.\r\n */\r\n public get transparencyAsAlphaCoverage(): boolean {\r\n return this._material.useRadianceOverAlpha || this._material.useSpecularOverAlpha;\r\n }\r\n\r\n /**\r\n * Sets/Gets whether the transparency is treated as alpha coverage\r\n */\r\n public set transparencyAsAlphaCoverage(value: boolean) {\r\n this._material.useRadianceOverAlpha = !value;\r\n this._material.useSpecularOverAlpha = !value;\r\n }\r\n\r\n // ========================================\r\n // BASE PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the base color of the material (mapped to PBR albedoColor).\r\n * @param value The base color as a Color3\r\n */\r\n public set baseColor(value: Color3) {\r\n this._material.albedoColor = value;\r\n }\r\n\r\n /**\r\n * Gets the base color of the material.\r\n * @returns The base color as a Color3\r\n */\r\n public get baseColor(): Color3 {\r\n return this._material.albedoColor;\r\n }\r\n\r\n /**\r\n * Sets the base color texture of the material (mapped to PBR albedoTexture).\r\n * @param value The base color texture or null\r\n */\r\n public set baseColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.albedoTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base color texture of the material.\r\n * @returns The base color texture or null\r\n */\r\n public get baseColorTexture(): Nullable<BaseTexture> {\r\n return this._material.albedoTexture;\r\n }\r\n\r\n /**\r\n * Sets the base diffuse roughness of the material.\r\n * @param value The diffuse roughness value (0-1)\r\n */\r\n public set baseDiffuseRoughness(value: number) {\r\n this._material.baseDiffuseRoughness = value;\r\n if (value > 0) {\r\n this._material.brdf.baseDiffuseModel = Constants.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the base diffuse roughness of the material.\r\n * @returns The diffuse roughness value (0-1), defaults to 0 if not set\r\n */\r\n public get baseDiffuseRoughness(): number {\r\n return this._material.baseDiffuseRoughness ?? 0;\r\n }\r\n\r\n /**\r\n * Sets the base diffuse roughness texture of the material.\r\n * @param value The diffuse roughness texture or null\r\n */\r\n public set baseDiffuseRoughnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.baseDiffuseRoughnessTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base diffuse roughness texture of the material.\r\n * @returns The diffuse roughness texture or null\r\n */\r\n public get baseDiffuseRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.baseDiffuseRoughnessTexture;\r\n }\r\n\r\n /**\r\n * Sets the base metalness value of the material (mapped to PBR metallic).\r\n * @param value The metalness value (0-1)\r\n */\r\n public set baseMetalness(value: number) {\r\n this._material.metallic = value;\r\n }\r\n\r\n /**\r\n * Gets the base metalness value of the material.\r\n * @returns The metalness value (0-1), defaults to 1 if not set\r\n */\r\n public get baseMetalness(): number {\r\n return this._material.metallic ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the base metalness texture of the material (mapped to PBR metallicTexture).\r\n * @param value The metalness texture or null\r\n */\r\n public set baseMetalnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.metallicTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base metalness texture of the material.\r\n * @returns The metalness texture or null\r\n */\r\n public get baseMetalnessTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicTexture;\r\n }\r\n\r\n /**\r\n * Sets whether to use roughness from the metallic texture's green channel.\r\n * Also disables using roughness from the alpha channel when enabled.\r\n * @param value True to use green channel for roughness\r\n */\r\n public set useRoughnessFromMetallicTextureGreen(value: boolean) {\r\n this._material.useRoughnessFromMetallicTextureGreen = value;\r\n this._material.useRoughnessFromMetallicTextureAlpha = !value;\r\n }\r\n\r\n /**\r\n * Sets whether to use metalness from the metallic texture's blue channel.\r\n * @param value True to use blue channel for metalness\r\n */\r\n public set useMetallicFromMetallicTextureBlue(value: boolean) {\r\n this._material.useMetallnessFromMetallicTextureBlue = value;\r\n }\r\n\r\n // ========================================\r\n // SPECULAR PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Configures specular properties and optionally enables OpenPBR BRDF model for edge color support.\r\n * @param enableEdgeColor Whether to enable OpenPBR BRDF models for edge color support\r\n */\r\n public enableSpecularEdgeColor(enableEdgeColor: boolean = false): void {\r\n if (enableEdgeColor) {\r\n this._material.brdf.dielectricSpecularModel = Constants.MATERIAL_DIELECTRIC_SPECULAR_MODEL_OPENPBR;\r\n this._material.brdf.conductorSpecularModel = Constants.MATERIAL_CONDUCTOR_SPECULAR_MODEL_OPENPBR;\r\n }\r\n }\r\n\r\n /**\r\n * Sets the specular weight (mapped to PBR metallicF0Factor).\r\n * @param value The specular weight value\r\n */\r\n public set specularWeight(value: number) {\r\n this._material.metallicF0Factor = value;\r\n }\r\n\r\n /**\r\n * Gets the specular weight.\r\n * @returns The specular weight value, defaults to 1 if not set\r\n */\r\n public get specularWeight(): number {\r\n return this._material.metallicF0Factor ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the specular weight texture (mapped to PBR metallicReflectanceTexture).\r\n * Configures the material to use only metalness from this texture when set.\r\n * @param value The specular weight texture or null\r\n */\r\n public set specularWeightTexture(value: Nullable<BaseTexture>) {\r\n if (value) {\r\n this._material.metallicReflectanceTexture = value;\r\n this._material.useOnlyMetallicFromMetallicReflectanceTexture = true;\r\n } else {\r\n this._material.metallicReflectanceTexture = null;\r\n this._material.useOnlyMetallicFromMetallicReflectanceTexture = false;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the specular weight texture.\r\n * @returns The specular weight texture or null\r\n */\r\n public get specularWeightTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicReflectanceTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular color (mapped to PBR metallicReflectanceColor).\r\n * @param value The specular color as a Color3\r\n */\r\n public set specularColor(value: Color3) {\r\n this._material.metallicReflectanceColor = value;\r\n }\r\n\r\n /**\r\n * Gets the specular color.\r\n * @returns The specular color as a Color3\r\n */\r\n public get specularColor(): Color3 {\r\n return this._material.metallicReflectanceColor;\r\n }\r\n\r\n /**\r\n * Sets the specular color texture (mapped to PBR reflectanceTexture).\r\n * @param value The specular color texture or null\r\n */\r\n public set specularColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.reflectanceTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the specular color texture.\r\n * @returns The specular color texture or null\r\n */\r\n public get specularColorTexture(): Nullable<BaseTexture> {\r\n return this._material.reflectanceTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular roughness (mapped to PBR roughness).\r\n * @param value The roughness value (0-1)\r\n */\r\n public set specularRoughness(value: number) {\r\n this._material.roughness = value;\r\n }\r\n\r\n /**\r\n * Gets the specular roughness.\r\n * @returns The roughness value (0-1), defaults to 1 if not set\r\n */\r\n public get specularRoughness(): number {\r\n return this._material.roughness ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the specular roughness texture.\r\n * Note: PBR uses the same texture for both metallic and roughness,\r\n * so this only sets the texture if no base metalness texture exists.\r\n * @param value The roughness texture or null\r\n */\r\n public set specularRoughnessTexture(value: Nullable<BaseTexture>) {\r\n // PBR uses the same texture for both metallic and roughness\r\n if (!this.baseMetalnessTexture) {\r\n this._material.metallicTexture = value;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the specular roughness texture.\r\n * @returns The roughness texture (same as metallic texture for PBR) or null\r\n */\r\n public get specularRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular index of refraction (mapped to PBR indexOfRefraction).\r\n * @param value The IOR value\r\n */\r\n public set specularIor(value: number) {\r\n this._material.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Gets the specular index of refraction.\r\n * @returns The IOR value\r\n */\r\n public get specularIor(): number {\r\n return this._material.indexOfRefraction;\r\n }\r\n\r\n // ========================================\r\n // EMISSION PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the emission color (mapped to PBR emissiveColor).\r\n * @param value The emission color as a Color3\r\n */\r\n public set emissionColor(value: Color3) {\r\n this._material.emissiveColor = value;\r\n }\r\n\r\n /**\r\n * Gets the emission color.\r\n * @returns The emission color as a Color3\r\n */\r\n public get emissionColor(): Color3 {\r\n return this._material.emissiveColor;\r\n }\r\n\r\n /**\r\n * Sets the emission luminance/intensity (mapped to PBR emissiveIntensity).\r\n * @param value The emission intensity value\r\n */\r\n public set emissionLuminance(value: number) {\r\n this._material.emissiveIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the emission luminance/intensity.\r\n * @returns The emission intensity value\r\n */\r\n public get emissionLuminance(): number {\r\n return this._material.emissiveIntensity;\r\n }\r\n\r\n /**\r\n * Sets the emission color texture (mapped to PBR emissiveTexture).\r\n * @param value The emission texture or null\r\n */\r\n public set emissionColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.emissiveTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the emission color texture.\r\n * @returns The emission texture or null\r\n */\r\n public get emissionColorTexture(): Nullable<BaseTexture> {\r\n return this._material.emissiveTexture;\r\n }\r\n\r\n // ========================================\r\n // AMBIENT OCCLUSION\r\n // ========================================\r\n\r\n /**\r\n * Sets the ambient occlusion texture (mapped to PBR ambientTexture).\r\n * Automatically enables grayscale mode when set.\r\n * @param value The ambient occlusion texture or null\r\n */\r\n public set ambientOcclusionTexture(value: Nullable<BaseTexture>) {\r\n this._material.ambientTexture = value;\r\n if (value) {\r\n this._material.useAmbientInGrayScale = true;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the ambient occlusion texture.\r\n * @returns The ambient occlusion texture or null\r\n */\r\n public get ambientOcclusionTexture(): Nullable<BaseTexture> {\r\n return this._material.ambientTexture;\r\n }\r\n\r\n /**\r\n * Sets the ambient occlusion texture strength.\r\n * @param value The strength value (typically 0-1)\r\n */\r\n public set ambientOcclusionTextureStrength(value: number) {\r\n this._material.ambientTextureStrength = value;\r\n }\r\n\r\n /**\r\n * Gets the ambient occlusion texture strength.\r\n * @returns The strength value, defaults to 1.0 if not set\r\n */\r\n public get ambientOcclusionTextureStrength(): number {\r\n return this._material.ambientTextureStrength ?? 1.0;\r\n }\r\n\r\n // ========================================\r\n // COAT PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Configures clear coat for PBR material.\r\n * Enables clear coat and sets up proper configuration.\r\n */\r\n public configureCoat(): void {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.useRoughnessFromMainTexture = false;\r\n this._material.clearCoat.remapF0OnInterfaceChange = false;\r\n }\r\n\r\n /**\r\n * Sets the coat weight (mapped to PBR clearCoat.intensity).\r\n * Automatically enables clear coat.\r\n * @param value The coat weight value (0-1)\r\n */\r\n public set coatWeight(value: number) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the coat weight.\r\n * @returns The coat weight value\r\n */\r\n public get coatWeight(): number {\r\n return this._material.clearCoat.intensity;\r\n }\r\n\r\n /**\r\n * Sets the coat weight texture (mapped to PBR clearCoat.texture).\r\n * Automatically enables clear coat.\r\n * @param value The coat weight texture or null\r\n */\r\n public set coatWeightTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.texture = value;\r\n }\r\n\r\n /**\r\n * Gets the coat weight texture.\r\n * @returns The coat weight texture or null\r\n */\r\n public get coatWeightTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.texture;\r\n }\r\n\r\n /**\r\n * Sets the coat color (mapped to PBR clearCoat.tintColor).\r\n * @param value The coat tint color as a Color3\r\n */\r\n public set coatColor(value: Color3) {\r\n this._material.clearCoat.isTintEnabled = value != Color3.White();\r\n this._material.clearCoat.tintColor = value;\r\n }\r\n\r\n /**\r\n * Sets the coat color texture (mapped to PBR clearCoat.tintTexture).\r\n * @param value The coat color texture or null\r\n */\r\n public set coatColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.tintTexture = value;\r\n }\r\n\r\n /**\r\n * Sets the coat roughness (mapped to PBR clearCoat.roughness).\r\n * Automatically enables clear coat.\r\n * @param value The coat roughness value (0-1)\r\n */\r\n public set coatRoughness(value: number) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.roughness = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness.\r\n * @returns The coat roughness value, defaults to 0 if not set\r\n */\r\n public get coatRoughness(): number {\r\n return this._material.clearCoat.roughness ?? 0;\r\n }\r\n\r\n /**\r\n * Sets the coat roughness texture (mapped to PBR clearCoat.textureRoughness).\r\n * Automatically enables clear coat and disables using roughness from main texture.\r\n * @param value The coat roughness texture or null\r\n */\r\n public set coatRoughnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.useRoughnessFromMainTexture = false;\r\n this._material.clearCoat.textureRoughness = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness texture.\r\n * @returns The coat roughness texture or null\r\n */\r\n public get coatRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.textureRoughness;\r\n }\r\n\r\n /**\r\n * Sets the coat index of refraction (IOR).\r\n */\r\n public set coatIor(value: number) {\r\n this._material.clearCoat.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Sets the coat darkening value.\r\n * Note: PBR doesn't have a direct coat darkening property, so this is a no-op.\r\n * @param value The coat darkening value (ignored for PBR)\r\n */\r\n public set coatDarkening(value: number) {\r\n // PBR doesn't have a coat darkening property\r\n }\r\n\r\n /**\r\n * Sets the coat darkening texture\r\n * @param value The coat darkening texture or null\r\n */\r\n public set coatDarkeningTexture(value: Nullable<BaseTexture>) {\r\n // PBR doesn't have a coat darkening property\r\n }\r\n\r\n /**\r\n * Sets the coat roughness anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.\r\n * @param value The coat anisotropy intensity value (currently ignored)\r\n */\r\n public set coatRoughnessAnisotropy(value: number) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropy = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this returns 0.\r\n * @returns Currently returns 0 as clearCoat anisotropy is not yet available\r\n */\r\n public get coatRoughnessAnisotropy(): number {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // return this._material.clearCoat.anisotropy ?? 0;\r\n return 0;\r\n }\r\n\r\n /**\r\n * Sets the coat tangent angle for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.\r\n * @param value The coat anisotropy rotation angle in radians (currently ignored)\r\n */\r\n public set geometryCoatTangentAngle(value: number) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropyAngle = value;\r\n }\r\n\r\n /**\r\n * Sets the coat tangent texture for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy textures yet, so this is a placeholder.\r\n * @param value The coat anisotropy texture (currently ignored)\r\n */\r\n public set geometryCoatTangentTexture(value: Nullable<BaseTexture>) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropyTangentTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the coat tangent texture for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy textures yet, so this returns null.\r\n * @returns Currently returns null as clearCoat anisotropy is not yet available\r\n */\r\n public get geometryCoatTangentTexture(): Nullable<BaseTexture> {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // return this._material.clearCoat.anisotropyTangentTexture;\r\n return null;\r\n }\r\n\r\n // ========================================\r\n // TRANSMISSION LAYER\r\n // ========================================\r\n\r\n /**\r\n * Sets the transmission weight (mapped to PBR subSurface.refractionIntensity).\r\n * Enables refraction when value \\> 0.\r\n * @param value The transmission weight value (0-1)\r\n */\r\n public set transmissionWeight(value: number) {\r\n this._material.subSurface.isRefractionEnabled = value > 0;\r\n this._material.subSurface.refractionIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the transmission weight.\r\n * @returns The transmission weight value\r\n */\r\n public get transmissionWeight(): number {\r\n return this._material.subSurface.refractionIntensity;\r\n }\r\n\r\n /**\r\n * Sets the transmission weight texture (mapped to PBR subSurface.refractionIntensityTexture).\r\n * Automatically enables refraction and glTF-style textures.\r\n * @param value The transmission weight texture or null\r\n */\r\n public set transmissionWeightTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.isRefractionEnabled = true;\r\n this._material.subSurface.refractionIntensityTexture = value;\r\n this._material.subSurface.useGltfStyleTextures = true;\r\n }\r\n\r\n /**\r\n * Sets the attenuation distance for volume scattering.\r\n * @param value The attenuation distance value\r\n */\r\n public set transmissionDepth(value: number) {\r\n this._material.subSurface.tintColorAtDistance = value;\r\n }\r\n\r\n /**\r\n * Sets the attenuation color (mapped to PBR subSurface.tintColor).\r\n * @param value The attenuation color as a Color3\r\n */\r\n public set transmissionColor(value: Color3) {\r\n this._material.subSurface.tintColor = value;\r\n }\r\n\r\n /**\r\n * Gets the transmission dispersion Abbe number.\r\n * @param value The Abbe number value\r\n */\r\n public set transmissionDispersionAbbeNumber(value: number) {\r\n if (value > 0) {\r\n this._material.subSurface.isDispersionEnabled = true;\r\n this._material.subSurface.dispersion = 20.0 / value;\r\n } else {\r\n this._material.subSurface.isDispersionEnabled = false;\r\n this._material.subSurface.dispersion = 0;\r\n }\r\n }\r\n\r\n /**\r\n * Configures transmission for thin-surface transmission (KHR_materials_transmission).\r\n * Sets up the material for proper thin-surface transmission behavior.\r\n */\r\n public configureTransmission(): void {\r\n // Since this extension models thin-surface transmission only, we must make IOR = 1.0\r\n this._material.subSurface.volumeIndexOfRefraction = 1.0;\r\n // Albedo colour will tint transmission.\r\n this._material.subSurface.useAlbedoToTintRefraction = true;\r\n this._material.subSurface.minimumThickness = 0.0;\r\n this._material.subSurface.maximumThickness = 0.0;\r\n }\r\n\r\n // ========================================\r\n // VOLUME PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets the thickness texture (mapped to PBR subSurface.thicknessTexture).\r\n * Automatically enables refraction.\r\n * @param value The thickness texture or null\r\n */\r\n public set volumeThicknessTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.thicknessTexture = value;\r\n this._material.subSurface.useGltfStyleTextures = true;\r\n }\r\n\r\n /**\r\n * Sets the thickness factor (mapped to PBR subSurface.maximumThickness).\r\n * Automatically enables refraction.\r\n * @param value The thickness value\r\n */\r\n public set volumeThickness(value: number) {\r\n this._material.subSurface.minimumThickness = 0.0;\r\n this._material.subSurface.maximumThickness = value;\r\n this._material.subSurface.useThicknessAsDepth = true;\r\n if (value > 0) {\r\n this._material.subSurface.volumeIndexOfRefraction = this._material.indexOfRefraction;\r\n }\r\n }\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 public configureSubsurface(): void {\r\n this._material.subSurface.useGltfStyleTextures = true;\r\n\r\n // Since this extension models thin-surface transmission only, we must make the\r\n // internal IOR == 1.0 and set the thickness to 0.\r\n this._material.subSurface.volumeIndexOfRefraction = 1.0;\r\n this._material.subSurface.minimumThickness = 0.0;\r\n this._material.subSurface.maximumThickness = 0.0;\r\n\r\n // Tint color will be used for transmission.\r\n this._material.subSurface.useAlbedoToTintTranslucency = false;\r\n }\r\n\r\n /**\r\n * Sets the subsurface weight\r\n */\r\n public set subsurfaceWeight(value: number) {\r\n this._material.subSurface.isTranslucencyEnabled = value > 0;\r\n this._material.subSurface.translucencyIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the subsurface weight\r\n * @returns The subsurface weight value\r\n */\r\n public get subsurfaceWeight(): number {\r\n return this._material.subSurface.isTranslucencyEnabled ? this._material.subSurface.translucencyIntensity : 0;\r\n }\r\n\r\n /**\r\n * Sets the subsurface weight texture\r\n */\r\n public set subsurfaceWeightTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.translucencyIntensityTexture = value;\r\n }\r\n\r\n /**\r\n * Sets the subsurface color.\r\n * @param value The subsurface tint color as a Color3\r\n */\r\n public set subsurfaceColor(value: Color3) {\r\n this._material.subSurface.tintColor = value;\r\n }\r\n\r\n /**\r\n * Sets the subsurface color texture.\r\n * @param value The subsurface tint texture or null\r\n */\r\n public set subsurfaceColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.translucencyColorTexture = value;\r\n }\r\n\r\n // ========================================\r\n // FUZZ LAYER (Sheen)\r\n // ========================================\r\n\r\n /**\r\n * Configures sheen for PBR material.\r\n * Enables sheen and sets up proper configuration.\r\n */\r\n public configureFuzz(): void {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.useRoughnessFromMainTexture = false;\r\n this._material.sheen.albedoScaling = true;\r\n }\r\n\r\n /**\r\n * Sets the sheen weight (mapped to PBR sheen.intensity).\r\n * Automatically enables sheen.\r\n * @param value The sheen weight value\r\n */\r\n public set fuzzWeight(value: number) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.intensity = value;\r\n }\r\n\r\n /**\r\n * Sets the sheen color (mapped to PBR sheen.color).\r\n * Automatically enables sheen.\r\n * @param value The sheen color as a Color3\r\n */\r\n public set fuzzColor(value: Color3) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.color = value;\r\n }\r\n\r\n /**\r\n * Sets the sheen color texture (mapped to PBR sheen.texture).\r\n * Automatically enables sheen.\r\n * @param value The sheen color texture or null\r\n */\r\n public set fuzzColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.texture = value;\r\n }\r\n\r\n /**\r\n * Sets the sheen roughness (mapped to PBR sheen.roughness).\r\n * Automatically enables sheen.\r\n * @param value The sheen roughness value (0-1)\r\n */\r\n public set fuzzRoughness(value: number) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.roughness = value;\r\n }\r\n\r\n /**\r\n * Sets the sheen roughness texture (mapped to PBR sheen.textureRoughness).\r\n * Automatically enables sheen.\r\n * @param value The sheen roughness texture or null\r\n */\r\n public set fuzzRoughnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.textureRoughness = value;\r\n }\r\n\r\n // ========================================\r\n // ANISOTROPY\r\n // ========================================\r\n\r\n /**\r\n * Sets the specular roughness anisotropy (mapped to PBR anisotropy.intensity).\r\n * Automatically enables anisotropy.\r\n * @param value The anisotropy intensity value\r\n */\r\n public set specularRoughnessAnisotropy(value: number) {\r\n this._material.anisotropy.isEnabled = true;\r\n this._material.anisotropy.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the specular roughness anisotropy.\r\n * @returns The anisotropy intensity value\r\n */\r\n public get specularRoughnessAnisotropy(): number {\r\n return this._material.anisotropy.intensity;\r\n }\r\n\r\n /**\r\n * Sets the anisotropy rotation (mapped to PBR anisotropy.angle).\r\n * Automatically enables anisotropy.\r\n * @param value The anisotropy rotation angle in radians\r\n */\r\n public set geometryTangentAngle(value: number) {\r\n this._material.anisotropy.isEnabled = true;\r\n this._material.anisotropy.angle = value;\r\n }\r\n\r\n /**\r\n * Sets the geometry tangent texture (mapped to PBR anisotropy.texture).\r\n * Automatically enables anisotropy.\r\n * @param value The anisotropy texture or null\r\n */\r\n public set geometryTangentTexture(value: Nullable<BaseTexture>) {\r\n this._material.anisotropy.isEnabled = true;\r\n this._material.anisotropy.texture = value;\r\n }\r\n\r\n /**\r\n * Gets the geometry tangent texture.\r\n * @returns The anisotropy texture or null\r\n */\r\n public get geometryTangentTexture(): Nullable<BaseTexture> {\r\n return this._material.anisotropy.texture;\r\n }\r\n\r\n /**\r\n * Configures glTF-style anisotropy for the material.\r\n * Note: PBR materials don't need this configuration, so this is a no-op.\r\n * @param useGltfStyle Whether to use glTF-style anisotropy (ignored for PBR)\r\n */\r\n public configureGltfStyleAnisotropy(useGltfStyle: boolean = true): void {\r\n // PBR materials don't need this configuration\r\n }\r\n\r\n // ========================================\r\n // THIN FILM IRIDESCENCE\r\n // ========================================\r\n\r\n /**\r\n * Sets the iridescence weight (mapped to PBR iridescence.intensity).\r\n * Automatically enables iridescence.\r\n * @param value The iridescence intensity value\r\n */\r\n public set iridescenceWeight(value: number) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.intensity = value;\r\n }\r\n\r\n /**\r\n * Sets the iridescence IOR (mapped to PBR iridescence.indexOfRefraction).\r\n * Automatically enables iridescence.\r\n * @param value The iridescence IOR value\r\n */\r\n public set iridescenceIor(value: number) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Sets the iridescence thickness minimum (mapped to PBR iridescence.minimumThickness).\r\n * Automatically enables iridescence.\r\n * @param value The minimum thickness value in nanometers\r\n */\r\n public set iridescenceThicknessMinimum(value: number) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.minimumThickness = value;\r\n }\r\n\r\n /**\r\n * Sets the iridescence thickness maximum (mapped to PBR iridescence.maximumThickness).\r\n * Automatically enables iridescence.\r\n * @param value The maximum thickness value in nanometers\r\n */\r\n public set iridescenceThicknessMaximum(value: number) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.maximumThickness = value;\r\n }\r\n\r\n /**\r\n * Sets the iridescence texture (mapped to PBR iridescence.texture).\r\n * Automatically enables iridescence.\r\n * @param value The iridescence intensity texture or null\r\n */\r\n public set iridescenceTexture(value: Nullable<BaseTexture>) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.texture = value;\r\n }\r\n\r\n /**\r\n * Sets the iridescence thickness texture (mapped to PBR iridescence.thicknessTexture).\r\n * Automatically enables iridescence.\r\n * @param value The iridescence thickness texture or null\r\n */\r\n public set iridescenceThicknessTexture(value: Nullable<BaseTexture>) {\r\n this._material.iridescence.isEnabled = true;\r\n this._material.iridescence.thicknessTexture = value;\r\n }\r\n\r\n // ========================================\r\n // DISPERSION\r\n // ========================================\r\n\r\n /**\r\n * Sets the transmission dispersion value.\r\n * Note: PBR doesn't have direct dispersion support, so this stores it as metadata.\r\n * @param value The dispersion value (stored as metadata)\r\n */\r\n public set transmissionDispersion(value: number) {\r\n // PBR doesn't have a direct dispersion property, this would need custom shader modification\r\n // For now, we'll store it as metadata\r\n (this._material as any)._dispersion = value;\r\n }\r\n\r\n // ========================================\r\n // UNLIT MATERIALS\r\n // ========================================\r\n\r\n /**\r\n * Sets whether the material is unlit.\r\n * @param value True to make the material unlit\r\n */\r\n public set unlit(value: boolean) {\r\n this._material.unlit = value;\r\n }\r\n\r\n // ========================================\r\n // GEOMETRY PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the geometry opacity (mapped to PBR alpha).\r\n * @param value The opacity value (0-1)\r\n */\r\n public set geometryOpacity(value: number) {\r\n this._material.alpha = value;\r\n }\r\n\r\n /**\r\n * Gets the geometry opacity.\r\n * @returns The opacity value (0-1)\r\n */\r\n public get geometryOpacity(): number {\r\n return this._material.alpha;\r\n }\r\n\r\n /**\r\n * Sets the geometry normal texture (mapped to PBR bumpTexture).\r\n * Also forces irradiance computation in fragment shader for better lighting.\r\n * @param value The normal texture or null\r\n */\r\n public set geometryNormalTexture(value: Nullable<BaseTexture>) {\r\n this._material.bumpTexture = value;\r\n this._material.forceIrradianceInFragment = true;\r\n }\r\n\r\n /**\r\n * Gets the geometry normal texture.\r\n * @returns The normal texture or null\r\n */\r\n public get geometryNormalTexture(): Nullable<BaseTexture> {\r\n return this._material.bumpTexture;\r\n }\r\n\r\n /**\r\n * Sets the normal map inversions for the material.\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 public setNormalMapInversions(invertX: boolean, invertY: boolean): void {\r\n this._material.invertNormalMapX = invertX;\r\n this._material.invertNormalMapY = invertY;\r\n }\r\n\r\n /**\r\n * Sets the geometry coat normal texture (mapped to PBR clearCoat.bumpTexture).\r\n * Automatically enables clear coat.\r\n * @param value The coat normal texture or null\r\n */\r\n public set geometryCoatNormalTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.bumpTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the geometry coat normal texture.\r\n * @returns The coat normal texture or null\r\n */\r\n public get geometryCoatNormalTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.bumpTexture;\r\n }\r\n\r\n /**\r\n * Sets the geometry coat normal texture scale.\r\n * @param value The scale value for the coat normal texture\r\n */\r\n public set geometryCoatNormalTextureScale(value: number) {\r\n if (this._material.clearCoat.bumpTexture) {\r\n this._material.clearCoat.bumpTexture.level = value;\r\n }\r\n }\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/loaders",
3
- "version": "8.29.0",
3
+ "version": "8.29.2",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,10 +18,10 @@
18
18
  "postcompile": "build-tools -c add-js-to-es6"
19
19
  },
20
20
  "devDependencies": {
21
- "@babylonjs/core": "^8.29.0",
21
+ "@babylonjs/core": "^8.29.2",
22
22
  "@dev/build-tools": "^1.0.0",
23
23
  "@lts/loaders": "^1.0.0",
24
- "babylonjs-gltf2interface": "^8.29.0"
24
+ "babylonjs-gltf2interface": "^8.29.2"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@babylonjs/core": "^8.0.0",
@@ -1,42 +0,0 @@
1
- import type { Nullable } from "@babylonjs/core/types.js";
2
- import type { Material } from "@babylonjs/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_anisotropy extension.
10
- */
11
- ["KHR_materials_clearcoat_anisotropy"]: {};
12
- }
13
- }
14
- /**
15
- * [Specification](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat_anisotropy)
16
- */
17
- export declare class KHR_materials_clearcoat_anisotropy implements IGLTFLoaderExtension {
18
- /**
19
- * The name of this extension.
20
- */
21
- readonly name = "KHR_materials_clearcoat_anisotropy";
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 _loadAnisotropyPropertiesAsync;
42
- }
@@ -1,66 +0,0 @@
1
- import { GLTFLoader } from "../glTFLoader.js";
2
- import { registerGLTFExtension, unregisterGLTFExtension } from "../glTFLoaderExtensionRegistry.js";
3
- const NAME = "KHR_materials_clearcoat_anisotropy";
4
- /**
5
- * [Specification](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat_anisotropy)
6
- */
7
- // eslint-disable-next-line @typescript-eslint/naming-convention
8
- export class KHR_materials_clearcoat_anisotropy {
9
- /**
10
- * @internal
11
- */
12
- constructor(loader) {
13
- /**
14
- * The name of this extension.
15
- */
16
- this.name = NAME;
17
- /**
18
- * Defines a number that determines the order the extensions are applied.
19
- */
20
- this.order = 195;
21
- this._loader = loader;
22
- this.enabled = this._loader.isExtensionUsed(NAME);
23
- }
24
- /** @internal */
25
- dispose() {
26
- this._loader = null;
27
- }
28
- /**
29
- * @internal
30
- */
31
- // eslint-disable-next-line no-restricted-syntax
32
- loadMaterialPropertiesAsync(context, material, babylonMaterial) {
33
- return GLTFLoader.LoadExtensionAsync(context, material, this.name, async (extensionContext, extension) => {
34
- const promises = new Array();
35
- promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
36
- promises.push(this._loadAnisotropyPropertiesAsync(extensionContext, extension, babylonMaterial));
37
- await Promise.all(promises);
38
- });
39
- }
40
- async _loadAnisotropyPropertiesAsync(context, properties, babylonMaterial) {
41
- const adapter = this._loader._getOrCreateMaterialAdapter(babylonMaterial);
42
- const promises = new Array();
43
- // Set non-texture properties immediately
44
- const clearcoatAnisotropyWeight = properties.clearcoatAnisotropyStrength ?? 0;
45
- const clearcoatAnisotropyAngle = properties.clearcoatAnisotropyRotation ?? 0;
46
- adapter.coatRoughnessAnisotropy = clearcoatAnisotropyWeight;
47
- adapter.geometryCoatTangentAngle = clearcoatAnisotropyAngle;
48
- // Check if this is glTF-style anisotropy
49
- const extensions = properties.extensions ?? {};
50
- if (!extensions.EXT_materials_anisotropy_openpbr || !extensions.EXT_materials_anisotropy_openpbr.openPbrAnisotropyEnabled) {
51
- adapter.configureGltfStyleAnisotropy(true);
52
- }
53
- // Load texture if present
54
- if (properties.clearcoatAnisotropyTexture) {
55
- properties.clearcoatAnisotropyTexture.nonColorData = true;
56
- promises.push(this._loader.loadTextureInfoAsync(`${context}/clearcoatAnisotropyTexture`, properties.clearcoatAnisotropyTexture, (texture) => {
57
- texture.name = `${babylonMaterial.name} (Clearcoat Anisotropy)`;
58
- adapter.geometryCoatTangentTexture = texture;
59
- }));
60
- }
61
- await Promise.all(promises);
62
- }
63
- }
64
- unregisterGLTFExtension(NAME);
65
- registerGLTFExtension(NAME, true, (loader) => new KHR_materials_clearcoat_anisotropy(loader));
66
- //# sourceMappingURL=KHR_materials_clearcoat_anisotropy.js.map
@@ -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,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,CAAmC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE;YACvI,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAgB,CAAC;YAC3C,QAAQ,CAAC,IAAI,CAAC,IAAI,C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AO,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 "@babylonjs/core/types.js";
2
- import type { Material } from "@babylonjs/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 "@babylonjs/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,4CAA8B;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,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,gDAAgD;IACzC,2BAA2B,CAAC,OAAe,EAAE,QAAmB,EAAE,eAAyB;QAC9F,OAAO,UAAU,CAAC,kBAAkB,CAA8B,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE;YAClI,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,CAAC;YAC5F,QAAQ,CAAC,I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,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 "@babylonjs/core/types.js";
2
- import type { Material } from "@babylonjs/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
- }