@onerjs/core 8.51.8 → 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.
- package/AudioV2/abstractAudio/audioEngineV2.d.ts +34 -1
- package/AudioV2/abstractAudio/audioEngineV2.js +54 -0
- package/AudioV2/abstractAudio/audioEngineV2.js.map +1 -1
- package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.d.ts +12 -0
- package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js +18 -0
- package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js.map +1 -1
- package/AudioV2/abstractAudio/index.d.ts +1 -0
- package/AudioV2/abstractAudio/index.js +1 -0
- package/AudioV2/abstractAudio/index.js.map +1 -1
- package/AudioV2/abstractAudio/pure.d.ts +1 -0
- package/AudioV2/abstractAudio/pure.js +1 -0
- package/AudioV2/abstractAudio/pure.js.map +1 -1
- package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.d.ts +7 -1
- package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js +12 -0
- package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.d.ts +14 -0
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.d.ts +4 -0
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudio.d.ts +6 -0
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js +12 -0
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudioListener.d.ts +2 -0
- package/AudioV2/abstractAudio/subProperties/spatialAudioListener.js +4 -0
- package/AudioV2/abstractAudio/subProperties/spatialAudioListener.js.map +1 -1
- package/AudioV2/webAudio/webAudioEngine.js +2 -1
- package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
- package/Gizmos/index.d.ts +1 -0
- package/Gizmos/index.js +1 -0
- package/Gizmos/index.js.map +1 -1
- package/Gizmos/pure.d.ts +1 -0
- package/Gizmos/pure.js +1 -0
- package/Gizmos/pure.js.map +1 -1
- package/Gizmos/spatialAudioGizmo.d.ts +55 -0
- package/Gizmos/spatialAudioGizmo.js +151 -0
- package/Gizmos/spatialAudioGizmo.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +5 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +54 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +42 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +93 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/instancedMesh.pure.js +1 -1
- package/Meshes/instancedMesh.pure.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +54 -5
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +14 -3
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +56 -5
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +14 -3
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,30 @@ import { type InternalTexture } from "../../Materials/Textures/internalTexture.j
|
|
|
10
10
|
import { type Material } from "../../Materials/material.pure.js";
|
|
11
11
|
import { type Effect } from "../../Materials/effect.pure.js";
|
|
12
12
|
import { type Camera } from "../../Cameras/camera.pure.js";
|
|
13
|
+
/** Internal mirror of ISogTexturePack (defined in loaders) — avoids a circular import. */
|
|
14
|
+
interface ISogPackInternal {
|
|
15
|
+
version: 1 | 2;
|
|
16
|
+
splatCount: number;
|
|
17
|
+
shDegree: number;
|
|
18
|
+
meansTextureL: BaseTexture;
|
|
19
|
+
meansTextureU: BaseTexture;
|
|
20
|
+
scalesTexture: BaseTexture;
|
|
21
|
+
quatsTexture: BaseTexture;
|
|
22
|
+
sh0Texture: BaseTexture;
|
|
23
|
+
shCentroidsTexture?: BaseTexture;
|
|
24
|
+
shLabelsTexture?: BaseTexture;
|
|
25
|
+
codebookTexture?: BaseTexture;
|
|
26
|
+
meansMin: [number, number, number];
|
|
27
|
+
meansMax: [number, number, number];
|
|
28
|
+
scalesMin?: [number, number, number];
|
|
29
|
+
scalesMax?: [number, number, number];
|
|
30
|
+
sh0Min?: [number, number, number, number];
|
|
31
|
+
sh0Max?: [number, number, number, number];
|
|
32
|
+
shnMin?: number;
|
|
33
|
+
shnMax?: number;
|
|
34
|
+
shCoeffCount: number;
|
|
35
|
+
positions: Float32Array;
|
|
36
|
+
}
|
|
13
37
|
interface IUpdateOptions {
|
|
14
38
|
flipY?: boolean;
|
|
15
39
|
/** @internal When set, skips reprocessing splats [0, previousVertexCount) and copies from cached arrays instead. */
|
|
@@ -254,6 +278,8 @@ export declare class GaussianSplattingMeshBase extends Mesh {
|
|
|
254
278
|
protected _flipY: boolean;
|
|
255
279
|
private _delayedTextureUpdate;
|
|
256
280
|
protected _useRGBACovariants: boolean;
|
|
281
|
+
protected _useSog: boolean;
|
|
282
|
+
protected _sogParams: Nullable<ISogPackInternal>;
|
|
257
283
|
private _material;
|
|
258
284
|
private _tmpCovariances;
|
|
259
285
|
private _splatSizeMin;
|
|
@@ -375,6 +401,22 @@ export declare class GaussianSplattingMeshBase extends Mesh {
|
|
|
375
401
|
* Gets the SH textures
|
|
376
402
|
*/
|
|
377
403
|
get shTextures(): Nullable<BaseTexture[]>;
|
|
404
|
+
/**
|
|
405
|
+
* True when this mesh holds raw SOG webp textures (dequantized in-shader) rather than the
|
|
406
|
+
* pre-decoded covariance/center/color textures produced by the standard splat loader.
|
|
407
|
+
*/
|
|
408
|
+
get useSog(): boolean;
|
|
409
|
+
/**
|
|
410
|
+
* SOG dequantization parameters paired with the raw textures.
|
|
411
|
+
* Set by the splat loader when `useSogTextures: true`. Null otherwise.
|
|
412
|
+
*/
|
|
413
|
+
get sogParams(): Nullable<ISogPackInternal>;
|
|
414
|
+
/**
|
|
415
|
+
* Install a set of raw SOG webp textures and bind the mesh to the in-shader dequantization path.
|
|
416
|
+
* @param pack SOG texture pack produced by ParseSogMetaAsTextures.
|
|
417
|
+
* @internal
|
|
418
|
+
*/
|
|
419
|
+
setSogTextureData(pack: ISogPackInternal): void;
|
|
378
420
|
/**
|
|
379
421
|
* Gets the kernel size
|
|
380
422
|
* Documentation and mathematical explanations here:
|
|
@@ -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;
|