@miris-inc/core 0.0.8-e7873f9 → 0.0.8-e8c86c8
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/dist/AquaApi.wasm +0 -0
- package/dist/aqua-parser.wasm +0 -0
- package/dist/core.d.ts +413 -14
- package/dist/core.js +274 -68
- package/dist/core.prod.js +1 -1
- package/dist/core.standalone.js +3851 -2087
- package/dist/core.standalone.prod.js +1 -1
- package/package.json +1 -8
- package/webshark.d.ts +0 -318
package/dist/AquaApi.wasm
CHANGED
|
Binary file
|
package/dist/aqua-parser.wasm
CHANGED
|
Binary file
|
package/dist/core.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare class AttributeNames {
|
|
|
37
37
|
static readonly SURFEL_OWNER_GROUPS: string;
|
|
38
38
|
static readonly OCTANT_CELL: string;
|
|
39
39
|
static readonly REFLECTANCE_DATA_V1: string;
|
|
40
|
+
static readonly REFLECTANCE_DATA_V2: string;
|
|
40
41
|
static readonly GLASS_MESH_GEOMETRY: string;
|
|
41
42
|
static readonly GLASS_MESH_PANELS: string;
|
|
42
43
|
static readonly MOD_DEPTH: string;
|
|
@@ -69,6 +70,18 @@ export declare class Camera {
|
|
|
69
70
|
constructor({ aspect, fov, near, far, matrix, scene, viewportHeight, }: CameraInit);
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
declare interface Camera_2 {
|
|
74
|
+
dir: vec4;
|
|
75
|
+
U: vec4;
|
|
76
|
+
V: vec4;
|
|
77
|
+
eye: vec4;
|
|
78
|
+
l: number;
|
|
79
|
+
fov: number;
|
|
80
|
+
zNear: number;
|
|
81
|
+
zFar: number;
|
|
82
|
+
delete(): void;
|
|
83
|
+
}
|
|
84
|
+
|
|
72
85
|
export declare type CameraInit = {
|
|
73
86
|
aspect: number;
|
|
74
87
|
fov: number;
|
|
@@ -112,7 +125,9 @@ declare class Client {
|
|
|
112
125
|
getSceneMetadata(...args: ClientMethodParameters["getSceneMetadata"]): number;
|
|
113
126
|
getSceneObjectParent(...args: ClientMethodParameters["getSceneObjectParent"]): number;
|
|
114
127
|
getSceneObjectType(...args: ClientMethodParameters["getSceneObjectType"]): SceneObjectType;
|
|
128
|
+
getStreamStatus(...args: ClientMethodParameters["getStreamStatus"]): StreamStatus;
|
|
115
129
|
getDrawnOctantMask(...args: ClientMethodParameters["getDrawnOctantMask"]): number;
|
|
130
|
+
getOctantLocalBoundingBoxes(...args: ClientMethodParameters["getOctantLocalBoundingBoxes"]): number[];
|
|
116
131
|
getLocalTransform(...args: ClientMethodParameters["getLocalTransform"]): AquaStatus;
|
|
117
132
|
getWorldTransform(...args: ClientMethodParameters["getWorldTransform"]): AquaStatus;
|
|
118
133
|
hasAttribute(...args: ClientMethodParameters["hasAttribute"]): boolean;
|
|
@@ -122,6 +137,8 @@ declare class Client {
|
|
|
122
137
|
setAssetViewerKey(...args: ClientMethodParameters["setAssetViewerKey"]): AquaStatus;
|
|
123
138
|
setClientSpatialFormat(...args: ClientMethodParameters["setClientSpatialFormat"]): AquaStatus;
|
|
124
139
|
setRuntimeSettings(...args: ClientMethodParameters["setRuntimeSettings"]): AquaStatus;
|
|
140
|
+
setStreamFetchMode(...args: ClientMethodParameters["setStreamFetchMode"]): boolean;
|
|
141
|
+
getStreamFetchMode(...args: ClientMethodParameters["getStreamFetchMode"]): number;
|
|
125
142
|
setMainCameraTransform(...args: ClientMethodParameters["setMainCameraTransform"]): AquaStatus;
|
|
126
143
|
setMainCameraViewFrustum(...args: ClientMethodParameters["setMainCameraViewFrustum"]): AquaStatus;
|
|
127
144
|
setSceneObjectTransform(...args: ClientMethodParameters["setSceneObjectTransform"]): AquaStatus;
|
|
@@ -139,6 +156,14 @@ declare class Client {
|
|
|
139
156
|
updateSceneExecution(...args: ClientMethodParameters["updateSceneExecution"]): AquaStatus;
|
|
140
157
|
}
|
|
141
158
|
|
|
159
|
+
declare type ClientAttributeInfo = {
|
|
160
|
+
elementsPerSplat: number;
|
|
161
|
+
discard: boolean;
|
|
162
|
+
bytes?: true;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export declare const clientAttributeList: Record<string, ClientAttributeInfo>;
|
|
166
|
+
|
|
142
167
|
declare type ClientInit = {
|
|
143
168
|
engine: Engine;
|
|
144
169
|
context?: AquaContextHandle;
|
|
@@ -188,6 +213,7 @@ declare class Engine {
|
|
|
188
213
|
readonly DrMap: 0;
|
|
189
214
|
readonly ReflMesh: 1;
|
|
190
215
|
readonly GlassMesh: 2;
|
|
216
|
+
readonly RenderAsPointCloud: 3;
|
|
191
217
|
};
|
|
192
218
|
static FeatureState: {
|
|
193
219
|
readonly NotLoaded: 0;
|
|
@@ -195,6 +221,18 @@ declare class Engine {
|
|
|
195
221
|
readonly Loaded: 2;
|
|
196
222
|
readonly Failed: 3;
|
|
197
223
|
};
|
|
224
|
+
static StreamStatus: {
|
|
225
|
+
readonly Unknown: 0;
|
|
226
|
+
readonly Resolving: 1;
|
|
227
|
+
readonly Loading: 2;
|
|
228
|
+
readonly Ready: 3;
|
|
229
|
+
readonly Failed: 4;
|
|
230
|
+
};
|
|
231
|
+
static StreamFetchMode: {
|
|
232
|
+
readonly Regular: 0;
|
|
233
|
+
readonly Prefetch: 1;
|
|
234
|
+
readonly Parked: 2;
|
|
235
|
+
};
|
|
198
236
|
readonly ready: Promise<this>;
|
|
199
237
|
readonly pending: boolean;
|
|
200
238
|
get module(): MainModule;
|
|
@@ -203,6 +241,7 @@ declare class Engine {
|
|
|
203
241
|
get CompressionType(): {
|
|
204
242
|
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
205
243
|
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE: unknown;
|
|
244
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE_V2: unknown;
|
|
206
245
|
};
|
|
207
246
|
get Handedness(): {
|
|
208
247
|
Right: number;
|
|
@@ -224,6 +263,7 @@ declare class Engine {
|
|
|
224
263
|
Y: number;
|
|
225
264
|
Z: number;
|
|
226
265
|
};
|
|
266
|
+
get UsePadding(): boolean;
|
|
227
267
|
activatedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
228
268
|
addStreamById(...args: [
|
|
229
269
|
handle: AquaClientHandle,
|
|
@@ -241,6 +281,7 @@ declare class Engine {
|
|
|
241
281
|
deactivatedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
242
282
|
remaskedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
243
283
|
getDrawnOctantMask(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
284
|
+
getOctantLocalBoundingBoxes(...args: [handle: AquaClientHandle, sceneObjectId: number]): number[];
|
|
244
285
|
destroyClient(...args: [handle: AquaClientHandle]): AquaStatus;
|
|
245
286
|
free(...args: [size: number]): number;
|
|
246
287
|
getAssetsAsync(...args: [handle: AquaClientHandle, tags: StringVector]): AssetInfo[];
|
|
@@ -259,6 +300,7 @@ declare class Engine {
|
|
|
259
300
|
getSceneChangesCounts(...args: [handle: AquaClientHandle, sceneChangeIds: SceneChangeIds]): void;
|
|
260
301
|
getSceneMetadata(...args: [handle: AquaClientHandle, metadata: SceneMetadata]): number;
|
|
261
302
|
getSceneObjectParent(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
303
|
+
getStreamStatus(...args: [handle: AquaClientHandle, streamObjectId: number]): StreamStatus;
|
|
262
304
|
getSceneObjectType(...args: [handle: AquaClientHandle, sceneObjectId: number]): SceneObjectType;
|
|
263
305
|
getLocalTransform(...args: [
|
|
264
306
|
handle: AquaClientHandle,
|
|
@@ -310,8 +352,11 @@ declare class Engine {
|
|
|
310
352
|
farPlane: number,
|
|
311
353
|
viewportHeightPixels: number
|
|
312
354
|
]): AquaStatus;
|
|
355
|
+
setStreamFetchMode(...args: [handle: AquaClientHandle, streamObjectId: number, mode: number]): boolean;
|
|
356
|
+
getStreamFetchMode(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
313
357
|
setMaxCacheSize(...args: [maxSizeBytes: number]): void;
|
|
314
358
|
setPreferSharkEncodingProfiles(...args: [preferShark: boolean]): void;
|
|
359
|
+
setPadSplatAttributes(usePadding: boolean): void;
|
|
315
360
|
setSceneObjectTransform(...args: [
|
|
316
361
|
handle: AquaClientHandle,
|
|
317
362
|
sceneObjectId: number,
|
|
@@ -340,9 +385,16 @@ declare class Engine {
|
|
|
340
385
|
* displayed frame per context, before the per-client updateSceneExecution() calls.
|
|
341
386
|
* `previousFrameTimeMs` is how long the previous frame took; pass 0 when there is no plausible
|
|
342
387
|
* measurement (first frame, or a resume from a stall) and the frame advances without recording
|
|
343
|
-
*
|
|
388
|
+
* `primsResident` is what the renderer held at the end of the previous frame, fading
|
|
389
|
+
* prims included, and `primCapacity` what it can hold; activations that would not fit are
|
|
390
|
+
* deferred, where primCapacity 0 means deferral is disabled.
|
|
344
391
|
*/
|
|
345
|
-
beginFrame(...args: [
|
|
392
|
+
beginFrame(...args: [
|
|
393
|
+
contextHandle: AquaContextHandle,
|
|
394
|
+
previousFrameTimeMs: number,
|
|
395
|
+
primsResident: number,
|
|
396
|
+
primCapacity: number
|
|
397
|
+
]): AquaStatus;
|
|
346
398
|
createDeserializeWorker(_url: string, _workerUrl: string, poolSize: number): boolean;
|
|
347
399
|
cancelRequest(requestIdLow: number, requestIdHigh: number): boolean;
|
|
348
400
|
submitToWorker(requestIdLow: number, requestIdHigh: number, descriptorBuffer: ArrayBuffer, contextPtr: number): boolean;
|
|
@@ -356,6 +408,52 @@ declare type EngineMethodParameters<E extends Engine = Engine> = {
|
|
|
356
408
|
[Key in keyof E]: E[Key] extends (...args: any[]) => any ? Parameters<E[Key]> : never;
|
|
357
409
|
};
|
|
358
410
|
|
|
411
|
+
declare interface GlassMeshRegistry {
|
|
412
|
+
// Decodes one octree node's glass payload and registers it, replacing any previous entry for
|
|
413
|
+
// that object. False for a malformed or empty payload, leaving the registry unchanged.
|
|
414
|
+
//
|
|
415
|
+
// The two slot arguments are different numbers here, unlike on the native path, and swapping
|
|
416
|
+
// them renders glass that does not follow its asset: modelRootSlot scopes the panel dedupe to
|
|
417
|
+
// one asset instance, while chunkModelRootIndex is stamped into every vertex and read back as
|
|
418
|
+
// chunkModelRoots[pos.w], so that one takes the chunk's fade slot.
|
|
419
|
+
//
|
|
420
|
+
// geometryPtr/panelPtr address THIS module's heap - _malloc here and copy the bytes in, since
|
|
421
|
+
// the attributes live in the engine module's. The AABB is the geometry attribute's own range.
|
|
422
|
+
registerObject(
|
|
423
|
+
objectId: number,
|
|
424
|
+
lodIndex: number,
|
|
425
|
+
modelRootSlot: number,
|
|
426
|
+
chunkModelRootIndex: number,
|
|
427
|
+
geometryPtr: number,
|
|
428
|
+
geometryByteCount: number,
|
|
429
|
+
panelPtr: number,
|
|
430
|
+
panelByteCount: number,
|
|
431
|
+
aabbMinX: number,
|
|
432
|
+
aabbMinY: number,
|
|
433
|
+
aabbMinZ: number,
|
|
434
|
+
aabbMaxX: number,
|
|
435
|
+
aabbMaxY: number,
|
|
436
|
+
aabbMaxZ: number,
|
|
437
|
+
): boolean;
|
|
438
|
+
// Returns true if the object had glass, which is what says the buffers need rebuilding.
|
|
439
|
+
removeObject(objectId: number): boolean;
|
|
440
|
+
clear(): void;
|
|
441
|
+
isDirty(): boolean;
|
|
442
|
+
// Rebuilds the flattened buffers, keeping each panel from its deepest resident LOD. Stays dirty
|
|
443
|
+
// so uploadIfDirty still fires. Walks every registered object, so not per frame.
|
|
444
|
+
flattenIfDirty(): void;
|
|
445
|
+
uploadIfDirty(renderState: RenderState): void;
|
|
446
|
+
vertexCount(): number;
|
|
447
|
+
panelCount(): number;
|
|
448
|
+
delete(): void;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export declare const HaveData = 2;
|
|
452
|
+
|
|
453
|
+
export declare const HaveMetadata = 1;
|
|
454
|
+
|
|
455
|
+
export declare const HaveNothing = 0;
|
|
456
|
+
|
|
359
457
|
export declare class Lod {
|
|
360
458
|
#private;
|
|
361
459
|
readonly id: LodInit["id"];
|
|
@@ -386,6 +484,8 @@ export declare class Lod {
|
|
|
386
484
|
get transform(): Float32Array<ArrayBuffer> | null;
|
|
387
485
|
get _drawnOctantMask(): number;
|
|
388
486
|
set _drawnOctantMask(mask: number);
|
|
487
|
+
get _octantLocalBounds(): Float32Array<ArrayBuffer> | null;
|
|
488
|
+
set _octantLocalBounds(bounds: Float32Array<ArrayBuffer> | null);
|
|
389
489
|
get _octantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
390
490
|
get _hasOctantOffsets(): boolean;
|
|
391
491
|
get _surfelOctantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
@@ -419,11 +519,12 @@ export declare class LodStore {
|
|
|
419
519
|
deleteId(id: number): void;
|
|
420
520
|
}
|
|
421
521
|
|
|
422
|
-
declare interface MainModule {
|
|
522
|
+
declare interface MainModule extends SharkModule {
|
|
423
523
|
AttributeInfo: new () => AttributeInfo;
|
|
424
524
|
CompressionType: {
|
|
425
525
|
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
426
526
|
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE: unknown;
|
|
527
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE_V2: unknown;
|
|
427
528
|
};
|
|
428
529
|
Handedness: { Right: number; Left: number };
|
|
429
530
|
HEAPF32: Float32Array<ArrayBuffer>;
|
|
@@ -453,6 +554,7 @@ declare interface MainModule {
|
|
|
453
554
|
remaskedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
454
555
|
deletedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
455
556
|
GetDrawnOctantMask(handle: number, sceneObjectId: number): number;
|
|
557
|
+
GetOctantLocalBoundingBoxes(handle: number, sceneObjectId: number): number[];
|
|
456
558
|
GetAssetsAsync(handle: number, tags: StringVector): unknown[];
|
|
457
559
|
GetSceneChanges(handle: number, sceneChangeIds: SceneChangeIds): void;
|
|
458
560
|
GetSceneChangesCounts(handle: number, sceneChangeIds: SceneChangeIds): void;
|
|
@@ -465,10 +567,17 @@ declare interface MainModule {
|
|
|
465
567
|
GetDrMapLadderRoughnessLevels(handle: number, sceneObjectId: number): number[];
|
|
466
568
|
SetClientSpatialFormat(handle: number, spatialFormat: SpatialFormat): { value: number };
|
|
467
569
|
SetRuntimeSettings(handle: number, settings: RuntimeSettings): { value: number };
|
|
570
|
+
SetStreamFetchMode(handle: number, streamObjectId: number, mode: number): boolean;
|
|
571
|
+
GetStreamFetchMode(handle: number, streamObjectId: number): number;
|
|
468
572
|
TakeEvictedClientSideAttributeIds(handle: number): EmbindVector<bigint>;
|
|
469
573
|
GetActiveClientSideIdsCheckSum(): number;
|
|
470
574
|
TakeRenderRequired(handle: number): boolean;
|
|
471
|
-
BeginFrame(
|
|
575
|
+
BeginFrame(
|
|
576
|
+
contextHandle: number,
|
|
577
|
+
previousFrameTimeMs: number,
|
|
578
|
+
primsResident: number,
|
|
579
|
+
primCapacity: number,
|
|
580
|
+
): number;
|
|
472
581
|
modifiedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
473
582
|
setMaxCacheSize(maxSizeBytes: number): void;
|
|
474
583
|
SetPreferSharkEncodingProfiles(prefer: boolean): void;
|
|
@@ -510,16 +619,20 @@ export declare class Miris {
|
|
|
510
619
|
static readonly _XR_TARGET_FRAME_RATE = 43;
|
|
511
620
|
/* Excluded from this release type: _XR_SPLAT_COUNT_BUDGET */
|
|
512
621
|
/* Excluded from this release type: _SHARK_SPLAT_CAPACITY_MOBILE */
|
|
513
|
-
static readonly _SHARK_SPLAT_CAPACITY_DESKTOP
|
|
622
|
+
static readonly _SHARK_SPLAT_CAPACITY_DESKTOP: number;
|
|
514
623
|
/* Excluded from this release type: _SHARK_SPLAT_BUDGET_CAP_MOBILE */
|
|
515
|
-
static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP =
|
|
624
|
+
static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP = 2400000;
|
|
516
625
|
/* Excluded from this release type: _isMobileDevice */
|
|
517
626
|
/* Excluded from this release type: _sharkSplatCapacity */
|
|
627
|
+
/* Excluded from this release type: _minimumSplatCount */
|
|
628
|
+
/* Excluded from this release type: _splatCountStorageKey */
|
|
629
|
+
/* Excluded from this release type: _reloadWithLowerSplatCapacity */
|
|
518
630
|
/* Excluded from this release type: _limitSharkSplatCapacity */
|
|
519
631
|
/* Excluded from this release type: _sharkSplatBudgetCap */
|
|
520
632
|
/* Excluded from this release type: _setTargetFrameRate */
|
|
521
633
|
/* Excluded from this release type: _setXRModeActive */
|
|
522
634
|
/* Excluded from this release type: _setSplatCountBudgetOverride */
|
|
635
|
+
/* Excluded from this release type: _reportRendererPrims */
|
|
523
636
|
/* Excluded from this release type: _update */
|
|
524
637
|
getLocalTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
525
638
|
getWorldTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
@@ -556,9 +669,9 @@ export declare type ModelRootInit = {
|
|
|
556
669
|
* The byte-exact counterpart of getRawUint32Attribute above: same no-padding, no-takeAttribute
|
|
557
670
|
* contract, returning bytes rather than words.
|
|
558
671
|
*
|
|
559
|
-
* Use this rather than that one wherever the stride is not a whole number of words:
|
|
560
|
-
*
|
|
561
|
-
* last field to dataPtrView's truncation.
|
|
672
|
+
* Use this rather than that one wherever the stride is not a whole number of words: the
|
|
673
|
+
* reflectance records' 18- and 26-byte strides are not, and an odd record count would lose that
|
|
674
|
+
* record's last field to dataPtrView's truncation.
|
|
562
675
|
*/
|
|
563
676
|
export declare type RawByteAttributeWithBounds = {
|
|
564
677
|
bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -574,6 +687,72 @@ export declare type RawByteAttributeWithBounds = {
|
|
|
574
687
|
};
|
|
575
688
|
};
|
|
576
689
|
|
|
690
|
+
declare type ReadyState_2 = typeof HaveNothing | typeof HaveMetadata | typeof HaveData;
|
|
691
|
+
export { ReadyState_2 as ReadyState }
|
|
692
|
+
|
|
693
|
+
declare interface RendererWGPU {
|
|
694
|
+
getProgramCount(): number;
|
|
695
|
+
getTextureCount(): number;
|
|
696
|
+
getEstimatedTextureSize(): number;
|
|
697
|
+
getTotalBufferSize(): number;
|
|
698
|
+
getGpuBufferSize(): number;
|
|
699
|
+
getUploadBufferSize(): number;
|
|
700
|
+
info: SharkInfo;
|
|
701
|
+
delete(): void;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
declare interface RenderState {
|
|
705
|
+
delete(): void;
|
|
706
|
+
initRenderState(
|
|
707
|
+
renderer: RendererWGPU,
|
|
708
|
+
width: number,
|
|
709
|
+
height: number,
|
|
710
|
+
vertices: number,
|
|
711
|
+
splats: number,
|
|
712
|
+
cubes: number,
|
|
713
|
+
sortThreads: number,
|
|
714
|
+
sortGroupSize: number,
|
|
715
|
+
sortKeySize: number,
|
|
716
|
+
): void;
|
|
717
|
+
initGraphicsState(
|
|
718
|
+
width: number,
|
|
719
|
+
height: number,
|
|
720
|
+
renderTextureFormat: TextureFormatValue,
|
|
721
|
+
depthTextureFormat: TextureFormatValue,
|
|
722
|
+
): void;
|
|
723
|
+
updateRenderDetails(
|
|
724
|
+
width: number,
|
|
725
|
+
height: number,
|
|
726
|
+
splatTriangles: number,
|
|
727
|
+
): void;
|
|
728
|
+
// Decodes Radiance .hdr bytes into roughness-ladder level `level` (0 is the sharp mirror).
|
|
729
|
+
// hdrPtr must address THIS module's heap - _malloc here and copy the bytes in.
|
|
730
|
+
// Returns false for bytes that are not a usable Radiance image, or a level out of range.
|
|
731
|
+
uploadEnvironmentLadderLevelFromHdr(
|
|
732
|
+
level: number,
|
|
733
|
+
sigmaDeg: number,
|
|
734
|
+
hdrPtr: number,
|
|
735
|
+
hdrSizeBytes: number,
|
|
736
|
+
): boolean;
|
|
737
|
+
// Republish the ladder's shape. Call after any level lands, or it is sampled at whatever shape
|
|
738
|
+
// the last uploadSplatSetData declared. Pass SplatSet.hasReflectionParams().
|
|
739
|
+
uploadReflectionLadderParams(reflectionsEnabled: boolean): void;
|
|
740
|
+
// Debug controls. Drop the reflection term, or replace the surfel colour with one of the layers
|
|
741
|
+
// it is shaded from, numbered as RenderViewModes.h's AOV_* defines. setRenderView below sets
|
|
742
|
+
// the AOV together with the rest of a named view.
|
|
743
|
+
setReflectionsEnabled(enabled: boolean): void;
|
|
744
|
+
// Render textured gaussians on pixels no surfel covers, resolved as fvdb's open gate does.
|
|
745
|
+
// Off by default: those pixels show the clear colour.
|
|
746
|
+
setSurfelLessTextureSplatsEnabled(enabled: boolean): void;
|
|
747
|
+
setDebugAovMode(mode: number): void;
|
|
748
|
+
// GPU pass timing. Turning it on makes every pass write timestamps; a no-op on a device without
|
|
749
|
+
// timestamp-query. resolveTimeStamps goes after a frame's render; passTimingsMs starts a readback
|
|
750
|
+
// of them unless one is in flight and maps pass name to milliseconds from the last that landed.
|
|
751
|
+
setPassTimingEnabled(enabled: boolean): void;
|
|
752
|
+
resolveTimeStamps(): void;
|
|
753
|
+
passTimingsMs(): Record<string, number>;
|
|
754
|
+
}
|
|
755
|
+
|
|
577
756
|
declare type RequestAnimationFrameFn = ((callback: FrameRequestCallback) => number) | ((callback: XRFrameRequestCallback) => void);
|
|
578
757
|
|
|
579
758
|
declare interface RuntimeSettings extends EmbindObject {
|
|
@@ -632,6 +811,8 @@ export declare class Scene extends EventTarget {
|
|
|
632
811
|
/* Excluded from this release type: _getDrMap */
|
|
633
812
|
/* Excluded from this release type: _onDrMapLadder */
|
|
634
813
|
/* Excluded from this release type: _onFeatureData */
|
|
814
|
+
/* Excluded from this release type: _applyStreamFetchModes */
|
|
815
|
+
/* Excluded from this release type: _updateStreamStatuses */
|
|
635
816
|
/* Excluded from this release type: _onSceneLoaded */
|
|
636
817
|
delete(stream: Stream): void;
|
|
637
818
|
close(): void;
|
|
@@ -655,12 +836,117 @@ declare interface SceneMetadata extends EmbindObject {
|
|
|
655
836
|
readonly inputColorSpace: string;
|
|
656
837
|
}
|
|
657
838
|
|
|
658
|
-
declare
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
839
|
+
declare interface SharkInfo {
|
|
840
|
+
renderCalls: number;
|
|
841
|
+
render: SharkRenderInfo;
|
|
842
|
+
reset(): void;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
declare interface SharkModule {
|
|
846
|
+
Camera: new () => Camera_2;
|
|
847
|
+
RenderState: new () => RenderState;
|
|
848
|
+
SplatSet: new () => SplatSet;
|
|
849
|
+
GlassMeshRegistry: new () => GlassMeshRegistry;
|
|
850
|
+
vec4: new (x: number, y: number, z: number, w: number) => vec4;
|
|
851
|
+
|
|
852
|
+
SortType: {
|
|
853
|
+
RADIX_SORT: SortTypeValue;
|
|
854
|
+
OCTREE_SORT: SortTypeValue;
|
|
855
|
+
KDTREE_SORT: SortTypeValue;
|
|
856
|
+
STD_SORT: SortTypeValue;
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
TextureFormat: {
|
|
860
|
+
RGBA32_Float: TextureFormatValue;
|
|
861
|
+
RGBA16_Float: TextureFormatValue;
|
|
862
|
+
RG16_Float: TextureFormatValue;
|
|
863
|
+
RGBA32_UInt: TextureFormatValue;
|
|
864
|
+
RGBA32_SInt: TextureFormatValue;
|
|
865
|
+
RGBA16_UInt: TextureFormatValue;
|
|
866
|
+
RGBA16_SInt: TextureFormatValue;
|
|
867
|
+
RGBA8_UInt: TextureFormatValue;
|
|
868
|
+
RGBA8_SInt: TextureFormatValue;
|
|
869
|
+
RGBA8_UNorm: TextureFormatValue;
|
|
870
|
+
RGBA8_SNorm: TextureFormatValue;
|
|
871
|
+
RGBA16_UNorm: TextureFormatValue;
|
|
872
|
+
RGBA16_SNorm: TextureFormatValue;
|
|
873
|
+
BGRA8_UNorm: TextureFormatValue;
|
|
874
|
+
BC6HRGB_UFloat: TextureFormatValue;
|
|
875
|
+
BC6HRGB_Float: TextureFormatValue;
|
|
876
|
+
BC7RGBA_UNorm: TextureFormatValue;
|
|
877
|
+
BC7RGBA_UNormSrgb: TextureFormatValue;
|
|
878
|
+
BC3RGBA_UNorm: TextureFormatValue;
|
|
879
|
+
BC3RGBA_UNormSrgb: TextureFormatValue;
|
|
880
|
+
Depth16Unorm: TextureFormatValue;
|
|
881
|
+
Depth24Plus: TextureFormatValue;
|
|
882
|
+
Depth32Float: TextureFormatValue;
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
WebGPU: WebGPUInterface;
|
|
886
|
+
|
|
887
|
+
// HEAPU8 is replaced whenever the heap grows, so read it fresh rather than caching it.
|
|
888
|
+
_malloc(byteCount: number): number;
|
|
889
|
+
_free(ptr: number): void;
|
|
890
|
+
readonly HEAPU8: Uint8Array;
|
|
891
|
+
|
|
892
|
+
uploadSplatSetData(
|
|
893
|
+
set: SplatSet,
|
|
894
|
+
renderState: RenderState,
|
|
895
|
+
start: number,
|
|
896
|
+
): void;
|
|
897
|
+
uploadChunkFades(set: SplatSet, renderState: RenderState): void;
|
|
898
|
+
// One mat4 per model root, so cheap enough to call every frame while an asset is moving
|
|
899
|
+
uploadModelRootTransforms(set: SplatSet, renderState: RenderState): void;
|
|
900
|
+
processSplatSet(
|
|
901
|
+
camera: Camera_2,
|
|
902
|
+
set: SplatSet,
|
|
903
|
+
renderState: RenderState,
|
|
904
|
+
width: number,
|
|
905
|
+
height: number,
|
|
906
|
+
triangles: number,
|
|
907
|
+
projectOnGPU: boolean,
|
|
908
|
+
cullEllipsoid: boolean,
|
|
909
|
+
useAffineApprox: boolean,
|
|
910
|
+
depthSortOnGPU: boolean,
|
|
911
|
+
useInvZ: boolean,
|
|
912
|
+
rasterizeWithCompute: boolean,
|
|
913
|
+
useSOGS: boolean,
|
|
914
|
+
sortType: SortTypeValue,
|
|
915
|
+
skipSort: boolean,
|
|
916
|
+
): number;
|
|
917
|
+
createRendererWGPUWithoutSurface(
|
|
918
|
+
colorTargetFormat: TextureFormatValue,
|
|
919
|
+
): RendererWGPU;
|
|
920
|
+
/// Gives back the reference WebGPU.importJsTexture returned for a texture.
|
|
921
|
+
releaseImportedTexture(texture: number): void;
|
|
922
|
+
renderSplatSetToSceneTextures(
|
|
923
|
+
splatSet: SplatSet,
|
|
924
|
+
renderState: RenderState,
|
|
925
|
+
colorTarget: number,
|
|
926
|
+
depthTarget: number,
|
|
927
|
+
renderGES: boolean,
|
|
928
|
+
): void;
|
|
929
|
+
// Render view registry, indexed as RenderViews.h orders it. setRenderView ignores an index
|
|
930
|
+
// Shark cannot produce.
|
|
931
|
+
setRenderView(viewIndex: number): void;
|
|
932
|
+
renderView(): number;
|
|
933
|
+
renderViewCount(): number;
|
|
934
|
+
renderViewName(viewIndex: number): string;
|
|
935
|
+
renderViewSupported(viewIndex: number): boolean;
|
|
936
|
+
// The next supported view, forwards for direction 1 and backwards for -1.
|
|
937
|
+
stepRenderView(from: number, direction: number): number;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
declare interface SharkRenderInfo {
|
|
941
|
+
triangles: number;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
declare interface SortTypeValue {
|
|
945
|
+
value: number;
|
|
946
|
+
}
|
|
662
947
|
|
|
663
|
-
|
|
948
|
+
/** @deprecated Use clientAttributeList. */
|
|
949
|
+
export declare const sparkAttributeList: Record<string, ClientAttributeInfo>;
|
|
664
950
|
|
|
665
951
|
declare interface SpatialFormat extends EmbindObject {
|
|
666
952
|
metersPerUnit: number;
|
|
@@ -669,6 +955,86 @@ declare interface SpatialFormat extends EmbindObject {
|
|
|
669
955
|
handedness: number;
|
|
670
956
|
}
|
|
671
957
|
|
|
958
|
+
declare interface SplatSet {
|
|
959
|
+
splatCount: number;
|
|
960
|
+
// Number of splats actually drawn: ordering[0, activeSplats) holds the unmasked splat indices.
|
|
961
|
+
// Set alongside orderingView() to restrict the draw to unmasked octant ranges.
|
|
962
|
+
activeSplats: number;
|
|
963
|
+
// Selects which ellipsoid layout to allocate and what ellipsoidsView() exposes:
|
|
964
|
+
// packed (16 bytes/splat) or uncompressed (48). Must be set before the first resize.
|
|
965
|
+
usePackedEllipsoids: boolean;
|
|
966
|
+
// direct-write upload: resize -> write into the views -> finalize.
|
|
967
|
+
// views are valid only until the next resize.
|
|
968
|
+
resize(splatCount: number): void;
|
|
969
|
+
ellipsoidsView(): Uint32Array;
|
|
970
|
+
colorsView(): Uint32Array;
|
|
971
|
+
sh1View(): Uint32Array;
|
|
972
|
+
sh2View(): Uint32Array;
|
|
973
|
+
sh3aView(): Uint32Array;
|
|
974
|
+
sh3bView(): Uint32Array;
|
|
975
|
+
// mod_depth is a half-float per primitive slot (dense, padded for non-surfels), so this is a
|
|
976
|
+
// Uint16Array unlike every other view here -- do not address it with the uint32 splat strides
|
|
977
|
+
// used for ellipsoids/colors/sh*.
|
|
978
|
+
modDepthView(): Uint16Array;
|
|
979
|
+
// Per-chunk fade (opacity multiplier), one float per chunk, defaults to 1.0.
|
|
980
|
+
// Also sizes the chunk slot to model root slot map below, since both are indexed by chunk slot
|
|
981
|
+
resizeChunkFades(chunkCount: number): void;
|
|
982
|
+
chunkFadesView(): Float32Array;
|
|
983
|
+
// Per-splat chunk index, defaults to slot 0. Write before finalize()
|
|
984
|
+
chunkIndicesView(): Int32Array;
|
|
985
|
+
// Model transforms, resolved per splat as
|
|
986
|
+
// modelRootTransforms[chunkModelRoots[chunkIndices[splat]]]
|
|
987
|
+
// Slot 0 of both tables is reserved as identity, so real slots start at 1 and a set that
|
|
988
|
+
// never writes them renders untransformed.
|
|
989
|
+
resizeModelRootSlots(modelRootCount: number): void;
|
|
990
|
+
// 16 floats per model root, COLUMN-major - i.e. write THREE's Matrix4.toArray() straight in
|
|
991
|
+
modelRootTransformsView(): Float32Array;
|
|
992
|
+
// The inverses, same slots and layout. The true-perspective projection (Project.glsl) transforms
|
|
993
|
+
// a quadratic form and needs them; writing a transform without its inverse leaves that path
|
|
994
|
+
// projecting the splat as if untransformed. Use Matrix4.invert() on a copy
|
|
995
|
+
modelRootInverseTransformsView(): Float32Array;
|
|
996
|
+
// Sized by resizeChunkFades. Defaults to slot 0 (identity) for every chunk
|
|
997
|
+
chunkModelRootsView(): Int32Array;
|
|
998
|
+
// resizeModelRootSlots resets every slot to the absolute decode. False for a slot outside the table
|
|
999
|
+
setModelRootRootRelativeDecode(
|
|
1000
|
+
slot: number,
|
|
1001
|
+
originX: number,
|
|
1002
|
+
originY: number,
|
|
1003
|
+
originZ: number,
|
|
1004
|
+
step: number,
|
|
1005
|
+
lnScaleOffset: number,
|
|
1006
|
+
): boolean;
|
|
1007
|
+
// int32 render-order buffer (sized 2*splatCount after finalize). Valid only until the next resize.
|
|
1008
|
+
orderingView(): Int32Array;
|
|
1009
|
+
finalize(): void;
|
|
1010
|
+
// like finalize() but keeps splats in their delivered (octant-sorted) order — no kd-tree reorder —
|
|
1011
|
+
// so sparse-octant range masking can index child-octant ranges directly. RADIX_SORT only.
|
|
1012
|
+
finalizeBounds(): void;
|
|
1013
|
+
// Whether the asset carries per-surfel reflectance records, which is what decides whether
|
|
1014
|
+
// reflections are shaded at all. Pass to RenderState.uploadReflectionLadderParams.
|
|
1015
|
+
hasReflectionParams(): boolean;
|
|
1016
|
+
// Widens packed reflectance records - recordVersion 2 for 18-byte reflectanceDataV2, 1 for
|
|
1017
|
+
// 26-byte reflectanceDataV1 - into the per-splat GPU records at bufferOffset. wirePtr must
|
|
1018
|
+
// address THIS module's heap - _malloc here and copy the bytes in, since the attribute lives in
|
|
1019
|
+
// the engine module's. Records cover a node's surfel range, which starts at its first splat.
|
|
1020
|
+
// Returns the records written; 0 if the data was rejected.
|
|
1021
|
+
decodeReflectionParams(
|
|
1022
|
+
recordVersion: number,
|
|
1023
|
+
wirePtr: number,
|
|
1024
|
+
wireSizeBytes: number,
|
|
1025
|
+
elementCount: number,
|
|
1026
|
+
bufferOffset: number,
|
|
1027
|
+
nodeSplatCount: number,
|
|
1028
|
+
logId: number,
|
|
1029
|
+
): number;
|
|
1030
|
+
// Zeroes records in [startSplat, endSplat). Needed wherever splats are re-packed at fresh
|
|
1031
|
+
// offsets, or a reused slot shades its splat from the previous occupant's material.
|
|
1032
|
+
clearReflectionParams(startSplat: number, endSplat: number): void;
|
|
1033
|
+
// Splats in [0, count) holding a non-zero record. Diagnostic.
|
|
1034
|
+
populatedReflectionParamCount(count: number): number;
|
|
1035
|
+
delete(): void;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
672
1038
|
export declare class Stream extends EventTarget {
|
|
673
1039
|
#private;
|
|
674
1040
|
static readonly _idMap: Map<number, Stream>;
|
|
@@ -691,6 +1057,9 @@ export declare class Stream extends EventTarget {
|
|
|
691
1057
|
set matrix(matrix: Matrix4x4Tuple);
|
|
692
1058
|
get opacity(): number;
|
|
693
1059
|
set opacity(opacity: number);
|
|
1060
|
+
get fetchMode(): StreamFetchMode;
|
|
1061
|
+
set fetchMode(fetchMode: StreamFetchMode);
|
|
1062
|
+
/* Excluded from this release type: _applyFetchMode */
|
|
694
1063
|
get boundingBox(): {
|
|
695
1064
|
min: {
|
|
696
1065
|
x: number;
|
|
@@ -723,11 +1092,23 @@ export declare class Stream extends EventTarget {
|
|
|
723
1092
|
/* Excluded from this release type: _onStreamLoaded */
|
|
724
1093
|
getDefaultCameraTransform(): Float32Array<ArrayBuffer> | null | undefined;
|
|
725
1094
|
/* Excluded from this release type: _getViewingVolumeObb */
|
|
1095
|
+
/** How much of the stream has loaded, as of the last frame. */
|
|
1096
|
+
get readyState(): ReadyState_2;
|
|
1097
|
+
/* Excluded from this release type: _updateStatus */
|
|
726
1098
|
/* Excluded from this release type: _onRootLoaded */
|
|
727
1099
|
add(modelRoot: ModelRoot): void;
|
|
728
1100
|
end(): void;
|
|
729
1101
|
}
|
|
730
1102
|
|
|
1103
|
+
/**
|
|
1104
|
+
* What the engine will do with stream data: "regular" fetches and draws what the
|
|
1105
|
+
* camera needs. "prefetch" keeps fetching for the camera into the cache but does not change what is drawn.
|
|
1106
|
+
* "parked" fetches nothing and draws nothing, giving its share of the splat budget and
|
|
1107
|
+
* renderer to the other streams; what it already loaded stays cached on the cpu side for when it is unparked.
|
|
1108
|
+
* You may want to park streams while making them invisible.
|
|
1109
|
+
*/
|
|
1110
|
+
export declare type StreamFetchMode = "regular" | "prefetch" | "parked";
|
|
1111
|
+
|
|
731
1112
|
export declare type StreamInit = {
|
|
732
1113
|
uuid: string;
|
|
733
1114
|
scene: Scene;
|
|
@@ -737,6 +1118,10 @@ export declare type StreamInit = {
|
|
|
737
1118
|
|
|
738
1119
|
declare type StringVector = EmbindVector<string>;
|
|
739
1120
|
|
|
1121
|
+
declare interface TextureFormatValue {
|
|
1122
|
+
value: number;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
740
1125
|
/** Recursive variant tree node from WASM. */
|
|
741
1126
|
export declare type VariantNode = {
|
|
742
1127
|
id: number;
|
|
@@ -747,4 +1132,18 @@ export declare type VariantNode = {
|
|
|
747
1132
|
nestedSets?: VariantNode[];
|
|
748
1133
|
};
|
|
749
1134
|
|
|
1135
|
+
declare interface vec4 {
|
|
1136
|
+
x: number;
|
|
1137
|
+
y: number;
|
|
1138
|
+
z: number;
|
|
1139
|
+
w: number;
|
|
1140
|
+
delete(): void;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
declare interface WebGPUInterface {
|
|
1144
|
+
importJsAdapter(adapter: GPUAdapter, parentPtr?: number): number;
|
|
1145
|
+
importJsDevice(device: GPUDevice, parentPtr?: number): number;
|
|
1146
|
+
importJsTexture(obj: GPUTexture, parentPtr?: number): number;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
750
1149
|
export { }
|