@babylonjs/loaders 9.32.1 → 9.33.0

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 (35) hide show
  1. package/SPLAT/gaussianSplattingWorkBuffer.js +1 -1
  2. package/SPLAT/gaussianSplattingWorkBuffer.js.map +1 -1
  3. package/SPLAT/sog.pure.js +2 -2
  4. package/SPLAT/sog.pure.js.map +1 -1
  5. package/glTF/2.0/Extensions/KHR_materials_scatter.d.ts +6 -0
  6. package/glTF/2.0/Extensions/KHR_materials_scatter.js +9 -0
  7. package/glTF/2.0/Extensions/KHR_materials_scatter.js.map +1 -0
  8. package/glTF/2.0/Extensions/KHR_materials_scatter.pure.d.ts +40 -0
  9. package/glTF/2.0/Extensions/KHR_materials_scatter.pure.js +105 -0
  10. package/glTF/2.0/Extensions/KHR_materials_scatter.pure.js.map +1 -0
  11. package/glTF/2.0/Extensions/KHR_materials_scatter.types.d.ts +9 -0
  12. package/glTF/2.0/Extensions/KHR_materials_scatter.types.js +2 -0
  13. package/glTF/2.0/Extensions/KHR_materials_scatter.types.js.map +1 -0
  14. package/glTF/2.0/Extensions/KHR_materials_volume_scatter.pure.js +2 -0
  15. package/glTF/2.0/Extensions/KHR_materials_volume_scatter.pure.js.map +1 -1
  16. package/glTF/2.0/Extensions/dynamic.js +5 -0
  17. package/glTF/2.0/Extensions/dynamic.js.map +1 -1
  18. package/glTF/2.0/Extensions/index.d.ts +1 -0
  19. package/glTF/2.0/Extensions/index.js +1 -0
  20. package/glTF/2.0/Extensions/index.js.map +1 -1
  21. package/glTF/2.0/Extensions/pure.d.ts +1 -0
  22. package/glTF/2.0/Extensions/pure.js +1 -0
  23. package/glTF/2.0/Extensions/pure.js.map +1 -1
  24. package/glTF/2.0/glTFLoader.pure.d.ts +7 -0
  25. package/glTF/2.0/glTFLoader.pure.js +29 -3
  26. package/glTF/2.0/glTFLoader.pure.js.map +1 -1
  27. package/glTF/2.0/materialLoadingAdapter.d.ts +23 -0
  28. package/glTF/2.0/materialLoadingAdapter.js.map +1 -1
  29. package/glTF/2.0/openpbrMaterialLoadingAdapter.d.ts +30 -4
  30. package/glTF/2.0/openpbrMaterialLoadingAdapter.js +172 -14
  31. package/glTF/2.0/openpbrMaterialLoadingAdapter.js.map +1 -1
  32. package/glTF/2.0/pbrMaterialLoadingAdapter.d.ts +89 -7
  33. package/glTF/2.0/pbrMaterialLoadingAdapter.js +278 -25
  34. package/glTF/2.0/pbrMaterialLoadingAdapter.js.map +1 -1
  35. package/package.json +4 -4
@@ -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,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAGlC;;;OAGG;IACH,YAAY,QAAkB;QALtB,kBAAa,GAAY,KAAK,CAAC;QAMnC,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;;;OAGG;IACI,KAAK,CAAC,aAAa,CAAC,OAAmB,IAAkB,CAAC;IAEjE;;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;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H,IAAW,eAAe,CAAC,KAAa;QACpC,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;IACjC,CAAC;IAED;;;OAGG;IACH,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,IAAW,qBAAqB,CAAC,KAA4B;QACzD,IAAI,CAAC,SAAS,CAAC,WAAW,GAAG,KAAK,CAAC;QACnC,IAAI,CAAC,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.pure\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { type IMaterialLoadingAdapter } from \"./materialLoadingAdapter\";\r\nimport { type GLTFLoader } from \"./glTFLoader\";\r\nimport { Vector3 } from \"core/Maths/math.vector.pure\";\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 private _specWorkflow: boolean = false;\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 * No-op: PBRMaterial has no deferred finalization.\r\n * @param _loader Unused.\r\n */\r\n public async finalizeAsync(_loader: GLTFLoader): Promise<void> {}\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 * Enable the specular/glossiness workflow and disable metallic/roughness.\r\n */\r\n public configureSpecularGlossiness(): void {\r\n this._specWorkflow = true;\r\n this._material.metallic = null;\r\n this._material.roughness = null;\r\n this._material.useMicroSurfaceFromReflectivityMapAlpha = true;\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 if (this._specWorkflow) {\r\n this._material.reflectivityColor = value;\r\n } else {\r\n this._material.metallicReflectanceColor = value;\r\n }\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 if (this._specWorkflow) {\r\n return this._material.reflectivityColor;\r\n } else {\r\n return this._material.metallicReflectanceColor;\r\n }\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 if (this._specWorkflow) {\r\n this._material.reflectivityTexture = value;\r\n if (this._material.reflectivityTexture) {\r\n this._material.reflectivityTexture.hasAlpha = true;\r\n }\r\n } else {\r\n this._material.reflectanceTexture = value;\r\n }\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 if (this._specWorkflow) {\r\n return this._material.reflectivityTexture;\r\n } else {\r\n return this._material.reflectanceTexture;\r\n }\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 * Sets/gets the glossiness (inverted roughness)\r\n * ONLY used for specular/glossiness workflow; has no effect when metallic/roughness workflow is active\r\n */\r\n public get glossiness(): number {\r\n return this._material.microSurface ?? 1;\r\n }\r\n\r\n /**\r\n * Sets/gets the glossiness (inverted roughness)\r\n * ONLY used for specular/glossiness workflow; has no effect when metallic/roughness workflow is active\r\n */\r\n public set glossiness(value: number) {\r\n this._material.microSurface = value;\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.isRefractionEnabled ? this._material.subSurface.refractionIntensity : 0;\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.\r\n * @param value The attenuation distance value\r\n */\r\n public set transmissionDepth(value: number) {\r\n if (this.transmissionWeight > 0) {\r\n this._material.subSurface.tintColorAtDistance = value;\r\n } else if (this.subsurfaceWeight > 0) {\r\n this._material.subSurface.diffusionDistance.multiplyInPlace(new Color3(value, value, value));\r\n }\r\n }\r\n\r\n /**\r\n * Gets the attenuation distance for volume.\r\n * @returns The attenuation distance value\r\n */\r\n public get transmissionDepth(): number {\r\n if (this.transmissionWeight > 0) {\r\n return this._material.subSurface.tintColorAtDistance;\r\n }\r\n return 0;\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 if (this.transmissionWeight > 0) {\r\n this._material.subSurface.tintColor = value;\r\n } else if (this.subsurfaceWeight > 0) {\r\n this._material.subSurface.diffusionDistance.multiplyInPlace(value);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the attenuation color (mapped to PBR subSurface.tintColor).\r\n * @returns The attenuation color as a Color3\r\n */\r\n public get transmissionColor(): Color3 {\r\n if (this.transmissionWeight > 0) {\r\n return this._material.subSurface.tintColor;\r\n } else if (this.subsurfaceWeight > 0) {\r\n return this._material.subSurface.diffusionDistance;\r\n }\r\n return new Color3(0, 0, 0);\r\n }\r\n\r\n /**\r\n * Sets the transmission scatter coefficient.\r\n * @param value The scatter coefficient as a Color3\r\n */\r\n public set transmissionScatter(value: Color3) {\r\n // TODO convert from scatter coefficient to diffusion distance\r\n this._material.subSurface.diffusionDistance = value;\r\n }\r\n\r\n /**\r\n * Sets the transmission scatter coefficient.\r\n * @returns The scatter coefficient as a Color3\r\n */\r\n public get transmissionScatter(): Color3 {\r\n // TODO convert from diffusion distance to scatter coefficient\r\n return this._material.subSurface.diffusionDistance;\r\n }\r\n\r\n public set transmissionScatterTexture(value: Nullable<BaseTexture>) {}\r\n\r\n /**\r\n * Sets the transmission scattering anisotropy.\r\n * @param value The anisotropy intensity value (-1 to 1)\r\n */\r\n public set transmissionScatterAnisotropy(value: number) {\r\n // No direct mapping in PBRMaterial\r\n }\r\n\r\n /**\r\n * Sets the transmission dispersion Abbe number.\r\n * @param value The Abbe number value\r\n */\r\n public set transmissionDispersionAbbeNumber(value: number) {\r\n // PBRMaterial assumes a fixed Abbe number of 20.0 for dispersion calculations.\r\n }\r\n\r\n /**\r\n * Sets the transmission dispersion scale.\r\n * @param value The dispersion scale value\r\n */\r\n public set transmissionDispersionScale(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 * Gets the refraction background texture\r\n * @returns The refraction background texture or null\r\n */\r\n public get refractionBackgroundTexture(): Nullable<BaseTexture> {\r\n return this._material.subSurface.refractionTexture;\r\n }\r\n\r\n /**\r\n * Sets the refraction background texture\r\n * @param value The refraction background texture or null\r\n */\r\n public set refractionBackgroundTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.refractionTexture = value;\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 * Configures volume properties for PBR material. Nothing to do for PBRMaterial.\r\n */\r\n public configureVolume(): void {}\r\n\r\n /**\r\n * Sets whether the material is thin-walled (i.e. non-volumetric) or not.\r\n */\r\n public set geometryThinWalled(value: boolean) {}\r\n\r\n /**\r\n * Gets whether the material is thin-walled (i.e. non-volumetric) or not.\r\n */\r\n public get geometryThinWalled(): boolean {\r\n return this._material.subSurface.maximumThickness === 0;\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 // PBRMaterial does not have a direct equivalent for subsurface color,\r\n // We could set the base color to this value, wherever subsurfaceWeight > 0\r\n // When scatterAnisotropy is 1, I believe we can approximate the subsurface effect quite well with\r\n // Translucency and a diffusion distance\r\n const extinctionCoefficient = new Vector3(-Math.log(this.transmissionColor.r), -Math.log(this.transmissionColor.g), -Math.log(this.transmissionColor.b));\r\n extinctionCoefficient.scaleInPlace(1 / Math.max(this.transmissionDepth, 0.001));\r\n const absorptionCoeff = extinctionCoefficient;\r\n const maxChannel = Math.max(absorptionCoeff.x, Math.max(absorptionCoeff.y, absorptionCoeff.z));\r\n const attenuationDistance = maxChannel > 0 ? 1.0 / maxChannel : 1;\r\n this._material.subSurface.diffusionDistance = new Color3(\r\n Math.exp(-absorptionCoeff.x * attenuationDistance),\r\n Math.exp(-absorptionCoeff.y * attenuationDistance),\r\n Math.exp(-absorptionCoeff.z * attenuationDistance)\r\n );\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 // PBRMaterial does not have a direct equivalent for subsurface color texture,\r\n }\r\n\r\n /**\r\n * Sets the surface tint of the material (when using subsurface scattering)\r\n */\r\n public set diffuseTransmissionTint(value: Color3) {\r\n this._material.subSurface.tintColor = value;\r\n }\r\n\r\n /**\r\n * Gets the subsurface constant tint (when using subsurface scattering)\r\n * @returns The subsurface constant tint as a Color3\r\n */\r\n public get diffuseTransmissionTint(): Color3 {\r\n return this._material.subSurface.tintColor;\r\n }\r\n\r\n /**\r\n * Sets the subsurface constant tint texture (when using subsurface scattering)\r\n * @param value The subsurface constant tint texture or null\r\n */\r\n public set diffuseTransmissionTintTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.translucencyColorTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the subsurface radius (used for subsurface scattering)\r\n * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.\r\n * @returns The subsurface radius as a Color3\r\n */\r\n public get subsurfaceRadius(): number {\r\n return 1.0;\r\n }\r\n\r\n /**\r\n * Sets the subsurface radius (used for subsurface scattering)\r\n * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.\r\n * @param value The subsurface radius as a number\r\n */\r\n public set subsurfaceRadius(value: number) {\r\n //\r\n }\r\n\r\n /**\r\n * Gets the subsurface radius scale (used for subsurface scattering)\r\n * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.\r\n * @returns The subsurface radius scale as a Color3\r\n */\r\n public get subsurfaceRadiusScale(): Color3 {\r\n return this._material.subSurface.scatteringDiffusionProfile ?? Color3.White();\r\n }\r\n\r\n /**\r\n * Sets the subsurface radius scale (used for subsurface scattering)\r\n * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.\r\n * @param value The subsurface radius scale as a Color3\r\n */\r\n public set subsurfaceRadiusScale(value: Color3) {\r\n this._material.subSurface.scatteringDiffusionProfile = value;\r\n }\r\n\r\n /**\r\n * Sets the subsurface scattering anisotropy.\r\n * Note: PBRMaterial does not have a direct equivalent, so this is a no-op.\r\n * @param value The anisotropy intensity value (ignored for PBR)\r\n */\r\n public set subsurfaceScatterAnisotropy(value: number) {\r\n // No equivalent in PBRMaterial\r\n }\r\n\r\n /**\r\n * Does this material have a translucent surface (i.e. either transmission or subsurface)?\r\n * @returns True if the material is translucent, false otherwise\r\n */\r\n public isTranslucent(): boolean {\r\n return this.transmissionWeight > 0 || this.subsurfaceWeight > 0;\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 fuzz weight texture.\r\n * @param value The fuzz weight texture or null\r\n */\r\n public set fuzzWeightTexture(value: Nullable<BaseTexture>) {\r\n // PBRMaterial sheen supports glTF-style sheen which doesn't\r\n // use a separate texture for intensity. So we'll only set the\r\n // weight texture if none is already assigned. If one's already\r\n // assigned, we assume it contains the sheen color data.\r\n if (!this._material.sheen.texture) {\r\n this._material.sheen.texture = value;\r\n }\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.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 thinFilmWeight(value: number) {\r\n this._material.iridescence.isEnabled = value > 0;\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 * @param value The iridescence IOR value\r\n */\r\n public set thinFilmIor(value: number) {\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 * @param value The minimum thickness value in nanometers\r\n */\r\n public set thinFilmThicknessMinimum(value: number) {\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 * @param value The maximum thickness value in nanometers\r\n */\r\n public set thinFilmThicknessMaximum(value: number) {\r\n this._material.iridescence.maximumThickness = value;\r\n }\r\n\r\n /**\r\n * Sets the thin film weight texture (mapped to PBR iridescence.texture).\r\n * @param value The thin film weight texture or null\r\n */\r\n public set thinFilmWeightTexture(value: Nullable<BaseTexture>) {\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 * @param value The iridescence thickness texture or null\r\n */\r\n public set thinFilmThicknessTexture(value: Nullable<BaseTexture>) {\r\n this._material.iridescence.thicknessTexture = 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,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EACH,mBAAmB,EACnB,8BAA8B,EAC9B,sBAAsB,EAGtB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,6BAA6B,GAChC,MAAM,0CAA0C,CAAC;AAGlD;;;;;GAKG;AACH,SAAS,yBAAyB,CAAC,KAAY;IAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC;IACzC,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,2BAA2B,EAAE,CAAC;QAC9D,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,iBAAiB,EAAE,CAAC;IACxD,CAAC;IACD,IAAI,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,+BAA+B,EAAE,CAAC;QACtE,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,sBAAsB,EAAE,CAAC;IAC7D,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,yBA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AE,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, Color4 } from \"core/Maths/math.color.pure\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { type IMaterialLoadingAdapter } from \"./materialLoadingAdapter\";\r\nimport { type GLTFLoader } from \"./glTFLoader\";\r\nimport {\r\n CreateFactorOperand,\r\n CreateTextureWithFactorOperand,\r\n ExtractMaxChannelAsync,\r\n type ITextureProcessOperand,\r\n type ITextureProcessorOutputOptions,\r\n LerpTexturesAsync,\r\n TextureChannel,\r\n TextureColorSpace,\r\n ThinWalledScatterWeightsAsync,\r\n} from \"core/Materials/Textures/textureProcessor\";\r\nimport { type Scene } from \"core/scene\";\r\n\r\n/**\r\n * Render-target options for intermediate texture processor passes: filterable floating point when the\r\n * engine can render to it, so that only the final textures are quantized to 8 bits.\r\n * @param scene the scene whose engine renders the passes\r\n * @returns output options for an intermediate pass\r\n */\r\nfunction IntermediateOutputOptions(scene: Scene): ITextureProcessorOutputOptions {\r\n const caps = scene.getEngine().getCaps();\r\n if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {\r\n return { textureType: Constants.TEXTURETYPE_FLOAT };\r\n }\r\n if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {\r\n return { textureType: Constants.TEXTURETYPE_HALF_FLOAT };\r\n }\r\n return { textureType: Constants.TEXTURETYPE_UNSIGNED_BYTE };\r\n}\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 private _specWorkflow: boolean = false;\r\n private _volumetricScatterStrengthFactor: Nullable<number> = null;\r\n private _volumetricScatterStrengthTexture: Nullable<BaseTexture> = null;\r\n private _thinWalledScatterStrengthFactor: Nullable<number> = null;\r\n private _thinWalledScatterStrengthTexture: Nullable<BaseTexture> = null;\r\n private _transmissionScatterTexture: Nullable<BaseTexture> = null;\r\n private _subsurfaceColorTexture: Nullable<BaseTexture> = null;\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 * Finalizes material properties after all loading is complete.\r\n * @param loader The glTF loader that created the material.\r\n */\r\n public async finalizeAsync(loader: GLTFLoader): Promise<void> {\r\n // Thin-walled KHR_materials_scatter stages its scatter strength S; convert it together with the\r\n // transmission T only now that every texture has loaded.\r\n const thinScatterStrength = this._thinWalledScatterStrengthFactor;\r\n const thinScatterTex = this._thinWalledScatterStrengthTexture;\r\n this._thinWalledScatterStrengthFactor = null;\r\n this._thinWalledScatterStrengthTexture = null;\r\n if (thinScatterStrength !== null && (thinScatterStrength > 0 || thinScatterTex)) {\r\n await this._applyThinWalledScatterAsync(loader, thinScatterStrength, thinScatterTex);\r\n if (loader._disposed) {\r\n return;\r\n }\r\n } else {\r\n this._disposeTextureIfUnused(loader, thinScatterTex);\r\n }\r\n\r\n // Volumetric KHR_materials_scatter maps to PBR translucency, applied only to the transmitted fraction\r\n // of each texel (see _applyVolumetricScatterAsync). The staged textures are applied here, after every\r\n // texture has loaded, so they deterministically replace any KHR_materials_diffuse_transmission\r\n // textures, whose async loads can otherwise resolve after these.\r\n // The subsurface color texture (thin-walled KHR_materials_scatter, KHR_materials_volume_scatter)\r\n // tints translucency through translucencyColorTexture and is applied here for the same reason.\r\n // Volumetric scatter only acts on transmitted light, so without transmission it has no visible\r\n // effect and must leave translucency (e.g. from KHR_materials_diffuse_transmission) untouched.\r\n const strengthTex = this._volumetricScatterStrengthTexture;\r\n const transmissionScatterTex = this._transmissionScatterTexture;\r\n const subsurfaceColorTex = this._subsurfaceColorTexture;\r\n const scatterStrength = this._volumetricScatterStrengthFactor;\r\n this._volumetricScatterStrengthFactor = null;\r\n this._volumetricScatterStrengthTexture = null;\r\n this._transmissionScatterTexture = null;\r\n this._subsurfaceColorTexture = null;\r\n const applyScatter = scatterStrength !== null && this.transmissionWeight > 0;\r\n const colorTex = (applyScatter ? transmissionScatterTex : null) ?? subsurfaceColorTex;\r\n\r\n const subSurface = this._material.subSurface;\r\n if (applyScatter) {\r\n await this._applyVolumetricScatterAsync(loader, scatterStrength, strengthTex);\r\n if (loader._disposed) {\r\n return;\r\n }\r\n }\r\n if (colorTex && subSurface.translucencyColorTexture !== colorTex) {\r\n const oldColorTexture = subSurface.translucencyColorTexture;\r\n subSurface.translucencyColorTexture = colorTex;\r\n this._disposeTextureIfUnused(loader, oldColorTexture);\r\n }\r\n\r\n // Dispose staged textures that weren't applied. The strength texture is baked into the\r\n // translucency intensity, so it's never applied directly.\r\n for (const texture of [strengthTex, transmissionScatterTex, subsurfaceColorTex]) {\r\n if (texture !== colorTex) {\r\n this._disposeTextureIfUnused(loader, texture);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Converts volumetric scatter strength S into the PBR translucency intensity. Volumetric scatter only\r\n * acts on the transmitted fraction T of the surface, so per texel the intensity blends from any\r\n * independently configured diffuse transmission D (where T = 0) to S (where T = 1): D + T * (S - D).\r\n * The staged strength texture isn't disposed here.\r\n * @param loader The glTF loader that created the material\r\n * @param scatterStrength The scatter strength factor\r\n * @param strengthTex The scatter strength texture (alpha channel) or null\r\n */\r\n private async _applyVolumetricScatterAsync(loader: GLTFLoader, scatterStrength: number, strengthTex: Nullable<BaseTexture>): Promise<void> {\r\n const subSurface = this._material.subSurface;\r\n const scene = this._material.getScene();\r\n const name = this._material.name;\r\n const transmissionFactor = this.transmissionWeight;\r\n const transmissionTex = subSurface.refractionIntensityTexture;\r\n const oldIntensityTexture = subSurface.translucencyIntensityTexture;\r\n const diffuseFactor = this.subsurfaceWeight;\r\n const diffuseTex = diffuseFactor > 0 ? oldIntensityTexture : null;\r\n\r\n // The translucency intensity is read from the alpha channel, but T is in the red channel of the\r\n // transmission texture and the channel swizzles keep the source alpha. So T is first broadcast to all\r\n // four channels (zeroing the source alpha before the max), in a floating point target when possible.\r\n let transmission: ITextureProcessOperand;\r\n if (transmissionTex) {\r\n transmission = await ExtractMaxChannelAsync(\r\n `${name}_scatterTransmission`,\r\n CreateTextureWithFactorOperand(transmissionTex, new Color4(transmissionFactor, transmissionFactor, transmissionFactor, 0), TextureChannel.R),\r\n scene,\r\n true,\r\n TextureColorSpace.Linear,\r\n undefined,\r\n IntermediateOutputOptions(scene)\r\n );\r\n if (loader._disposed) {\r\n transmission.dispose?.();\r\n return;\r\n }\r\n } else {\r\n transmission = CreateFactorOperand(new Color4(transmissionFactor, transmissionFactor, transmissionFactor, transmissionFactor));\r\n }\r\n\r\n const intensity = await LerpTexturesAsync(\r\n `${name}_scatterTranslucency`,\r\n CreateTextureWithFactorOperand(diffuseTex, new Color4(diffuseFactor, diffuseFactor, diffuseFactor, diffuseFactor), TextureChannel.A),\r\n CreateTextureWithFactorOperand(strengthTex, new Color4(scatterStrength, scatterStrength, scatterStrength, scatterStrength), TextureChannel.A),\r\n transmission,\r\n scene\r\n );\r\n if (loader._disposed) {\r\n intensity.dispose?.();\r\n return;\r\n }\r\n\r\n if (intensity.texture) {\r\n subSurface.isTranslucencyEnabled = true;\r\n subSurface.translucencyIntensity = 1.0;\r\n subSurface.translucencyIntensityTexture = intensity.texture;\r\n subSurface.useGltfStyleTextures = true;\r\n } else {\r\n const value = intensity.factor?.a ?? 0;\r\n subSurface.isTranslucencyEnabled = value > 0;\r\n subSurface.translucencyIntensity = value;\r\n subSurface.translucencyIntensityTexture = null;\r\n }\r\n this._disposeTextureIfUnused(loader, oldIntensityTexture);\r\n }\r\n\r\n /**\r\n * Converts thin-walled scatter strength S into PBR refraction and translucency intensities.\r\n * S turns a fraction of the transmission T into diffuse transmission, so per texel the coherent\r\n * transmission is T * (1 - S). PBR applies translucency to the surface left over by refraction, so\r\n * the translucency intensity is T * S / (1 - T * (1 - S)), which keeps the diffusely transmitted\r\n * light at T * S and the reflected diffuse at 1 - T.\r\n * @param loader The glTF loader that created the material\r\n * @param scatterStrength The scatter strength factor\r\n * @param scatterTex The scatter strength texture (alpha channel) or null\r\n */\r\n private async _applyThinWalledScatterAsync(loader: GLTFLoader, scatterStrength: number, scatterTex: Nullable<BaseTexture>): Promise<void> {\r\n const subSurface = this._material.subSurface;\r\n const transmissionFactor = this.transmissionWeight;\r\n if (transmissionFactor <= 0) {\r\n // Nothing to convert; keep any independently configured diffuse transmission.\r\n this._disposeTextureIfUnused(loader, scatterTex);\r\n return;\r\n }\r\n const transmissionTex = subSurface.refractionIntensityTexture;\r\n const scene = this._material.getScene();\r\n const name = this._material.name;\r\n\r\n // The weights are computed from the red channel of T and S and broadcast to all four channels, so\r\n // they serve both PBR's refraction intensity (red) and translucency intensity (alpha). T is passed\r\n // with its factor unbaked so that it isn't quantized before the weights are computed.\r\n const weights = await ThinWalledScatterWeightsAsync(\r\n name,\r\n CreateTextureWithFactorOperand(transmissionTex, new Color4(transmissionFactor, transmissionFactor, transmissionFactor, transmissionFactor), TextureChannel.R),\r\n CreateTextureWithFactorOperand(scatterTex, new Color4(scatterStrength, scatterStrength, scatterStrength, scatterStrength), TextureChannel.A),\r\n scene\r\n );\r\n if (loader._disposed) {\r\n weights.transmission.dispose?.();\r\n weights.subsurface.dispose?.();\r\n return;\r\n }\r\n\r\n if (weights.transmission.texture) {\r\n this.transmissionWeight = 1.0;\r\n subSurface.refractionIntensityTexture = weights.transmission.texture;\r\n subSurface.useGltfStyleTextures = true;\r\n this._disposeTextureIfUnused(loader, transmissionTex);\r\n } else {\r\n this.transmissionWeight = weights.transmission.factor?.r ?? 0;\r\n }\r\n\r\n if (weights.subsurface.texture) {\r\n const oldTranslucencyTexture = subSurface.translucencyIntensityTexture;\r\n this.subsurfaceWeight = 1.0;\r\n subSurface.translucencyIntensityTexture = weights.subsurface.texture;\r\n subSurface.useGltfStyleTextures = true;\r\n this._disposeTextureIfUnused(loader, oldTranslucencyTexture);\r\n } else {\r\n this.subsurfaceWeight = weights.subsurface.factor?.r ?? 0;\r\n }\r\n this._disposeTextureIfUnused(loader, scatterTex);\r\n }\r\n\r\n /**\r\n * Disposes a texture that has been replaced on this material, unless another slot on this\r\n * material (or on any other material created by the loader) still references it.\r\n * Must be called after the texture has been removed from the slot being replaced.\r\n * @param loader The glTF loader that created the materials\r\n * @param texture The replaced texture\r\n */\r\n private _disposeTextureIfUnused(loader: GLTFLoader, texture: Nullable<BaseTexture>): void {\r\n if (texture && !loader._isTextureUsedByMaterials(texture)) {\r\n texture.dispose();\r\n }\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 * Enable the specular/glossiness workflow and disable metallic/roughness.\r\n */\r\n public configureSpecularGlossiness(): void {\r\n this._specWorkflow = true;\r\n this._material.metallic = null;\r\n this._material.roughness = null;\r\n this._material.useMicroSurfaceFromReflectivityMapAlpha = true;\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 if (this._specWorkflow) {\r\n this._material.reflectivityColor = value;\r\n } else {\r\n this._material.metallicReflectanceColor = value;\r\n }\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 if (this._specWorkflow) {\r\n return this._material.reflectivityColor;\r\n } else {\r\n return this._material.metallicReflectanceColor;\r\n }\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 if (this._specWorkflow) {\r\n this._material.reflectivityTexture = value;\r\n if (this._material.reflectivityTexture) {\r\n this._material.reflectivityTexture.hasAlpha = true;\r\n }\r\n } else {\r\n this._material.reflectanceTexture = value;\r\n }\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 if (this._specWorkflow) {\r\n return this._material.reflectivityTexture;\r\n } else {\r\n return this._material.reflectanceTexture;\r\n }\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 * Sets/gets the glossiness (inverted roughness)\r\n * ONLY used for specular/glossiness workflow; has no effect when metallic/roughness workflow is active\r\n */\r\n public get glossiness(): number {\r\n return this._material.microSurface ?? 1;\r\n }\r\n\r\n /**\r\n * Sets/gets the glossiness (inverted roughness)\r\n * ONLY used for specular/glossiness workflow; has no effect when metallic/roughness workflow is active\r\n */\r\n public set glossiness(value: number) {\r\n this._material.microSurface = value;\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.isRefractionEnabled ? this._material.subSurface.refractionIntensity : 0;\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.\r\n * @param value The attenuation distance value\r\n */\r\n public set transmissionDepth(value: number) {\r\n if (this.transmissionWeight > 0) {\r\n this._material.subSurface.tintColorAtDistance = value;\r\n } else if (this.subsurfaceWeight > 0) {\r\n this._material.subSurface.diffusionDistance.multiplyInPlace(new Color3(value, value, value));\r\n }\r\n }\r\n\r\n /**\r\n * Gets the attenuation distance for volume.\r\n * @returns The attenuation distance value\r\n */\r\n public get transmissionDepth(): number {\r\n if (this.transmissionWeight > 0) {\r\n return this._material.subSurface.tintColorAtDistance;\r\n }\r\n return 0;\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 if (this.transmissionWeight > 0) {\r\n this._material.subSurface.tintColor = value;\r\n } else if (this.subsurfaceWeight > 0) {\r\n this._material.subSurface.diffusionDistance.multiplyInPlace(value);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the attenuation color (mapped to PBR subSurface.tintColor).\r\n * @returns The attenuation color as a Color3\r\n */\r\n public get transmissionColor(): Color3 {\r\n if (this.transmissionWeight > 0) {\r\n return this._material.subSurface.tintColor;\r\n } else if (this.subsurfaceWeight > 0) {\r\n return this._material.subSurface.diffusionDistance;\r\n }\r\n return new Color3(0, 0, 0);\r\n }\r\n\r\n /**\r\n * Sets the transmission scatter coefficient, scaled by transmissionDepth.\r\n * @param value The scatter coefficient * transmissionDepth as a Color3\r\n */\r\n public set transmissionScatter(value: Color3) {\r\n this._material.subSurface.translucencyColor = value;\r\n }\r\n\r\n /**\r\n * Gets the transmission scatter coefficient, scaled by transmissionDepth.\r\n * @returns The scatter coefficient * transmissionDepth as a Color3\r\n */\r\n public get transmissionScatter(): Color3 {\r\n // Callers may mutate the result in place, so never return the attenuation tint itself. Until a scatter\r\n // color is set, the renderer falls back to the tint, so start from a copy of it to keep the same look.\r\n if (!this._material.subSurface.translucencyColor) {\r\n this._material.subSurface.translucencyColor = this._material.subSurface.tintColor.clone();\r\n }\r\n return this._material.subSurface.translucencyColor;\r\n }\r\n\r\n /**\r\n * Sets the transmission scatter texture.\r\n * Staged and applied to subSurface.translucencyColorTexture in finalizeAsync.\r\n * @param value The multiscatter color texture or null\r\n */\r\n public set transmissionScatterTexture(value: Nullable<BaseTexture>) {\r\n this._transmissionScatterTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the staged transmission scatter texture.\r\n * @returns The staged multiscatter color texture or null\r\n */\r\n public get transmissionScatterTexture(): Nullable<BaseTexture> {\r\n return this._transmissionScatterTexture;\r\n }\r\n\r\n /** @internal */\r\n public set volumetricScatterStrengthFactor(value: Nullable<number>) {\r\n // Staged and applied in finalizeAsync, once the transmission weight is known.\r\n this._volumetricScatterStrengthFactor = value;\r\n }\r\n\r\n /** @internal */\r\n public get volumetricScatterStrengthFactor(): Nullable<number> {\r\n return this._volumetricScatterStrengthFactor;\r\n }\r\n\r\n /**\r\n * Sets the volumetric scatter strength texture.\r\n * Staged and applied to subSurface.translucencyIntensityTexture in finalizeAsync.\r\n * @param value The scatter strength texture (alpha channel) or null\r\n */\r\n public set volumetricScatterStrengthTexture(value: Nullable<BaseTexture>) {\r\n this._volumetricScatterStrengthTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the staged volumetric scatter strength texture.\r\n * @returns The staged scatter strength texture or null\r\n */\r\n public get volumetricScatterStrengthTexture(): Nullable<BaseTexture> {\r\n return this._volumetricScatterStrengthTexture;\r\n }\r\n\r\n /**\r\n * Sets the thin-walled scatter strength.\r\n * Staged and converted, together with the transmission weight, in finalizeAsync.\r\n * @internal\r\n */\r\n public set thinWalledScatterStrengthFactor(value: Nullable<number>) {\r\n this._thinWalledScatterStrengthFactor = value;\r\n }\r\n\r\n /** @internal */\r\n public get thinWalledScatterStrengthFactor(): Nullable<number> {\r\n return this._thinWalledScatterStrengthFactor;\r\n }\r\n\r\n /**\r\n * Sets the thin-walled scatter strength texture (alpha channel).\r\n * Staged and converted, together with the transmission weight, in finalizeAsync.\r\n * @internal\r\n */\r\n public set thinWalledScatterStrengthTexture(value: Nullable<BaseTexture>) {\r\n this._thinWalledScatterStrengthTexture = value;\r\n }\r\n\r\n /** @internal */\r\n public get thinWalledScatterStrengthTexture(): Nullable<BaseTexture> {\r\n return this._thinWalledScatterStrengthTexture;\r\n }\r\n\r\n /**\r\n * Sets the transmission scattering anisotropy.\r\n * @param value The anisotropy intensity value (-1 to 1)\r\n */\r\n public set transmissionScatterAnisotropy(value: number) {\r\n // No direct mapping in PBRMaterial\r\n }\r\n\r\n /**\r\n * Sets the transmission dispersion Abbe number.\r\n * @param value The Abbe number value\r\n */\r\n public set transmissionDispersionAbbeNumber(value: number) {\r\n // PBRMaterial assumes a fixed Abbe number of 20.0 for dispersion calculations.\r\n }\r\n\r\n /**\r\n * Sets the transmission dispersion scale.\r\n * @param value The dispersion scale value\r\n */\r\n public set transmissionDispersionScale(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 * Gets the refraction background texture\r\n * @returns The refraction background texture or null\r\n */\r\n public get refractionBackgroundTexture(): Nullable<BaseTexture> {\r\n return this._material.subSurface.refractionTexture;\r\n }\r\n\r\n /**\r\n * Sets the refraction background texture\r\n * @param value The refraction background texture or null\r\n */\r\n public set refractionBackgroundTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.refractionTexture = value;\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 * Configures volume properties for PBR material. Nothing to do for PBRMaterial.\r\n */\r\n public configureVolume(): void {}\r\n\r\n /**\r\n * Sets whether the material is thin-walled (i.e. non-volumetric) or not.\r\n */\r\n public set geometryThinWalled(value: boolean) {}\r\n\r\n /**\r\n * Gets whether the material is thin-walled (i.e. non-volumetric) or not.\r\n */\r\n public get geometryThinWalled(): boolean {\r\n return this._material.subSurface.maximumThickness === 0;\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.translucencyColor = value;\r\n }\r\n\r\n /**\r\n * Sets the subsurface color texture.\r\n * Staged and applied to subSurface.translucencyColorTexture in finalizeAsync.\r\n * @param value The subsurface tint texture or null\r\n */\r\n public set subsurfaceColorTexture(value: Nullable<BaseTexture>) {\r\n this._subsurfaceColorTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the staged subsurface color texture.\r\n * @returns The staged subsurface tint texture or null\r\n */\r\n public get subsurfaceColorTexture(): Nullable<BaseTexture> {\r\n return this._subsurfaceColorTexture;\r\n }\r\n\r\n /**\r\n * Sets the surface tint of the material (when using subsurface scattering)\r\n */\r\n public set diffuseTransmissionTint(value: Color3) {\r\n this._material.subSurface.tintColor = value;\r\n }\r\n\r\n /**\r\n * Gets the subsurface constant tint (when using subsurface scattering)\r\n * @returns The subsurface constant tint as a Color3\r\n */\r\n public get diffuseTransmissionTint(): Color3 {\r\n return this._material.subSurface.tintColor;\r\n }\r\n\r\n /**\r\n * Sets the subsurface constant tint texture (when using subsurface scattering)\r\n * @param value The subsurface constant tint texture or null\r\n */\r\n public set diffuseTransmissionTintTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.translucencyColorTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the subsurface radius (used for subsurface scattering)\r\n * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.\r\n * @returns The subsurface radius as a Color3\r\n */\r\n public get subsurfaceRadius(): number {\r\n return 1.0;\r\n }\r\n\r\n /**\r\n * Sets the subsurface radius (used for subsurface scattering)\r\n * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.\r\n * @param value The subsurface radius as a number\r\n */\r\n public set subsurfaceRadius(value: number) {\r\n //\r\n }\r\n\r\n /**\r\n * Gets the subsurface radius scale (used for subsurface scattering)\r\n * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.\r\n * @returns The subsurface radius scale as a Color3\r\n */\r\n public get subsurfaceRadiusScale(): Color3 {\r\n return this._material.subSurface.scatteringDiffusionProfile ?? Color3.White();\r\n }\r\n\r\n /**\r\n * Sets the subsurface radius scale (used for subsurface scattering)\r\n * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.\r\n * @param value The subsurface radius scale as a Color3\r\n */\r\n public set subsurfaceRadiusScale(value: Color3) {\r\n this._material.subSurface.scatteringDiffusionProfile = value;\r\n }\r\n\r\n /**\r\n * Sets the subsurface scattering anisotropy.\r\n * Note: PBRMaterial does not have a direct equivalent, so this is a no-op.\r\n * @param value The anisotropy intensity value (ignored for PBR)\r\n */\r\n public set subsurfaceScatterAnisotropy(value: number) {\r\n // No equivalent in PBRMaterial\r\n }\r\n\r\n /**\r\n * Does this material have a translucent surface (i.e. either transmission or subsurface)?\r\n * @returns True if the material is translucent, false otherwise\r\n */\r\n public isTranslucent(): boolean {\r\n return this.transmissionWeight > 0 || this.subsurfaceWeight > 0;\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 fuzz weight texture.\r\n * @param value The fuzz weight texture or null\r\n */\r\n public set fuzzWeightTexture(value: Nullable<BaseTexture>) {\r\n // PBRMaterial sheen supports glTF-style sheen which doesn't\r\n // use a separate texture for intensity. So we'll only set the\r\n // weight texture if none is already assigned. If one's already\r\n // assigned, we assume it contains the sheen color data.\r\n if (!this._material.sheen.texture) {\r\n this._material.sheen.texture = value;\r\n }\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.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 thinFilmWeight(value: number) {\r\n this._material.iridescence.isEnabled = value > 0;\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 * @param value The iridescence IOR value\r\n */\r\n public set thinFilmIor(value: number) {\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 * @param value The minimum thickness value in nanometers\r\n */\r\n public set thinFilmThicknessMinimum(value: number) {\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 * @param value The maximum thickness value in nanometers\r\n */\r\n public set thinFilmThicknessMaximum(value: number) {\r\n this._material.iridescence.maximumThickness = value;\r\n }\r\n\r\n /**\r\n * Sets the thin film weight texture (mapped to PBR iridescence.texture).\r\n * @param value The thin film weight texture or null\r\n */\r\n public set thinFilmWeightTexture(value: Nullable<BaseTexture>) {\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 * @param value The iridescence thickness texture or null\r\n */\r\n public set thinFilmThicknessTexture(value: Nullable<BaseTexture>) {\r\n this._material.iridescence.thicknessTexture = 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": "9.32.1",
3
+ "version": "9.33.0",
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": "9.32.1",
21
+ "@babylonjs/core": "9.33.0",
22
22
  "@dev/build-tools": "^1.0.0",
23
23
  "@dev/loaders": "^1.0.0",
24
- "babylonjs-gltf2interface": "9.32.1"
24
+ "babylonjs-gltf2interface": "9.33.0"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@babylonjs/core": "^9.0.0",
@@ -44,6 +44,7 @@
44
44
  "**/glTFLoader.js",
45
45
  "glTF/2.0/Extensions/*coat.js",
46
46
  "glTF/2.0/Extensions/*data.js",
47
+ "glTF/2.0/Extensions/*scatter.js",
47
48
  "BVH/bvhFileLoader.js",
48
49
  "FBX/fbxFileLoader.js",
49
50
  "OBJ/objFileLoader.js",
@@ -76,7 +77,6 @@
76
77
  "glTF/2.0/Extensions/KHR_materials_unlit.js",
77
78
  "glTF/2.0/Extensions/KHR_materials_variants.js",
78
79
  "glTF/2.0/Extensions/KHR_materials_volume.js",
79
- "glTF/2.0/Extensions/KHR_materials_volume_scatter.js",
80
80
  "glTF/2.0/Extensions/KHR_mesh_quantization.js",
81
81
  "glTF/2.0/Extensions/KHR_node_hoverability.js",
82
82
  "glTF/2.0/Extensions/KHR_node_selectability.js",