babylonjs-loaders 8.28.1 → 8.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babylon.glTF1FileLoader.js +1 -1
- package/babylon.glTF1FileLoader.min.js +1 -1
- package/babylon.glTF1FileLoader.min.js.map +1 -1
- package/babylon.glTF2FileLoader.js +1 -1
- package/babylon.glTF2FileLoader.min.js +1 -1
- package/babylon.glTF2FileLoader.min.js.map +1 -1
- package/babylon.glTFFileLoader.js +1 -1
- package/babylon.glTFFileLoader.min.js +1 -1
- package/babylon.glTFFileLoader.min.js.map +1 -1
- package/babylon.objFileLoader.js +1 -1
- package/babylon.objFileLoader.min.js +1 -1
- package/babylon.objFileLoader.min.js.map +1 -1
- package/babylonjs.loaders.d.ts +1786 -107
- package/babylonjs.loaders.js +1 -1
- package/babylonjs.loaders.min.js +1 -1
- package/babylonjs.loaders.min.js.map +1 -1
- package/babylonjs.loaders.module.d.ts +4119 -747
- package/package.json +3 -3
package/babylonjs.loaders.d.ts
CHANGED
|
@@ -257,6 +257,11 @@ declare module BABYLON {
|
|
|
257
257
|
* Defines if the loader should validate the asset.
|
|
258
258
|
*/
|
|
259
259
|
validate: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Load the glTF files using the OpenPBR material.
|
|
262
|
+
* @experimental
|
|
263
|
+
*/
|
|
264
|
+
useOpenPBR: boolean;
|
|
260
265
|
}
|
|
261
266
|
/**
|
|
262
267
|
* The default GLTF loader options.
|
|
@@ -506,86 +511,1617 @@ declare module BABYLON {
|
|
|
506
511
|
*/
|
|
507
512
|
importMeshAsync(meshesNames: string | readonly string[] | null | undefined, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
|
|
508
513
|
/**
|
|
509
|
-
* @internal
|
|
514
|
+
* @internal
|
|
515
|
+
*/
|
|
516
|
+
loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
|
|
517
|
+
/**
|
|
518
|
+
* @internal
|
|
519
|
+
*/
|
|
520
|
+
loadAssetContainerAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
|
|
521
|
+
/**
|
|
522
|
+
* @internal
|
|
523
|
+
*/
|
|
524
|
+
canDirectLoad(data: string): boolean;
|
|
525
|
+
/**
|
|
526
|
+
* @internal
|
|
527
|
+
*/
|
|
528
|
+
directLoad(scene: Scene, data: string): Promise<object>;
|
|
529
|
+
/**
|
|
530
|
+
* The callback that allows custom handling of the root url based on the response url.
|
|
531
|
+
* @param rootUrl the original root url
|
|
532
|
+
* @param responseURL the response url if available
|
|
533
|
+
* @returns the new root url
|
|
534
|
+
*/
|
|
535
|
+
rewriteRootURL?(rootUrl: string, responseURL?: string): string;
|
|
536
|
+
/** @internal */
|
|
537
|
+
createPlugin(options: SceneLoaderPluginOptions): ISceneLoaderPluginAsync;
|
|
538
|
+
/**
|
|
539
|
+
* The loader state or null if the loader is not active.
|
|
540
|
+
*/
|
|
541
|
+
get loaderState(): Nullable<GLTFLoaderState>;
|
|
542
|
+
/**
|
|
543
|
+
* Observable raised when the loader state changes.
|
|
544
|
+
*/
|
|
545
|
+
onLoaderStateChangedObservable: Observable<Nullable<GLTFLoaderState>>;
|
|
546
|
+
/**
|
|
547
|
+
* Returns a promise that resolves when the asset is completely loaded.
|
|
548
|
+
* @returns a promise that resolves when the asset is completely loaded.
|
|
549
|
+
*/
|
|
550
|
+
whenCompleteAsync(): Promise<void>;
|
|
551
|
+
/**
|
|
552
|
+
* @internal
|
|
553
|
+
*/
|
|
554
|
+
_setState(state: GLTFLoaderState): void;
|
|
555
|
+
/**
|
|
556
|
+
* @internal
|
|
557
|
+
*/
|
|
558
|
+
_loadFile(scene: Scene, fileOrUrl: File | string, onSuccess: (data: string | ArrayBuffer) => void, useArrayBuffer?: boolean, onError?: (request?: WebRequest) => void, onOpened?: (request: WebRequest) => void): IFileRequest;
|
|
559
|
+
private _onProgress;
|
|
560
|
+
private _validate;
|
|
561
|
+
private _getLoader;
|
|
562
|
+
private _parseJson;
|
|
563
|
+
private _unpackBinaryAsync;
|
|
564
|
+
private _unpackBinaryV1Async;
|
|
565
|
+
private _unpackBinaryV2Async;
|
|
566
|
+
private static _parseVersion;
|
|
567
|
+
private static _compareVersion;
|
|
568
|
+
private static readonly _logSpaces;
|
|
569
|
+
private _logIndentLevel;
|
|
570
|
+
private _loggingEnabled;
|
|
571
|
+
/** @internal */
|
|
572
|
+
_log: (message: string) => void;
|
|
573
|
+
/**
|
|
574
|
+
* @internal
|
|
575
|
+
*/
|
|
576
|
+
_logOpen(message: string): void;
|
|
577
|
+
/** @internal */
|
|
578
|
+
_logClose(): void;
|
|
579
|
+
private _logEnabled;
|
|
580
|
+
private _logDisabled;
|
|
581
|
+
private _capturePerformanceCounters;
|
|
582
|
+
/** @internal */
|
|
583
|
+
_startPerformanceCounter: (counterName: string) => void;
|
|
584
|
+
/** @internal */
|
|
585
|
+
_endPerformanceCounter: (counterName: string) => void;
|
|
586
|
+
private _startPerformanceCounterEnabled;
|
|
587
|
+
private _startPerformanceCounterDisabled;
|
|
588
|
+
private _endPerformanceCounterEnabled;
|
|
589
|
+
private _endPerformanceCounterDisabled;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
}
|
|
595
|
+
declare module BABYLON.GLTF2 {
|
|
596
|
+
/**
|
|
597
|
+
* Material Loading Adapter for PBR materials that provides a unified OpenPBR-like interface.
|
|
598
|
+
*/
|
|
599
|
+
export class PBRMaterialLoadingAdapter implements BABYLON.GLTF2.IMaterialLoadingAdapter {
|
|
600
|
+
private _material;
|
|
601
|
+
/**
|
|
602
|
+
* Creates a new instance of the PBRMaterialLoadingAdapter.
|
|
603
|
+
* @param material - The PBR material to adapt.
|
|
604
|
+
*/
|
|
605
|
+
constructor(material: Material);
|
|
606
|
+
/**
|
|
607
|
+
* Gets the underlying material
|
|
608
|
+
*/
|
|
609
|
+
get material(): PBRMaterial;
|
|
610
|
+
/**
|
|
611
|
+
* Whether the material should be treated as unlit
|
|
612
|
+
*/
|
|
613
|
+
get isUnlit(): boolean;
|
|
614
|
+
/**
|
|
615
|
+
* Sets whether the material should be treated as unlit
|
|
616
|
+
*/
|
|
617
|
+
set isUnlit(value: boolean);
|
|
618
|
+
/**
|
|
619
|
+
* Sets whether back face culling is enabled.
|
|
620
|
+
* @param value True to enable back face culling
|
|
621
|
+
*/
|
|
622
|
+
set backFaceCulling(value: boolean);
|
|
623
|
+
/**
|
|
624
|
+
* Gets whether back face culling is enabled.
|
|
625
|
+
* @returns True if back face culling is enabled
|
|
626
|
+
*/
|
|
627
|
+
get backFaceCulling(): boolean;
|
|
628
|
+
/**
|
|
629
|
+
* Sets whether two-sided lighting is enabled.
|
|
630
|
+
* @param value True to enable two-sided lighting
|
|
631
|
+
*/
|
|
632
|
+
set twoSidedLighting(value: boolean);
|
|
633
|
+
/**
|
|
634
|
+
* Gets whether two-sided lighting is enabled.
|
|
635
|
+
* @returns True if two-sided lighting is enabled
|
|
636
|
+
*/
|
|
637
|
+
get twoSidedLighting(): boolean;
|
|
638
|
+
/**
|
|
639
|
+
* Sets the alpha cutoff value for alpha testing.
|
|
640
|
+
* @param value The alpha cutoff threshold (0-1)
|
|
641
|
+
*/
|
|
642
|
+
set alphaCutOff(value: number);
|
|
643
|
+
/**
|
|
644
|
+
* Gets the alpha cutoff value.
|
|
645
|
+
* @returns The alpha cutoff threshold (0-1)
|
|
646
|
+
*/
|
|
647
|
+
get alphaCutOff(): number;
|
|
648
|
+
/**
|
|
649
|
+
* Sets whether to use alpha from the albedo texture.
|
|
650
|
+
* @param value True to use alpha from albedo texture
|
|
651
|
+
*/
|
|
652
|
+
set useAlphaFromBaseColorTexture(value: boolean);
|
|
653
|
+
/**
|
|
654
|
+
* Gets whether alpha is used from the albedo texture.
|
|
655
|
+
* @returns True if using alpha from albedo texture
|
|
656
|
+
*/
|
|
657
|
+
get useAlphaFromBaseColorTexture(): boolean;
|
|
658
|
+
/**
|
|
659
|
+
* Gets whether the transparency is treated as alpha coverage.
|
|
660
|
+
*/
|
|
661
|
+
get transparencyAsAlphaCoverage(): boolean;
|
|
662
|
+
/**
|
|
663
|
+
* Sets/Gets whether the transparency is treated as alpha coverage
|
|
664
|
+
*/
|
|
665
|
+
set transparencyAsAlphaCoverage(value: boolean);
|
|
666
|
+
/**
|
|
667
|
+
* Sets the base color of the material (mapped to PBR albedoColor).
|
|
668
|
+
* @param value The base color as a Color3
|
|
669
|
+
*/
|
|
670
|
+
set baseColor(value: Color3);
|
|
671
|
+
/**
|
|
672
|
+
* Gets the base color of the material.
|
|
673
|
+
* @returns The base color as a Color3
|
|
674
|
+
*/
|
|
675
|
+
get baseColor(): Color3;
|
|
676
|
+
/**
|
|
677
|
+
* Sets the base color texture of the material (mapped to PBR albedoTexture).
|
|
678
|
+
* @param value The base color texture or null
|
|
679
|
+
*/
|
|
680
|
+
set baseColorTexture(value: Nullable<BaseTexture>);
|
|
681
|
+
/**
|
|
682
|
+
* Gets the base color texture of the material.
|
|
683
|
+
* @returns The base color texture or null
|
|
684
|
+
*/
|
|
685
|
+
get baseColorTexture(): Nullable<BaseTexture>;
|
|
686
|
+
/**
|
|
687
|
+
* Sets the base diffuse roughness of the material.
|
|
688
|
+
* @param value The diffuse roughness value (0-1)
|
|
689
|
+
*/
|
|
690
|
+
set baseDiffuseRoughness(value: number);
|
|
691
|
+
/**
|
|
692
|
+
* Gets the base diffuse roughness of the material.
|
|
693
|
+
* @returns The diffuse roughness value (0-1), defaults to 0 if not set
|
|
694
|
+
*/
|
|
695
|
+
get baseDiffuseRoughness(): number;
|
|
696
|
+
/**
|
|
697
|
+
* Sets the base diffuse roughness texture of the material.
|
|
698
|
+
* @param value The diffuse roughness texture or null
|
|
699
|
+
*/
|
|
700
|
+
set baseDiffuseRoughnessTexture(value: Nullable<BaseTexture>);
|
|
701
|
+
/**
|
|
702
|
+
* Gets the base diffuse roughness texture of the material.
|
|
703
|
+
* @returns The diffuse roughness texture or null
|
|
704
|
+
*/
|
|
705
|
+
get baseDiffuseRoughnessTexture(): Nullable<BaseTexture>;
|
|
706
|
+
/**
|
|
707
|
+
* Sets the base metalness value of the material (mapped to PBR metallic).
|
|
708
|
+
* @param value The metalness value (0-1)
|
|
709
|
+
*/
|
|
710
|
+
set baseMetalness(value: number);
|
|
711
|
+
/**
|
|
712
|
+
* Gets the base metalness value of the material.
|
|
713
|
+
* @returns The metalness value (0-1), defaults to 1 if not set
|
|
714
|
+
*/
|
|
715
|
+
get baseMetalness(): number;
|
|
716
|
+
/**
|
|
717
|
+
* Sets the base metalness texture of the material (mapped to PBR metallicTexture).
|
|
718
|
+
* @param value The metalness texture or null
|
|
719
|
+
*/
|
|
720
|
+
set baseMetalnessTexture(value: Nullable<BaseTexture>);
|
|
721
|
+
/**
|
|
722
|
+
* Gets the base metalness texture of the material.
|
|
723
|
+
* @returns The metalness texture or null
|
|
724
|
+
*/
|
|
725
|
+
get baseMetalnessTexture(): Nullable<BaseTexture>;
|
|
726
|
+
/**
|
|
727
|
+
* Sets whether to use roughness from the metallic texture's green channel.
|
|
728
|
+
* Also disables using roughness from the alpha channel when enabled.
|
|
729
|
+
* @param value True to use green channel for roughness
|
|
730
|
+
*/
|
|
731
|
+
set useRoughnessFromMetallicTextureGreen(value: boolean);
|
|
732
|
+
/**
|
|
733
|
+
* Sets whether to use metalness from the metallic texture's blue channel.
|
|
734
|
+
* @param value True to use blue channel for metalness
|
|
735
|
+
*/
|
|
736
|
+
set useMetallicFromMetallicTextureBlue(value: boolean);
|
|
737
|
+
/**
|
|
738
|
+
* Configures specular properties and optionally enables OpenPBR BRDF model for edge color support.
|
|
739
|
+
* @param enableEdgeColor Whether to enable OpenPBR BRDF models for edge color support
|
|
740
|
+
*/
|
|
741
|
+
enableSpecularEdgeColor(enableEdgeColor?: boolean): void;
|
|
742
|
+
/**
|
|
743
|
+
* Sets the specular weight (mapped to PBR metallicF0Factor).
|
|
744
|
+
* @param value The specular weight value
|
|
745
|
+
*/
|
|
746
|
+
set specularWeight(value: number);
|
|
747
|
+
/**
|
|
748
|
+
* Gets the specular weight.
|
|
749
|
+
* @returns The specular weight value, defaults to 1 if not set
|
|
750
|
+
*/
|
|
751
|
+
get specularWeight(): number;
|
|
752
|
+
/**
|
|
753
|
+
* Sets the specular weight texture (mapped to PBR metallicReflectanceTexture).
|
|
754
|
+
* Configures the material to use only metalness from this texture when set.
|
|
755
|
+
* @param value The specular weight texture or null
|
|
756
|
+
*/
|
|
757
|
+
set specularWeightTexture(value: Nullable<BaseTexture>);
|
|
758
|
+
/**
|
|
759
|
+
* Gets the specular weight texture.
|
|
760
|
+
* @returns The specular weight texture or null
|
|
761
|
+
*/
|
|
762
|
+
get specularWeightTexture(): Nullable<BaseTexture>;
|
|
763
|
+
/**
|
|
764
|
+
* Sets the specular color (mapped to PBR metallicReflectanceColor).
|
|
765
|
+
* @param value The specular color as a Color3
|
|
766
|
+
*/
|
|
767
|
+
set specularColor(value: Color3);
|
|
768
|
+
/**
|
|
769
|
+
* Gets the specular color.
|
|
770
|
+
* @returns The specular color as a Color3
|
|
771
|
+
*/
|
|
772
|
+
get specularColor(): Color3;
|
|
773
|
+
/**
|
|
774
|
+
* Sets the specular color texture (mapped to PBR reflectanceTexture).
|
|
775
|
+
* @param value The specular color texture or null
|
|
776
|
+
*/
|
|
777
|
+
set specularColorTexture(value: Nullable<BaseTexture>);
|
|
778
|
+
/**
|
|
779
|
+
* Gets the specular color texture.
|
|
780
|
+
* @returns The specular color texture or null
|
|
781
|
+
*/
|
|
782
|
+
get specularColorTexture(): Nullable<BaseTexture>;
|
|
783
|
+
/**
|
|
784
|
+
* Sets the specular roughness (mapped to PBR roughness).
|
|
785
|
+
* @param value The roughness value (0-1)
|
|
786
|
+
*/
|
|
787
|
+
set specularRoughness(value: number);
|
|
788
|
+
/**
|
|
789
|
+
* Gets the specular roughness.
|
|
790
|
+
* @returns The roughness value (0-1), defaults to 1 if not set
|
|
791
|
+
*/
|
|
792
|
+
get specularRoughness(): number;
|
|
793
|
+
/**
|
|
794
|
+
* Sets the specular roughness texture.
|
|
795
|
+
* Note: PBR uses the same texture for both metallic and roughness,
|
|
796
|
+
* so this only sets the texture if no base metalness texture exists.
|
|
797
|
+
* @param value The roughness texture or null
|
|
798
|
+
*/
|
|
799
|
+
set specularRoughnessTexture(value: Nullable<BaseTexture>);
|
|
800
|
+
/**
|
|
801
|
+
* Gets the specular roughness texture.
|
|
802
|
+
* @returns The roughness texture (same as metallic texture for PBR) or null
|
|
803
|
+
*/
|
|
804
|
+
get specularRoughnessTexture(): Nullable<BaseTexture>;
|
|
805
|
+
/**
|
|
806
|
+
* Sets the specular index of refraction (mapped to PBR indexOfRefraction).
|
|
807
|
+
* @param value The IOR value
|
|
808
|
+
*/
|
|
809
|
+
set specularIor(value: number);
|
|
810
|
+
/**
|
|
811
|
+
* Gets the specular index of refraction.
|
|
812
|
+
* @returns The IOR value
|
|
813
|
+
*/
|
|
814
|
+
get specularIor(): number;
|
|
815
|
+
/**
|
|
816
|
+
* Sets the emission color (mapped to PBR emissiveColor).
|
|
817
|
+
* @param value The emission color as a Color3
|
|
818
|
+
*/
|
|
819
|
+
set emissionColor(value: Color3);
|
|
820
|
+
/**
|
|
821
|
+
* Gets the emission color.
|
|
822
|
+
* @returns The emission color as a Color3
|
|
823
|
+
*/
|
|
824
|
+
get emissionColor(): Color3;
|
|
825
|
+
/**
|
|
826
|
+
* Sets the emission luminance/intensity (mapped to PBR emissiveIntensity).
|
|
827
|
+
* @param value The emission intensity value
|
|
828
|
+
*/
|
|
829
|
+
set emissionLuminance(value: number);
|
|
830
|
+
/**
|
|
831
|
+
* Gets the emission luminance/intensity.
|
|
832
|
+
* @returns The emission intensity value
|
|
833
|
+
*/
|
|
834
|
+
get emissionLuminance(): number;
|
|
835
|
+
/**
|
|
836
|
+
* Sets the emission color texture (mapped to PBR emissiveTexture).
|
|
837
|
+
* @param value The emission texture or null
|
|
838
|
+
*/
|
|
839
|
+
set emissionColorTexture(value: Nullable<BaseTexture>);
|
|
840
|
+
/**
|
|
841
|
+
* Gets the emission color texture.
|
|
842
|
+
* @returns The emission texture or null
|
|
843
|
+
*/
|
|
844
|
+
get emissionColorTexture(): Nullable<BaseTexture>;
|
|
845
|
+
/**
|
|
846
|
+
* Sets the ambient occlusion texture (mapped to PBR ambientTexture).
|
|
847
|
+
* Automatically enables grayscale mode when set.
|
|
848
|
+
* @param value The ambient occlusion texture or null
|
|
849
|
+
*/
|
|
850
|
+
set ambientOcclusionTexture(value: Nullable<BaseTexture>);
|
|
851
|
+
/**
|
|
852
|
+
* Gets the ambient occlusion texture.
|
|
853
|
+
* @returns The ambient occlusion texture or null
|
|
854
|
+
*/
|
|
855
|
+
get ambientOcclusionTexture(): Nullable<BaseTexture>;
|
|
856
|
+
/**
|
|
857
|
+
* Sets the ambient occlusion texture strength.
|
|
858
|
+
* @param value The strength value (typically 0-1)
|
|
859
|
+
*/
|
|
860
|
+
set ambientOcclusionTextureStrength(value: number);
|
|
861
|
+
/**
|
|
862
|
+
* Gets the ambient occlusion texture strength.
|
|
863
|
+
* @returns The strength value, defaults to 1.0 if not set
|
|
864
|
+
*/
|
|
865
|
+
get ambientOcclusionTextureStrength(): number;
|
|
866
|
+
/**
|
|
867
|
+
* Configures clear coat for PBR material.
|
|
868
|
+
* Enables clear coat and sets up proper configuration.
|
|
869
|
+
*/
|
|
870
|
+
configureCoat(): void;
|
|
871
|
+
/**
|
|
872
|
+
* Sets the coat weight (mapped to PBR clearCoat.intensity).
|
|
873
|
+
* Automatically enables clear coat.
|
|
874
|
+
* @param value The coat weight value (0-1)
|
|
875
|
+
*/
|
|
876
|
+
set coatWeight(value: number);
|
|
877
|
+
/**
|
|
878
|
+
* Gets the coat weight.
|
|
879
|
+
* @returns The coat weight value
|
|
880
|
+
*/
|
|
881
|
+
get coatWeight(): number;
|
|
882
|
+
/**
|
|
883
|
+
* Sets the coat weight texture (mapped to PBR clearCoat.texture).
|
|
884
|
+
* Automatically enables clear coat.
|
|
885
|
+
* @param value The coat weight texture or null
|
|
886
|
+
*/
|
|
887
|
+
set coatWeightTexture(value: Nullable<BaseTexture>);
|
|
888
|
+
/**
|
|
889
|
+
* Gets the coat weight texture.
|
|
890
|
+
* @returns The coat weight texture or null
|
|
891
|
+
*/
|
|
892
|
+
get coatWeightTexture(): Nullable<BaseTexture>;
|
|
893
|
+
/**
|
|
894
|
+
* Sets the coat color (mapped to PBR clearCoat.tintColor).
|
|
895
|
+
* @param value The coat tint color as a Color3
|
|
896
|
+
*/
|
|
897
|
+
set coatColor(value: Color3);
|
|
898
|
+
/**
|
|
899
|
+
* Sets the coat color texture (mapped to PBR clearCoat.tintTexture).
|
|
900
|
+
* @param value The coat color texture or null
|
|
901
|
+
*/
|
|
902
|
+
set coatColorTexture(value: Nullable<BaseTexture>);
|
|
903
|
+
/**
|
|
904
|
+
* Sets the coat roughness (mapped to PBR clearCoat.roughness).
|
|
905
|
+
* Automatically enables clear coat.
|
|
906
|
+
* @param value The coat roughness value (0-1)
|
|
907
|
+
*/
|
|
908
|
+
set coatRoughness(value: number);
|
|
909
|
+
/**
|
|
910
|
+
* Gets the coat roughness.
|
|
911
|
+
* @returns The coat roughness value, defaults to 0 if not set
|
|
912
|
+
*/
|
|
913
|
+
get coatRoughness(): number;
|
|
914
|
+
/**
|
|
915
|
+
* Sets the coat roughness texture (mapped to PBR clearCoat.textureRoughness).
|
|
916
|
+
* Automatically enables clear coat and disables using roughness from main texture.
|
|
917
|
+
* @param value The coat roughness texture or null
|
|
918
|
+
*/
|
|
919
|
+
set coatRoughnessTexture(value: Nullable<BaseTexture>);
|
|
920
|
+
/**
|
|
921
|
+
* Gets the coat roughness texture.
|
|
922
|
+
* @returns The coat roughness texture or null
|
|
923
|
+
*/
|
|
924
|
+
get coatRoughnessTexture(): Nullable<BaseTexture>;
|
|
925
|
+
/**
|
|
926
|
+
* Sets the coat darkening value.
|
|
927
|
+
* Note: PBR doesn't have a direct coat darkening property, so this is a no-op.
|
|
928
|
+
* @param value The coat darkening value (ignored for PBR)
|
|
929
|
+
*/
|
|
930
|
+
set coatDarkening(value: number);
|
|
931
|
+
/**
|
|
932
|
+
* Sets the coat darkening texture
|
|
933
|
+
* @param value The coat darkening texture or null
|
|
934
|
+
*/
|
|
935
|
+
set coatDarkeningTexture(value: Nullable<BaseTexture>);
|
|
936
|
+
/**
|
|
937
|
+
* Sets the coat roughness anisotropy.
|
|
938
|
+
* Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.
|
|
939
|
+
* @param value The coat anisotropy intensity value (currently ignored)
|
|
940
|
+
*/
|
|
941
|
+
set coatRoughnessAnisotropy(value: number);
|
|
942
|
+
/**
|
|
943
|
+
* Gets the coat roughness anisotropy.
|
|
944
|
+
* Note: PBR clearCoat doesn't support anisotropy yet, so this returns 0.
|
|
945
|
+
* @returns Currently returns 0 as clearCoat anisotropy is not yet available
|
|
946
|
+
*/
|
|
947
|
+
get coatRoughnessAnisotropy(): number;
|
|
948
|
+
/**
|
|
949
|
+
* Sets the coat tangent angle for anisotropy.
|
|
950
|
+
* Note: PBR clearCoat doesn't support anisotropy yet, so this is a placeholder.
|
|
951
|
+
* @param value The coat anisotropy rotation angle in radians (currently ignored)
|
|
952
|
+
*/
|
|
953
|
+
set geometryCoatTangentAngle(value: number);
|
|
954
|
+
/**
|
|
955
|
+
* Sets the coat tangent texture for anisotropy.
|
|
956
|
+
* Note: PBR clearCoat doesn't support anisotropy textures yet, so this is a placeholder.
|
|
957
|
+
* @param value The coat anisotropy texture (currently ignored)
|
|
958
|
+
*/
|
|
959
|
+
set geometryCoatTangentTexture(value: Nullable<BaseTexture>);
|
|
960
|
+
/**
|
|
961
|
+
* Gets the coat tangent texture for anisotropy.
|
|
962
|
+
* Note: PBR clearCoat doesn't support anisotropy textures yet, so this returns null.
|
|
963
|
+
* @returns Currently returns null as clearCoat anisotropy is not yet available
|
|
964
|
+
*/
|
|
965
|
+
get geometryCoatTangentTexture(): Nullable<BaseTexture>;
|
|
966
|
+
/**
|
|
967
|
+
* Sets the transmission weight (mapped to PBR subSurface.refractionIntensity).
|
|
968
|
+
* Enables refraction when value \> 0.
|
|
969
|
+
* @param value The transmission weight value (0-1)
|
|
970
|
+
*/
|
|
971
|
+
set transmissionWeight(value: number);
|
|
972
|
+
/**
|
|
973
|
+
* Gets the transmission weight.
|
|
974
|
+
* @returns The transmission weight value
|
|
975
|
+
*/
|
|
976
|
+
get transmissionWeight(): number;
|
|
977
|
+
/**
|
|
978
|
+
* Sets the transmission weight texture (mapped to PBR subSurface.refractionIntensityTexture).
|
|
979
|
+
* Automatically enables refraction and glTF-style textures.
|
|
980
|
+
* @param value The transmission weight texture or null
|
|
981
|
+
*/
|
|
982
|
+
set transmissionWeightTexture(value: Nullable<BaseTexture>);
|
|
983
|
+
/**
|
|
984
|
+
* Sets the attenuation distance for volume scattering.
|
|
985
|
+
* @param value The attenuation distance value
|
|
986
|
+
*/
|
|
987
|
+
set transmissionDepth(value: number);
|
|
988
|
+
/**
|
|
989
|
+
* Sets the attenuation color (mapped to PBR subSurface.tintColor).
|
|
990
|
+
* @param value The attenuation color as a Color3
|
|
991
|
+
*/
|
|
992
|
+
set transmissionColor(value: Color3);
|
|
993
|
+
/**
|
|
994
|
+
* Gets the transmission dispersion Abbe number.
|
|
995
|
+
* @param value The Abbe number value
|
|
996
|
+
*/
|
|
997
|
+
set transmissionDispersionAbbeNumber(value: number);
|
|
998
|
+
/**
|
|
999
|
+
* Configures transmission for thin-surface transmission (KHR_materials_transmission).
|
|
1000
|
+
* Sets up the material for proper thin-surface transmission behavior.
|
|
1001
|
+
*/
|
|
1002
|
+
configureTransmission(): void;
|
|
1003
|
+
/**
|
|
1004
|
+
* Sets the thickness texture (mapped to PBR subSurface.thicknessTexture).
|
|
1005
|
+
* Automatically enables refraction.
|
|
1006
|
+
* @param value The thickness texture or null
|
|
1007
|
+
*/
|
|
1008
|
+
set volumeThicknessTexture(value: Nullable<BaseTexture>);
|
|
1009
|
+
/**
|
|
1010
|
+
* Sets the thickness factor (mapped to PBR subSurface.maximumThickness).
|
|
1011
|
+
* Automatically enables refraction.
|
|
1012
|
+
* @param value The thickness value
|
|
1013
|
+
*/
|
|
1014
|
+
set volumeThickness(value: number);
|
|
1015
|
+
/**
|
|
1016
|
+
* Configures subsurface properties for PBR material
|
|
1017
|
+
*/
|
|
1018
|
+
configureSubsurface(): void;
|
|
1019
|
+
/**
|
|
1020
|
+
* Sets the subsurface weight
|
|
1021
|
+
*/
|
|
1022
|
+
set subsurfaceWeight(value: number);
|
|
1023
|
+
/**
|
|
1024
|
+
* Gets the subsurface weight
|
|
1025
|
+
* @returns The subsurface weight value
|
|
1026
|
+
*/
|
|
1027
|
+
get subsurfaceWeight(): number;
|
|
1028
|
+
/**
|
|
1029
|
+
* Sets the subsurface weight texture
|
|
1030
|
+
*/
|
|
1031
|
+
set subsurfaceWeightTexture(value: Nullable<BaseTexture>);
|
|
1032
|
+
/**
|
|
1033
|
+
* Sets the subsurface color.
|
|
1034
|
+
* @param value The subsurface tint color as a Color3
|
|
1035
|
+
*/
|
|
1036
|
+
set subsurfaceColor(value: Color3);
|
|
1037
|
+
/**
|
|
1038
|
+
* Sets the subsurface color texture.
|
|
1039
|
+
* @param value The subsurface tint texture or null
|
|
1040
|
+
*/
|
|
1041
|
+
set subsurfaceColorTexture(value: Nullable<BaseTexture>);
|
|
1042
|
+
/**
|
|
1043
|
+
* Configures sheen for PBR material.
|
|
1044
|
+
* Enables sheen and sets up proper configuration.
|
|
1045
|
+
*/
|
|
1046
|
+
configureFuzz(): void;
|
|
1047
|
+
/**
|
|
1048
|
+
* Sets the sheen weight (mapped to PBR sheen.intensity).
|
|
1049
|
+
* Automatically enables sheen.
|
|
1050
|
+
* @param value The sheen weight value
|
|
1051
|
+
*/
|
|
1052
|
+
set fuzzWeight(value: number);
|
|
1053
|
+
/**
|
|
1054
|
+
* Sets the sheen color (mapped to PBR sheen.color).
|
|
1055
|
+
* Automatically enables sheen.
|
|
1056
|
+
* @param value The sheen color as a Color3
|
|
1057
|
+
*/
|
|
1058
|
+
set fuzzColor(value: Color3);
|
|
1059
|
+
/**
|
|
1060
|
+
* Sets the sheen color texture (mapped to PBR sheen.texture).
|
|
1061
|
+
* Automatically enables sheen.
|
|
1062
|
+
* @param value The sheen color texture or null
|
|
1063
|
+
*/
|
|
1064
|
+
set fuzzColorTexture(value: Nullable<BaseTexture>);
|
|
1065
|
+
/**
|
|
1066
|
+
* Sets the sheen roughness (mapped to PBR sheen.roughness).
|
|
1067
|
+
* Automatically enables sheen.
|
|
1068
|
+
* @param value The sheen roughness value (0-1)
|
|
1069
|
+
*/
|
|
1070
|
+
set fuzzRoughness(value: number);
|
|
1071
|
+
/**
|
|
1072
|
+
* Sets the sheen roughness texture (mapped to PBR sheen.textureRoughness).
|
|
1073
|
+
* Automatically enables sheen.
|
|
1074
|
+
* @param value The sheen roughness texture or null
|
|
1075
|
+
*/
|
|
1076
|
+
set fuzzRoughnessTexture(value: Nullable<BaseTexture>);
|
|
1077
|
+
/**
|
|
1078
|
+
* Sets the specular roughness anisotropy (mapped to PBR anisotropy.intensity).
|
|
1079
|
+
* Automatically enables anisotropy.
|
|
1080
|
+
* @param value The anisotropy intensity value
|
|
1081
|
+
*/
|
|
1082
|
+
set specularRoughnessAnisotropy(value: number);
|
|
1083
|
+
/**
|
|
1084
|
+
* Gets the specular roughness anisotropy.
|
|
1085
|
+
* @returns The anisotropy intensity value
|
|
1086
|
+
*/
|
|
1087
|
+
get specularRoughnessAnisotropy(): number;
|
|
1088
|
+
/**
|
|
1089
|
+
* Sets the anisotropy rotation (mapped to PBR anisotropy.angle).
|
|
1090
|
+
* Automatically enables anisotropy.
|
|
1091
|
+
* @param value The anisotropy rotation angle in radians
|
|
1092
|
+
*/
|
|
1093
|
+
set geometryTangentAngle(value: number);
|
|
1094
|
+
/**
|
|
1095
|
+
* Sets the geometry tangent texture (mapped to PBR anisotropy.texture).
|
|
1096
|
+
* Automatically enables anisotropy.
|
|
1097
|
+
* @param value The anisotropy texture or null
|
|
1098
|
+
*/
|
|
1099
|
+
set geometryTangentTexture(value: Nullable<BaseTexture>);
|
|
1100
|
+
/**
|
|
1101
|
+
* Gets the geometry tangent texture.
|
|
1102
|
+
* @returns The anisotropy texture or null
|
|
1103
|
+
*/
|
|
1104
|
+
get geometryTangentTexture(): Nullable<BaseTexture>;
|
|
1105
|
+
/**
|
|
1106
|
+
* Configures glTF-style anisotropy for the material.
|
|
1107
|
+
* Note: PBR materials don't need this configuration, so this is a no-op.
|
|
1108
|
+
* @param useGltfStyle Whether to use glTF-style anisotropy (ignored for PBR)
|
|
1109
|
+
*/
|
|
1110
|
+
configureGltfStyleAnisotropy(useGltfStyle?: boolean): void;
|
|
1111
|
+
/**
|
|
1112
|
+
* Sets the iridescence weight (mapped to PBR iridescence.intensity).
|
|
1113
|
+
* Automatically enables iridescence.
|
|
1114
|
+
* @param value The iridescence intensity value
|
|
1115
|
+
*/
|
|
1116
|
+
set iridescenceWeight(value: number);
|
|
1117
|
+
/**
|
|
1118
|
+
* Sets the iridescence IOR (mapped to PBR iridescence.indexOfRefraction).
|
|
1119
|
+
* Automatically enables iridescence.
|
|
1120
|
+
* @param value The iridescence IOR value
|
|
1121
|
+
*/
|
|
1122
|
+
set iridescenceIor(value: number);
|
|
1123
|
+
/**
|
|
1124
|
+
* Sets the iridescence thickness minimum (mapped to PBR iridescence.minimumThickness).
|
|
1125
|
+
* Automatically enables iridescence.
|
|
1126
|
+
* @param value The minimum thickness value in nanometers
|
|
1127
|
+
*/
|
|
1128
|
+
set iridescenceThicknessMinimum(value: number);
|
|
1129
|
+
/**
|
|
1130
|
+
* Sets the iridescence thickness maximum (mapped to PBR iridescence.maximumThickness).
|
|
1131
|
+
* Automatically enables iridescence.
|
|
1132
|
+
* @param value The maximum thickness value in nanometers
|
|
1133
|
+
*/
|
|
1134
|
+
set iridescenceThicknessMaximum(value: number);
|
|
1135
|
+
/**
|
|
1136
|
+
* Sets the iridescence texture (mapped to PBR iridescence.texture).
|
|
1137
|
+
* Automatically enables iridescence.
|
|
1138
|
+
* @param value The iridescence intensity texture or null
|
|
1139
|
+
*/
|
|
1140
|
+
set iridescenceTexture(value: Nullable<BaseTexture>);
|
|
1141
|
+
/**
|
|
1142
|
+
* Sets the iridescence thickness texture (mapped to PBR iridescence.thicknessTexture).
|
|
1143
|
+
* Automatically enables iridescence.
|
|
1144
|
+
* @param value The iridescence thickness texture or null
|
|
1145
|
+
*/
|
|
1146
|
+
set iridescenceThicknessTexture(value: Nullable<BaseTexture>);
|
|
1147
|
+
/**
|
|
1148
|
+
* Sets the transmission dispersion value.
|
|
1149
|
+
* Note: PBR doesn't have direct dispersion support, so this stores it as metadata.
|
|
1150
|
+
* @param value The dispersion value (stored as metadata)
|
|
1151
|
+
*/
|
|
1152
|
+
set transmissionDispersion(value: number);
|
|
1153
|
+
/**
|
|
1154
|
+
* Sets whether the material is unlit.
|
|
1155
|
+
* @param value True to make the material unlit
|
|
1156
|
+
*/
|
|
1157
|
+
set unlit(value: boolean);
|
|
1158
|
+
/**
|
|
1159
|
+
* Sets the geometry opacity (mapped to PBR alpha).
|
|
1160
|
+
* @param value The opacity value (0-1)
|
|
1161
|
+
*/
|
|
1162
|
+
set geometryOpacity(value: number);
|
|
1163
|
+
/**
|
|
1164
|
+
* Gets the geometry opacity.
|
|
1165
|
+
* @returns The opacity value (0-1)
|
|
1166
|
+
*/
|
|
1167
|
+
get geometryOpacity(): number;
|
|
1168
|
+
/**
|
|
1169
|
+
* Sets the geometry normal texture (mapped to PBR bumpTexture).
|
|
1170
|
+
* Also forces irradiance computation in fragment shader for better lighting.
|
|
1171
|
+
* @param value The normal texture or null
|
|
1172
|
+
*/
|
|
1173
|
+
set geometryNormalTexture(value: Nullable<BaseTexture>);
|
|
1174
|
+
/**
|
|
1175
|
+
* Gets the geometry normal texture.
|
|
1176
|
+
* @returns The normal texture or null
|
|
1177
|
+
*/
|
|
1178
|
+
get geometryNormalTexture(): Nullable<BaseTexture>;
|
|
1179
|
+
/**
|
|
1180
|
+
* Sets the normal map inversions for the material.
|
|
1181
|
+
* @param invertX Whether to invert the normal map on the X axis
|
|
1182
|
+
* @param invertY Whether to invert the normal map on the Y axis
|
|
1183
|
+
*/
|
|
1184
|
+
setNormalMapInversions(invertX: boolean, invertY: boolean): void;
|
|
1185
|
+
/**
|
|
1186
|
+
* Sets the geometry coat normal texture (mapped to PBR clearCoat.bumpTexture).
|
|
1187
|
+
* Automatically enables clear coat.
|
|
1188
|
+
* @param value The coat normal texture or null
|
|
1189
|
+
*/
|
|
1190
|
+
set geometryCoatNormalTexture(value: Nullable<BaseTexture>);
|
|
1191
|
+
/**
|
|
1192
|
+
* Gets the geometry coat normal texture.
|
|
1193
|
+
* @returns The coat normal texture or null
|
|
1194
|
+
*/
|
|
1195
|
+
get geometryCoatNormalTexture(): Nullable<BaseTexture>;
|
|
1196
|
+
/**
|
|
1197
|
+
* Sets the geometry coat normal texture scale.
|
|
1198
|
+
* @param value The scale value for the coat normal texture
|
|
1199
|
+
*/
|
|
1200
|
+
set geometryCoatNormalTextureScale(value: number);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
|
|
1205
|
+
}
|
|
1206
|
+
declare module BABYLON {
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
}
|
|
1210
|
+
declare module BABYLON.GLTF2 {
|
|
1211
|
+
/**
|
|
1212
|
+
* Material Loading Adapter for OpenPBR materials that provides a unified OpenPBR-like interface.
|
|
1213
|
+
*/
|
|
1214
|
+
export class OpenPBRMaterialLoadingAdapter implements BABYLON.GLTF2.IMaterialLoadingAdapter {
|
|
1215
|
+
private _material;
|
|
1216
|
+
/**
|
|
1217
|
+
* Creates a new instance of the OpenPBRMaterialLoadingAdapter.
|
|
1218
|
+
* @param material - The OpenPBR material to adapt.
|
|
1219
|
+
*/
|
|
1220
|
+
constructor(material: Material);
|
|
1221
|
+
/**
|
|
1222
|
+
* Gets the underlying material
|
|
1223
|
+
*/
|
|
1224
|
+
get material(): OpenPBRMaterial;
|
|
1225
|
+
/**
|
|
1226
|
+
* Whether the material should be treated as unlit
|
|
1227
|
+
*/
|
|
1228
|
+
get isUnlit(): boolean;
|
|
1229
|
+
/**
|
|
1230
|
+
* Sets whether the material should be treated as unlit
|
|
1231
|
+
*/
|
|
1232
|
+
set isUnlit(value: boolean);
|
|
1233
|
+
/**
|
|
1234
|
+
* Sets whether back face culling is enabled.
|
|
1235
|
+
* @param value True to enable back face culling
|
|
1236
|
+
*/
|
|
1237
|
+
set backFaceCulling(value: boolean);
|
|
1238
|
+
/**
|
|
1239
|
+
* Gets whether back face culling is enabled.
|
|
1240
|
+
* @returns True if back face culling is enabled
|
|
1241
|
+
*/
|
|
1242
|
+
get backFaceCulling(): boolean;
|
|
1243
|
+
/**
|
|
1244
|
+
* Sets whether two-sided lighting is enabled.
|
|
1245
|
+
* @param value True to enable two-sided lighting
|
|
1246
|
+
*/
|
|
1247
|
+
set twoSidedLighting(value: boolean);
|
|
1248
|
+
/**
|
|
1249
|
+
* Gets whether two-sided lighting is enabled.
|
|
1250
|
+
* @returns True if two-sided lighting is enabled
|
|
1251
|
+
*/
|
|
1252
|
+
get twoSidedLighting(): boolean;
|
|
1253
|
+
/**
|
|
1254
|
+
* Sets the alpha cutoff value for alpha testing.
|
|
1255
|
+
* Note: OpenPBR doesn't have a direct equivalent, so this is a no-op.
|
|
1256
|
+
* @param value The alpha cutoff threshold (ignored for OpenPBR)
|
|
1257
|
+
*/
|
|
1258
|
+
set alphaCutOff(value: number);
|
|
1259
|
+
/**
|
|
1260
|
+
* Gets the alpha cutoff value.
|
|
1261
|
+
* @returns Default value of 0.5 (OpenPBR doesn't support this directly)
|
|
1262
|
+
*/
|
|
1263
|
+
get alphaCutOff(): number;
|
|
1264
|
+
/**
|
|
1265
|
+
* Sets whether to use alpha from the base color texture.
|
|
1266
|
+
* Note: OpenPBR handles this differently through the baseColorTexture alpha channel.
|
|
1267
|
+
* @param value True to use alpha from base color texture (handled automatically in OpenPBR)
|
|
1268
|
+
*/
|
|
1269
|
+
set useAlphaFromBaseColorTexture(value: boolean);
|
|
1270
|
+
/**
|
|
1271
|
+
* Gets whether alpha is used from the base color texture.
|
|
1272
|
+
* @returns Always false for OpenPBR as it's handled automatically
|
|
1273
|
+
*/
|
|
1274
|
+
get useAlphaFromBaseColorTexture(): boolean;
|
|
1275
|
+
/**
|
|
1276
|
+
* Gets whether the transparency is treated as alpha coverage.
|
|
1277
|
+
*/
|
|
1278
|
+
get transparencyAsAlphaCoverage(): boolean;
|
|
1279
|
+
/**
|
|
1280
|
+
* Sets/Gets whether the transparency is treated as alpha coverage
|
|
1281
|
+
*/
|
|
1282
|
+
set transparencyAsAlphaCoverage(value: boolean);
|
|
1283
|
+
/**
|
|
1284
|
+
* Sets the base color of the OpenPBR material.
|
|
1285
|
+
* @param value The base color as a Color3
|
|
1286
|
+
*/
|
|
1287
|
+
set baseColor(value: Color3);
|
|
1288
|
+
/**
|
|
1289
|
+
* Gets the base color of the OpenPBR material.
|
|
1290
|
+
* @returns The base color as a Color3
|
|
1291
|
+
*/
|
|
1292
|
+
get baseColor(): Color3;
|
|
1293
|
+
/**
|
|
1294
|
+
* Sets the base color texture of the OpenPBR material.
|
|
1295
|
+
* @param value The base color texture or null
|
|
1296
|
+
*/
|
|
1297
|
+
set baseColorTexture(value: Nullable<BaseTexture>);
|
|
1298
|
+
/**
|
|
1299
|
+
* Gets the base color texture of the OpenPBR material.
|
|
1300
|
+
* @returns The base color texture or null
|
|
1301
|
+
*/
|
|
1302
|
+
get baseColorTexture(): Nullable<BaseTexture>;
|
|
1303
|
+
/**
|
|
1304
|
+
* Sets the base diffuse roughness of the OpenPBR material.
|
|
1305
|
+
* @param value The diffuse roughness value (0-1)
|
|
1306
|
+
*/
|
|
1307
|
+
set baseDiffuseRoughness(value: number);
|
|
1308
|
+
/**
|
|
1309
|
+
* Gets the base diffuse roughness of the OpenPBR material.
|
|
1310
|
+
* @returns The diffuse roughness value (0-1)
|
|
1311
|
+
*/
|
|
1312
|
+
get baseDiffuseRoughness(): number;
|
|
1313
|
+
/**
|
|
1314
|
+
* Sets the base diffuse roughness texture of the OpenPBR material.
|
|
1315
|
+
* @param value The diffuse roughness texture or null
|
|
1316
|
+
*/
|
|
1317
|
+
set baseDiffuseRoughnessTexture(value: Nullable<BaseTexture>);
|
|
1318
|
+
/**
|
|
1319
|
+
* Gets the base diffuse roughness texture of the OpenPBR material.
|
|
1320
|
+
* @returns The diffuse roughness texture or null
|
|
1321
|
+
*/
|
|
1322
|
+
get baseDiffuseRoughnessTexture(): Nullable<BaseTexture>;
|
|
1323
|
+
/**
|
|
1324
|
+
* Sets the base metalness value of the OpenPBR material.
|
|
1325
|
+
* @param value The metalness value (0-1)
|
|
1326
|
+
*/
|
|
1327
|
+
set baseMetalness(value: number);
|
|
1328
|
+
/**
|
|
1329
|
+
* Gets the base metalness value of the OpenPBR material.
|
|
1330
|
+
* @returns The metalness value (0-1)
|
|
1331
|
+
*/
|
|
1332
|
+
get baseMetalness(): number;
|
|
1333
|
+
/**
|
|
1334
|
+
* Sets the base metalness texture of the OpenPBR material.
|
|
1335
|
+
* @param value The metalness texture or null
|
|
1336
|
+
*/
|
|
1337
|
+
set baseMetalnessTexture(value: Nullable<BaseTexture>);
|
|
1338
|
+
/**
|
|
1339
|
+
* Gets the base metalness texture of the OpenPBR material.
|
|
1340
|
+
* @returns The metalness texture or null
|
|
1341
|
+
*/
|
|
1342
|
+
get baseMetalnessTexture(): Nullable<BaseTexture>;
|
|
1343
|
+
/**
|
|
1344
|
+
* Sets whether to use roughness from the metallic texture's green channel.
|
|
1345
|
+
* @param value True to use green channel for roughness
|
|
1346
|
+
*/
|
|
1347
|
+
set useRoughnessFromMetallicTextureGreen(value: boolean);
|
|
1348
|
+
/**
|
|
1349
|
+
* Sets whether to use metalness from the metallic texture's blue channel.
|
|
1350
|
+
* @param value True to use blue channel for metalness
|
|
1351
|
+
*/
|
|
1352
|
+
set useMetallicFromMetallicTextureBlue(value: boolean);
|
|
1353
|
+
/**
|
|
1354
|
+
* Configures specular properties for OpenPBR material.
|
|
1355
|
+
* @param _enableEdgeColor Whether to enable edge color support (ignored for OpenPBR)
|
|
1356
|
+
*/
|
|
1357
|
+
enableSpecularEdgeColor(_enableEdgeColor?: boolean): void;
|
|
1358
|
+
/**
|
|
1359
|
+
* Sets the specular weight of the OpenPBR material.
|
|
1360
|
+
* @param value The specular weight value (0-1)
|
|
1361
|
+
*/
|
|
1362
|
+
set specularWeight(value: number);
|
|
1363
|
+
/**
|
|
1364
|
+
* Gets the specular weight of the OpenPBR material.
|
|
1365
|
+
* @returns The specular weight value (0-1)
|
|
1366
|
+
*/
|
|
1367
|
+
get specularWeight(): number;
|
|
1368
|
+
/**
|
|
1369
|
+
* Sets the specular weight texture of the OpenPBR material.
|
|
1370
|
+
* If the same texture is used for specular color, optimizes by using alpha channel for weight.
|
|
1371
|
+
* @param value The specular weight texture or null
|
|
1372
|
+
*/
|
|
1373
|
+
set specularWeightTexture(value: Nullable<BaseTexture>);
|
|
1374
|
+
/**
|
|
1375
|
+
* Gets the specular weight texture of the OpenPBR material.
|
|
1376
|
+
* @returns The specular weight texture or null
|
|
1377
|
+
*/
|
|
1378
|
+
get specularWeightTexture(): Nullable<BaseTexture>;
|
|
1379
|
+
/**
|
|
1380
|
+
* Sets the specular color of the OpenPBR material.
|
|
1381
|
+
* @param value The specular color as a Color3
|
|
1382
|
+
*/
|
|
1383
|
+
set specularColor(value: Color3);
|
|
1384
|
+
/**
|
|
1385
|
+
* Gets the specular color of the OpenPBR material.
|
|
1386
|
+
* @returns The specular color as a Color3
|
|
1387
|
+
*/
|
|
1388
|
+
get specularColor(): Color3;
|
|
1389
|
+
/**
|
|
1390
|
+
* Sets the specular color texture of the OpenPBR material.
|
|
1391
|
+
* If the same texture is used for specular weight, optimizes by using alpha channel for weight.
|
|
1392
|
+
* @param value The specular color texture or null
|
|
1393
|
+
*/
|
|
1394
|
+
set specularColorTexture(value: Nullable<BaseTexture>);
|
|
1395
|
+
/**
|
|
1396
|
+
* Gets the specular color texture of the OpenPBR material.
|
|
1397
|
+
* @returns The specular color texture or null
|
|
1398
|
+
*/
|
|
1399
|
+
get specularColorTexture(): Nullable<BaseTexture>;
|
|
1400
|
+
/**
|
|
1401
|
+
* Sets the specular roughness of the OpenPBR material.
|
|
1402
|
+
* @param value The roughness value (0-1)
|
|
1403
|
+
*/
|
|
1404
|
+
set specularRoughness(value: number);
|
|
1405
|
+
/**
|
|
1406
|
+
* Gets the specular roughness of the OpenPBR material.
|
|
1407
|
+
* @returns The roughness value (0-1)
|
|
1408
|
+
*/
|
|
1409
|
+
get specularRoughness(): number;
|
|
1410
|
+
/**
|
|
1411
|
+
* Sets the specular roughness texture of the OpenPBR material.
|
|
1412
|
+
* @param value The roughness texture or null
|
|
1413
|
+
*/
|
|
1414
|
+
set specularRoughnessTexture(value: Nullable<BaseTexture>);
|
|
1415
|
+
/**
|
|
1416
|
+
* Gets the specular roughness texture of the OpenPBR material.
|
|
1417
|
+
* @returns The roughness texture or null
|
|
1418
|
+
*/
|
|
1419
|
+
get specularRoughnessTexture(): Nullable<BaseTexture>;
|
|
1420
|
+
/**
|
|
1421
|
+
* Sets the specular index of refraction (IOR) of the OpenPBR material.
|
|
1422
|
+
* @param value The IOR value
|
|
1423
|
+
*/
|
|
1424
|
+
set specularIor(value: number);
|
|
1425
|
+
/**
|
|
1426
|
+
* Gets the specular index of refraction (IOR) of the OpenPBR material.
|
|
1427
|
+
* @returns The IOR value
|
|
1428
|
+
*/
|
|
1429
|
+
get specularIor(): number;
|
|
1430
|
+
/**
|
|
1431
|
+
* Sets the emission color of the OpenPBR material.
|
|
1432
|
+
* @param value The emission color as a Color3
|
|
1433
|
+
*/
|
|
1434
|
+
set emissionColor(value: Color3);
|
|
1435
|
+
/**
|
|
1436
|
+
* Gets the emission color of the OpenPBR material.
|
|
1437
|
+
* @returns The emission color as a Color3
|
|
1438
|
+
*/
|
|
1439
|
+
get emissionColor(): Color3;
|
|
1440
|
+
/**
|
|
1441
|
+
* Sets the emission luminance of the OpenPBR material.
|
|
1442
|
+
* @param value The emission luminance value
|
|
1443
|
+
*/
|
|
1444
|
+
set emissionLuminance(value: number);
|
|
1445
|
+
/**
|
|
1446
|
+
* Gets the emission luminance of the OpenPBR material.
|
|
1447
|
+
* @returns The emission luminance value
|
|
1448
|
+
*/
|
|
1449
|
+
get emissionLuminance(): number;
|
|
1450
|
+
/**
|
|
1451
|
+
* Sets the emission color texture of the OpenPBR material.
|
|
1452
|
+
* @param value The emission texture or null
|
|
1453
|
+
*/
|
|
1454
|
+
set emissionColorTexture(value: Nullable<BaseTexture>);
|
|
1455
|
+
/**
|
|
1456
|
+
* Gets the emission color texture of the OpenPBR material.
|
|
1457
|
+
* @returns The emission texture or null
|
|
1458
|
+
*/
|
|
1459
|
+
get emissionColorTexture(): Nullable<BaseTexture>;
|
|
1460
|
+
/**
|
|
1461
|
+
* Sets the ambient occlusion texture of the OpenPBR material.
|
|
1462
|
+
* @param value The ambient occlusion texture or null
|
|
1463
|
+
*/
|
|
1464
|
+
set ambientOcclusionTexture(value: Nullable<BaseTexture>);
|
|
1465
|
+
/**
|
|
1466
|
+
* Gets the ambient occlusion texture of the OpenPBR material.
|
|
1467
|
+
* @returns The ambient occlusion texture or null
|
|
1468
|
+
*/
|
|
1469
|
+
get ambientOcclusionTexture(): Nullable<BaseTexture>;
|
|
1470
|
+
/**
|
|
1471
|
+
* Sets the ambient occlusion texture strength by modifying the texture's level.
|
|
1472
|
+
* @param value The strength value (typically 0-1)
|
|
1473
|
+
*/
|
|
1474
|
+
set ambientOcclusionTextureStrength(value: number);
|
|
1475
|
+
/**
|
|
1476
|
+
* Gets the ambient occlusion texture strength from the texture's level property.
|
|
1477
|
+
* @returns The strength value, defaults to 1.0 if no texture or level is set
|
|
1478
|
+
*/
|
|
1479
|
+
get ambientOcclusionTextureStrength(): number;
|
|
1480
|
+
/**
|
|
1481
|
+
* Configures coat parameters for OpenPBR material.
|
|
1482
|
+
* OpenPBR coat is already built-in, so no configuration is needed.
|
|
1483
|
+
*/
|
|
1484
|
+
configureCoat(): void;
|
|
1485
|
+
/**
|
|
1486
|
+
* Sets the coat weight of the OpenPBR material.
|
|
1487
|
+
* @param value The coat weight value (0-1)
|
|
1488
|
+
*/
|
|
1489
|
+
set coatWeight(value: number);
|
|
1490
|
+
/**
|
|
1491
|
+
* Gets the coat weight of the OpenPBR material.
|
|
1492
|
+
* @returns The coat weight value (0-1)
|
|
1493
|
+
*/
|
|
1494
|
+
get coatWeight(): number;
|
|
1495
|
+
/**
|
|
1496
|
+
* Sets the coat weight texture of the OpenPBR material.
|
|
1497
|
+
* @param value The coat weight texture or null
|
|
1498
|
+
*/
|
|
1499
|
+
set coatWeightTexture(value: Nullable<BaseTexture>);
|
|
1500
|
+
/**
|
|
1501
|
+
* Gets the coat weight texture of the OpenPBR material.
|
|
1502
|
+
* @returns The coat weight texture or null
|
|
1503
|
+
*/
|
|
1504
|
+
get coatWeightTexture(): Nullable<BaseTexture>;
|
|
1505
|
+
/**
|
|
1506
|
+
* Sets the coat color of the OpenPBR material.
|
|
1507
|
+
* @param value The coat color as a Color3
|
|
1508
|
+
*/
|
|
1509
|
+
set coatColor(value: Color3);
|
|
1510
|
+
/**
|
|
1511
|
+
* Sets the coat color texture of the OpenPBR material.
|
|
1512
|
+
* @param value The coat color texture or null
|
|
1513
|
+
*/
|
|
1514
|
+
set coatColorTexture(value: Nullable<BaseTexture>);
|
|
1515
|
+
/**
|
|
1516
|
+
* Sets the coat roughness of the OpenPBR material.
|
|
1517
|
+
* @param value The coat roughness value (0-1)
|
|
1518
|
+
*/
|
|
1519
|
+
set coatRoughness(value: number);
|
|
1520
|
+
/**
|
|
1521
|
+
* Gets the coat roughness of the OpenPBR material.
|
|
1522
|
+
* @returns The coat roughness value (0-1)
|
|
1523
|
+
*/
|
|
1524
|
+
get coatRoughness(): number;
|
|
1525
|
+
/**
|
|
1526
|
+
* Sets the coat roughness texture of the OpenPBR material.
|
|
1527
|
+
* @param value The coat roughness texture or null
|
|
1528
|
+
*/
|
|
1529
|
+
set coatRoughnessTexture(value: Nullable<BaseTexture>);
|
|
1530
|
+
/**
|
|
1531
|
+
* Gets the coat roughness texture of the OpenPBR material.
|
|
1532
|
+
* @returns The coat roughness texture or null
|
|
1533
|
+
*/
|
|
1534
|
+
get coatRoughnessTexture(): Nullable<BaseTexture>;
|
|
1535
|
+
/**
|
|
1536
|
+
* Sets the coat darkening value of the OpenPBR material.
|
|
1537
|
+
* @param value The coat darkening value
|
|
1538
|
+
*/
|
|
1539
|
+
set coatDarkening(value: number);
|
|
1540
|
+
/**
|
|
1541
|
+
* Sets the coat darkening texture (OpenPBR: coatDarkeningTexture, no PBR equivalent)
|
|
1542
|
+
*/
|
|
1543
|
+
set coatDarkeningTexture(value: Nullable<BaseTexture>);
|
|
1544
|
+
/**
|
|
1545
|
+
* Sets the coat roughness anisotropy.
|
|
1546
|
+
* TODO: Implementation pending OpenPBR coat anisotropy feature availability.
|
|
1547
|
+
* @param value The coat anisotropy intensity value
|
|
1548
|
+
*/
|
|
1549
|
+
set coatRoughnessAnisotropy(value: number);
|
|
1550
|
+
/**
|
|
1551
|
+
* Gets the coat roughness anisotropy.
|
|
1552
|
+
* TODO: Implementation pending OpenPBR coat anisotropy feature availability.
|
|
1553
|
+
* @returns Currently returns 0 as coat anisotropy is not yet available
|
|
1554
|
+
*/
|
|
1555
|
+
get coatRoughnessAnisotropy(): number;
|
|
1556
|
+
/**
|
|
1557
|
+
* Sets the coat tangent angle for anisotropy.
|
|
1558
|
+
* TODO: Implementation pending OpenPBR coat anisotropy feature availability.
|
|
1559
|
+
* @param value The coat anisotropy rotation angle in radians
|
|
1560
|
+
*/
|
|
1561
|
+
set geometryCoatTangentAngle(value: number);
|
|
1562
|
+
/**
|
|
1563
|
+
* Sets the coat tangent texture for anisotropy.
|
|
1564
|
+
* TODO: Implementation pending OpenPBR coat anisotropy feature availability.
|
|
1565
|
+
* @param value The coat anisotropy texture or null
|
|
1566
|
+
*/
|
|
1567
|
+
set geometryCoatTangentTexture(value: Nullable<BaseTexture>);
|
|
1568
|
+
/**
|
|
1569
|
+
* Gets the coat tangent texture for anisotropy.
|
|
1570
|
+
* TODO: Implementation pending OpenPBR coat anisotropy feature availability.
|
|
1571
|
+
* @returns Currently returns null as coat anisotropy is not yet available
|
|
1572
|
+
*/
|
|
1573
|
+
get geometryCoatTangentTexture(): Nullable<BaseTexture>;
|
|
1574
|
+
/**
|
|
1575
|
+
* Sets the transmission weight.
|
|
1576
|
+
* TODO: Implementation pending OpenPBR transmission feature availability.
|
|
1577
|
+
* @param value The transmission weight value (0-1)
|
|
1578
|
+
*/
|
|
1579
|
+
set transmissionWeight(value: number);
|
|
1580
|
+
/**
|
|
1581
|
+
* Sets the transmission weight texture.
|
|
1582
|
+
* TODO: Implementation pending OpenPBR transmission feature availability.
|
|
1583
|
+
* @param value The transmission weight texture or null
|
|
1584
|
+
*/
|
|
1585
|
+
set transmissionWeightTexture(value: Nullable<BaseTexture>);
|
|
1586
|
+
/**
|
|
1587
|
+
* Gets the transmission weight.
|
|
1588
|
+
* TODO: Implementation pending OpenPBR transmission feature availability.
|
|
1589
|
+
* @returns Currently returns 0 as transmission is not yet available
|
|
1590
|
+
*/
|
|
1591
|
+
get transmissionWeight(): number;
|
|
1592
|
+
/**
|
|
1593
|
+
* Gets the transmission dispersion Abbe number.
|
|
1594
|
+
* @param value The Abbe number value
|
|
1595
|
+
*/
|
|
1596
|
+
set transmissionDispersionAbbeNumber(value: number);
|
|
1597
|
+
/**
|
|
1598
|
+
* Configures transmission for OpenPBR material.
|
|
1599
|
+
* TODO: Implementation pending OpenPBR transmission feature availability.
|
|
1600
|
+
*/
|
|
1601
|
+
configureTransmission(): void;
|
|
1602
|
+
/**
|
|
1603
|
+
* Sets the attenuation distance for volume scattering.
|
|
1604
|
+
* TODO: Implementation pending OpenPBR volume feature availability.
|
|
1605
|
+
* @param value The attenuation distance value
|
|
1606
|
+
*/
|
|
1607
|
+
set transmissionDepth(value: number);
|
|
1608
|
+
/**
|
|
1609
|
+
* Sets the attenuation color for volume scattering.
|
|
1610
|
+
* TODO: Implementation pending OpenPBR volume feature availability.
|
|
1611
|
+
* @param value The attenuation color as a Color3
|
|
1612
|
+
*/
|
|
1613
|
+
set transmissionColor(value: Color3);
|
|
1614
|
+
/**
|
|
1615
|
+
* Sets the thickness texture for volume scattering.
|
|
1616
|
+
* TODO: Implementation pending OpenPBR volume feature availability.
|
|
1617
|
+
* @param value The thickness texture or null
|
|
1618
|
+
*/
|
|
1619
|
+
set volumeThicknessTexture(value: Nullable<BaseTexture>);
|
|
1620
|
+
/**
|
|
1621
|
+
* Sets the thickness factor for volume scattering.
|
|
1622
|
+
* TODO: Implementation pending OpenPBR volume feature availability.
|
|
1623
|
+
* @param value The thickness value
|
|
1624
|
+
*/
|
|
1625
|
+
set volumeThickness(value: number);
|
|
1626
|
+
/**
|
|
1627
|
+
* Configures subsurface properties for PBR material
|
|
1628
|
+
*/
|
|
1629
|
+
configureSubsurface(): void;
|
|
1630
|
+
/**
|
|
1631
|
+
* Sets the subsurface weight
|
|
1632
|
+
*/
|
|
1633
|
+
set subsurfaceWeight(value: number);
|
|
1634
|
+
get subsurfaceWeight(): number;
|
|
1635
|
+
/**
|
|
1636
|
+
* Sets the subsurface weight texture
|
|
1637
|
+
*/
|
|
1638
|
+
set subsurfaceWeightTexture(value: Nullable<BaseTexture>);
|
|
1639
|
+
/**
|
|
1640
|
+
* Sets the subsurface color.
|
|
1641
|
+
* @param value The subsurface tint color as a Color3
|
|
1642
|
+
*/
|
|
1643
|
+
set subsurfaceColor(value: Color3);
|
|
1644
|
+
/**
|
|
1645
|
+
* Sets the subsurface color texture.
|
|
1646
|
+
* @param value The subsurface tint texture or null
|
|
1647
|
+
*/
|
|
1648
|
+
set subsurfaceColorTexture(value: Nullable<BaseTexture>);
|
|
1649
|
+
/**
|
|
1650
|
+
* Configures fuzz for OpenPBR.
|
|
1651
|
+
* Enables fuzz and sets up proper configuration.
|
|
1652
|
+
*/
|
|
1653
|
+
configureFuzz(): void;
|
|
1654
|
+
/**
|
|
1655
|
+
* Sets the fuzz weight.
|
|
1656
|
+
* TODO: Implementation pending OpenPBR fuzz feature availability.
|
|
1657
|
+
* @param value The fuzz weight value
|
|
1658
|
+
*/
|
|
1659
|
+
set fuzzWeight(value: number);
|
|
1660
|
+
/**
|
|
1661
|
+
* Sets the fuzz color.
|
|
1662
|
+
* TODO: Implementation pending OpenPBR fuzz feature availability.
|
|
1663
|
+
* @param value The fuzz color as a Color3
|
|
1664
|
+
*/
|
|
1665
|
+
set fuzzColor(value: Color3);
|
|
1666
|
+
/**
|
|
1667
|
+
* Sets the fuzz color texture.
|
|
1668
|
+
* TODO: Implementation pending OpenPBR fuzz feature availability.
|
|
1669
|
+
* @param value The fuzz color texture or null
|
|
1670
|
+
*/
|
|
1671
|
+
set fuzzColorTexture(value: Nullable<BaseTexture>);
|
|
1672
|
+
/**
|
|
1673
|
+
* Sets the fuzz roughness.
|
|
1674
|
+
* TODO: Implementation pending OpenPBR fuzz feature availability.
|
|
1675
|
+
* @param value The fuzz roughness value (0-1)
|
|
1676
|
+
*/
|
|
1677
|
+
set fuzzRoughness(value: number);
|
|
1678
|
+
/**
|
|
1679
|
+
* Sets the fuzz roughness texture.
|
|
1680
|
+
* TODO: Implementation pending OpenPBR fuzz feature availability.
|
|
1681
|
+
* @param value The fuzz roughness texture or null
|
|
1682
|
+
*/
|
|
1683
|
+
set fuzzRoughnessTexture(value: Nullable<BaseTexture>);
|
|
1684
|
+
/**
|
|
1685
|
+
* Sets the specular roughness anisotropy of the OpenPBR material.
|
|
1686
|
+
* @param value The anisotropy intensity value
|
|
1687
|
+
*/
|
|
1688
|
+
set specularRoughnessAnisotropy(value: number);
|
|
1689
|
+
/**
|
|
1690
|
+
* Gets the specular roughness anisotropy of the OpenPBR material.
|
|
1691
|
+
* @returns The anisotropy intensity value
|
|
1692
|
+
*/
|
|
1693
|
+
get specularRoughnessAnisotropy(): number;
|
|
1694
|
+
/**
|
|
1695
|
+
* Sets the anisotropy rotation angle.
|
|
1696
|
+
* @param value The anisotropy rotation angle in radians
|
|
1697
|
+
*/
|
|
1698
|
+
set geometryTangentAngle(value: number);
|
|
1699
|
+
/**
|
|
1700
|
+
* Sets the geometry tangent texture for anisotropy.
|
|
1701
|
+
* Automatically enables using anisotropy from the tangent texture.
|
|
1702
|
+
* @param value The anisotropy texture or null
|
|
1703
|
+
*/
|
|
1704
|
+
set geometryTangentTexture(value: Nullable<BaseTexture>);
|
|
1705
|
+
/**
|
|
1706
|
+
* Gets the geometry tangent texture for anisotropy.
|
|
1707
|
+
* @returns The anisotropy texture or null
|
|
1708
|
+
*/
|
|
1709
|
+
get geometryTangentTexture(): Nullable<BaseTexture>;
|
|
1710
|
+
/**
|
|
1711
|
+
* Configures glTF-style anisotropy for the OpenPBR material.
|
|
1712
|
+
* @param useGltfStyle Whether to use glTF-style anisotropy
|
|
1713
|
+
*/
|
|
1714
|
+
configureGltfStyleAnisotropy(useGltfStyle?: boolean): void;
|
|
1715
|
+
/**
|
|
1716
|
+
* Sets the iridescence weight.
|
|
1717
|
+
* TODO: Implementation pending OpenPBR iridescence feature availability.
|
|
1718
|
+
* @param value The iridescence intensity value
|
|
1719
|
+
*/
|
|
1720
|
+
set iridescenceWeight(value: number);
|
|
1721
|
+
/**
|
|
1722
|
+
* Sets the iridescence IOR.
|
|
1723
|
+
* TODO: Implementation pending OpenPBR iridescence feature availability.
|
|
1724
|
+
* @param value The iridescence IOR value
|
|
1725
|
+
*/
|
|
1726
|
+
set iridescenceIor(value: number);
|
|
1727
|
+
/**
|
|
1728
|
+
* Sets the iridescence thickness minimum.
|
|
1729
|
+
* TODO: Implementation pending OpenPBR iridescence feature availability.
|
|
1730
|
+
* @param value The minimum thickness value in nanometers
|
|
1731
|
+
*/
|
|
1732
|
+
set iridescenceThicknessMinimum(value: number);
|
|
1733
|
+
/**
|
|
1734
|
+
* Sets the iridescence thickness maximum.
|
|
1735
|
+
* TODO: Implementation pending OpenPBR iridescence feature availability.
|
|
1736
|
+
* @param value The maximum thickness value in nanometers
|
|
1737
|
+
*/
|
|
1738
|
+
set iridescenceThicknessMaximum(value: number);
|
|
1739
|
+
/**
|
|
1740
|
+
* Sets the iridescence texture.
|
|
1741
|
+
* TODO: Implementation pending OpenPBR iridescence feature availability.
|
|
1742
|
+
* @param value The iridescence intensity texture or null
|
|
1743
|
+
*/
|
|
1744
|
+
set iridescenceTexture(value: Nullable<BaseTexture>);
|
|
1745
|
+
/**
|
|
1746
|
+
* Sets the iridescence thickness texture.
|
|
1747
|
+
* TODO: Implementation pending OpenPBR iridescence feature availability.
|
|
1748
|
+
* @param value The iridescence thickness texture or null
|
|
1749
|
+
*/
|
|
1750
|
+
set iridescenceThicknessTexture(value: Nullable<BaseTexture>);
|
|
1751
|
+
/**
|
|
1752
|
+
* Sets whether the OpenPBR material is unlit.
|
|
1753
|
+
* @param value True to make the material unlit
|
|
1754
|
+
*/
|
|
1755
|
+
set unlit(value: boolean);
|
|
1756
|
+
/**
|
|
1757
|
+
* Sets the geometry opacity of the OpenPBR material.
|
|
1758
|
+
* @param value The opacity value (0-1)
|
|
1759
|
+
*/
|
|
1760
|
+
set geometryOpacity(value: number);
|
|
1761
|
+
/**
|
|
1762
|
+
* Gets the geometry opacity of the OpenPBR material.
|
|
1763
|
+
* @returns The opacity value (0-1)
|
|
1764
|
+
*/
|
|
1765
|
+
get geometryOpacity(): number;
|
|
1766
|
+
/**
|
|
1767
|
+
* Sets the geometry normal texture of the OpenPBR material.
|
|
1768
|
+
* @param value The normal texture or null
|
|
1769
|
+
*/
|
|
1770
|
+
set geometryNormalTexture(value: Nullable<BaseTexture>);
|
|
1771
|
+
/**
|
|
1772
|
+
* Gets the geometry normal texture of the OpenPBR material.
|
|
1773
|
+
* @returns The normal texture or null
|
|
1774
|
+
*/
|
|
1775
|
+
get geometryNormalTexture(): Nullable<BaseTexture>;
|
|
1776
|
+
/**
|
|
1777
|
+
* Sets the normal map inversions for the OpenPBR material.
|
|
1778
|
+
* Note: OpenPBR may handle normal map inversions differently or may not need them.
|
|
1779
|
+
* @param invertX Whether to invert the normal map on the X axis (may be ignored)
|
|
1780
|
+
* @param invertY Whether to invert the normal map on the Y axis (may be ignored)
|
|
1781
|
+
*/
|
|
1782
|
+
setNormalMapInversions(invertX: boolean, invertY: boolean): void;
|
|
1783
|
+
/**
|
|
1784
|
+
* Sets the geometry coat normal texture of the OpenPBR material.
|
|
1785
|
+
* @param value The coat normal texture or null
|
|
1786
|
+
*/
|
|
1787
|
+
set geometryCoatNormalTexture(value: Nullable<BaseTexture>);
|
|
1788
|
+
/**
|
|
1789
|
+
* Gets the geometry coat normal texture of the OpenPBR material.
|
|
1790
|
+
* @returns The coat normal texture or null
|
|
1791
|
+
*/
|
|
1792
|
+
get geometryCoatNormalTexture(): Nullable<BaseTexture>;
|
|
1793
|
+
/**
|
|
1794
|
+
* Sets the geometry coat normal texture scale.
|
|
1795
|
+
* @param value The scale value for the coat normal texture
|
|
1796
|
+
*/
|
|
1797
|
+
set geometryCoatNormalTextureScale(value: number);
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
|
|
1801
|
+
|
|
1802
|
+
}
|
|
1803
|
+
declare module BABYLON {
|
|
1804
|
+
|
|
1805
|
+
|
|
1806
|
+
}
|
|
1807
|
+
declare module BABYLON.GLTF2 {
|
|
1808
|
+
/**
|
|
1809
|
+
* Interface for material loading adapters that provides a unified OpenPBR-like interface
|
|
1810
|
+
* for both OpenPBR and PBR materials, eliminating conditional branches in extensions.
|
|
1811
|
+
*/
|
|
1812
|
+
export interface IMaterialLoadingAdapter {
|
|
1813
|
+
/**
|
|
1814
|
+
* Gets the underlying material
|
|
1815
|
+
*/
|
|
1816
|
+
readonly material: Material;
|
|
1817
|
+
/**
|
|
1818
|
+
* Whether the material should be treated as unlit
|
|
1819
|
+
*/
|
|
1820
|
+
isUnlit: boolean;
|
|
1821
|
+
/**
|
|
1822
|
+
* Sets/gets the back face culling
|
|
1823
|
+
*/
|
|
1824
|
+
backFaceCulling: boolean;
|
|
1825
|
+
/**
|
|
1826
|
+
* Sets/gets the two sided lighting
|
|
1827
|
+
*/
|
|
1828
|
+
twoSidedLighting: boolean;
|
|
1829
|
+
/**
|
|
1830
|
+
* Sets/gets the alpha cutoff value (used for alpha test mode)
|
|
1831
|
+
*/
|
|
1832
|
+
alphaCutOff: number;
|
|
1833
|
+
/**
|
|
1834
|
+
* Sets/gets whether to use alpha from albedo/base color texture
|
|
1835
|
+
*/
|
|
1836
|
+
useAlphaFromBaseColorTexture: boolean;
|
|
1837
|
+
/**
|
|
1838
|
+
* Sets/Gets whether the transparency is treated as alpha coverage
|
|
1839
|
+
*/
|
|
1840
|
+
transparencyAsAlphaCoverage: boolean;
|
|
1841
|
+
/**
|
|
1842
|
+
* Sets/gets the base color (OpenPBR: baseColor, PBR: albedoColor)
|
|
1843
|
+
*/
|
|
1844
|
+
baseColor: Color3;
|
|
1845
|
+
/**
|
|
1846
|
+
* Sets/gets the base color texture (OpenPBR: baseColorTexture, PBR: albedoTexture)
|
|
1847
|
+
*/
|
|
1848
|
+
baseColorTexture: Nullable<BaseTexture>;
|
|
1849
|
+
/**
|
|
1850
|
+
* Sets/gets the base diffuse roughness (OpenPBR: baseDiffuseRoughness, PBR: baseDiffuseRoughness)
|
|
1851
|
+
*/
|
|
1852
|
+
baseDiffuseRoughness: number;
|
|
1853
|
+
/**
|
|
1854
|
+
* Sets/gets the base diffuse roughness texture (OpenPBR: baseDiffuseRoughnessTexture, PBR: baseDiffuseRoughnessTexture)
|
|
1855
|
+
*/
|
|
1856
|
+
baseDiffuseRoughnessTexture: Nullable<BaseTexture>;
|
|
1857
|
+
/**
|
|
1858
|
+
* Sets/gets the base metalness (OpenPBR: baseMetalness, PBR: metallic)
|
|
1859
|
+
*/
|
|
1860
|
+
baseMetalness: number;
|
|
1861
|
+
/**
|
|
1862
|
+
* Sets/gets the base metalness texture (OpenPBR: baseMetalnessTexture, PBR: metallicTexture)
|
|
1863
|
+
*/
|
|
1864
|
+
baseMetalnessTexture: Nullable<BaseTexture>;
|
|
1865
|
+
/**
|
|
1866
|
+
* Sets whether to use roughness from metallic texture green channel
|
|
1867
|
+
*/
|
|
1868
|
+
useRoughnessFromMetallicTextureGreen: boolean;
|
|
1869
|
+
/**
|
|
1870
|
+
* Sets whether to use metallic from metallic texture blue channel
|
|
1871
|
+
*/
|
|
1872
|
+
useMetallicFromMetallicTextureBlue: boolean;
|
|
1873
|
+
/**
|
|
1874
|
+
* Configures specular properties and enables OpenPBR BRDF model for edge color support
|
|
1875
|
+
* @param enableEdgeColor - Whether to enable edge color support
|
|
1876
|
+
*/
|
|
1877
|
+
enableSpecularEdgeColor(enableEdgeColor?: boolean): void;
|
|
1878
|
+
/**
|
|
1879
|
+
* Sets/gets the specular weight (OpenPBR: specularWeight, PBR: metallicF0Factor)
|
|
1880
|
+
*/
|
|
1881
|
+
specularWeight: number;
|
|
1882
|
+
/**
|
|
1883
|
+
* Sets/gets the specular weight texture (OpenPBR: specularWeightTexture, PBR: metallicReflectanceTexture)
|
|
1884
|
+
*/
|
|
1885
|
+
specularWeightTexture: Nullable<BaseTexture>;
|
|
1886
|
+
/**
|
|
1887
|
+
* Sets/gets the specular color (OpenPBR: specularColor, PBR: reflectance)
|
|
1888
|
+
*/
|
|
1889
|
+
specularColor: Color3;
|
|
1890
|
+
/**
|
|
1891
|
+
* Sets/gets the specular color texture (OpenPBR: specularColorTexture, PBR: reflectanceTexture)
|
|
1892
|
+
*/
|
|
1893
|
+
specularColorTexture: Nullable<BaseTexture>;
|
|
1894
|
+
/**
|
|
1895
|
+
* Sets/gets the specular roughness (OpenPBR: specularRoughness, PBR: roughness)
|
|
1896
|
+
*/
|
|
1897
|
+
specularRoughness: number;
|
|
1898
|
+
/**
|
|
1899
|
+
* Sets/gets the specular roughness texture
|
|
1900
|
+
*/
|
|
1901
|
+
specularRoughnessTexture: Nullable<BaseTexture>;
|
|
1902
|
+
/**
|
|
1903
|
+
* Sets/gets the specular IOR (OpenPBR: specularIor, PBR: indexOfRefraction)
|
|
1904
|
+
*/
|
|
1905
|
+
specularIor: number;
|
|
1906
|
+
/**
|
|
1907
|
+
* Sets/gets the emissive color (OpenPBR: emissionColor, PBR: emissiveColor)
|
|
1908
|
+
*/
|
|
1909
|
+
emissionColor: Color3;
|
|
1910
|
+
/**
|
|
1911
|
+
* Sets/gets the emissive luminance (OpenPBR: emissionLuminance, PBR: emissiveIntensity)
|
|
1912
|
+
*/
|
|
1913
|
+
emissionLuminance: number;
|
|
1914
|
+
/**
|
|
1915
|
+
* Sets/gets the emissive texture
|
|
1916
|
+
*/
|
|
1917
|
+
emissionColorTexture: Nullable<BaseTexture>;
|
|
1918
|
+
/**
|
|
1919
|
+
* Sets/gets the ambient occlusion texture (OpenPBR: ambientOcclusionTexture, PBR: ambientTexture)
|
|
1920
|
+
*/
|
|
1921
|
+
ambientOcclusionTexture: Nullable<BaseTexture>;
|
|
1922
|
+
/**
|
|
1923
|
+
* Sets/gets the ambient occlusion texture strength/level
|
|
1924
|
+
*/
|
|
1925
|
+
ambientOcclusionTextureStrength: number;
|
|
1926
|
+
/**
|
|
1927
|
+
* Configures clear coat for PBR material
|
|
1928
|
+
*/
|
|
1929
|
+
configureCoat(): void;
|
|
1930
|
+
/**
|
|
1931
|
+
* Sets/gets the coat weight (OpenPBR: coatWeight, PBR: clearCoat.intensity)
|
|
1932
|
+
*/
|
|
1933
|
+
coatWeight: number;
|
|
1934
|
+
/**
|
|
1935
|
+
* Sets/gets the coat weight texture (OpenPBR: coatWeightTexture, PBR: clearCoat.texture)
|
|
1936
|
+
*/
|
|
1937
|
+
coatWeightTexture: Nullable<BaseTexture>;
|
|
1938
|
+
/**
|
|
1939
|
+
* Sets the coat color (OpenPBR: coatColor, no PBR equivalent)
|
|
1940
|
+
*/
|
|
1941
|
+
coatColor: Color3;
|
|
1942
|
+
/**
|
|
1943
|
+
* Sets the coat color texture (OpenPBR: coatColorTexture, no PBR equivalent)
|
|
1944
|
+
*/
|
|
1945
|
+
coatColorTexture: Nullable<BaseTexture>;
|
|
1946
|
+
/**
|
|
1947
|
+
* Sets/gets the coat roughness (OpenPBR: coatRoughness, PBR: clearCoat.roughness)
|
|
1948
|
+
*/
|
|
1949
|
+
coatRoughness: number;
|
|
1950
|
+
/**
|
|
1951
|
+
* Sets/gets the coat roughness texture (OpenPBR: coatRoughnessTexture, PBR: clearCoat.textureRoughness)
|
|
1952
|
+
*/
|
|
1953
|
+
coatRoughnessTexture: Nullable<BaseTexture>;
|
|
1954
|
+
/**
|
|
1955
|
+
* Sets the coat darkening (OpenPBR: coatDarkening, no PBR equivalent)
|
|
1956
|
+
*/
|
|
1957
|
+
coatDarkening: number;
|
|
1958
|
+
/**
|
|
1959
|
+
* Sets the coat darkening texture (OpenPBR: coatDarkeningTexture, no PBR equivalent)
|
|
1960
|
+
*/
|
|
1961
|
+
coatDarkeningTexture: Nullable<BaseTexture>;
|
|
1962
|
+
/**
|
|
1963
|
+
* Sets/gets the coat roughness anisotropy (OpenPBR: coatRoughnessAnisotropy, PBR: clearCoat.anisotropy.intensity)
|
|
1964
|
+
*/
|
|
1965
|
+
coatRoughnessAnisotropy: number;
|
|
1966
|
+
/**
|
|
1967
|
+
* Sets the coat tangent angle for anisotropy (OpenPBR: geometryCoatTangentAngle, PBR: clearCoat.anisotropy.angle)
|
|
1968
|
+
*/
|
|
1969
|
+
geometryCoatTangentAngle: number;
|
|
1970
|
+
/**
|
|
1971
|
+
* Sets the coat tangent texture for anisotropy (OpenPBR: geometryCoatTangentTexture, PBR: clearCoat.anisotropy.texture)
|
|
1972
|
+
*/
|
|
1973
|
+
geometryCoatTangentTexture: Nullable<BaseTexture>;
|
|
1974
|
+
/**
|
|
1975
|
+
* Sets the transmission weight (OpenPBR: transmissionWeight, PBR: subSurface.refractionIntensity)
|
|
1976
|
+
*/
|
|
1977
|
+
transmissionWeight: number;
|
|
1978
|
+
/**
|
|
1979
|
+
* Sets the transmission weight texture (OpenPBR: transmissionWeightTexture, PBR: subSurface.refractionIntensityTexture)
|
|
1980
|
+
*/
|
|
1981
|
+
transmissionWeightTexture: Nullable<BaseTexture>;
|
|
1982
|
+
/**
|
|
1983
|
+
* Sets the attenuation distance (OpenPBR: attenuationDistance, PBR: subSurface.volumeIndexOfRefraction)
|
|
1984
|
+
*/
|
|
1985
|
+
transmissionDepth: number;
|
|
1986
|
+
/**
|
|
1987
|
+
* Sets the attenuation color (OpenPBR: attenuationColor, PBR: subSurface.tintColor)
|
|
1988
|
+
*/
|
|
1989
|
+
transmissionColor: Color3;
|
|
1990
|
+
/**
|
|
1991
|
+
* Sets the dispersion Abbe number
|
|
1992
|
+
*/
|
|
1993
|
+
transmissionDispersionAbbeNumber: number;
|
|
1994
|
+
/**
|
|
1995
|
+
* Configures transmission for thin-surface transmission (KHR_materials_transmission)
|
|
1996
|
+
*/
|
|
1997
|
+
configureTransmission(): void;
|
|
1998
|
+
/**
|
|
1999
|
+
* Sets the thickness texture (OpenPBR: thicknessTexture, PBR: subSurface.thicknessTexture)
|
|
2000
|
+
*/
|
|
2001
|
+
volumeThicknessTexture: Nullable<BaseTexture>;
|
|
2002
|
+
/**
|
|
2003
|
+
* Sets the thickness factor (OpenPBR: thickness, PBR: subSurface.maximumThickness)
|
|
2004
|
+
*/
|
|
2005
|
+
volumeThickness: number;
|
|
2006
|
+
/**
|
|
2007
|
+
* Configures subsurface properties for PBR material
|
|
2008
|
+
*/
|
|
2009
|
+
configureSubsurface(): void;
|
|
2010
|
+
/**
|
|
2011
|
+
* Sets/gets the subsurface weight
|
|
2012
|
+
*/
|
|
2013
|
+
subsurfaceWeight: number;
|
|
2014
|
+
/**
|
|
2015
|
+
* Sets/gets the subsurface weight texture
|
|
2016
|
+
*/
|
|
2017
|
+
subsurfaceWeightTexture: Nullable<BaseTexture>;
|
|
2018
|
+
/**
|
|
2019
|
+
* Sets/gets the subsurface color (OpenPBR: subsurfaceColor, PBR: subSurface.tintColor)
|
|
2020
|
+
*/
|
|
2021
|
+
subsurfaceColor: Color3;
|
|
2022
|
+
/**
|
|
2023
|
+
* Sets/gets the subsurface color texture (OpenPBR: subsurfaceColorTexture, PBR: subSurface.tintColorTexture)
|
|
2024
|
+
*/
|
|
2025
|
+
subsurfaceColorTexture: Nullable<BaseTexture>;
|
|
2026
|
+
/**
|
|
2027
|
+
* Configures initial settings for fuzz for material.
|
|
2028
|
+
*/
|
|
2029
|
+
configureFuzz(): void;
|
|
2030
|
+
/**
|
|
2031
|
+
* Sets the fuzz weight (OpenPBR: fuzzWeight, PBR: fuzz.intensity)
|
|
2032
|
+
*/
|
|
2033
|
+
fuzzWeight: number;
|
|
2034
|
+
/**
|
|
2035
|
+
* Sets the fuzz color (OpenPBR: fuzzColor, PBR: fuzz.color)
|
|
2036
|
+
*/
|
|
2037
|
+
fuzzColor: Color3;
|
|
2038
|
+
/**
|
|
2039
|
+
* Sets the fuzz color texture (OpenPBR: fuzzColorTexture, PBR: fuzz.texture)
|
|
2040
|
+
*/
|
|
2041
|
+
fuzzColorTexture: Nullable<BaseTexture>;
|
|
2042
|
+
/**
|
|
2043
|
+
* Sets the fuzz roughness (OpenPBR: fuzzRoughness, PBR: fuzz.roughness)
|
|
2044
|
+
*/
|
|
2045
|
+
fuzzRoughness: number;
|
|
2046
|
+
/**
|
|
2047
|
+
* Sets the fuzz roughness texture (OpenPBR: fuzzRoughnessTexture, PBR: fuzz.textureRoughness)
|
|
2048
|
+
*/
|
|
2049
|
+
fuzzRoughnessTexture: Nullable<BaseTexture>;
|
|
2050
|
+
/**
|
|
2051
|
+
* Sets/gets the specular roughness anisotropy (OpenPBR: specularRoughnessAnisotropy, PBR: anisotropy.intensity)
|
|
2052
|
+
*/
|
|
2053
|
+
specularRoughnessAnisotropy: number;
|
|
2054
|
+
/**
|
|
2055
|
+
* Sets the anisotropy rotation (OpenPBR: anisotropyRotation, PBR: anisotropy.angle)
|
|
2056
|
+
*/
|
|
2057
|
+
geometryTangentAngle: number;
|
|
2058
|
+
/**
|
|
2059
|
+
* Sets/gets the anisotropy texture (OpenPBR: geometryTangentTexture, PBR: anisotropy.texture)
|
|
2060
|
+
*/
|
|
2061
|
+
geometryTangentTexture: Nullable<BaseTexture>;
|
|
2062
|
+
/**
|
|
2063
|
+
* Configures glTF-style anisotropy for OpenPBR materials
|
|
2064
|
+
* @param useGltfStyle - Whether to use glTF-style anisotropy (default: true)
|
|
2065
|
+
*/
|
|
2066
|
+
configureGltfStyleAnisotropy(useGltfStyle?: boolean): void;
|
|
2067
|
+
/**
|
|
2068
|
+
* Sets the iridescence weight (OpenPBR: iridescenceWeight, PBR: iridescence.intensity)
|
|
2069
|
+
*/
|
|
2070
|
+
iridescenceWeight: number;
|
|
2071
|
+
/**
|
|
2072
|
+
* Sets the iridescence IOR (OpenPBR: iridescenceIor, PBR: iridescence.indexOfRefraction)
|
|
510
2073
|
*/
|
|
511
|
-
|
|
2074
|
+
iridescenceIor: number;
|
|
512
2075
|
/**
|
|
513
|
-
*
|
|
2076
|
+
* Sets the iridescence thickness minimum (OpenPBR: iridescenceThicknessMinimum, PBR: iridescence.minimumThickness)
|
|
514
2077
|
*/
|
|
515
|
-
|
|
2078
|
+
iridescenceThicknessMinimum: number;
|
|
516
2079
|
/**
|
|
517
|
-
*
|
|
2080
|
+
* Sets the iridescence thickness maximum (OpenPBR: iridescenceThicknessMaximum, PBR: iridescence.maximumThickness)
|
|
518
2081
|
*/
|
|
519
|
-
|
|
2082
|
+
iridescenceThicknessMaximum: number;
|
|
520
2083
|
/**
|
|
521
|
-
*
|
|
2084
|
+
* Sets the iridescence texture (OpenPBR: iridescenceTexture, PBR: iridescence.intensityTexture)
|
|
522
2085
|
*/
|
|
523
|
-
|
|
2086
|
+
iridescenceTexture: Nullable<BaseTexture>;
|
|
524
2087
|
/**
|
|
525
|
-
*
|
|
526
|
-
* @param rootUrl the original root url
|
|
527
|
-
* @param responseURL the response url if available
|
|
528
|
-
* @returns the new root url
|
|
2088
|
+
* Sets the iridescence thickness texture (OpenPBR: iridescenceThicknessTexture, PBR: iridescence.thicknessTexture)
|
|
529
2089
|
*/
|
|
530
|
-
|
|
531
|
-
/** @internal */
|
|
532
|
-
createPlugin(options: SceneLoaderPluginOptions): ISceneLoaderPluginAsync;
|
|
2090
|
+
iridescenceThicknessTexture: Nullable<BaseTexture>;
|
|
533
2091
|
/**
|
|
534
|
-
*
|
|
2092
|
+
* Sets the unlit flag (OpenPBR: unlit, PBR: unlit)
|
|
535
2093
|
*/
|
|
536
|
-
|
|
2094
|
+
unlit: boolean;
|
|
537
2095
|
/**
|
|
538
|
-
*
|
|
2096
|
+
* Sets/gets the geometry opacity (OpenPBR: geometryOpacity, PBR: alpha)
|
|
539
2097
|
*/
|
|
540
|
-
|
|
2098
|
+
geometryOpacity: number;
|
|
541
2099
|
/**
|
|
542
|
-
*
|
|
543
|
-
* @returns a promise that resolves when the asset is completely loaded.
|
|
2100
|
+
* Sets/gets the geometry normal texture (OpenPBR: geometryNormalTexture, PBR: bumpTexture)
|
|
544
2101
|
*/
|
|
545
|
-
|
|
2102
|
+
geometryNormalTexture: Nullable<BaseTexture>;
|
|
546
2103
|
/**
|
|
547
|
-
*
|
|
2104
|
+
* Sets the normal map inversions for PBR material only
|
|
2105
|
+
* @param invertX - Whether to invert the normal map on the X axis
|
|
2106
|
+
* @param invertY - Whether to invert the normal map on the Y axis
|
|
548
2107
|
*/
|
|
549
|
-
|
|
2108
|
+
setNormalMapInversions(invertX: boolean, invertY: boolean): void;
|
|
550
2109
|
/**
|
|
551
|
-
*
|
|
2110
|
+
* Sets/gets the coat normal texture (OpenPBR: geometryCoatNormalTexture, PBR: clearCoat.bumpTexture)
|
|
552
2111
|
*/
|
|
553
|
-
|
|
554
|
-
private _onProgress;
|
|
555
|
-
private _validate;
|
|
556
|
-
private _getLoader;
|
|
557
|
-
private _parseJson;
|
|
558
|
-
private _unpackBinaryAsync;
|
|
559
|
-
private _unpackBinaryV1Async;
|
|
560
|
-
private _unpackBinaryV2Async;
|
|
561
|
-
private static _parseVersion;
|
|
562
|
-
private static _compareVersion;
|
|
563
|
-
private static readonly _logSpaces;
|
|
564
|
-
private _logIndentLevel;
|
|
565
|
-
private _loggingEnabled;
|
|
566
|
-
/** @internal */
|
|
567
|
-
_log: (message: string) => void;
|
|
2112
|
+
geometryCoatNormalTexture: Nullable<BaseTexture>;
|
|
568
2113
|
/**
|
|
569
|
-
*
|
|
2114
|
+
* Sets the coat normal texture scale
|
|
570
2115
|
*/
|
|
571
|
-
|
|
572
|
-
/** @internal */
|
|
573
|
-
_logClose(): void;
|
|
574
|
-
private _logEnabled;
|
|
575
|
-
private _logDisabled;
|
|
576
|
-
private _capturePerformanceCounters;
|
|
577
|
-
/** @internal */
|
|
578
|
-
_startPerformanceCounter: (counterName: string) => void;
|
|
579
|
-
/** @internal */
|
|
580
|
-
_endPerformanceCounter: (counterName: string) => void;
|
|
581
|
-
private _startPerformanceCounterEnabled;
|
|
582
|
-
private _startPerformanceCounterDisabled;
|
|
583
|
-
private _endPerformanceCounterEnabled;
|
|
584
|
-
private _endPerformanceCounterDisabled;
|
|
2116
|
+
geometryCoatNormalTextureScale: number;
|
|
585
2117
|
}
|
|
586
2118
|
|
|
587
2119
|
|
|
588
2120
|
|
|
2121
|
+
}
|
|
2122
|
+
declare module BABYLON {
|
|
2123
|
+
|
|
2124
|
+
|
|
589
2125
|
}
|
|
590
2126
|
declare module BABYLON.GLTF2 {
|
|
591
2127
|
|
|
@@ -1161,6 +2697,11 @@ declare module BABYLON.GLTF2 {
|
|
|
1161
2697
|
private _rootBabylonMesh;
|
|
1162
2698
|
private _defaultBabylonMaterialData;
|
|
1163
2699
|
private readonly _postSceneLoadActions;
|
|
2700
|
+
private readonly _materialAdapterCache;
|
|
2701
|
+
/** @internal */
|
|
2702
|
+
_pbrMaterialClass: typeof PBRMaterial | typeof OpenPBRMaterial | null;
|
|
2703
|
+
/** @internal */
|
|
2704
|
+
_pbrMaterialAdapterClass: typeof BABYLON.GLTF2.OpenPBRMaterialLoadingAdapter | typeof BABYLON.GLTF2.PBRMaterialLoadingAdapter | null;
|
|
1164
2705
|
/**
|
|
1165
2706
|
* The default glTF sampler.
|
|
1166
2707
|
*/
|
|
@@ -1207,6 +2748,13 @@ declare module BABYLON.GLTF2 {
|
|
|
1207
2748
|
* @internal
|
|
1208
2749
|
*/
|
|
1209
2750
|
constructor(parent: GLTFFileLoader);
|
|
2751
|
+
/**
|
|
2752
|
+
* Creates or gets a cached material loading adapter with dynamic imports
|
|
2753
|
+
* @param material The material to adapt
|
|
2754
|
+
* @returns Promise that resolves to the appropriate adapter
|
|
2755
|
+
* @internal
|
|
2756
|
+
*/
|
|
2757
|
+
_getOrCreateMaterialAdapter(material: Material): BABYLON.GLTF2.IMaterialLoadingAdapter;
|
|
1210
2758
|
/** @internal */
|
|
1211
2759
|
dispose(): void;
|
|
1212
2760
|
/**
|
|
@@ -2914,6 +4462,180 @@ declare module BABYLON {
|
|
|
2914
4462
|
["KHR_materials_diffuse_transmission"]: {};
|
|
2915
4463
|
}
|
|
2916
4464
|
|
|
4465
|
+
}
|
|
4466
|
+
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
4467
|
+
/**
|
|
4468
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/fdee35425ae560ea378092e38977216d63a094ec/extensions/2.0/Khronos/KHR_materials_diffuse_roughness/README.md)
|
|
4469
|
+
* @experimental
|
|
4470
|
+
*/
|
|
4471
|
+
export class KHR_materials_diffuse_roughness implements BABYLON.GLTF2.IGLTFLoaderExtension {
|
|
4472
|
+
/**
|
|
4473
|
+
* The name of this extension.
|
|
4474
|
+
*/
|
|
4475
|
+
readonly name = "KHR_materials_diffuse_roughness";
|
|
4476
|
+
/**
|
|
4477
|
+
* Defines whether this extension is enabled.
|
|
4478
|
+
*/
|
|
4479
|
+
enabled: boolean;
|
|
4480
|
+
/**
|
|
4481
|
+
* Defines a number that determines the order the extensions are applied.
|
|
4482
|
+
*/
|
|
4483
|
+
order: number;
|
|
4484
|
+
private _loader;
|
|
4485
|
+
/**
|
|
4486
|
+
* @internal
|
|
4487
|
+
*/
|
|
4488
|
+
constructor(loader: BABYLON.GLTF2.GLTFLoader);
|
|
4489
|
+
/** @internal */
|
|
4490
|
+
dispose(): void;
|
|
4491
|
+
/**
|
|
4492
|
+
* @internal
|
|
4493
|
+
*/
|
|
4494
|
+
loadMaterialPropertiesAsync(context: string, material: BABYLON.GLTF2.Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
|
|
4495
|
+
private _loadDiffuseRoughnessPropertiesAsync;
|
|
4496
|
+
}
|
|
4497
|
+
|
|
4498
|
+
|
|
4499
|
+
|
|
4500
|
+
}
|
|
4501
|
+
declare module BABYLON {
|
|
4502
|
+
interface GLTFLoaderExtensionOptions {
|
|
4503
|
+
/**
|
|
4504
|
+
* Defines options for the KHR_materials_diffuse_roughness extension.
|
|
4505
|
+
*/
|
|
4506
|
+
["KHR_materials_diffuse_roughness"]: {};
|
|
4507
|
+
}
|
|
4508
|
+
|
|
4509
|
+
}
|
|
4510
|
+
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
4511
|
+
/**
|
|
4512
|
+
* [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/2518)
|
|
4513
|
+
* !!! Experimental Extension Subject to Changes !!!
|
|
4514
|
+
*/
|
|
4515
|
+
export class KHR_materials_clearcoat_darkening implements BABYLON.GLTF2.IGLTFLoaderExtension {
|
|
4516
|
+
/**
|
|
4517
|
+
* The name of this extension.
|
|
4518
|
+
*/
|
|
4519
|
+
readonly name = "KHR_materials_clearcoat_darkening";
|
|
4520
|
+
/**
|
|
4521
|
+
* Defines whether this extension is enabled.
|
|
4522
|
+
*/
|
|
4523
|
+
enabled: boolean;
|
|
4524
|
+
/**
|
|
4525
|
+
* Defines a number that determines the order the extensions are applied.
|
|
4526
|
+
*/
|
|
4527
|
+
order: number;
|
|
4528
|
+
private _loader;
|
|
4529
|
+
/**
|
|
4530
|
+
* @internal
|
|
4531
|
+
*/
|
|
4532
|
+
constructor(loader: BABYLON.GLTF2.GLTFLoader);
|
|
4533
|
+
/** @internal */
|
|
4534
|
+
dispose(): void;
|
|
4535
|
+
/**
|
|
4536
|
+
* @internal
|
|
4537
|
+
*/
|
|
4538
|
+
loadMaterialPropertiesAsync(context: string, material: BABYLON.GLTF2.Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
|
|
4539
|
+
private _loadDarkeningPropertiesAsync;
|
|
4540
|
+
}
|
|
4541
|
+
|
|
4542
|
+
|
|
4543
|
+
|
|
4544
|
+
}
|
|
4545
|
+
declare module BABYLON {
|
|
4546
|
+
interface GLTFLoaderExtensionOptions {
|
|
4547
|
+
/**
|
|
4548
|
+
* Defines options for the KHR_materials_clearcoat_darkening extension.
|
|
4549
|
+
*/
|
|
4550
|
+
["KHR_materials_clearcoat_darkening"]: {};
|
|
4551
|
+
}
|
|
4552
|
+
|
|
4553
|
+
}
|
|
4554
|
+
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
4555
|
+
/**
|
|
4556
|
+
* !!! Experimental Extension Subject to Changes !!!
|
|
4557
|
+
*/
|
|
4558
|
+
export class KHR_materials_clearcoat_color implements BABYLON.GLTF2.IGLTFLoaderExtension {
|
|
4559
|
+
/**
|
|
4560
|
+
* The name of this extension.
|
|
4561
|
+
*/
|
|
4562
|
+
readonly name = "KHR_materials_clearcoat_color";
|
|
4563
|
+
/**
|
|
4564
|
+
* Defines whether this extension is enabled.
|
|
4565
|
+
*/
|
|
4566
|
+
enabled: boolean;
|
|
4567
|
+
/**
|
|
4568
|
+
* Defines a number that determines the order the extensions are applied.
|
|
4569
|
+
*/
|
|
4570
|
+
order: number;
|
|
4571
|
+
private _loader;
|
|
4572
|
+
/**
|
|
4573
|
+
* @internal
|
|
4574
|
+
*/
|
|
4575
|
+
constructor(loader: BABYLON.GLTF2.GLTFLoader);
|
|
4576
|
+
/** @internal */
|
|
4577
|
+
dispose(): void;
|
|
4578
|
+
/**
|
|
4579
|
+
* @internal
|
|
4580
|
+
*/
|
|
4581
|
+
loadMaterialPropertiesAsync(context: string, material: BABYLON.GLTF2.Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
|
|
4582
|
+
private _loadColorPropertiesAsync;
|
|
4583
|
+
}
|
|
4584
|
+
|
|
4585
|
+
|
|
4586
|
+
|
|
4587
|
+
}
|
|
4588
|
+
declare module BABYLON {
|
|
4589
|
+
interface GLTFLoaderExtensionOptions {
|
|
4590
|
+
/**
|
|
4591
|
+
* Defines options for the KHR_materials_clearcoat_color extension.
|
|
4592
|
+
*/
|
|
4593
|
+
["KHR_materials_clearcoat_color"]: {};
|
|
4594
|
+
}
|
|
4595
|
+
|
|
4596
|
+
}
|
|
4597
|
+
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
4598
|
+
/**
|
|
4599
|
+
* [Specification](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat_anisotropy)
|
|
4600
|
+
*/
|
|
4601
|
+
export class KHR_materials_clearcoat_anisotropy implements BABYLON.GLTF2.IGLTFLoaderExtension {
|
|
4602
|
+
/**
|
|
4603
|
+
* The name of this extension.
|
|
4604
|
+
*/
|
|
4605
|
+
readonly name = "KHR_materials_clearcoat_anisotropy";
|
|
4606
|
+
/**
|
|
4607
|
+
* Defines whether this extension is enabled.
|
|
4608
|
+
*/
|
|
4609
|
+
enabled: boolean;
|
|
4610
|
+
/**
|
|
4611
|
+
* Defines a number that determines the order the extensions are applied.
|
|
4612
|
+
*/
|
|
4613
|
+
order: number;
|
|
4614
|
+
private _loader;
|
|
4615
|
+
/**
|
|
4616
|
+
* @internal
|
|
4617
|
+
*/
|
|
4618
|
+
constructor(loader: BABYLON.GLTF2.GLTFLoader);
|
|
4619
|
+
/** @internal */
|
|
4620
|
+
dispose(): void;
|
|
4621
|
+
/**
|
|
4622
|
+
* @internal
|
|
4623
|
+
*/
|
|
4624
|
+
loadMaterialPropertiesAsync(context: string, material: BABYLON.GLTF2.Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
|
|
4625
|
+
private _loadAnisotropyPropertiesAsync;
|
|
4626
|
+
}
|
|
4627
|
+
|
|
4628
|
+
|
|
4629
|
+
|
|
4630
|
+
}
|
|
4631
|
+
declare module BABYLON {
|
|
4632
|
+
interface GLTFLoaderExtensionOptions {
|
|
4633
|
+
/**
|
|
4634
|
+
* Defines options for the KHR_materials_clearcoat_anisotropy extension.
|
|
4635
|
+
*/
|
|
4636
|
+
["KHR_materials_clearcoat_anisotropy"]: {};
|
|
4637
|
+
}
|
|
4638
|
+
|
|
2917
4639
|
}
|
|
2918
4640
|
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
2919
4641
|
/**
|
|
@@ -2987,7 +4709,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
2987
4709
|
* @internal
|
|
2988
4710
|
*/
|
|
2989
4711
|
loadMaterialPropertiesAsync(context: string, material: BABYLON.GLTF2.Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
|
|
2990
|
-
private
|
|
4712
|
+
private _loadAnisotropyPropertiesAsync;
|
|
2991
4713
|
}
|
|
2992
4714
|
|
|
2993
4715
|
|
|
@@ -3381,50 +5103,6 @@ declare module BABYLON {
|
|
|
3381
5103
|
["EXT_mesh_gpu_instancing"]: {};
|
|
3382
5104
|
}
|
|
3383
5105
|
|
|
3384
|
-
}
|
|
3385
|
-
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
3386
|
-
/**
|
|
3387
|
-
* [Specification](https://github.com/KhronosGroup/glTF/blob/fdee35425ae560ea378092e38977216d63a094ec/extensions/2.0/Khronos/EXT_materials_diffuse_roughness/README.md)
|
|
3388
|
-
* @experimental
|
|
3389
|
-
*/
|
|
3390
|
-
export class EXT_materials_diffuse_roughness implements BABYLON.GLTF2.IGLTFLoaderExtension {
|
|
3391
|
-
/**
|
|
3392
|
-
* The name of this extension.
|
|
3393
|
-
*/
|
|
3394
|
-
readonly name = "EXT_materials_diffuse_roughness";
|
|
3395
|
-
/**
|
|
3396
|
-
* Defines whether this extension is enabled.
|
|
3397
|
-
*/
|
|
3398
|
-
enabled: boolean;
|
|
3399
|
-
/**
|
|
3400
|
-
* Defines a number that determines the order the extensions are applied.
|
|
3401
|
-
*/
|
|
3402
|
-
order: number;
|
|
3403
|
-
private _loader;
|
|
3404
|
-
/**
|
|
3405
|
-
* @internal
|
|
3406
|
-
*/
|
|
3407
|
-
constructor(loader: BABYLON.GLTF2.GLTFLoader);
|
|
3408
|
-
/** @internal */
|
|
3409
|
-
dispose(): void;
|
|
3410
|
-
/**
|
|
3411
|
-
* @internal
|
|
3412
|
-
*/
|
|
3413
|
-
loadMaterialPropertiesAsync(context: string, material: BABYLON.GLTF2.Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
|
|
3414
|
-
private _loadDiffuseRoughnessPropertiesAsync;
|
|
3415
|
-
}
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
}
|
|
3420
|
-
declare module BABYLON {
|
|
3421
|
-
interface GLTFLoaderExtensionOptions {
|
|
3422
|
-
/**
|
|
3423
|
-
* Defines options for the EXT_materials_diffuse_roughness extension.
|
|
3424
|
-
*/
|
|
3425
|
-
["EXT_materials_diffuse_roughness"]: {};
|
|
3426
|
-
}
|
|
3427
|
-
|
|
3428
5106
|
}
|
|
3429
5107
|
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
3430
5108
|
/** @internal */
|
|
@@ -4994,13 +6672,14 @@ declare module BABYLON {
|
|
|
4994
6672
|
* If a tuple of (position, normal) is not set, add the data into the corresponding array
|
|
4995
6673
|
* If the tuple already exist, add only their indice
|
|
4996
6674
|
*
|
|
4997
|
-
* @param
|
|
4998
|
-
*
|
|
4999
|
-
*
|
|
5000
|
-
*
|
|
5001
|
-
*
|
|
5002
|
-
*
|
|
5003
|
-
*
|
|
6675
|
+
* @param data The vertex's data
|
|
6676
|
+
* * indicesPositionFromObj: The index in positions array
|
|
6677
|
+
* * indicesUvsFromObj: The index in uvs array
|
|
6678
|
+
* * indicesNormalFromObj: The index in normals array
|
|
6679
|
+
* * positionVectorFromOBJ: The value of position at index objIndice
|
|
6680
|
+
* * textureVectorFromOBJ: The value of uvs
|
|
6681
|
+
* * normalsVectorFromOBJ: The value of normals at index objNormale
|
|
6682
|
+
* * positionColorsFromOBJ: The value of color at index objIndice
|
|
5004
6683
|
*/
|
|
5005
6684
|
private _setData;
|
|
5006
6685
|
/**
|