@babylonjs/core 8.48.0 → 8.48.1

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.
Files changed (80) hide show
  1. package/Audio/analyser.js.map +1 -1
  2. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -1
  3. package/Buffers/buffer.align.js +3 -3
  4. package/Buffers/buffer.align.js.map +1 -1
  5. package/Buffers/bufferUtils.d.ts +7 -0
  6. package/Buffers/bufferUtils.js +31 -13
  7. package/Buffers/bufferUtils.js.map +1 -1
  8. package/Engines/Extensions/engine.dynamicBuffer.js +3 -3
  9. package/Engines/Extensions/engine.dynamicBuffer.js.map +1 -1
  10. package/Engines/Native/nativeDataStream.d.ts +1 -1
  11. package/Engines/Native/nativeDataStream.js.map +1 -1
  12. package/Engines/Native/nativeInterfaces.d.ts +4 -4
  13. package/Engines/Native/nativeInterfaces.js.map +1 -1
  14. package/Engines/WebGPU/Extensions/engine.rawTexture.d.ts +13 -1
  15. package/Engines/WebGPU/Extensions/engine.rawTexture.js +26 -8
  16. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  17. package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -1
  18. package/Engines/WebGPU/webgpuTextureManager.js +19 -6
  19. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  20. package/Engines/abstractEngine.d.ts +4 -2
  21. package/Engines/abstractEngine.functions.d.ts +1 -1
  22. package/Engines/abstractEngine.functions.js +8 -8
  23. package/Engines/abstractEngine.functions.js.map +1 -1
  24. package/Engines/abstractEngine.js +6 -4
  25. package/Engines/abstractEngine.js.map +1 -1
  26. package/Engines/engine.d.ts +12 -0
  27. package/Engines/thinNativeEngine.js +1 -1
  28. package/Engines/thinNativeEngine.js.map +1 -1
  29. package/Engines/thinWebGPUEngine.js +3 -0
  30. package/Engines/thinWebGPUEngine.js.map +1 -1
  31. package/Engines/webgpuEngine.js +18 -18
  32. package/Engines/webgpuEngine.js.map +1 -1
  33. package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
  34. package/Materials/Background/backgroundMaterial.d.ts +16 -8
  35. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +14 -1
  36. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  37. package/Materials/Node/nodeMaterial.d.ts +16 -8
  38. package/Materials/PBR/openpbrMaterial.d.ts +16 -8
  39. package/Materials/PBR/pbrBaseMaterial.d.ts +16 -8
  40. package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.d.ts +1 -1
  41. package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.js.map +1 -1
  42. package/Materials/Textures/Loaders/EXR/exrLoader.core.d.ts +1 -1
  43. package/Materials/Textures/Loaders/EXR/exrLoader.core.js.map +1 -1
  44. package/Materials/Textures/internalTexture.d.ts +6 -0
  45. package/Materials/Textures/internalTexture.js +24 -2
  46. package/Materials/Textures/internalTexture.js.map +1 -1
  47. package/Materials/Textures/rawTexture.d.ts +8 -1
  48. package/Materials/Textures/rawTexture.js +12 -3
  49. package/Materials/Textures/rawTexture.js.map +1 -1
  50. package/Materials/Textures/rawTexture2DArray.d.ts +8 -1
  51. package/Materials/Textures/rawTexture2DArray.js +14 -3
  52. package/Materials/Textures/rawTexture2DArray.js.map +1 -1
  53. package/Materials/imageProcessing.d.ts +47 -8
  54. package/Materials/standardMaterial.d.ts +16 -8
  55. package/Meshes/Builders/shapeBuilder.d.ts +4 -0
  56. package/Meshes/Builders/shapeBuilder.js +12 -9
  57. package/Meshes/Builders/shapeBuilder.js.map +1 -1
  58. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +68 -4
  59. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +343 -26
  60. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  61. package/Misc/dds.js.map +1 -1
  62. package/Misc/environmentTextureTools.js +3 -1
  63. package/Misc/environmentTextureTools.js.map +1 -1
  64. package/Misc/fileTools.js +9 -1
  65. package/Misc/fileTools.js.map +1 -1
  66. package/Physics/v1/physicsImpostor.d.ts +2 -2
  67. package/Physics/v1/physicsImpostor.js.map +1 -1
  68. package/Shaders/ShadersInclude/gaussianSplatting.js +16 -3
  69. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  70. package/Shaders/gaussianSplatting.vertex.js +17 -4
  71. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  72. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +11 -1
  73. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  74. package/ShadersWGSL/gaussianSplatting.vertex.js +17 -4
  75. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  76. package/XR/native/nativeXRFrame.d.ts +1 -1
  77. package/XR/native/nativeXRFrame.js.map +1 -1
  78. package/package.json +1 -1
  79. package/types.d.ts +1 -1
  80. package/types.js.map +1 -1
@@ -4,7 +4,7 @@ import type { BaseTexture } from "../../Materials/Textures/baseTexture.js";
4
4
  import { SubMesh } from "../subMesh.js";
5
5
  import type { AbstractMesh } from "../abstractMesh.js";
6
6
  import { Mesh } from "../mesh.js";
7
- import { Vector3 } from "../../Maths/math.vector.js";
7
+ import { Matrix, Vector3 } from "../../Maths/math.vector.js";
8
8
  import "../thinInstanceMesh.js";
9
9
  import type { Material } from "../../Materials/material.js";
10
10
  import type { Camera } from "../../Cameras/camera.js";
@@ -186,6 +186,7 @@ export declare class GaussianSplattingMesh extends Mesh {
186
186
  private _vertexCount;
187
187
  private _worker;
188
188
  private _modelViewProjectionMatrix;
189
+ private _viewProjectionMatrix;
189
190
  private _depthMix;
190
191
  private _canPostToWorker;
191
192
  private _readyToDisplay;
@@ -197,6 +198,11 @@ export declare class GaussianSplattingMesh extends Mesh {
197
198
  private _splatIndex;
198
199
  private _shTextures;
199
200
  private _splatsData;
201
+ private _shData;
202
+ private _partIndicesTexture;
203
+ private _partIndices;
204
+ private _partMatrices;
205
+ private _textureSize;
200
206
  private readonly _keepInRam;
201
207
  private _delayedTextureUpdate;
202
208
  private _useRGBACovariants;
@@ -238,6 +244,22 @@ export declare class GaussianSplattingMesh extends Mesh {
238
244
  * returns the splats data array buffer that contains in order : postions (3 floats), size (3 floats), color (4 bytes), orientation quaternion (4 bytes)
239
245
  */
240
246
  get splatsData(): Nullable<ArrayBuffer>;
247
+ /**
248
+ * returns the SH data arrays
249
+ */
250
+ get shData(): Nullable<Uint8Array<ArrayBufferLike>[]>;
251
+ /**
252
+ * True when this mesh is a compound that regroups multiple Gaussian splatting parts.
253
+ */
254
+ get isCompound(): boolean;
255
+ /**
256
+ * returns the part indices array
257
+ */
258
+ get partIndices(): Nullable<Uint8Array<ArrayBufferLike>>;
259
+ /**
260
+ * Gets the part indices texture, if the mesh is a compound
261
+ */
262
+ get partIndicesTexture(): Nullable<BaseTexture>;
241
263
  /**
242
264
  * Set the number of batch (a batch is 16384 splats) after which a display update is performed
243
265
  * A value of 0 (default) means display update will not happens before splat is ready.
@@ -411,17 +433,19 @@ export declare class GaussianSplattingMesh extends Mesh {
411
433
  * Update asynchronously the buffer
412
434
  * @param data array buffer containing center, color, orientation and scale of splats
413
435
  * @param sh optional array of uint8 array for SH data
436
+ * @param partIndices optional array of uint8 for rig node indices
414
437
  * @returns a promise
415
438
  */
416
- updateDataAsync(data: ArrayBuffer, sh?: Uint8Array[]): Promise<void>;
439
+ updateDataAsync(data: ArrayBuffer, sh?: Uint8Array[], partIndices?: Uint8Array): Promise<void>;
417
440
  /**
418
441
  * @experimental
419
442
  * Update data from GS (position, orientation, color, scaling)
420
443
  * @param data array that contain all the datas
421
444
  * @param sh optional array of uint8 array for SH data
422
- * @param options optional informations on how to treat data
445
+ * @param options optional informations on how to treat data (needs to be 3rd for backward compatibility)
446
+ * @param partIndices optional array of uint8 for rig node indices
423
447
  */
424
- updateData(data: ArrayBuffer, sh?: Uint8Array[], options?: IUpdateOptions): void;
448
+ updateData(data: ArrayBuffer, sh?: Uint8Array[], options?: IUpdateOptions, partIndices?: Uint8Array): void;
425
449
  /**
426
450
  * Refreshes the bounding info, taking into account all the thin instances defined
427
451
  * @returns the current Gaussian Splatting
@@ -431,5 +455,45 @@ export declare class GaussianSplattingMesh extends Mesh {
431
455
  private _updateSubTextures;
432
456
  private _instanciateWorker;
433
457
  private _getTextureSize;
458
+ /**
459
+ * Gets the number of parts in the compound
460
+ * @returns the number of parts in the compound, or 0 if the mesh is not a compound
461
+ */
462
+ get partCount(): number;
463
+ /**
464
+ * Sets the world matrix for a specific part of the compound (if this mesh is a compound).
465
+ * This will trigger a re-sort of the mesh.
466
+ * @param partIndex index of the part, that must be between 0 and partCount - 1
467
+ * @param worldMatrix the world matrix to set
468
+ */
469
+ setWorldMatrixForPart(partIndex: number, worldMatrix: Matrix): void;
470
+ /**
471
+ * Gets the world matrix for a specific part of the compound (if this mesh is a compound).
472
+ * @param partIndex index of the part, that must be between 0 and partCount - 1
473
+ * @returns the world matrix for the part, or the current world matrix of the mesh if the mesh is not a compound
474
+ */
475
+ getWorldMatrixForPart(partIndex: number): Matrix;
476
+ /**
477
+ * Ensure that the part world matrix array is at least the given length.
478
+ * NB: This length is used as reference for the number of parts in the compound.
479
+ * Newly inserted parts are initialized with the current world matrix of the mesh.
480
+ * @param length - The minimum length to ensure
481
+ */
482
+ private _ensureMinimumPartMatricesLength;
483
+ /**
484
+ * This sets the number of parts in the compound.
485
+ * Warning: This must be consistent with the indices used in the partIndices texture.
486
+ * Newly inserted parts are initialized with the current world matrix of the mesh.
487
+ * @param length - The length to resize to
488
+ */
489
+ private _resizePartMatrices;
490
+ /**
491
+ * Add another mesh to this mesh, as a new part. This makes the current mesh a compound, if not already.
492
+ * NB: The current mesh needs to be loaded with keepInRam: true.
493
+ * @param other - The other mesh to add. This must be loaded with keepInRam: true.
494
+ * @param disposeOther - Whether to dispose the other mesh after adding it to the current mesh.
495
+ * @returns a placeholder mesh that can be used to manipulate the part transform
496
+ */
497
+ addPart(other: GaussianSplattingMesh, disposeOther?: boolean): Mesh;
434
498
  }
435
499
  export {};