@babylonjs-toolkit/next 9.12.1 → 9.12.101

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.
@@ -47,7 +47,7 @@ import { MaterialDefines } from '@babylonjs/core/Materials/materialDefines';
47
47
  import { UniformBuffer } from '@babylonjs/core/Materials/uniformBuffer';
48
48
  import { MaterialPluginBase } from '@babylonjs/core/Materials/materialPluginBase';
49
49
  import { IAnimatable } from '@babylonjs/core/Animations';
50
- import { ShaderLanguage } from '@babylonjs/core/Materials';
50
+ import { ShaderLanguage, RawTexture2DArray } from '@babylonjs/core/Materials';
51
51
  import { StaticSound, IStaticSoundOptions, AudioEngineV2, StaticSoundBuffer, StreamingSound, IWebAudioEngineOptions, AbstractSpatialAudio, IStaticSoundBufferOptions, IStreamingSoundOptions } from '@babylonjs/core/AudioV2';
52
52
  import { VertexData } from '@babylonjs/core/Meshes/mesh.vertexData';
53
53
  import { IFileRequest } from '@babylonjs/core/Misc/fileRequest';
@@ -814,6 +814,7 @@ export declare class CVTOOLS_unity_metadata implements IGLTFLoaderExtension {
814
814
  static readonly IBL_SPEC_FACTOR: number;
815
815
  static readonly IBL_PROBE_FACTOR: number;
816
816
  static SuppressReflectionProbeDiffuse(texture: BaseTexture): void;
817
+ static ApplyGlobalReflectionProbeDiffuse(texture: BaseTexture, scene: Scene, createPolynomialsFromFaces?: boolean): void;
817
818
  enabled: boolean;
818
819
  private _webgpu;
819
820
  private _loader;
@@ -920,6 +921,12 @@ export declare class CustomShaderMaterial extends PBRMaterial {
920
921
  protected shader: string;
921
922
  protected plugin: MaterialPluginBase;
922
923
  private _unityLightingPlugin;
924
+ private _skinArray;
925
+ private _skinArrayNormal;
926
+ private _skinArrayMetalRough;
927
+ private _skinArrayEmissive;
928
+ private _skinLayerUniform;
929
+ private _skinArraySwitchingPlugin;
923
930
  getPlugin(): MaterialPluginBase;
924
931
  getClassName(): string;
925
932
  constructor(name: string, scene: Scene);
@@ -928,6 +935,21 @@ export declare class CustomShaderMaterial extends PBRMaterial {
928
935
  checkUniform(uniformName: string, type: string, value?: any): void;
929
936
  checkSampler(samplerName: string, texture?: any): void;
930
937
  splitLighting(diffuseIbl: number, specularIbl: number): void;
938
+ enableSkinArray(layerUniform?: boolean): CustomShaderMaterial;
939
+ setSkinLayer(layer: number): CustomShaderMaterial;
940
+ enableSkinArrayNormal(enabled?: boolean): CustomShaderMaterial;
941
+ enableSkinArrayMetalRough(enabled?: boolean): CustomShaderMaterial;
942
+ enableSkinArrayEmissive(enabled?: boolean): CustomShaderMaterial;
943
+ setSkinArrayLayerMode(uniform: boolean): CustomShaderMaterial;
944
+ addTextureArrayUniform(name: string, texture: BaseTexture): CustomShaderMaterial;
945
+ get skinArray(): boolean;
946
+ get skinArrayNormal(): boolean;
947
+ get skinArrayMetalRough(): boolean;
948
+ get skinArrayEmissive(): boolean;
949
+ get skinArrayActive(): boolean;
950
+ get skinLayerUniform(): boolean;
951
+ clone(name: string, cloneTexturesOnlyOnce?: boolean, rootUrl?: string): CustomShaderMaterial;
952
+ protected copyCustomStateTo(result: CustomShaderMaterial): void;
931
953
  addTextureUniform(name: string, texture: Texture): CustomShaderMaterial;
932
954
  setTextureValue(name: string, texture: Texture): CustomShaderMaterial;
933
955
  markTextureAsRaw(name: string): void;
@@ -979,6 +1001,31 @@ export declare class UnityStyleLightingPlugin extends CustomShaderMaterialPlugin
979
1001
  prepareDefines(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void;
980
1002
  bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: AbstractEngine, subMesh: SubMesh): void;
981
1003
  }
1004
+ export declare class SkinArraySwitchingPlugin extends CustomShaderMaterialPlugin {
1005
+ constructor(material: CustomShaderMaterial);
1006
+ isCompatible(shaderLanguage: ShaderLanguage): boolean;
1007
+ getClassName(): string;
1008
+ getAttributes(attributes: string[], scene: Scene, mesh: AbstractMesh): void;
1009
+ getSamplers(samplers: string[]): void;
1010
+ prepareDefines(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void;
1011
+ getCustomCode(shaderType: string, shaderLanguage: ShaderLanguage): any;
1012
+ private getGLSLVertexDefinitions;
1013
+ private getGLSLVertexMainEnd;
1014
+ private getGLSLFragmentDefinitions;
1015
+ private getGLSLAlbedoCode;
1016
+ private getGLSLNormalCode;
1017
+ private getGLSLMetalRoughSampleCode;
1018
+ private getGLSLMetalRoughApplyCode;
1019
+ private getGLSLEmissiveCode;
1020
+ private getWGSLVertexDefinitions;
1021
+ private getWGSLVertexMainEnd;
1022
+ private getWGSLFragmentDefinitions;
1023
+ private getWGSLAlbedoCode;
1024
+ private getWGSLNormalCode;
1025
+ private getWGSLMetalRoughSampleCode;
1026
+ private getWGSLMetalRoughApplyCode;
1027
+ private getWGSLEmissiveCode;
1028
+ }
982
1029
  export type CustomUniformProperty = {
983
1030
  name: string;
984
1031
  size: number;
@@ -1461,26 +1508,29 @@ export declare class TreeBranchMaterialPlugin extends CustomShaderMaterialPlugin
1461
1508
  }
1462
1509
  export declare class VertexAnimationMaterial extends CustomShaderMaterial {
1463
1510
  controller: VertexAnimationController;
1464
- runtimeAlbedoSkins: BaseTexture;
1465
- runtimeNormalSkins: BaseTexture;
1511
+ private _vatSkinArray;
1512
+ private _vatSkinArrayNormal;
1513
+ private _vatSkinArrayMetalRough;
1514
+ private _vatSkinArrayEmissive;
1466
1515
  constructor(name: string, scene: Scene);
1467
1516
  awake(): void;
1468
1517
  update(): void;
1469
1518
  getShaderName(): string;
1470
1519
  getController(): VertexAnimationController;
1471
1520
  cloneForInstance(instanceName: string): VertexAnimationMaterial;
1472
- setRuntimeSkinArrays(albedoArray: BaseTexture, normalArray: BaseTexture, nullOutDefaults?: boolean): void;
1473
- clearRuntimeSkinArrays(): void;
1474
- installSkinsFromUrlsAsync(layers: {
1475
- albedo: string;
1476
- normal: string;
1477
- }[], width: number, height: number, options?: {
1478
- nullOutDefaults?: boolean;
1479
- rootUrl?: string;
1480
- generateMipMaps?: boolean;
1481
- samplingMode?: number;
1482
- }): Promise<void>;
1483
- private _notifyPluginOfRuntimeSkinChange;
1521
+ enableVatSkinArray(): VertexAnimationMaterial;
1522
+ disableVatSkinArray(): void;
1523
+ enableVatSkinArrayNormal(): VertexAnimationMaterial;
1524
+ disableVatSkinArrayNormal(): void;
1525
+ enableVatSkinArrayMetalRough(): VertexAnimationMaterial;
1526
+ disableVatSkinArrayMetalRough(): void;
1527
+ enableVatSkinArrayEmissive(): VertexAnimationMaterial;
1528
+ disableVatSkinArrayEmissive(): void;
1529
+ get vatSkinArray(): boolean;
1530
+ get vatSkinArrayNormal(): boolean;
1531
+ get vatSkinArrayMetalRough(): boolean;
1532
+ get vatSkinArrayEmissive(): boolean;
1533
+ get vatSkinArrayActive(): boolean;
1484
1534
  }
1485
1535
  export interface IVertexAnimationRendererReference {
1486
1536
  name?: string;
@@ -1539,8 +1589,8 @@ export declare class VertexAnimationController {
1539
1589
  static Find(guid: string): VertexAnimationController;
1540
1590
  static GetOrCreate(guid: string, scene: Scene, rootUrl?: string, lazyLoadTextures?: boolean): VertexAnimationController;
1541
1591
  static CollectRendererTargets(settings: IVertexAnimationSettings[]): IVertexAnimationRendererReference[];
1542
- static SetSkinIndex(mesh: AbstractMesh, skinIndex: number): void;
1543
- static GetSkinIndex(mesh: AbstractMesh): number;
1592
+ static SetAtlasCellIndex(mesh: AbstractMesh, cellIndex: number): void;
1593
+ static GetAtlasCellIndex(mesh: AbstractMesh): number;
1544
1594
  static DisposeAll(scene?: Scene): void;
1545
1595
  readonly guid: string;
1546
1596
  readonly scene: Scene;
@@ -1585,17 +1635,6 @@ export declare class VertexAnimationController {
1585
1635
  getClip(name: string): IVertexAnimationClip | null;
1586
1636
  setSpeed(speed: number): void;
1587
1637
  setLoop(loop: boolean): void;
1588
- setRuntimeSkinArrays(albedoArray: BaseTexture, normalArray: BaseTexture, nullOutDefaults?: boolean): void;
1589
- clearRuntimeSkinArrays(): void;
1590
- installSkinsFromUrlsAsync(layers: {
1591
- albedo: string;
1592
- normal: string;
1593
- }[], width: number, height: number, options?: {
1594
- nullOutDefaults?: boolean;
1595
- rootUrl?: string;
1596
- generateMipMaps?: boolean;
1597
- samplingMode?: number;
1598
- }): Promise<void>;
1599
1638
  setCurrentTime(time: number): void;
1600
1639
  getCurrentTime(): number;
1601
1640
  addPlugin(plugin: VertexAnimationMaterialPlugin): void;
@@ -1628,8 +1667,6 @@ export declare class VertexAnimationMaterialPlugin extends CustomShaderMaterialP
1628
1667
  private _rendererTargets;
1629
1668
  private _targetRendererGuid;
1630
1669
  private _placeholderTexture;
1631
- private _placeholderAlbedoArray;
1632
- private _placeholderNormalArray;
1633
1670
  private _cc_posTex;
1634
1671
  private _cc_normTex;
1635
1672
  private _cc_prevPosTex;
@@ -1655,9 +1692,7 @@ export declare class VertexAnimationMaterialPlugin extends CustomShaderMaterialP
1655
1692
  getSamplers(samplers: string[]): void;
1656
1693
  getAttributes(attributes: string[], scene: Scene, mesh: AbstractMesh): void;
1657
1694
  prepareDefines(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void;
1658
- onRuntimeSkinArraysChanged(): void;
1659
1695
  bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: AbstractEngine, subMesh: SubMesh): void;
1660
- private _pushRuntimeSkinSamplers;
1661
1696
  setupAnimations(settings: IVertexAnimationSettings[], controllerId: string, rootUrl?: string, lazyLoadTextures?: boolean): VertexAnimationController;
1662
1697
  private _captureRendererTarget;
1663
1698
  private _resolveRendererTarget;
@@ -1676,14 +1711,20 @@ export declare class VertexAnimationMaterialPlugin extends CustomShaderMaterialP
1676
1711
  private getWGSLVertexDefinitions;
1677
1712
  private getWGSLVertexPositionCode;
1678
1713
  private getWGSLVertexNormalCode;
1679
- private getGLSLVertexMainEnd;
1680
- private getWGSLVertexMainEnd;
1681
- private getGLSLFragmentDefinitions;
1682
- private getGLSLFragmentAlbedoCode;
1683
- private getGLSLFragmentNormalCode;
1684
- private getWGSLFragmentDefinitions;
1685
- private getWGSLFragmentAlbedoCode;
1686
- private getWGSLFragmentNormalCode;
1714
+ private getGLSLSkinLayerVaryingCode;
1715
+ private getGLSLSkinFragmentDefs;
1716
+ private getGLSLSkinAlbedoCode;
1717
+ private getGLSLSkinNormalCode;
1718
+ private getGLSLSkinMetalRoughSampleCode;
1719
+ private getGLSLSkinMetalRoughApplyCode;
1720
+ private getGLSLSkinEmissiveCode;
1721
+ private getWGSLSkinLayerVaryingCode;
1722
+ private getWGSLSkinFragmentDefs;
1723
+ private getWGSLSkinAlbedoCode;
1724
+ private getWGSLSkinNormalCode;
1725
+ private getWGSLSkinMetalRoughSampleCode;
1726
+ private getWGSLSkinMetalRoughApplyCode;
1727
+ private getWGSLSkinEmissiveCode;
1687
1728
  }
1688
1729
  export interface KeymapState {
1689
1730
  result: boolean | number;
@@ -3913,6 +3954,20 @@ export interface IParticleSystemProperties {
3913
3954
  trails?: any;
3914
3955
  customData?: any;
3915
3956
  }
3957
+ export declare class SkinTextureArray {
3958
+ private static _cache;
3959
+ static Build(scene: Scene, urls: string[], options?: {
3960
+ samplingMode?: number;
3961
+ aniso?: number;
3962
+ invertY?: boolean;
3963
+ mipmaps?: boolean;
3964
+ }): Promise<RawTexture2DArray>;
3965
+ private static _uploadMipChain;
3966
+ private static _downsampleLayers;
3967
+ private static _maxArrayLayers;
3968
+ private static _loadImages;
3969
+ static Clear(): void;
3970
+ }
3916
3971
  export declare class MeshNormalProxy {
3917
3972
  blendWithPhysicsNormal: number;
3918
3973
  maxLookupDistance: number;
@@ -4096,6 +4151,52 @@ export declare class TerrainBuilder extends ScriptComponent {
4096
4151
  private static GammaToLinear;
4097
4152
  private static LinearToGamma;
4098
4153
  }
4154
+ export declare class TextureAtlasSkin extends ScriptComponent {
4155
+ private abtractMesh;
4156
+ private textureData;
4157
+ private defaultIndex;
4158
+ private skinnedParts;
4159
+ private albedoSlices;
4160
+ private normalSlices;
4161
+ private metallicSlices;
4162
+ private occlusionSlices;
4163
+ private emissiveSlices;
4164
+ private _applied;
4165
+ private _manifest;
4166
+ private _currentIndex;
4167
+ private _targets;
4168
+ private _clonedMultiMaterial;
4169
+ constructor(transform: TransformNode, scene: Scene, properties?: any, alias?: string);
4170
+ protected awake(): void;
4171
+ protected start(): void;
4172
+ applySkins(): void;
4173
+ setSkinIndex(index: number): number;
4174
+ private clampIndex;
4175
+ skinCount(): number;
4176
+ private maxChannelSliceCount;
4177
+ getSkinIndex(): number;
4178
+ private configureMaterial;
4179
+ private albedoChannelUrls;
4180
+ private normalChannelUrls;
4181
+ private metalRoughChannelUrls;
4182
+ private emissiveChannelUrls;
4183
+ private sliceUrls;
4184
+ private resolveLayerUrl;
4185
+ private applyIndexToTargets;
4186
+ private applyLayerToMaterial;
4187
+ private isInstancedSetup;
4188
+ private ensureSkinLayerBuffer;
4189
+ private getMeshSlots;
4190
+ private matchSlot;
4191
+ private resolvePartMaterial;
4192
+ private partName;
4193
+ private cloneForRegular;
4194
+ private parseManifest;
4195
+ private toInt;
4196
+ private isConfigured;
4197
+ private markConfigured;
4198
+ private describeKind;
4199
+ }
4099
4200
  export declare class UserInterface extends ScriptComponent {
4100
4201
  private static readonly PHYSICAL_SIZE_SLICE_FACTOR;
4101
4202
  private static readonly PHYSICAL_SIZE_POINT_FACTOR;