babylonjs-loaders 8.30.1 → 8.30.3

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.
@@ -6534,6 +6534,20 @@ export class STLFileLoader implements ISceneLoaderPlugin {
6534
6534
  declare module "babylonjs-loaders/STL/index" {
6535
6535
  export * from "babylonjs-loaders/STL/stlFileLoader";
6536
6536
 
6537
+ }
6538
+ declare module "babylonjs-loaders/SPLAT/spz" {
6539
+ import { Scene } from "babylonjs/scene";
6540
+ import { SPLATLoadingOptions } from "babylonjs-loaders/SPLAT/splatLoadingOptions";
6541
+ import { IParsedPLY } from "babylonjs-loaders/SPLAT/splatDefs";
6542
+ /**
6543
+ * Parses SPZ data and returns a promise resolving to an IParsedPLY object.
6544
+ * @param data The ArrayBuffer containing SPZ data.
6545
+ * @param scene The Babylon.js scene.
6546
+ * @param loadingOptions Options for loading Gaussian Splatting files.
6547
+ * @returns A promise resolving to the parsed SPZ data.
6548
+ */
6549
+ export function ParseSpz(data: ArrayBuffer, scene: Scene, loadingOptions: SPLATLoadingOptions): Promise<IParsedPLY>;
6550
+
6537
6551
  }
6538
6552
  declare module "babylonjs-loaders/SPLAT/splatLoadingOptions" {
6539
6553
  /**
@@ -6564,6 +6578,12 @@ export const SPLATFileLoaderMetadata: {
6564
6578
  readonly ".spz": {
6565
6579
  readonly isBinary: true;
6566
6580
  };
6581
+ readonly ".json": {
6582
+ readonly isBinary: false;
6583
+ };
6584
+ readonly ".sog": {
6585
+ readonly isBinary: true;
6586
+ };
6567
6587
  };
6568
6588
  };
6569
6589
 
@@ -6608,6 +6628,12 @@ export class SPLATFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlu
6608
6628
  readonly ".spz": {
6609
6629
  readonly isBinary: true;
6610
6630
  };
6631
+ readonly ".json": {
6632
+ readonly isBinary: false;
6633
+ };
6634
+ readonly ".sog": {
6635
+ readonly isBinary: true;
6636
+ };
6611
6637
  };
6612
6638
  /**
6613
6639
  * Creates loader for gaussian splatting files
@@ -6630,7 +6656,7 @@ export class SPLATFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlu
6630
6656
  importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, _onProgress?: (event: ISceneLoaderProgressEvent) => void, _fileName?: string): Promise<ISceneLoaderAsyncResult>;
6631
6657
  private static _BuildPointCloud;
6632
6658
  private static _BuildMesh;
6633
- private _parseSPZAsync;
6659
+ private _unzipWithFFlateAsync;
6634
6660
  private _parseAsync;
6635
6661
  /**
6636
6662
  * Load into an asset container.
@@ -6658,6 +6684,118 @@ export class SPLATFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlu
6658
6684
  private static _ConvertPLYToSplat;
6659
6685
  }
6660
6686
 
6687
+ }
6688
+ declare module "babylonjs-loaders/SPLAT/splatDefs" {
6689
+ /**
6690
+ * Indicator of the parsed ply buffer. A standard ready to use splat or an array of positions for a point cloud
6691
+ */
6692
+ export enum Mode {
6693
+ Splat = 0,
6694
+ PointCloud = 1,
6695
+ Mesh = 2,
6696
+ Reject = 3
6697
+ }
6698
+ /**
6699
+ * A parsed buffer and how to use it
6700
+ */
6701
+ export interface IParsedPLY {
6702
+ data: ArrayBuffer;
6703
+ mode: Mode;
6704
+ faces?: number[];
6705
+ hasVertexColors?: boolean;
6706
+ sh?: Uint8Array[];
6707
+ trainedWithAntialiasing?: boolean;
6708
+ compressed?: boolean;
6709
+ rawSplat?: boolean;
6710
+ }
6711
+
6712
+ }
6713
+ declare module "babylonjs-loaders/SPLAT/sog" {
6714
+ import { Scene } from "babylonjs/scene";
6715
+ import { IParsedPLY } from "babylonjs-loaders/SPLAT/splatDefs";
6716
+ /**
6717
+ * Definition of a SOG data file
6718
+ */
6719
+ export interface SOGDataFile {
6720
+ /**
6721
+ * index 0 is number of splats index 1 is number of components per splat (3 for vec3, 4 for vec4, etc.)
6722
+ */
6723
+ shape: number[];
6724
+ /**
6725
+ * type of components
6726
+ */
6727
+ dtype: string;
6728
+ /**
6729
+ * min range of data
6730
+ */
6731
+ mins?: number | number[];
6732
+ /**
6733
+ * max range of data
6734
+ */
6735
+ maxs?: number | number[];
6736
+ /**
6737
+ * palette for indexed data (quantized)
6738
+ */
6739
+ codebook?: number[];
6740
+ /**
6741
+ * type of encoding
6742
+ */
6743
+ encoding?: string;
6744
+ /**
6745
+ * number of bits for quantization (if any)
6746
+ */
6747
+ quantization?: number;
6748
+ /**
6749
+ * webp file names
6750
+ */
6751
+ files: string[];
6752
+ /**
6753
+ * SH band count (if applicable)
6754
+ */
6755
+ bands?: number;
6756
+ }
6757
+ /**
6758
+ * Definition of the root SOG data file
6759
+ */
6760
+ export interface SOGRootData {
6761
+ /**
6762
+ * version of the SOG format
6763
+ */
6764
+ version?: number;
6765
+ /**
6766
+ * mean positions of the splats
6767
+ */
6768
+ means: SOGDataFile;
6769
+ /**
6770
+ * scales of the splats
6771
+ */
6772
+ scales: SOGDataFile;
6773
+ /**
6774
+ * quaternions of the splats
6775
+ */
6776
+ quats: SOGDataFile;
6777
+ /**
6778
+ * SH0 coefficients of the splats (base color)
6779
+ */
6780
+ sh0: SOGDataFile;
6781
+ /**
6782
+ * Optional higher order SH coefficients of the splats (lighting information)
6783
+ */
6784
+ shN?: SOGDataFile;
6785
+ /**
6786
+ * number of splats (optional, can be inferred from means.shape[0])
6787
+ */
6788
+ count?: number;
6789
+ }
6790
+ /**
6791
+ * Parse SOG data from either a SOGRootData object (with webp files loaded from rootUrl) or from a Map of filenames to Uint8Array file data (including meta.json)
6792
+ * @param dataOrFiles Either the SOGRootData or a Map of filenames to Uint8Array file data (including meta.json)
6793
+ * @param rootUrl Base URL to load webp files from (if dataOrFiles is SOGRootData)
6794
+ * @param scene The Babylon.js scene
6795
+ * @returns Parsed data
6796
+ */
6797
+ export function ParseSogMeta(dataOrFiles: SOGRootData | Map<string, Uint8Array>, rootUrl: string, scene: Scene): Promise<IParsedPLY>;
6798
+
6661
6799
  }
6662
6800
  declare module "babylonjs-loaders/SPLAT/index" {
6663
6801
  export * from "babylonjs-loaders/SPLAT/splatLoadingOptions";
@@ -13618,6 +13756,16 @@ declare module BABYLON {
13618
13756
 
13619
13757
 
13620
13758
 
13759
+ /**
13760
+ * Parses SPZ data and returns a promise resolving to an IParsedPLY object.
13761
+ * @param data The ArrayBuffer containing SPZ data.
13762
+ * @param scene The Babylon.js scene.
13763
+ * @param loadingOptions Options for loading Gaussian Splatting files.
13764
+ * @returns A promise resolving to the parsed SPZ data.
13765
+ */
13766
+ export function ParseSpz(data: ArrayBuffer, scene: Scene, loadingOptions: SPLATLoadingOptions): Promise<IParsedPLY>;
13767
+
13768
+
13621
13769
  /**
13622
13770
  * Options for loading Gaussian Splatting and PLY files
13623
13771
  */
@@ -13645,6 +13793,12 @@ declare module BABYLON {
13645
13793
  readonly ".spz": {
13646
13794
  readonly isBinary: true;
13647
13795
  };
13796
+ readonly ".json": {
13797
+ readonly isBinary: false;
13798
+ };
13799
+ readonly ".sog": {
13800
+ readonly isBinary: true;
13801
+ };
13648
13802
  };
13649
13803
  };
13650
13804
 
@@ -13681,6 +13835,12 @@ declare module BABYLON {
13681
13835
  readonly ".spz": {
13682
13836
  readonly isBinary: true;
13683
13837
  };
13838
+ readonly ".json": {
13839
+ readonly isBinary: false;
13840
+ };
13841
+ readonly ".sog": {
13842
+ readonly isBinary: true;
13843
+ };
13684
13844
  };
13685
13845
  /**
13686
13846
  * Creates loader for gaussian splatting files
@@ -13703,7 +13863,7 @@ declare module BABYLON {
13703
13863
  importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, _onProgress?: (event: ISceneLoaderProgressEvent) => void, _fileName?: string): Promise<ISceneLoaderAsyncResult>;
13704
13864
  private static _BuildPointCloud;
13705
13865
  private static _BuildMesh;
13706
- private _parseSPZAsync;
13866
+ private _unzipWithFFlateAsync;
13707
13867
  private _parseAsync;
13708
13868
  /**
13709
13869
  * Load into an asset container.
@@ -13732,6 +13892,114 @@ declare module BABYLON {
13732
13892
  }
13733
13893
 
13734
13894
 
13895
+ /**
13896
+ * Indicator of the parsed ply buffer. A standard ready to use splat or an array of positions for a point cloud
13897
+ */
13898
+ export enum Mode {
13899
+ Splat = 0,
13900
+ PointCloud = 1,
13901
+ Mesh = 2,
13902
+ Reject = 3
13903
+ }
13904
+ /**
13905
+ * A parsed buffer and how to use it
13906
+ */
13907
+ export interface IParsedPLY {
13908
+ data: ArrayBuffer;
13909
+ mode: Mode;
13910
+ faces?: number[];
13911
+ hasVertexColors?: boolean;
13912
+ sh?: Uint8Array[];
13913
+ trainedWithAntialiasing?: boolean;
13914
+ compressed?: boolean;
13915
+ rawSplat?: boolean;
13916
+ }
13917
+
13918
+
13919
+ /**
13920
+ * Definition of a SOG data file
13921
+ */
13922
+ export interface SOGDataFile {
13923
+ /**
13924
+ * index 0 is number of splats index 1 is number of components per splat (3 for vec3, 4 for vec4, etc.)
13925
+ */
13926
+ shape: number[];
13927
+ /**
13928
+ * type of components
13929
+ */
13930
+ dtype: string;
13931
+ /**
13932
+ * min range of data
13933
+ */
13934
+ mins?: number | number[];
13935
+ /**
13936
+ * max range of data
13937
+ */
13938
+ maxs?: number | number[];
13939
+ /**
13940
+ * palette for indexed data (quantized)
13941
+ */
13942
+ codebook?: number[];
13943
+ /**
13944
+ * type of encoding
13945
+ */
13946
+ encoding?: string;
13947
+ /**
13948
+ * number of bits for quantization (if any)
13949
+ */
13950
+ quantization?: number;
13951
+ /**
13952
+ * webp file names
13953
+ */
13954
+ files: string[];
13955
+ /**
13956
+ * SH band count (if applicable)
13957
+ */
13958
+ bands?: number;
13959
+ }
13960
+ /**
13961
+ * Definition of the root SOG data file
13962
+ */
13963
+ export interface SOGRootData {
13964
+ /**
13965
+ * version of the SOG format
13966
+ */
13967
+ version?: number;
13968
+ /**
13969
+ * mean positions of the splats
13970
+ */
13971
+ means: SOGDataFile;
13972
+ /**
13973
+ * scales of the splats
13974
+ */
13975
+ scales: SOGDataFile;
13976
+ /**
13977
+ * quaternions of the splats
13978
+ */
13979
+ quats: SOGDataFile;
13980
+ /**
13981
+ * SH0 coefficients of the splats (base color)
13982
+ */
13983
+ sh0: SOGDataFile;
13984
+ /**
13985
+ * Optional higher order SH coefficients of the splats (lighting information)
13986
+ */
13987
+ shN?: SOGDataFile;
13988
+ /**
13989
+ * number of splats (optional, can be inferred from means.shape[0])
13990
+ */
13991
+ count?: number;
13992
+ }
13993
+ /**
13994
+ * Parse SOG data from either a SOGRootData object (with webp files loaded from rootUrl) or from a Map of filenames to Uint8Array file data (including meta.json)
13995
+ * @param dataOrFiles Either the SOGRootData or a Map of filenames to Uint8Array file data (including meta.json)
13996
+ * @param rootUrl Base URL to load webp files from (if dataOrFiles is SOGRootData)
13997
+ * @param scene The Babylon.js scene
13998
+ * @returns Parsed data
13999
+ */
14000
+ export function ParseSogMeta(dataOrFiles: SOGRootData | Map<string, Uint8Array>, rootUrl: string, scene: Scene): Promise<IParsedPLY>;
14001
+
14002
+
13735
14003
 
13736
14004
 
13737
14005
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-loaders",
3
- "version": "8.30.1",
3
+ "version": "8.30.3",
4
4
  "main": "babylonjs.loaders.min.js",
5
5
  "types": "babylonjs.loaders.module.d.ts",
6
6
  "files": [
@@ -15,8 +15,8 @@
15
15
  "test:escheck": "es-check es6 ./babylonjs.loaders.js"
16
16
  },
17
17
  "dependencies": {
18
- "babylonjs": "^8.30.1",
19
- "babylonjs-gltf2interface": "^8.30.1"
18
+ "babylonjs": "^8.30.3",
19
+ "babylonjs-gltf2interface": "^8.30.3"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@dev/build-tools": "1.0.0",