@onerjs/loaders 8.36.4 → 8.36.6

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 (37) hide show
  1. package/glTF/2.0/Extensions/KHR_materials_coat.d.ts +2 -2
  2. package/glTF/2.0/Extensions/KHR_materials_coat.js +2 -2
  3. package/glTF/2.0/Extensions/KHR_materials_coat.js.map +1 -1
  4. package/glTF/2.0/Extensions/KHR_materials_diffuse_roughness.d.ts +1 -1
  5. package/glTF/2.0/Extensions/KHR_materials_diffuse_roughness.js +1 -1
  6. package/glTF/2.0/Extensions/KHR_materials_diffuse_roughness.js.map +1 -1
  7. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.js +2 -2
  8. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.js.map +1 -1
  9. package/glTF/2.0/Extensions/KHR_materials_dispersion.js +3 -2
  10. package/glTF/2.0/Extensions/KHR_materials_dispersion.js.map +1 -1
  11. package/glTF/2.0/Extensions/KHR_materials_fuzz.d.ts +2 -1
  12. package/glTF/2.0/Extensions/KHR_materials_fuzz.js +2 -1
  13. package/glTF/2.0/Extensions/KHR_materials_fuzz.js.map +1 -1
  14. package/glTF/2.0/Extensions/KHR_materials_transmission.js +25 -22
  15. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  16. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  17. package/glTF/2.0/Extensions/KHR_materials_volume.js +9 -3
  18. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
  19. package/glTF/2.0/Extensions/KHR_materials_volume_scatter.d.ts +45 -0
  20. package/glTF/2.0/Extensions/KHR_materials_volume_scatter.js +110 -0
  21. package/glTF/2.0/Extensions/KHR_materials_volume_scatter.js.map +1 -0
  22. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  23. package/glTF/2.0/Extensions/index.d.ts +1 -0
  24. package/glTF/2.0/Extensions/index.js +1 -0
  25. package/glTF/2.0/Extensions/index.js.map +1 -1
  26. package/glTF/2.0/materialLoadingAdapter.d.ts +43 -1
  27. package/glTF/2.0/materialLoadingAdapter.js.map +1 -1
  28. package/glTF/2.0/openpbrMaterialLoadingAdapter.d.ts +98 -16
  29. package/glTF/2.0/openpbrMaterialLoadingAdapter.js +172 -35
  30. package/glTF/2.0/openpbrMaterialLoadingAdapter.js.map +1 -1
  31. package/glTF/2.0/pbrMaterialLoadingAdapter.d.ts +97 -8
  32. package/glTF/2.0/pbrMaterialLoadingAdapter.js +165 -19
  33. package/glTF/2.0/pbrMaterialLoadingAdapter.js.map +1 -1
  34. package/glTF/glTFValidation.d.ts +6 -0
  35. package/glTF/glTFValidation.js +6 -0
  36. package/glTF/glTFValidation.js.map +1 -1
  37. package/package.json +3 -3
@@ -1,4 +1,5 @@
1
1
  import { Color3 } from "@onerjs/core/Maths/math.color.js";
2
+ import { Vector3 } from "@onerjs/core/Maths/math.vector.js";
2
3
  import { Constants } from "@onerjs/core/Engines/constants.js";
3
4
  /**
4
5
  * Material Loading Adapter for PBR materials that provides a unified OpenPBR-like interface.
@@ -9,6 +10,7 @@ export class PBRMaterialLoadingAdapter {
9
10
  * @param material - The PBR material to adapt.
10
11
  */
11
12
  constructor(material) {
13
+ this._extinctionCoefficient = Vector3.Zero();
12
14
  this._material = material;
13
15
  this._material.enableSpecularAntiAliasing = true;
14
16
  }
@@ -592,7 +594,7 @@ export class PBRMaterialLoadingAdapter {
592
594
  * @returns The transmission weight value
593
595
  */
594
596
  get transmissionWeight() {
595
- return this._material.subSurface.refractionIntensity;
597
+ return this._material.subSurface.isRefractionEnabled ? this._material.subSurface.refractionIntensity : 0;
596
598
  }
597
599
  /**
598
600
  * Sets the transmission weight texture (mapped to PBR subSurface.refractionIntensityTexture).
@@ -605,24 +607,87 @@ export class PBRMaterialLoadingAdapter {
605
607
  this._material.subSurface.useGltfStyleTextures = true;
606
608
  }
607
609
  /**
608
- * Sets the attenuation distance for volume scattering.
610
+ * Sets the attenuation distance for volume.
609
611
  * @param value The attenuation distance value
610
612
  */
611
613
  set transmissionDepth(value) {
612
- this._material.subSurface.tintColorAtDistance = value;
614
+ if (this.transmissionWeight > 0) {
615
+ this._material.subSurface.tintColorAtDistance = value;
616
+ }
617
+ else if (this.subsurfaceWeight > 0) {
618
+ this._material.subSurface.diffusionDistance.multiplyInPlace(new Color3(value, value, value));
619
+ }
620
+ }
621
+ /**
622
+ * Gets the attenuation distance for volume.
623
+ * @returns The attenuation distance value
624
+ */
625
+ get transmissionDepth() {
626
+ if (this.transmissionWeight > 0) {
627
+ return this._material.subSurface.tintColorAtDistance;
628
+ }
629
+ return 0;
613
630
  }
614
631
  /**
615
632
  * Sets the attenuation color (mapped to PBR subSurface.tintColor).
616
633
  * @param value The attenuation color as a Color3
617
634
  */
618
635
  set transmissionColor(value) {
619
- this._material.subSurface.tintColor = value;
636
+ if (this.transmissionWeight > 0) {
637
+ this._material.subSurface.tintColor = value;
638
+ }
639
+ else if (this.subsurfaceWeight > 0) {
640
+ this._material.subSurface.diffusionDistance.multiplyInPlace(value);
641
+ }
642
+ }
643
+ /**
644
+ * Sets the attenuation color (mapped to PBR subSurface.tintColor).
645
+ * @returns The attenuation color as a Color3
646
+ */
647
+ get transmissionColor() {
648
+ if (this.transmissionWeight > 0) {
649
+ return this._material.subSurface.tintColor;
650
+ }
651
+ else if (this.subsurfaceWeight > 0) {
652
+ return this._material.subSurface.diffusionDistance;
653
+ }
654
+ return new Color3(0, 0, 0);
655
+ }
656
+ /**
657
+ * Sets the transmission scatter coefficient.
658
+ * @param value The scatter coefficient as a Color3
659
+ */
660
+ set transmissionScatter(value) {
661
+ // TODO convert from scatter coefficient to diffusion distance
662
+ this._material.subSurface.diffusionDistance = value;
620
663
  }
621
664
  /**
622
- * Gets the transmission dispersion Abbe number.
665
+ * Sets the transmission scatter coefficient.
666
+ * @returns The scatter coefficient as a Color3
667
+ */
668
+ get transmissionScatter() {
669
+ // TODO convert from diffusion distance to scatter coefficient
670
+ return this._material.subSurface.diffusionDistance;
671
+ }
672
+ /**
673
+ * Sets the transmission scattering anisotropy.
674
+ * @param value The anisotropy intensity value (-1 to 1)
675
+ */
676
+ set transmissionScatterAnisotropy(value) {
677
+ // No direct mapping in PBRMaterial
678
+ }
679
+ /**
680
+ * Sets the transmission dispersion Abbe number.
623
681
  * @param value The Abbe number value
624
682
  */
625
683
  set transmissionDispersionAbbeNumber(value) {
684
+ // PBRMaterial assumes a fixed Abbe number of 20.0 for dispersion calculations.
685
+ }
686
+ /**
687
+ * Sets the transmission dispersion scale.
688
+ * @param value The dispersion scale value
689
+ */
690
+ set transmissionDispersionScale(value) {
626
691
  if (value > 0) {
627
692
  this._material.subSurface.isDispersionEnabled = true;
628
693
  this._material.subSurface.dispersion = 20.0 / value;
@@ -632,6 +697,20 @@ export class PBRMaterialLoadingAdapter {
632
697
  this._material.subSurface.dispersion = 0;
633
698
  }
634
699
  }
700
+ /**
701
+ * Gets the refraction background texture
702
+ * @returns The refraction background texture or null
703
+ */
704
+ get refractionBackgroundTexture() {
705
+ return this._material.subSurface.refractionTexture;
706
+ }
707
+ /**
708
+ * Sets the refraction background texture
709
+ * @param value The refraction background texture or null
710
+ */
711
+ set refractionBackgroundTexture(value) {
712
+ this._material.subSurface.refractionTexture = value;
713
+ }
635
714
  /**
636
715
  * Configures transmission for thin-surface transmission (KHR_materials_transmission).
637
716
  * Sets up the material for proper thin-surface transmission behavior.
@@ -685,6 +764,19 @@ export class PBRMaterialLoadingAdapter {
685
764
  // Tint color will be used for transmission.
686
765
  this._material.subSurface.useAlbedoToTintTranslucency = false;
687
766
  }
767
+ /**
768
+ * Sets the extinction coefficient of the volume.
769
+ * @param value The extinction coefficient as a Vector3
770
+ */
771
+ set extinctionCoefficient(value) {
772
+ this._extinctionCoefficient = value;
773
+ }
774
+ /**
775
+ * Gets the extinction coefficient of the volume.
776
+ */
777
+ get extinctionCoefficient() {
778
+ return this._extinctionCoefficient;
779
+ }
688
780
  /**
689
781
  * Sets the subsurface weight
690
782
  */
@@ -710,15 +802,82 @@ export class PBRMaterialLoadingAdapter {
710
802
  * @param value The subsurface tint color as a Color3
711
803
  */
712
804
  set subsurfaceColor(value) {
713
- this._material.subSurface.tintColor = value;
805
+ // PBRMaterial does not have a direct equivalent for subsurface color,
806
+ // We could set the base color to this value, wherever subsurfaceWeight > 0
807
+ // When scatterAnisotropy is 1, I believe we can approximate the subsurface effect quite well with
808
+ // Translucency and a diffusion distance
809
+ const absorptionCoeff = this.extinctionCoefficient;
810
+ const maxChannel = Math.max(absorptionCoeff.x, Math.max(absorptionCoeff.y, absorptionCoeff.z));
811
+ const attenuationDistance = maxChannel > 0 ? 1.0 / maxChannel : 1;
812
+ this._material.subSurface.diffusionDistance = new Color3(Math.exp(-absorptionCoeff.x * attenuationDistance), Math.exp(-absorptionCoeff.y * attenuationDistance), Math.exp(-absorptionCoeff.z * attenuationDistance));
714
813
  }
715
814
  /**
716
815
  * Sets the subsurface color texture.
717
816
  * @param value The subsurface tint texture or null
718
817
  */
719
818
  set subsurfaceColorTexture(value) {
819
+ // PBRMaterial does not have a direct equivalent for subsurface color texture,
820
+ }
821
+ /**
822
+ * Sets the surface tint of the material (when using subsurface scattering)
823
+ */
824
+ set subsurfaceConstantTint(value) {
825
+ this._material.subSurface.tintColor = value;
826
+ }
827
+ /**
828
+ * Gets the subsurface constant tint (when using subsurface scattering)
829
+ * @returns The subsurface constant tint as a Color3
830
+ */
831
+ get subsurfaceConstantTint() {
832
+ return this._material.subSurface.tintColor;
833
+ }
834
+ /**
835
+ * Sets the subsurface constant tint texture (when using subsurface scattering)
836
+ * @param value The subsurface constant tint texture or null
837
+ */
838
+ set subsurfaceConstantTintTexture(value) {
720
839
  this._material.subSurface.translucencyColorTexture = value;
721
840
  }
841
+ /**
842
+ * Gets the subsurface radius (used for subsurface scattering)
843
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
844
+ * @returns The subsurface radius as a Color3
845
+ */
846
+ get subsurfaceRadius() {
847
+ return 1.0;
848
+ }
849
+ /**
850
+ * Sets the subsurface radius (used for subsurface scattering)
851
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
852
+ * @param value The subsurface radius as a number
853
+ */
854
+ set subsurfaceRadius(value) {
855
+ //
856
+ }
857
+ /**
858
+ * Gets the subsurface radius scale (used for subsurface scattering)
859
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
860
+ * @returns The subsurface radius scale as a Color3
861
+ */
862
+ get subsurfaceRadiusScale() {
863
+ return this._material.subSurface.scatteringDiffusionProfile ?? Color3.White();
864
+ }
865
+ /**
866
+ * Sets the subsurface radius scale (used for subsurface scattering)
867
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
868
+ * @param value The subsurface radius scale as a Color3
869
+ */
870
+ set subsurfaceRadiusScale(value) {
871
+ this._material.subSurface.scatteringDiffusionProfile = value;
872
+ }
873
+ /**
874
+ * Sets the subsurface scattering anisotropy.
875
+ * Note: PBRMaterial does not have a direct equivalent, so this is a no-op.
876
+ * @param value The anisotropy intensity value (ignored for PBR)
877
+ */
878
+ set subsurfaceScatterAnisotropy(value) {
879
+ // No equivalent in PBRMaterial
880
+ }
722
881
  // ========================================
723
882
  // FUZZ LAYER (Sheen)
724
883
  // ========================================
@@ -888,19 +1047,6 @@ export class PBRMaterialLoadingAdapter {
888
1047
  this._material.iridescence.thicknessTexture = value;
889
1048
  }
890
1049
  // ========================================
891
- // DISPERSION
892
- // ========================================
893
- /**
894
- * Sets the transmission dispersion value.
895
- * Note: PBR doesn't have direct dispersion support, so this stores it as metadata.
896
- * @param value The dispersion value (stored as metadata)
897
- */
898
- set transmissionDispersion(value) {
899
- // PBR doesn't have a direct dispersion property, this would need custom shader modification
900
- // For now, we'll store it as metadata
901
- this._material._dispersion = value;
902
- }
903
- // ========================================
904
1050
  // UNLIT MATERIALS
905
1051
  // ========================================
906
1052
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pbr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S,CAAC,gBAAgB,GAAG,OAAO,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,gBAAgB,GAAG,OAAO,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,IAAW,yBAAyB,CAAC,KAA4B;QAC7D,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,GAAG,KAAK,CAAC;IACjD,CAAC;IAED;;;OAGG;IACH,IAAW,yBAAyB;QAChC,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC;IAChD,CAAC;IAED;;;OAGG;IACH,IAAW,8BAA8B,CAAC,KAAa;QACnD,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;YACvC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;QACvD,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport type { IMaterialLoadingAdapter } from \"./materialLoadingAdapter\";\r\n\r\n/**\r\n * Material Loading Adapter for PBR materials that provides a unified OpenPBR-like interface.\r\n */\r\nexport class PBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {\r\n private _material: PBRMaterial;\r\n\r\n /**\r\n * Creates a new instance of the PBRMaterialLoadingAdapter.\r\n * @param material - The PBR material to adapt.\r\n */\r\n constructor(material: Material) {\r\n this._material = material as PBRMaterial;\r\n this._material.enableSpecularAntiAliasing = true;\r\n }\r\n\r\n /**\r\n * Gets the underlying material\r\n */\r\n public get material(): PBRMaterial {\r\n return this._material;\r\n }\r\n\r\n /**\r\n * Whether the material should be treated as unlit\r\n */\r\n public get isUnlit(): boolean {\r\n return this._material.unlit;\r\n }\r\n\r\n /**\r\n * Sets whether the material should be treated as unlit\r\n */\r\n public set isUnlit(value: boolean) {\r\n this._material.unlit = value;\r\n }\r\n\r\n // ========================================\r\n // CULLING PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets whether back face culling is enabled.\r\n * @param value True to enable back face culling\r\n */\r\n public set backFaceCulling(value: boolean) {\r\n this._material.backFaceCulling = value;\r\n }\r\n\r\n /**\r\n * Gets whether back face culling is enabled.\r\n * @returns True if back face culling is enabled\r\n */\r\n public get backFaceCulling(): boolean {\r\n return this._material.backFaceCulling;\r\n }\r\n\r\n /**\r\n * Sets whether two-sided lighting is enabled.\r\n * @param value True to enable two-sided lighting\r\n */\r\n public set twoSidedLighting(value: boolean) {\r\n this._material.twoSidedLighting = value;\r\n }\r\n\r\n /**\r\n * Gets whether two-sided lighting is enabled.\r\n * @returns True if two-sided lighting is enabled\r\n */\r\n public get twoSidedLighting(): boolean {\r\n return this._material.twoSidedLighting;\r\n }\r\n\r\n // ========================================\r\n // ALPHA PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets the alpha cutoff value for alpha testing.\r\n * @param value The alpha cutoff threshold (0-1)\r\n */\r\n public set alphaCutOff(value: number) {\r\n this._material.alphaCutOff = value;\r\n }\r\n\r\n /**\r\n * Gets the alpha cutoff value.\r\n * @returns The alpha cutoff threshold (0-1)\r\n */\r\n public get alphaCutOff(): number {\r\n return this._material.alphaCutOff;\r\n }\r\n\r\n /**\r\n * Sets whether to use alpha from the albedo texture.\r\n * @param value True to use alpha from albedo texture\r\n */\r\n public set useAlphaFromBaseColorTexture(value: boolean) {\r\n this._material.useAlphaFromAlbedoTexture = value;\r\n }\r\n\r\n /**\r\n * Gets whether alpha is used from the albedo texture.\r\n * @returns True if using alpha from albedo texture\r\n */\r\n public get useAlphaFromBaseColorTexture(): boolean {\r\n return this._material.useAlphaFromAlbedoTexture;\r\n }\r\n\r\n /**\r\n * Gets whether the transparency is treated as alpha coverage.\r\n */\r\n public get transparencyAsAlphaCoverage(): boolean {\r\n return this._material.useRadianceOverAlpha || this._material.useSpecularOverAlpha;\r\n }\r\n\r\n /**\r\n * Sets/Gets whether the transparency is treated as alpha coverage\r\n */\r\n public set transparencyAsAlphaCoverage(value: boolean) {\r\n this._material.useRadianceOverAlpha = !value;\r\n this._material.useSpecularOverAlpha = !value;\r\n }\r\n\r\n // ========================================\r\n // BASE PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the base color of the material (mapped to PBR albedoColor).\r\n * @param value The base color as a Color3\r\n */\r\n public set baseColor(value: Color3) {\r\n this._material.albedoColor = value;\r\n }\r\n\r\n /**\r\n * Gets the base color of the material.\r\n * @returns The base color as a Color3\r\n */\r\n public get baseColor(): Color3 {\r\n return this._material.albedoColor;\r\n }\r\n\r\n /**\r\n * Sets the base color texture of the material (mapped to PBR albedoTexture).\r\n * @param value The base color texture or null\r\n */\r\n public set baseColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.albedoTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base color texture of the material.\r\n * @returns The base color texture or null\r\n */\r\n public get baseColorTexture(): Nullable<BaseTexture> {\r\n return this._material.albedoTexture;\r\n }\r\n\r\n /**\r\n * Sets the base diffuse roughness of the material.\r\n * @param value The diffuse roughness value (0-1)\r\n */\r\n public set baseDiffuseRoughness(value: number) {\r\n this._material.baseDiffuseRoughness = value;\r\n if (value > 0) {\r\n this._material.brdf.baseDiffuseModel = Constants.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the base diffuse roughness of the material.\r\n * @returns The diffuse roughness value (0-1), defaults to 0 if not set\r\n */\r\n public get baseDiffuseRoughness(): number {\r\n return this._material.baseDiffuseRoughness ?? 0;\r\n }\r\n\r\n /**\r\n * Sets the base diffuse roughness texture of the material.\r\n * @param value The diffuse roughness texture or null\r\n */\r\n public set baseDiffuseRoughnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.baseDiffuseRoughnessTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base diffuse roughness texture of the material.\r\n * @returns The diffuse roughness texture or null\r\n */\r\n public get baseDiffuseRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.baseDiffuseRoughnessTexture;\r\n }\r\n\r\n /**\r\n * Sets the base metalness value of the material (mapped to PBR metallic).\r\n * @param value The metalness value (0-1)\r\n */\r\n public set baseMetalness(value: number) {\r\n this._material.metallic = value;\r\n }\r\n\r\n /**\r\n * Gets the base metalness value of the material.\r\n * @returns The metalness value (0-1), defaults to 1 if not set\r\n */\r\n public get baseMetalness(): number {\r\n return this._material.metallic ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the base metalness texture of the material (mapped to PBR metallicTexture).\r\n * @param value The metalness texture or null\r\n */\r\n public set baseMetalnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.metallicTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base metalness texture of the material.\r\n * @returns The metalness texture or null\r\n */\r\n public get baseMetalnessTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicTexture;\r\n }\r\n\r\n /**\r\n * Sets whether to use roughness from the metallic texture's green channel.\r\n * Also disables using roughness from the alpha channel when enabled.\r\n * @param value True to use green channel for roughness\r\n */\r\n public set useRoughnessFromMetallicTextureGreen(value: boolean) {\r\n this._material.useRoughnessFromMetallicTextureGreen = value;\r\n this._material.useRoughnessFromMetallicTextureAlpha = !value;\r\n }\r\n\r\n /**\r\n * Sets whether to use metalness from the metallic texture's blue channel.\r\n * @param value True to use blue channel for metalness\r\n */\r\n public set useMetallicFromMetallicTextureBlue(value: boolean) {\r\n this._material.useMetallnessFromMetallicTextureBlue = value;\r\n }\r\n\r\n // ========================================\r\n // SPECULAR PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Configures specular properties and optionally enables OpenPBR BRDF model for edge color support.\r\n * @param enableEdgeColor Whether to enable OpenPBR BRDF models for edge color support\r\n */\r\n public enableSpecularEdgeColor(enableEdgeColor: boolean = false): void {\r\n if (enableEdgeColor) {\r\n this._material.brdf.dielectricSpecularModel = Constants.MATERIAL_DIELECTRIC_SPECULAR_MODEL_OPENPBR;\r\n this._material.brdf.conductorSpecularModel = Constants.MATERIAL_CONDUCTOR_SPECULAR_MODEL_OPENPBR;\r\n }\r\n }\r\n\r\n /**\r\n * Sets the specular weight (mapped to PBR metallicF0Factor).\r\n * @param value The specular weight value\r\n */\r\n public set specularWeight(value: number) {\r\n this._material.metallicF0Factor = value;\r\n }\r\n\r\n /**\r\n * Gets the specular weight.\r\n * @returns The specular weight value, defaults to 1 if not set\r\n */\r\n public get specularWeight(): number {\r\n return this._material.metallicF0Factor ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the specular weight texture (mapped to PBR metallicReflectanceTexture).\r\n * Configures the material to use only metalness from this texture when set.\r\n * @param value The specular weight texture or null\r\n */\r\n public set specularWeightTexture(value: Nullable<BaseTexture>) {\r\n if (value) {\r\n this._material.metallicReflectanceTexture = value;\r\n this._material.useOnlyMetallicFromMetallicReflectanceTexture = true;\r\n } else {\r\n this._material.metallicReflectanceTexture = null;\r\n this._material.useOnlyMetallicFromMetallicReflectanceTexture = false;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the specular weight texture.\r\n * @returns The specular weight texture or null\r\n */\r\n public get specularWeightTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicReflectanceTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular color (mapped to PBR metallicReflectanceColor).\r\n * @param value The specular color as a Color3\r\n */\r\n public set specularColor(value: Color3) {\r\n this._material.metallicReflectanceColor = value;\r\n }\r\n\r\n /**\r\n * Gets the specular color.\r\n * @returns The specular color as a Color3\r\n */\r\n public get specularColor(): Color3 {\r\n return this._material.metallicReflectanceColor;\r\n }\r\n\r\n /**\r\n * Sets the specular color texture (mapped to PBR reflectanceTexture).\r\n * @param value The specular color texture or null\r\n */\r\n public set specularColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.reflectanceTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the specular color texture.\r\n * @returns The specular color texture or null\r\n */\r\n public get specularColorTexture(): Nullable<BaseTexture> {\r\n return this._material.reflectanceTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular roughness (mapped to PBR roughness).\r\n * @param value The roughness value (0-1)\r\n */\r\n public set specularRoughness(value: number) {\r\n this._material.roughness = value;\r\n }\r\n\r\n /**\r\n * Gets the specular roughness.\r\n * @returns The roughness value (0-1), defaults to 1 if not set\r\n */\r\n public get specularRoughness(): number {\r\n return this._material.roughness ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the specular roughness texture.\r\n * Note: PBR uses the same texture for both metallic and roughness,\r\n * so this only sets the texture if no base metalness texture exists.\r\n * @param value The roughness texture or null\r\n */\r\n public set specularRoughnessTexture(value: Nullable<BaseTexture>) {\r\n // PBR uses the same texture for both metallic and roughness\r\n if (!this.baseMetalnessTexture) {\r\n this._material.metallicTexture = value;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the specular roughness texture.\r\n * @returns The roughness texture (same as metallic texture for PBR) or null\r\n */\r\n public get specularRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular index of refraction (mapped to PBR indexOfRefraction).\r\n * @param value The IOR value\r\n */\r\n public set specularIor(value: number) {\r\n this._material.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Gets the specular index of refraction.\r\n * @returns The IOR value\r\n */\r\n public get specularIor(): number {\r\n return this._material.indexOfRefraction;\r\n }\r\n\r\n // ========================================\r\n // EMISSION PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the emission color (mapped to PBR emissiveColor).\r\n * @param value The emission color as a Color3\r\n */\r\n public set emissionColor(value: Color3) {\r\n this._material.emissiveColor = value;\r\n }\r\n\r\n /**\r\n * Gets the emission color.\r\n * @returns The emission color as a Color3\r\n */\r\n public get emissionColor(): Color3 {\r\n return this._material.emissiveColor;\r\n }\r\n\r\n /**\r\n * Sets the emission luminance/intensity (mapped to PBR emissiveIntensity).\r\n * @param value The emission intensity value\r\n */\r\n public set emissionLuminance(value: number) {\r\n this._material.emissiveIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the emission luminance/intensity.\r\n * @returns The emission intensity value\r\n */\r\n public get emissionLuminance(): number {\r\n return this._material.emissiveIntensity;\r\n }\r\n\r\n /**\r\n * Sets the emission color texture (mapped to PBR emissiveTexture).\r\n * @param value The emission texture or null\r\n */\r\n public set emissionColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.emissiveTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the emission color texture.\r\n * @returns The emission texture or null\r\n */\r\n public get emissionColorTexture(): Nullable<BaseTexture> {\r\n return this._material.emissiveTexture;\r\n }\r\n\r\n // ========================================\r\n // AMBIENT OCCLUSION\r\n // ========================================\r\n\r\n /**\r\n * Sets the ambient occlusion texture (mapped to PBR ambientTexture).\r\n * Automatically enables grayscale mode when set.\r\n * @param value The ambient occlusion texture or null\r\n */\r\n public set ambientOcclusionTexture(value: Nullable<BaseTexture>) {\r\n this._material.ambientTexture = value;\r\n if (value) {\r\n this._material.useAmbientInGrayScale = true;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the ambient occlusion texture.\r\n * @returns The ambient occlusion texture or null\r\n */\r\n public get ambientOcclusionTexture(): Nullable<BaseTexture> {\r\n return this._material.ambientTexture;\r\n }\r\n\r\n /**\r\n * Sets the ambient occlusion texture strength.\r\n * @param value The strength value (typically 0-1)\r\n */\r\n public set ambientOcclusionTextureStrength(value: number) {\r\n this._material.ambientTextureStrength = value;\r\n }\r\n\r\n /**\r\n * Gets the ambient occlusion texture strength.\r\n * @returns The strength value, defaults to 1.0 if not set\r\n */\r\n public get ambientOcclusionTextureStrength(): number {\r\n return this._material.ambientTextureStrength ?? 1.0;\r\n }\r\n\r\n // ========================================\r\n // COAT PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Configures clear coat for PBR material.\r\n * Enables clear coat and sets up proper configuration.\r\n */\r\n public configureCoat(): void {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.useRoughnessFromMainTexture = false;\r\n this._material.clearCoat.remapF0OnInterfaceChange = false;\r\n }\r\n\r\n /**\r\n * Sets the coat weight (mapped to PBR clearCoat.intensity).\r\n * Automatically enables clear coat.\r\n * @param value The coat weight value (0-1)\r\n */\r\n public set coatWeight(value: number) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the coat weight.\r\n * @returns The coat weight value\r\n */\r\n public get coatWeight(): number {\r\n return this._material.clearCoat.intensity;\r\n }\r\n\r\n /**\r\n * Sets the coat weight texture (mapped to PBR clearCoat.texture).\r\n * Automatically enables clear coat.\r\n * @param value The coat weight texture or null\r\n */\r\n public set coatWeightTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.texture = value;\r\n }\r\n\r\n /**\r\n * Gets the coat weight texture.\r\n * @returns The coat weight texture or null\r\n */\r\n public get coatWeightTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.texture;\r\n }\r\n\r\n /**\r\n * Sets the coat color (mapped to PBR clearCoat.tintColor).\r\n * @param value The coat tint color as a Color3\r\n */\r\n public set coatColor(value: Color3) {\r\n this._material.clearCoat.isTintEnabled = value != Color3.White();\r\n this._material.clearCoat.tintColor = value;\r\n }\r\n\r\n /**\r\n * Sets the coat color texture (mapped to PBR clearCoat.tintTexture).\r\n * @param value The coat color texture or null\r\n */\r\n public set coatColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.tintTexture = value;\r\n }\r\n\r\n /**\r\n * Sets the coat roughness (mapped to PBR clearCoat.roughness).\r\n * Automatically enables clear coat.\r\n * @param value The coat roughness value (0-1)\r\n */\r\n public set coatRoughness(value: number) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.roughness = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness.\r\n * @returns The coat roughness value, defaults to 0 if not set\r\n */\r\n public get coatRoughness(): number {\r\n return this._material.clearCoat.roughness ?? 0;\r\n }\r\n\r\n /**\r\n * Sets the coat roughness texture (mapped to PBR clearCoat.textureRoughness).\r\n * Automatically enables clear coat and disables using roughness from main texture.\r\n * @param value The coat roughness texture or null\r\n */\r\n public set coatRoughnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.useRoughnessFromMainTexture = false;\r\n this._material.clearCoat.textureRoughness = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness texture.\r\n * @returns The coat roughness texture or null\r\n */\r\n public get coatRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.textureRoughness;\r\n }\r\n\r\n /**\r\n * Sets the coat index of refraction (IOR).\r\n */\r\n public set coatIor(value: number) {\r\n this._material.clearCoat.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Sets the coat darkening value.\r\n * Note: PBR doesn't have a direct coat darkening property, so this is a no-op.\r\n * @param value The coat darkening value (ignored for PBR)\r\n */\r\n public set coatDarkening(value: number) {\r\n // PBR doesn't have a coat darkening property\r\n }\r\n\r\n /**\r\n * Sets the coat darkening texture\r\n * @param value The coat darkening texture or null\r\n */\r\n public set coatDarkeningTexture(value: Nullable<BaseTexture>) {\r\n // PBR doesn't have a coat darkening property\r\n }\r\n\r\n /**\r\n * Sets the coat roughness anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.\r\n * @param value The coat anisotropy intensity value (currently ignored)\r\n */\r\n public set coatRoughnessAnisotropy(value: number) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropy = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this returns 0.\r\n * @returns Currently returns 0 as clearCoat anisotropy is not yet available\r\n */\r\n public get coatRoughnessAnisotropy(): number {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // return this._material.clearCoat.anisotropy ?? 0;\r\n return 0;\r\n }\r\n\r\n /**\r\n * Sets the coat tangent angle for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.\r\n * @param value The coat anisotropy rotation angle in radians (currently ignored)\r\n */\r\n public set geometryCoatTangentAngle(value: number) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropyAngle = value;\r\n }\r\n\r\n /**\r\n * Sets the coat tangent texture for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy textures yet, so this is a placeholder.\r\n * @param value The coat anisotropy texture (currently ignored)\r\n */\r\n public set geometryCoatTangentTexture(value: Nullable<BaseTexture>) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropyTangentTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the coat tangent texture for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy textures yet, so this returns null.\r\n * @returns Currently returns null as clearCoat anisotropy is not yet available\r\n */\r\n public get geometryCoatTangentTexture(): Nullable<BaseTexture> {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // return this._material.clearCoat.anisotropyTangentTexture;\r\n return null;\r\n }\r\n\r\n // ========================================\r\n // TRANSMISSION LAYER\r\n // ========================================\r\n\r\n /**\r\n * Sets the transmission weight (mapped to PBR subSurface.refractionIntensity).\r\n * Enables refraction when value \\> 0.\r\n * @param value The transmission weight value (0-1)\r\n */\r\n public set transmissionWeight(value: number) {\r\n this._material.subSurface.isRefractionEnabled = value > 0;\r\n this._material.subSurface.refractionIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the transmission weight.\r\n * @returns The transmission weight value\r\n */\r\n public get transmissionWeight(): number {\r\n return this._material.subSurface.refractionIntensity;\r\n }\r\n\r\n /**\r\n * Sets the transmission weight texture (mapped to PBR subSurface.refractionIntensityTexture).\r\n * Automatically enables refraction and glTF-style textures.\r\n * @param value The transmission weight texture or null\r\n */\r\n public set transmissionWeightTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.isRefractionEnabled = true;\r\n this._material.subSurface.refractionIntensityTexture = value;\r\n this._material.subSurface.useGltfStyleTextures = true;\r\n }\r\n\r\n /**\r\n * Sets the attenuation distance for volume scattering.\r\n * @param value The attenuation distance value\r\n */\r\n public set transmissionDepth(value: number) {\r\n this._material.subSurface.tintColorAtDistance = value;\r\n }\r\n\r\n /**\r\n * Sets the attenuation color (mapped to PBR subSurface.tintColor).\r\n * @param value The attenuation color as a Color3\r\n */\r\n public set transmissionColor(value: Color3) {\r\n this._material.subSurface.tintColor = value;\r\n }\r\n\r\n /**\r\n * Gets the transmission dispersion Abbe number.\r\n * @param value The Abbe number value\r\n */\r\n public set transmissionDispersionAbbeNumber(value: number) {\r\n if (value > 0) {\r\n this._material.subSurface.isDispersionEnabled = true;\r\n this._material.subSurface.dispersion = 20.0 / value;\r\n } else {\r\n this._material.subSurface.isDispersionEnabled = false;\r\n this._material.subSurface.dispersion = 0;\r\n }\r\n }\r\n\r\n /**\r\n * Configures transmission for thin-surface transmission (KHR_materials_transmission).\r\n * Sets up the material for proper thin-surface transmission behavior.\r\n */\r\n public configureTransmission(): void {\r\n // Since this extension models thin-surface transmission only, we must make IOR = 1.0\r\n this._material.subSurface.volumeIndexOfRefraction = 1.0;\r\n // Albedo colour will tint transmission.\r\n this._material.subSurface.useAlbedoToTintRefraction = true;\r\n this._material.subSurface.minimumThickness = 0.0;\r\n this._material.subSurface.maximumThickness = 0.0;\r\n }\r\n\r\n // ========================================\r\n // VOLUME PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets the thickness texture (mapped to PBR subSurface.thicknessTexture).\r\n * Automatically enables refraction.\r\n * @param value The thickness texture or null\r\n */\r\n public set volumeThicknessTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.thicknessTexture = value;\r\n this._material.subSurface.useGltfStyleTextures = true;\r\n }\r\n\r\n /**\r\n * Sets the thickness factor (mapped to PBR subSurface.maximumThickness).\r\n * Automatically enables refraction.\r\n * @param value The thickness value\r\n */\r\n public set volumeThickness(value: number) {\r\n this._material.subSurface.minimumThickness = 0.0;\r\n this._material.subSurface.maximumThickness = value;\r\n this._material.subSurface.useThicknessAsDepth = true;\r\n if (value > 0) {\r\n this._material.subSurface.volumeIndexOfRefraction = this._material.indexOfRefraction;\r\n }\r\n }\r\n\r\n // ========================================\r\n // SUBSURFACE PROPERTIES (Subsurface Scattering)\r\n // ========================================\r\n\r\n /**\r\n * Configures subsurface properties for PBR material\r\n */\r\n public configureSubsurface(): void {\r\n this._material.subSurface.useGltfStyleTextures = true;\r\n\r\n // Since this extension models thin-surface transmission only, we must make the\r\n // internal IOR == 1.0 and set the thickness to 0.\r\n this._material.subSurface.volumeIndexOfRefraction = 1.0;\r\n this._material.subSurface.minimumThickness = 0.0;\r\n this._material.subSurface.maximumThickness = 0.0;\r\n\r\n // Tint color will be used for transmission.\r\n this._material.subSurface.useAlbedoToTintTranslucency = false;\r\n }\r\n\r\n /**\r\n * Sets the subsurface weight\r\n */\r\n public set subsurfaceWeight(value: number) {\r\n this._material.subSurface.isTranslucencyEnabled = value > 0;\r\n this._material.subSurface.translucencyIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the subsurface weight\r\n * @returns The subsurface weight value\r\n */\r\n public get subsurfaceWeight(): number {\r\n return this._material.subSurface.isTranslucencyEnabled ? this._material.subSurface.translucencyIntensity : 0;\r\n }\r\n\r\n /**\r\n * Sets the subsurface weight texture\r\n */\r\n public set subsurfaceWeightTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.translucencyIntensityTexture = value;\r\n }\r\n\r\n /**\r\n * Sets the subsurface color.\r\n * @param value The subsurface tint color as a Color3\r\n */\r\n public set subsurfaceColor(value: Color3) {\r\n this._material.subSurface.tintColor = value;\r\n }\r\n\r\n /**\r\n * Sets the subsurface color texture.\r\n * @param value The subsurface tint texture or null\r\n */\r\n public set subsurfaceColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.subSurface.translucencyColorTexture = value;\r\n }\r\n\r\n // ========================================\r\n // FUZZ LAYER (Sheen)\r\n // ========================================\r\n\r\n /**\r\n * Configures sheen for PBR material.\r\n * Enables sheen and sets up proper configuration.\r\n */\r\n public configureFuzz(): void {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.useRoughnessFromMainTexture = false;\r\n this._material.sheen.albedoScaling = true;\r\n }\r\n\r\n /**\r\n * Sets the sheen weight (mapped to PBR sheen.intensity).\r\n * Automatically enables sheen.\r\n * @param value The sheen weight value\r\n */\r\n public set fuzzWeight(value: number) {\r\n this._material.sheen.isEnabled = true;\r\n this._material.sheen.intensity = value;\r\n }\r\n\r\n /**\r\n * Sets the 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 // DISPERSION\r\n // ========================================\r\n\r\n /**\r\n * Sets the transmission dispersion value.\r\n * Note: PBR doesn't have direct dispersion support, so this stores it as metadata.\r\n * @param value The dispersion value (stored as metadata)\r\n */\r\n public set transmissionDispersion(value: number) {\r\n // PBR doesn't have a direct dispersion property, this would need custom shader modification\r\n // For now, we'll store it as metadata\r\n (this._material as any)._dispersion = value;\r\n }\r\n\r\n // ========================================\r\n // UNLIT MATERIALS\r\n // ========================================\r\n\r\n /**\r\n * Sets whether the material is unlit.\r\n * @param value True to make the material unlit\r\n */\r\n public set unlit(value: boolean) {\r\n this._material.unlit = value;\r\n }\r\n\r\n // ========================================\r\n // GEOMETRY PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the geometry opacity (mapped to PBR alpha).\r\n * @param value The opacity value (0-1)\r\n */\r\n public set geometryOpacity(value: number) {\r\n this._material.alpha = value;\r\n }\r\n\r\n /**\r\n * Gets the geometry opacity.\r\n * @returns The opacity value (0-1)\r\n */\r\n public get geometryOpacity(): number {\r\n return this._material.alpha;\r\n }\r\n\r\n /**\r\n * Sets the geometry normal texture (mapped to PBR bumpTexture).\r\n * Also forces irradiance computation in fragment shader for better lighting.\r\n * @param value The normal texture or null\r\n */\r\n public set geometryNormalTexture(value: Nullable<BaseTexture>) {\r\n this._material.bumpTexture = value;\r\n this._material.forceIrradianceInFragment = true;\r\n }\r\n\r\n /**\r\n * Gets the geometry normal texture.\r\n * @returns The normal texture or null\r\n */\r\n public get geometryNormalTexture(): Nullable<BaseTexture> {\r\n return this._material.bumpTexture;\r\n }\r\n\r\n /**\r\n * Sets the normal map inversions for the material.\r\n * @param invertX Whether to invert the normal map on the X axis\r\n * @param invertY Whether to invert the normal map on the Y axis\r\n */\r\n public setNormalMapInversions(invertX: boolean, invertY: boolean): void {\r\n this._material.invertNormalMapX = invertX;\r\n this._material.invertNormalMapY = invertY;\r\n }\r\n\r\n /**\r\n * Sets the geometry coat normal texture (mapped to PBR clearCoat.bumpTexture).\r\n * Automatically enables clear coat.\r\n * @param value The coat normal texture or null\r\n */\r\n public set geometryCoatNormalTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.bumpTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the geometry coat normal texture.\r\n * @returns The coat normal texture or null\r\n */\r\n public get geometryCoatNormalTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.bumpTexture;\r\n }\r\n\r\n /**\r\n * Sets the geometry coat normal texture scale.\r\n * @param value The scale value for the coat normal texture\r\n */\r\n public set geometryCoatNormalTextureScale(value: number) {\r\n if (this._material.clearCoat.bumpTexture) {\r\n this._material.clearCoat.bumpTexture.level = value;\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"pbrMaterialLoadingAdapter.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/pbrMaterialLoadingAdapter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,yCAA8B;AAC/C,OAAO,EAAE,OAAO,EAAE,0CAA+B;AACjD,OAAO,EAAE,SAAS,EAAE,0CAA+B;AAGnD;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAIlC;;;OAGG;IACH,YAAY,QAAkB;QANtB,2BAAsB,GAAY,OAAO,CAAC,IAAI,EAAE,CAAC;QAOrD,IAAI,CAAC,SAAS,GAAG,QAAuB,CAAC;QACzC,IAAI,CAAC,SAAS,CAAC,0BAA0B,GAAG,IAAI,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAW,OAAO,CAAC,KAAc;QAC7B,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;IACjC,CAAC;IAED,2CAA2C;IAC3C,qBAAqB;IACrB,2CAA2C;IAE3C;;;OAGG;IACH,IAAW,eAAe,CAAC,KAAc;QACrC,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,KAAK,CAAC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,CAAC,SAAS,CAAC,gBAAgB,GAAG,OAAO,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,IAAW,yBAAyB,CAAC,KAA4B;QAC7D,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,GAAG,KAAK,CAAC;IACjD,CAAC;IAED;;;OAGG;IACH,IAAW,yBAAyB;QAChC,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC;IAChD,CAAC;IAED;;;OAGG;IACH,IAAW,8BAA8B,CAAC,KAAa;QACnD,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;YACvC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;QACvD,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport type { IMaterialLoadingAdapter } from \"./materialLoadingAdapter\";\r\n\r\n/**\r\n * Material Loading Adapter for PBR materials that provides a unified OpenPBR-like interface.\r\n */\r\nexport class PBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {\r\n private _material: PBRMaterial;\r\n private _extinctionCoefficient: Vector3 = Vector3.Zero();\r\n\r\n /**\r\n * Creates a new instance of the PBRMaterialLoadingAdapter.\r\n * @param material - The PBR material to adapt.\r\n */\r\n constructor(material: Material) {\r\n this._material = material as PBRMaterial;\r\n this._material.enableSpecularAntiAliasing = true;\r\n }\r\n\r\n /**\r\n * Gets the underlying material\r\n */\r\n public get material(): PBRMaterial {\r\n return this._material;\r\n }\r\n\r\n /**\r\n * Whether the material should be treated as unlit\r\n */\r\n public get isUnlit(): boolean {\r\n return this._material.unlit;\r\n }\r\n\r\n /**\r\n * Sets whether the material should be treated as unlit\r\n */\r\n public set isUnlit(value: boolean) {\r\n this._material.unlit = value;\r\n }\r\n\r\n // ========================================\r\n // CULLING PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets whether back face culling is enabled.\r\n * @param value True to enable back face culling\r\n */\r\n public set backFaceCulling(value: boolean) {\r\n this._material.backFaceCulling = value;\r\n }\r\n\r\n /**\r\n * Gets whether back face culling is enabled.\r\n * @returns True if back face culling is enabled\r\n */\r\n public get backFaceCulling(): boolean {\r\n return this._material.backFaceCulling;\r\n }\r\n\r\n /**\r\n * Sets whether two-sided lighting is enabled.\r\n * @param value True to enable two-sided lighting\r\n */\r\n public set twoSidedLighting(value: boolean) {\r\n this._material.twoSidedLighting = value;\r\n }\r\n\r\n /**\r\n * Gets whether two-sided lighting is enabled.\r\n * @returns True if two-sided lighting is enabled\r\n */\r\n public get twoSidedLighting(): boolean {\r\n return this._material.twoSidedLighting;\r\n }\r\n\r\n // ========================================\r\n // ALPHA PROPERTIES\r\n // ========================================\r\n\r\n /**\r\n * Sets the alpha cutoff value for alpha testing.\r\n * @param value The alpha cutoff threshold (0-1)\r\n */\r\n public set alphaCutOff(value: number) {\r\n this._material.alphaCutOff = value;\r\n }\r\n\r\n /**\r\n * Gets the alpha cutoff value.\r\n * @returns The alpha cutoff threshold (0-1)\r\n */\r\n public get alphaCutOff(): number {\r\n return this._material.alphaCutOff;\r\n }\r\n\r\n /**\r\n * Sets whether to use alpha from the albedo texture.\r\n * @param value True to use alpha from albedo texture\r\n */\r\n public set useAlphaFromBaseColorTexture(value: boolean) {\r\n this._material.useAlphaFromAlbedoTexture = value;\r\n }\r\n\r\n /**\r\n * Gets whether alpha is used from the albedo texture.\r\n * @returns True if using alpha from albedo texture\r\n */\r\n public get useAlphaFromBaseColorTexture(): boolean {\r\n return this._material.useAlphaFromAlbedoTexture;\r\n }\r\n\r\n /**\r\n * Gets whether the transparency is treated as alpha coverage.\r\n */\r\n public get transparencyAsAlphaCoverage(): boolean {\r\n return this._material.useRadianceOverAlpha || this._material.useSpecularOverAlpha;\r\n }\r\n\r\n /**\r\n * Sets/Gets whether the transparency is treated as alpha coverage\r\n */\r\n public set transparencyAsAlphaCoverage(value: boolean) {\r\n this._material.useRadianceOverAlpha = !value;\r\n this._material.useSpecularOverAlpha = !value;\r\n }\r\n\r\n // ========================================\r\n // BASE PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the base color of the material (mapped to PBR albedoColor).\r\n * @param value The base color as a Color3\r\n */\r\n public set baseColor(value: Color3) {\r\n this._material.albedoColor = value;\r\n }\r\n\r\n /**\r\n * Gets the base color of the material.\r\n * @returns The base color as a Color3\r\n */\r\n public get baseColor(): Color3 {\r\n return this._material.albedoColor;\r\n }\r\n\r\n /**\r\n * Sets the base color texture of the material (mapped to PBR albedoTexture).\r\n * @param value The base color texture or null\r\n */\r\n public set baseColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.albedoTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base color texture of the material.\r\n * @returns The base color texture or null\r\n */\r\n public get baseColorTexture(): Nullable<BaseTexture> {\r\n return this._material.albedoTexture;\r\n }\r\n\r\n /**\r\n * Sets the base diffuse roughness of the material.\r\n * @param value The diffuse roughness value (0-1)\r\n */\r\n public set baseDiffuseRoughness(value: number) {\r\n this._material.baseDiffuseRoughness = value;\r\n if (value > 0) {\r\n this._material.brdf.baseDiffuseModel = Constants.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the base diffuse roughness of the material.\r\n * @returns The diffuse roughness value (0-1), defaults to 0 if not set\r\n */\r\n public get baseDiffuseRoughness(): number {\r\n return this._material.baseDiffuseRoughness ?? 0;\r\n }\r\n\r\n /**\r\n * Sets the base diffuse roughness texture of the material.\r\n * @param value The diffuse roughness texture or null\r\n */\r\n public set baseDiffuseRoughnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.baseDiffuseRoughnessTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base diffuse roughness texture of the material.\r\n * @returns The diffuse roughness texture or null\r\n */\r\n public get baseDiffuseRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.baseDiffuseRoughnessTexture;\r\n }\r\n\r\n /**\r\n * Sets the base metalness value of the material (mapped to PBR metallic).\r\n * @param value The metalness value (0-1)\r\n */\r\n public set baseMetalness(value: number) {\r\n this._material.metallic = value;\r\n }\r\n\r\n /**\r\n * Gets the base metalness value of the material.\r\n * @returns The metalness value (0-1), defaults to 1 if not set\r\n */\r\n public get baseMetalness(): number {\r\n return this._material.metallic ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the base metalness texture of the material (mapped to PBR metallicTexture).\r\n * @param value The metalness texture or null\r\n */\r\n public set baseMetalnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.metallicTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the base metalness texture of the material.\r\n * @returns The metalness texture or null\r\n */\r\n public get baseMetalnessTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicTexture;\r\n }\r\n\r\n /**\r\n * Sets whether to use roughness from the metallic texture's green channel.\r\n * Also disables using roughness from the alpha channel when enabled.\r\n * @param value True to use green channel for roughness\r\n */\r\n public set useRoughnessFromMetallicTextureGreen(value: boolean) {\r\n this._material.useRoughnessFromMetallicTextureGreen = value;\r\n this._material.useRoughnessFromMetallicTextureAlpha = !value;\r\n }\r\n\r\n /**\r\n * Sets whether to use metalness from the metallic texture's blue channel.\r\n * @param value True to use blue channel for metalness\r\n */\r\n public set useMetallicFromMetallicTextureBlue(value: boolean) {\r\n this._material.useMetallnessFromMetallicTextureBlue = value;\r\n }\r\n\r\n // ========================================\r\n // SPECULAR PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Configures specular properties and optionally enables OpenPBR BRDF model for edge color support.\r\n * @param enableEdgeColor Whether to enable OpenPBR BRDF models for edge color support\r\n */\r\n public enableSpecularEdgeColor(enableEdgeColor: boolean = false): void {\r\n if (enableEdgeColor) {\r\n this._material.brdf.dielectricSpecularModel = Constants.MATERIAL_DIELECTRIC_SPECULAR_MODEL_OPENPBR;\r\n this._material.brdf.conductorSpecularModel = Constants.MATERIAL_CONDUCTOR_SPECULAR_MODEL_OPENPBR;\r\n }\r\n }\r\n\r\n /**\r\n * Sets the specular weight (mapped to PBR metallicF0Factor).\r\n * @param value The specular weight value\r\n */\r\n public set specularWeight(value: number) {\r\n this._material.metallicF0Factor = value;\r\n }\r\n\r\n /**\r\n * Gets the specular weight.\r\n * @returns The specular weight value, defaults to 1 if not set\r\n */\r\n public get specularWeight(): number {\r\n return this._material.metallicF0Factor ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the specular weight texture (mapped to PBR metallicReflectanceTexture).\r\n * Configures the material to use only metalness from this texture when set.\r\n * @param value The specular weight texture or null\r\n */\r\n public set specularWeightTexture(value: Nullable<BaseTexture>) {\r\n if (value) {\r\n this._material.metallicReflectanceTexture = value;\r\n this._material.useOnlyMetallicFromMetallicReflectanceTexture = true;\r\n } else {\r\n this._material.metallicReflectanceTexture = null;\r\n this._material.useOnlyMetallicFromMetallicReflectanceTexture = false;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the specular weight texture.\r\n * @returns The specular weight texture or null\r\n */\r\n public get specularWeightTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicReflectanceTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular color (mapped to PBR metallicReflectanceColor).\r\n * @param value The specular color as a Color3\r\n */\r\n public set specularColor(value: Color3) {\r\n this._material.metallicReflectanceColor = value;\r\n }\r\n\r\n /**\r\n * Gets the specular color.\r\n * @returns The specular color as a Color3\r\n */\r\n public get specularColor(): Color3 {\r\n return this._material.metallicReflectanceColor;\r\n }\r\n\r\n /**\r\n * Sets the specular color texture (mapped to PBR reflectanceTexture).\r\n * @param value The specular color texture or null\r\n */\r\n public set specularColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.reflectanceTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the specular color texture.\r\n * @returns The specular color texture or null\r\n */\r\n public get specularColorTexture(): Nullable<BaseTexture> {\r\n return this._material.reflectanceTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular roughness (mapped to PBR roughness).\r\n * @param value The roughness value (0-1)\r\n */\r\n public set specularRoughness(value: number) {\r\n this._material.roughness = value;\r\n }\r\n\r\n /**\r\n * Gets the specular roughness.\r\n * @returns The roughness value (0-1), defaults to 1 if not set\r\n */\r\n public get specularRoughness(): number {\r\n return this._material.roughness ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the specular roughness texture.\r\n * Note: PBR uses the same texture for both metallic and roughness,\r\n * so this only sets the texture if no base metalness texture exists.\r\n * @param value The roughness texture or null\r\n */\r\n public set specularRoughnessTexture(value: Nullable<BaseTexture>) {\r\n // PBR uses the same texture for both metallic and roughness\r\n if (!this.baseMetalnessTexture) {\r\n this._material.metallicTexture = value;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the specular roughness texture.\r\n * @returns The roughness texture (same as metallic texture for PBR) or null\r\n */\r\n public get specularRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.metallicTexture;\r\n }\r\n\r\n /**\r\n * Sets the specular index of refraction (mapped to PBR indexOfRefraction).\r\n * @param value The IOR value\r\n */\r\n public set specularIor(value: number) {\r\n this._material.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Gets the specular index of refraction.\r\n * @returns The IOR value\r\n */\r\n public get specularIor(): number {\r\n return this._material.indexOfRefraction;\r\n }\r\n\r\n // ========================================\r\n // EMISSION PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Sets the emission color (mapped to PBR emissiveColor).\r\n * @param value The emission color as a Color3\r\n */\r\n public set emissionColor(value: Color3) {\r\n this._material.emissiveColor = value;\r\n }\r\n\r\n /**\r\n * Gets the emission color.\r\n * @returns The emission color as a Color3\r\n */\r\n public get emissionColor(): Color3 {\r\n return this._material.emissiveColor;\r\n }\r\n\r\n /**\r\n * Sets the emission luminance/intensity (mapped to PBR emissiveIntensity).\r\n * @param value The emission intensity value\r\n */\r\n public set emissionLuminance(value: number) {\r\n this._material.emissiveIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the emission luminance/intensity.\r\n * @returns The emission intensity value\r\n */\r\n public get emissionLuminance(): number {\r\n return this._material.emissiveIntensity;\r\n }\r\n\r\n /**\r\n * Sets the emission color texture (mapped to PBR emissiveTexture).\r\n * @param value The emission texture or null\r\n */\r\n public set emissionColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.emissiveTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the emission color texture.\r\n * @returns The emission texture or null\r\n */\r\n public get emissionColorTexture(): Nullable<BaseTexture> {\r\n return this._material.emissiveTexture;\r\n }\r\n\r\n // ========================================\r\n // AMBIENT OCCLUSION\r\n // ========================================\r\n\r\n /**\r\n * Sets the ambient occlusion texture (mapped to PBR ambientTexture).\r\n * Automatically enables grayscale mode when set.\r\n * @param value The ambient occlusion texture or null\r\n */\r\n public set ambientOcclusionTexture(value: Nullable<BaseTexture>) {\r\n this._material.ambientTexture = value;\r\n if (value) {\r\n this._material.useAmbientInGrayScale = true;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the ambient occlusion texture.\r\n * @returns The ambient occlusion texture or null\r\n */\r\n public get ambientOcclusionTexture(): Nullable<BaseTexture> {\r\n return this._material.ambientTexture;\r\n }\r\n\r\n /**\r\n * Sets the ambient occlusion texture strength.\r\n * @param value The strength value (typically 0-1)\r\n */\r\n public set ambientOcclusionTextureStrength(value: number) {\r\n this._material.ambientTextureStrength = value;\r\n }\r\n\r\n /**\r\n * Gets the ambient occlusion texture strength.\r\n * @returns The strength value, defaults to 1.0 if not set\r\n */\r\n public get ambientOcclusionTextureStrength(): number {\r\n return this._material.ambientTextureStrength ?? 1.0;\r\n }\r\n\r\n // ========================================\r\n // COAT PARAMETERS\r\n // ========================================\r\n\r\n /**\r\n * Configures clear coat for PBR material.\r\n * Enables clear coat and sets up proper configuration.\r\n */\r\n public configureCoat(): void {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.useRoughnessFromMainTexture = false;\r\n this._material.clearCoat.remapF0OnInterfaceChange = false;\r\n }\r\n\r\n /**\r\n * Sets the coat weight (mapped to PBR clearCoat.intensity).\r\n * Automatically enables clear coat.\r\n * @param value The coat weight value (0-1)\r\n */\r\n public set coatWeight(value: number) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the coat weight.\r\n * @returns The coat weight value\r\n */\r\n public get coatWeight(): number {\r\n return this._material.clearCoat.intensity;\r\n }\r\n\r\n /**\r\n * Sets the coat weight texture (mapped to PBR clearCoat.texture).\r\n * Automatically enables clear coat.\r\n * @param value The coat weight texture or null\r\n */\r\n public set coatWeightTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.texture = value;\r\n }\r\n\r\n /**\r\n * Gets the coat weight texture.\r\n * @returns The coat weight texture or null\r\n */\r\n public get coatWeightTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.texture;\r\n }\r\n\r\n /**\r\n * Sets the coat color (mapped to PBR clearCoat.tintColor).\r\n * @param value The coat tint color as a Color3\r\n */\r\n public set coatColor(value: Color3) {\r\n this._material.clearCoat.isTintEnabled = value != Color3.White();\r\n this._material.clearCoat.tintColor = value;\r\n }\r\n\r\n /**\r\n * Sets the coat color texture (mapped to PBR clearCoat.tintTexture).\r\n * @param value The coat color texture or null\r\n */\r\n public set coatColorTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.tintTexture = value;\r\n }\r\n\r\n /**\r\n * Sets the coat roughness (mapped to PBR clearCoat.roughness).\r\n * Automatically enables clear coat.\r\n * @param value The coat roughness value (0-1)\r\n */\r\n public set coatRoughness(value: number) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.roughness = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness.\r\n * @returns The coat roughness value, defaults to 0 if not set\r\n */\r\n public get coatRoughness(): number {\r\n return this._material.clearCoat.roughness ?? 0;\r\n }\r\n\r\n /**\r\n * Sets the coat roughness texture (mapped to PBR clearCoat.textureRoughness).\r\n * Automatically enables clear coat and disables using roughness from main texture.\r\n * @param value The coat roughness texture or null\r\n */\r\n public set coatRoughnessTexture(value: Nullable<BaseTexture>) {\r\n this._material.clearCoat.isEnabled = true;\r\n this._material.clearCoat.useRoughnessFromMainTexture = false;\r\n this._material.clearCoat.textureRoughness = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness texture.\r\n * @returns The coat roughness texture or null\r\n */\r\n public get coatRoughnessTexture(): Nullable<BaseTexture> {\r\n return this._material.clearCoat.textureRoughness;\r\n }\r\n\r\n /**\r\n * Sets the coat index of refraction (IOR).\r\n */\r\n public set coatIor(value: number) {\r\n this._material.clearCoat.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Sets the coat darkening value.\r\n * Note: PBR doesn't have a direct coat darkening property, so this is a no-op.\r\n * @param value The coat darkening value (ignored for PBR)\r\n */\r\n public set coatDarkening(value: number) {\r\n // PBR doesn't have a coat darkening property\r\n }\r\n\r\n /**\r\n * Sets the coat darkening texture\r\n * @param value The coat darkening texture or null\r\n */\r\n public set coatDarkeningTexture(value: Nullable<BaseTexture>) {\r\n // PBR doesn't have a coat darkening property\r\n }\r\n\r\n /**\r\n * Sets the coat roughness anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.\r\n * @param value The coat anisotropy intensity value (currently ignored)\r\n */\r\n public set coatRoughnessAnisotropy(value: number) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropy = value;\r\n }\r\n\r\n /**\r\n * Gets the coat roughness anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this returns 0.\r\n * @returns Currently returns 0 as clearCoat anisotropy is not yet available\r\n */\r\n public get coatRoughnessAnisotropy(): number {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // return this._material.clearCoat.anisotropy ?? 0;\r\n return 0;\r\n }\r\n\r\n /**\r\n * Sets the coat tangent angle for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.\r\n * @param value The coat anisotropy rotation angle in radians (currently ignored)\r\n */\r\n public set geometryCoatTangentAngle(value: number) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropyAngle = value;\r\n }\r\n\r\n /**\r\n * Sets the coat tangent texture for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy textures yet, so this is a placeholder.\r\n * @param value The coat anisotropy texture (currently ignored)\r\n */\r\n public set geometryCoatTangentTexture(value: Nullable<BaseTexture>) {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // this._material.clearCoat.anisotropyTangentTexture = value;\r\n }\r\n\r\n /**\r\n * Gets the coat tangent texture for anisotropy.\r\n * Note: PBR clearCoat doesn't support anisotropy textures yet, so this returns null.\r\n * @returns Currently returns null as clearCoat anisotropy is not yet available\r\n */\r\n public get geometryCoatTangentTexture(): Nullable<BaseTexture> {\r\n // TODO: Implement when PBR clearCoat anisotropy becomes available\r\n // return this._material.clearCoat.anisotropyTangentTexture;\r\n return null;\r\n }\r\n\r\n // ========================================\r\n // TRANSMISSION LAYER\r\n // ========================================\r\n\r\n /**\r\n * Sets the transmission weight (mapped to PBR subSurface.refractionIntensity).\r\n * Enables refraction when value \\> 0.\r\n * @param value The transmission weight value (0-1)\r\n */\r\n public set transmissionWeight(value: number) {\r\n this._material.subSurface.isRefractionEnabled = value > 0;\r\n this._material.subSurface.refractionIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets the transmission weight.\r\n * @returns The transmission weight value\r\n */\r\n public get transmissionWeight(): number {\r\n return this._material.subSurface.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 /**\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 * 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 extinction coefficient of the volume.\r\n * @param value The extinction coefficient as a Vector3\r\n */\r\n public set extinctionCoefficient(value: Vector3) {\r\n this._extinctionCoefficient = value;\r\n }\r\n\r\n /**\r\n * Gets the extinction coefficient of the volume.\r\n */\r\n public get extinctionCoefficient(): Vector3 {\r\n return this._extinctionCoefficient;\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\r\n const absorptionCoeff = this.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 subsurfaceConstantTint(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 subsurfaceConstantTint(): 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 subsurfaceConstantTintTexture(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 // 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,4 +1,5 @@
1
1
  import type * as GLTF2 from "babylonjs-gltf2interface";
2
+ import type { Nullable } from "@onerjs/core/types.js";
2
3
  /**
3
4
  * Configuration for glTF validation
4
5
  */
@@ -17,6 +18,11 @@ export declare class GLTFValidation {
17
18
  */
18
19
  static Configuration: IGLTFValidationConfiguration;
19
20
  private static _LoadScriptPromise;
21
+ /**
22
+ * The most recent validation results.
23
+ * @internal - Used for back-compat in Sandbox with Inspector V2.
24
+ */
25
+ static _LastResults: Nullable<GLTF2.IGLTFValidationResults>;
20
26
  /**
21
27
  * Validate a glTF asset using the glTF-Validator.
22
28
  * @param data The JSON of a glTF or the array buffer of a binary glTF
@@ -81,6 +81,7 @@ export class GLTFValidation {
81
81
  case "validate.resolve": {
82
82
  worker.removeEventListener("error", onError);
83
83
  worker.removeEventListener("message", onMessage);
84
+ GLTFValidation._LastResults = data.value;
84
85
  resolve(data.value);
85
86
  worker.terminate();
86
87
  break;
@@ -123,4 +124,9 @@ export class GLTFValidation {
123
124
  GLTFValidation.Configuration = {
124
125
  url: `${Tools._DefaultCdnUrl}/gltf_validator.js`,
125
126
  };
127
+ /**
128
+ * The most recent validation results.
129
+ * @internal - Used for back-compat in Sandbox with Inspector V2.
130
+ */
131
+ GLTFValidation._LastResults = null;
126
132
  //# sourceMappingURL=glTFValidation.js.map