@babylonjs-toolkit/next 9.12.1 → 9.12.1011

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