@onerjs/core 8.51.7 → 8.51.9

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/AudioV2/abstractAudio/audioEngineV2.d.ts +34 -1
  2. package/AudioV2/abstractAudio/audioEngineV2.js +54 -0
  3. package/AudioV2/abstractAudio/audioEngineV2.js.map +1 -1
  4. package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.d.ts +12 -0
  5. package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js +18 -0
  6. package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js.map +1 -1
  7. package/AudioV2/abstractAudio/index.d.ts +1 -0
  8. package/AudioV2/abstractAudio/index.js +1 -0
  9. package/AudioV2/abstractAudio/index.js.map +1 -1
  10. package/AudioV2/abstractAudio/pure.d.ts +1 -0
  11. package/AudioV2/abstractAudio/pure.js +1 -0
  12. package/AudioV2/abstractAudio/pure.js.map +1 -1
  13. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.d.ts +7 -1
  14. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js +12 -0
  15. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js.map +1 -1
  16. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.d.ts +14 -0
  17. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js.map +1 -1
  18. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.d.ts +4 -0
  19. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js.map +1 -1
  20. package/AudioV2/abstractAudio/subProperties/spatialAudio.d.ts +6 -0
  21. package/AudioV2/abstractAudio/subProperties/spatialAudio.js +12 -0
  22. package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
  23. package/AudioV2/abstractAudio/subProperties/spatialAudioListener.d.ts +2 -0
  24. package/AudioV2/abstractAudio/subProperties/spatialAudioListener.js +4 -0
  25. package/AudioV2/abstractAudio/subProperties/spatialAudioListener.js.map +1 -1
  26. package/AudioV2/webAudio/webAudioEngine.js +2 -1
  27. package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
  28. package/Engines/abstractEngine.pure.js +11 -4
  29. package/Engines/abstractEngine.pure.js.map +1 -1
  30. package/Engines/engine.pure.d.ts +23 -0
  31. package/Engines/engine.pure.js +96 -1
  32. package/Engines/engine.pure.js.map +1 -1
  33. package/Engines/nativeEngine.pure.d.ts +4 -0
  34. package/Engines/nativeEngine.pure.js +6 -0
  35. package/Engines/nativeEngine.pure.js.map +1 -1
  36. package/Engines/thinNativeEngine.pure.d.ts +21 -0
  37. package/Engines/thinNativeEngine.pure.js +119 -4
  38. package/Engines/thinNativeEngine.pure.js.map +1 -1
  39. package/Engines/webgpuEngine.pure.d.ts +21 -0
  40. package/Engines/webgpuEngine.pure.js +46 -1
  41. package/Engines/webgpuEngine.pure.js.map +1 -1
  42. package/Gizmos/index.d.ts +1 -0
  43. package/Gizmos/index.js +1 -0
  44. package/Gizmos/index.js.map +1 -1
  45. package/Gizmos/pure.d.ts +1 -0
  46. package/Gizmos/pure.js +1 -0
  47. package/Gizmos/pure.js.map +1 -1
  48. package/Gizmos/spatialAudioGizmo.d.ts +55 -0
  49. package/Gizmos/spatialAudioGizmo.js +151 -0
  50. package/Gizmos/spatialAudioGizmo.js.map +1 -0
  51. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +5 -0
  52. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +54 -1
  53. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  54. package/Materials/Textures/internalTexture.d.ts +11 -1
  55. package/Materials/Textures/internalTexture.js +16 -0
  56. package/Materials/Textures/internalTexture.js.map +1 -1
  57. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +42 -0
  58. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +93 -0
  59. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  60. package/Meshes/instancedMesh.pure.js +1 -1
  61. package/Meshes/instancedMesh.pure.js.map +1 -1
  62. package/Misc/tools.pure.js +1 -1
  63. package/Misc/tools.pure.js.map +1 -1
  64. package/Shaders/ShadersInclude/gaussianSplatting.js +54 -5
  65. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  66. package/Shaders/gaussianSplatting.vertex.js +14 -3
  67. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  68. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +56 -5
  69. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  70. package/ShadersWGSL/gaussianSplatting.vertex.js +14 -3
  71. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  72. package/SmartAssets/index.d.ts +2 -2
  73. package/SmartAssets/index.js +2 -1
  74. package/SmartAssets/index.js.map +1 -1
  75. package/SmartAssets/pure.d.ts +1 -1
  76. package/SmartAssets/pure.js +2 -1
  77. package/SmartAssets/pure.js.map +1 -1
  78. package/SmartAssets/smartAssetManager.js +9 -0
  79. package/SmartAssets/smartAssetManager.js.map +1 -1
  80. package/package.json +1 -1
@@ -366,6 +366,96 @@ export class GaussianSplattingMeshBase extends Mesh {
366
366
  get shTextures() {
367
367
  return this._shTextures;
368
368
  }
369
+ /**
370
+ * True when this mesh holds raw SOG webp textures (dequantized in-shader) rather than the
371
+ * pre-decoded covariance/center/color textures produced by the standard splat loader.
372
+ */
373
+ get useSog() {
374
+ return this._useSog;
375
+ }
376
+ /**
377
+ * SOG dequantization parameters paired with the raw textures.
378
+ * Set by the splat loader when `useSogTextures: true`. Null otherwise.
379
+ */
380
+ get sogParams() {
381
+ return this._sogParams;
382
+ }
383
+ /**
384
+ * Install a set of raw SOG webp textures and bind the mesh to the in-shader dequantization path.
385
+ * @param pack SOG texture pack produced by ParseSogMetaAsTextures.
386
+ * @internal
387
+ */
388
+ setSogTextureData(pack) {
389
+ this._useSog = true;
390
+ this._sogParams?.codebookTexture?.dispose();
391
+ this._sogParams = pack;
392
+ this._vertexCount = pack.splatCount;
393
+ this._shDegree = pack.shDegree ?? 0;
394
+ this._maxShDegree = this._shDegree;
395
+ // Stride-4 (xyz + 1) — required by the depth-sort worker and the centers texture path.
396
+ this._splatPositions = pack.positions;
397
+ // Reuse existing texture slots for SOG textures (the shader, under USE_SOG, samples them as RGBA8).
398
+ this._covariancesATexture?.dispose();
399
+ this._covariancesBTexture?.dispose();
400
+ this._centersTexture?.dispose();
401
+ this._colorsTexture?.dispose();
402
+ this._rotationsATexture?.dispose();
403
+ if (this._shTextures) {
404
+ for (const t of this._shTextures) {
405
+ t.dispose();
406
+ }
407
+ }
408
+ this._centersTexture = pack.meansTextureL;
409
+ this._covariancesATexture = pack.meansTextureU;
410
+ this._covariancesBTexture = pack.scalesTexture;
411
+ this._rotationsATexture = pack.quatsTexture;
412
+ this._colorsTexture = pack.sh0Texture;
413
+ const shTextures = [];
414
+ if (pack.shCentroidsTexture) {
415
+ shTextures.push(pack.shCentroidsTexture);
416
+ }
417
+ if (pack.shLabelsTexture) {
418
+ shTextures.push(pack.shLabelsTexture);
419
+ }
420
+ this._shTextures = shTextures.length ? shTextures : null;
421
+ // Force pipeline rebuild so the USE_SOG define and extra samplers are picked up.
422
+ this._material?.resetDrawCache();
423
+ const size = pack.meansTextureL.getSize();
424
+ this._textureSize.x = size.width;
425
+ this._textureSize.y = size.height;
426
+ this._updateSplatIndexBuffer(this._vertexCount);
427
+ this._instantiateWorker();
428
+ // Compute bounds from the CPU-decoded positions (stride-4) so the mesh is not frustum-culled.
429
+ const positions = pack.positions;
430
+ const minimum = new Vector3(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);
431
+ const maximum = new Vector3(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);
432
+ for (let i = 0; i < this._vertexCount; i++) {
433
+ const x = positions[i * 4 + 0];
434
+ const y = positions[i * 4 + 1];
435
+ const z = positions[i * 4 + 2];
436
+ if (x < minimum.x) {
437
+ minimum.x = x;
438
+ }
439
+ if (y < minimum.y) {
440
+ minimum.y = y;
441
+ }
442
+ if (z < minimum.z) {
443
+ minimum.z = z;
444
+ }
445
+ if (x > maximum.x) {
446
+ maximum.x = x;
447
+ }
448
+ if (y > maximum.y) {
449
+ maximum.y = y;
450
+ }
451
+ if (z > maximum.z) {
452
+ maximum.z = z;
453
+ }
454
+ }
455
+ this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());
456
+ this.setEnabled(true);
457
+ this._sortIsDirty = true;
458
+ }
369
459
  /**
370
460
  * Gets the kernel size
371
461
  * Documentation and mathematical explanations here:
@@ -458,6 +548,8 @@ export class GaussianSplattingMeshBase extends Mesh {
458
548
  this._flipY = false;
459
549
  this._delayedTextureUpdate = null;
460
550
  this._useRGBACovariants = false;
551
+ this._useSog = false;
552
+ this._sogParams = null;
461
553
  this._material = null;
462
554
  this._tmpCovariances = [0, 0, 0, 0, 0, 0];
463
555
  this._splatSizeMin = Infinity;
@@ -1571,6 +1663,7 @@ export class GaussianSplattingMeshBase extends Mesh {
1571
1663
  this._rotationsATexture?.dispose();
1572
1664
  this._rotationsBTexture?.dispose();
1573
1665
  this._rotationScaleTexture?.dispose();
1666
+ this._sogParams?.codebookTexture?.dispose();
1574
1667
  this._rotationsATexture = null;
1575
1668
  this._rotationsBTexture = null;
1576
1669
  this._rotationScaleTexture = null;