babylonjs-serializers 5.32.1 → 5.32.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.
@@ -305,13 +305,12 @@ export class KHR_materials_volume implements IGLTFExporterExtensionV2 {
305
305
  declare module "babylonjs-serializers/glTF/2.0/Extensions/KHR_texture_transform" {
306
306
  import { ITextureInfo } from "babylonjs-gltf2interface";
307
307
  import { Texture } from "babylonjs/Materials/Textures/texture";
308
+ import { Nullable } from "babylonjs/types";
308
309
  import { IGLTFExporterExtensionV2 } from "babylonjs-serializers/glTF/2.0/glTFExporterExtension";
309
- import "babylonjs-serializers/glTF/2.0/shaders/textureTransform.fragment";
310
310
  /**
311
311
  * @internal
312
312
  */
313
313
  export class KHR_texture_transform implements IGLTFExporterExtensionV2 {
314
- private _recordedTextures;
315
314
  /** Name of this extension */
316
315
  readonly name: string;
317
316
  /** Defines whether this extension is enabled */
@@ -325,13 +324,7 @@ export class KHR_texture_transform implements IGLTFExporterExtensionV2 {
325
324
  /** @internal */
326
325
  get wasUsed(): boolean;
327
326
  postExportTexture?(context: string, textureInfo: ITextureInfo, babylonTexture: Texture): void;
328
- preExportTextureAsync(context: string, babylonTexture: Texture): Promise<Texture>;
329
- /**
330
- * Transform the babylon texture by the offset, rotation and scale parameters using a procedural texture
331
- * @param babylonTexture
332
- * @param scene
333
- */
334
- private _textureTransformTextureAsync;
327
+ preExportTextureAsync(context: string, babylonTexture: Texture): Promise<Nullable<Texture>>;
335
328
  }
336
329
 
337
330
  }
@@ -665,12 +658,12 @@ export class _Exporter {
665
658
  */
666
659
  _imageData: {
667
660
  [fileName: string]: {
668
- data: Uint8Array;
661
+ data: ArrayBuffer;
669
662
  mimeType: ImageMimeType;
670
663
  };
671
664
  };
672
665
  protected _orderedImageData: Array<{
673
- data: Uint8Array;
666
+ data: ArrayBuffer;
674
667
  mimeType: ImageMimeType;
675
668
  }>;
676
669
  /**
@@ -1066,7 +1059,7 @@ export interface IGLTFExporterExtensionV2 extends IGLTFExporterExtension, IDispo
1066
1059
  * @param mimeType The mime-type of the generated image
1067
1060
  * @returns A promise that resolves with the exported texture
1068
1061
  */
1069
- preExportTextureAsync?(context: string, babylonTexture: Nullable<Texture>, mimeType: ImageMimeType): Promise<Texture>;
1062
+ preExportTextureAsync?(context: string, babylonTexture: Nullable<Texture>, mimeType: ImageMimeType): Promise<Nullable<Texture>>;
1070
1063
  /**
1071
1064
  * Define this method to get notified when a texture info is created
1072
1065
  * @param context The context when loading the asset
@@ -1144,6 +1137,7 @@ export class _GLTFMaterialExporter {
1144
1137
  * Mapping to store textures
1145
1138
  */
1146
1139
  private _textureMap;
1140
+ private _internalTextureToImage;
1147
1141
  /**
1148
1142
  * Numeric tolerance value
1149
1143
  */
@@ -1216,7 +1210,7 @@ export class _GLTFMaterialExporter {
1216
1210
  * @param mimeType mimetype of the image
1217
1211
  * @returns base64 image string
1218
1212
  */
1219
- private _createBase64FromCanvasAsync;
1213
+ private _getImageDataAsync;
1220
1214
  /**
1221
1215
  * Generates a white texture based on the specified width and height
1222
1216
  * @param width width of the texture in pixels
@@ -1278,9 +1272,8 @@ export class _GLTFMaterialExporter {
1278
1272
  * @returns glTF PBR Metallic Roughness factors
1279
1273
  */
1280
1274
  private _convertMetalRoughFactorsToMetallicRoughnessAsync;
1281
- private _getGLTFTextureSampler;
1275
+ private _getTextureSampler;
1282
1276
  private _getGLTFTextureWrapMode;
1283
- private _getGLTFTextureWrapModesSampler;
1284
1277
  /**
1285
1278
  * Convert a PBRMaterial (Specular/Glossiness) to Metallic Roughness factors
1286
1279
  * @param babylonPBRMaterial BJS PBR Metallic Roughness Material
@@ -1307,16 +1300,9 @@ export class _GLTFMaterialExporter {
1307
1300
  */
1308
1301
  _exportTextureAsync(babylonTexture: BaseTexture, mimeType: ImageMimeType): Promise<Nullable<ITextureInfo>>;
1309
1302
  _exportTextureInfoAsync(babylonTexture: BaseTexture, mimeType: ImageMimeType): Promise<Nullable<ITextureInfo>>;
1310
- /**
1311
- * Builds a texture from base64 string
1312
- * @param base64Texture base64 texture string
1313
- * @param baseTextureName Name to use for the texture
1314
- * @param mimeType image mime type for the texture
1315
- * @param texCoordIndex
1316
- * @param samplerIndex
1317
- * @returns glTF texture info, or null if the texture format is not supported
1318
- */
1319
- private _getTextureInfoFromBase64;
1303
+ private _exportImage;
1304
+ private _exportTextureInfo;
1305
+ private _exportTextureSampler;
1320
1306
  }
1321
1307
  export {};
1322
1308
 
@@ -1496,14 +1482,6 @@ export * from "babylonjs-serializers/glTF/2.0/glTFSerializer";
1496
1482
  export * from "babylonjs-serializers/glTF/2.0/glTFUtilities";
1497
1483
  export * from "babylonjs-serializers/glTF/2.0/Extensions/index";
1498
1484
 
1499
- }
1500
- declare module "babylonjs-serializers/glTF/2.0/shaders/textureTransform.fragment" {
1501
- /** @internal */
1502
- export const textureTransformPixelShader: {
1503
- name: string;
1504
- shader: string;
1505
- };
1506
-
1507
1485
  }
1508
1486
  declare module "babylonjs-serializers/glTF/glTFFileExporter" {
1509
1487
  /** @internal */
@@ -1855,7 +1833,6 @@ declare module BABYLON {
1855
1833
  * @internal
1856
1834
  */
1857
1835
  export class KHR_texture_transform implements IGLTFExporterExtensionV2 {
1858
- private _recordedTextures;
1859
1836
  /** Name of this extension */
1860
1837
  readonly name = "KHR_texture_transform";
1861
1838
  /** Defines whether this extension is enabled */
@@ -1869,13 +1846,7 @@ declare module BABYLON {
1869
1846
  /** @internal */
1870
1847
  get wasUsed(): boolean;
1871
1848
  postExportTexture?(context: string, textureInfo: BABYLON.GLTF2.ITextureInfo, babylonTexture: Texture): void;
1872
- preExportTextureAsync(context: string, babylonTexture: Texture): Promise<Texture>;
1873
- /**
1874
- * Transform the babylon texture by the offset, rotation and scale parameters using a procedural texture
1875
- * @param babylonTexture
1876
- * @param scene
1877
- */
1878
- private _textureTransformTextureAsync;
1849
+ preExportTextureAsync(context: string, babylonTexture: Texture): Promise<Nullable<Texture>>;
1879
1850
  }
1880
1851
 
1881
1852
 
@@ -2183,12 +2154,12 @@ declare module BABYLON {
2183
2154
  */
2184
2155
  _imageData: {
2185
2156
  [fileName: string]: {
2186
- data: Uint8Array;
2157
+ data: ArrayBuffer;
2187
2158
  mimeType: BABYLON.GLTF2.ImageMimeType;
2188
2159
  };
2189
2160
  };
2190
2161
  protected _orderedImageData: Array<{
2191
- data: Uint8Array;
2162
+ data: ArrayBuffer;
2192
2163
  mimeType: BABYLON.GLTF2.ImageMimeType;
2193
2164
  }>;
2194
2165
  /**
@@ -2573,7 +2544,7 @@ declare module BABYLON {
2573
2544
  * @param mimeType The mime-type of the generated image
2574
2545
  * @returns A promise that resolves with the exported texture
2575
2546
  */
2576
- preExportTextureAsync?(context: string, babylonTexture: Nullable<Texture>, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Texture>;
2547
+ preExportTextureAsync?(context: string, babylonTexture: Nullable<Texture>, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Nullable<Texture>>;
2577
2548
  /**
2578
2549
  * Define this method to get notified when a texture info is created
2579
2550
  * @param context The context when loading the asset
@@ -2642,6 +2613,7 @@ declare module BABYLON {
2642
2613
  * Mapping to store textures
2643
2614
  */
2644
2615
  private _textureMap;
2616
+ private _internalTextureToImage;
2645
2617
  /**
2646
2618
  * Numeric tolerance value
2647
2619
  */
@@ -2714,7 +2686,7 @@ declare module BABYLON {
2714
2686
  * @param mimeType mimetype of the image
2715
2687
  * @returns base64 image string
2716
2688
  */
2717
- private _createBase64FromCanvasAsync;
2689
+ private _getImageDataAsync;
2718
2690
  /**
2719
2691
  * Generates a white texture based on the specified width and height
2720
2692
  * @param width width of the texture in pixels
@@ -2776,9 +2748,8 @@ declare module BABYLON {
2776
2748
  * @returns glTF PBR Metallic Roughness factors
2777
2749
  */
2778
2750
  private _convertMetalRoughFactorsToMetallicRoughnessAsync;
2779
- private _getGLTFTextureSampler;
2751
+ private _getTextureSampler;
2780
2752
  private _getGLTFTextureWrapMode;
2781
- private _getGLTFTextureWrapModesSampler;
2782
2753
  /**
2783
2754
  * Convert a PBRMaterial (Specular/Glossiness) to Metallic Roughness factors
2784
2755
  * @param babylonPBRMaterial BJS PBR Metallic Roughness Material
@@ -2805,16 +2776,9 @@ declare module BABYLON {
2805
2776
  */
2806
2777
  _exportTextureAsync(babylonTexture: BaseTexture, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Nullable<BABYLON.GLTF2.ITextureInfo>>;
2807
2778
  _exportTextureInfoAsync(babylonTexture: BaseTexture, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Nullable<BABYLON.GLTF2.ITextureInfo>>;
2808
- /**
2809
- * Builds a texture from base64 string
2810
- * @param base64Texture base64 texture string
2811
- * @param baseTextureName Name to use for the texture
2812
- * @param mimeType image mime type for the texture
2813
- * @param texCoordIndex
2814
- * @param samplerIndex
2815
- * @returns glTF texture info, or null if the texture format is not supported
2816
- */
2817
- private _getTextureInfoFromBase64;
2779
+ private _exportImage;
2780
+ private _exportTextureInfo;
2781
+ private _exportTextureSampler;
2818
2782
  }
2819
2783
 
2820
2784
 
@@ -2975,13 +2939,6 @@ declare module BABYLON {
2975
2939
 
2976
2940
 
2977
2941
 
2978
- /** @internal */
2979
- export var textureTransformPixelShader: {
2980
- name: string;
2981
- shader: string;
2982
- };
2983
-
2984
-
2985
2942
  /** @internal */
2986
2943
  export var __IGLTFExporterExtension: number;
2987
2944
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-serializers",
3
- "version": "5.32.1",
3
+ "version": "5.32.2",
4
4
  "main": "babylonjs.serializers.js",
5
5
  "types": "babylonjs.serializers.module.d.ts",
6
6
  "files": [
@@ -14,8 +14,8 @@
14
14
  "clean": "rimraf dist && rimraf babylon*.*"
15
15
  },
16
16
  "dependencies": {
17
- "babylonjs": "^5.32.1",
18
- "babylonjs-gltf2interface": "^5.32.1"
17
+ "babylonjs": "^5.32.2",
18
+ "babylonjs-gltf2interface": "^5.32.2"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@dev/build-tools": "1.0.0",