@miris-inc/core 0.0.8-cc23da1 → 0.0.8-cca9011
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 +429 -15
- package/dist/core.js +312 -72
- package/dist/core.prod.js +1 -1
- package/dist/core.standalone.js +3889 -2091
- package/dist/core.standalone.prod.js +1 -1
- package/package.json +1 -8
- package/webshark.d.ts +0 -290
package/dist/AquaApi.wasm
CHANGED
|
Binary file
|
package/dist/aqua-parser.wasm
CHANGED
|
Binary file
|
package/dist/core.d.ts
CHANGED
|
@@ -9,7 +9,9 @@ declare interface AttributeInfo extends EmbindObject {
|
|
|
9
9
|
readonly elementCount: number;
|
|
10
10
|
readonly dataSizeBytes: number;
|
|
11
11
|
readonly clientSideId: bigint;
|
|
12
|
-
|
|
12
|
+
// An embind CompressionType value, compared by identity against MainModule.CompressionType
|
|
13
|
+
readonly compressionType: unknown;
|
|
14
|
+
readonly minValue: { x: number; y: number; z: number; w: number };
|
|
13
15
|
readonly maxValue: { x: number; y: number; z: number };
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -32,7 +34,10 @@ export declare class AttributeNames {
|
|
|
32
34
|
static readonly OCTANT_OFFSETS: string;
|
|
33
35
|
static readonly SURFEL_OCTANT_OFFSETS: string;
|
|
34
36
|
static readonly SURFEL_COUNT: string;
|
|
37
|
+
static readonly SURFEL_OWNER_GROUPS: string;
|
|
38
|
+
static readonly OCTANT_CELL: string;
|
|
35
39
|
static readonly REFLECTANCE_DATA_V1: string;
|
|
40
|
+
static readonly REFLECTANCE_DATA_V2: string;
|
|
36
41
|
static readonly GLASS_MESH_GEOMETRY: string;
|
|
37
42
|
static readonly GLASS_MESH_PANELS: string;
|
|
38
43
|
static readonly MOD_DEPTH: string;
|
|
@@ -65,6 +70,18 @@ export declare class Camera {
|
|
|
65
70
|
constructor({ aspect, fov, near, far, matrix, scene, viewportHeight, }: CameraInit);
|
|
66
71
|
}
|
|
67
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
|
+
|
|
68
85
|
export declare type CameraInit = {
|
|
69
86
|
aspect: number;
|
|
70
87
|
fov: number;
|
|
@@ -108,7 +125,9 @@ declare class Client {
|
|
|
108
125
|
getSceneMetadata(...args: ClientMethodParameters["getSceneMetadata"]): number;
|
|
109
126
|
getSceneObjectParent(...args: ClientMethodParameters["getSceneObjectParent"]): number;
|
|
110
127
|
getSceneObjectType(...args: ClientMethodParameters["getSceneObjectType"]): SceneObjectType;
|
|
128
|
+
getStreamStatus(...args: ClientMethodParameters["getStreamStatus"]): StreamStatus;
|
|
111
129
|
getDrawnOctantMask(...args: ClientMethodParameters["getDrawnOctantMask"]): number;
|
|
130
|
+
getOctantLocalBoundingBoxes(...args: ClientMethodParameters["getOctantLocalBoundingBoxes"]): number[];
|
|
112
131
|
getLocalTransform(...args: ClientMethodParameters["getLocalTransform"]): AquaStatus;
|
|
113
132
|
getWorldTransform(...args: ClientMethodParameters["getWorldTransform"]): AquaStatus;
|
|
114
133
|
hasAttribute(...args: ClientMethodParameters["hasAttribute"]): boolean;
|
|
@@ -118,6 +137,8 @@ declare class Client {
|
|
|
118
137
|
setAssetViewerKey(...args: ClientMethodParameters["setAssetViewerKey"]): AquaStatus;
|
|
119
138
|
setClientSpatialFormat(...args: ClientMethodParameters["setClientSpatialFormat"]): AquaStatus;
|
|
120
139
|
setRuntimeSettings(...args: ClientMethodParameters["setRuntimeSettings"]): AquaStatus;
|
|
140
|
+
setStreamFetchMode(...args: ClientMethodParameters["setStreamFetchMode"]): boolean;
|
|
141
|
+
getStreamFetchMode(...args: ClientMethodParameters["getStreamFetchMode"]): number;
|
|
121
142
|
setMainCameraTransform(...args: ClientMethodParameters["setMainCameraTransform"]): AquaStatus;
|
|
122
143
|
setMainCameraViewFrustum(...args: ClientMethodParameters["setMainCameraViewFrustum"]): AquaStatus;
|
|
123
144
|
setSceneObjectTransform(...args: ClientMethodParameters["setSceneObjectTransform"]): AquaStatus;
|
|
@@ -135,6 +156,14 @@ declare class Client {
|
|
|
135
156
|
updateSceneExecution(...args: ClientMethodParameters["updateSceneExecution"]): AquaStatus;
|
|
136
157
|
}
|
|
137
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
|
+
|
|
138
167
|
declare type ClientInit = {
|
|
139
168
|
engine: Engine;
|
|
140
169
|
context?: AquaContextHandle;
|
|
@@ -184,6 +213,7 @@ declare class Engine {
|
|
|
184
213
|
readonly DrMap: 0;
|
|
185
214
|
readonly ReflMesh: 1;
|
|
186
215
|
readonly GlassMesh: 2;
|
|
216
|
+
readonly RenderAsPointCloud: 3;
|
|
187
217
|
};
|
|
188
218
|
static FeatureState: {
|
|
189
219
|
readonly NotLoaded: 0;
|
|
@@ -191,11 +221,28 @@ declare class Engine {
|
|
|
191
221
|
readonly Loaded: 2;
|
|
192
222
|
readonly Failed: 3;
|
|
193
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
|
+
};
|
|
194
236
|
readonly ready: Promise<this>;
|
|
195
237
|
readonly pending: boolean;
|
|
196
238
|
get module(): MainModule;
|
|
197
239
|
constructor(moduleOptions?: Record<string, unknown>);
|
|
198
240
|
get AttributeInfo(): new () => AttributeInfo;
|
|
241
|
+
get CompressionType(): {
|
|
242
|
+
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
243
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE: unknown;
|
|
244
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE_V2: unknown;
|
|
245
|
+
};
|
|
199
246
|
get Handedness(): {
|
|
200
247
|
Right: number;
|
|
201
248
|
Left: number;
|
|
@@ -216,6 +263,7 @@ declare class Engine {
|
|
|
216
263
|
Y: number;
|
|
217
264
|
Z: number;
|
|
218
265
|
};
|
|
266
|
+
get UsePadding(): boolean;
|
|
219
267
|
activatedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
220
268
|
addStreamById(...args: [
|
|
221
269
|
handle: AquaClientHandle,
|
|
@@ -233,6 +281,7 @@ declare class Engine {
|
|
|
233
281
|
deactivatedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
234
282
|
remaskedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
235
283
|
getDrawnOctantMask(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
284
|
+
getOctantLocalBoundingBoxes(...args: [handle: AquaClientHandle, sceneObjectId: number]): number[];
|
|
236
285
|
destroyClient(...args: [handle: AquaClientHandle]): AquaStatus;
|
|
237
286
|
free(...args: [size: number]): number;
|
|
238
287
|
getAssetsAsync(...args: [handle: AquaClientHandle, tags: StringVector]): AssetInfo[];
|
|
@@ -251,6 +300,7 @@ declare class Engine {
|
|
|
251
300
|
getSceneChangesCounts(...args: [handle: AquaClientHandle, sceneChangeIds: SceneChangeIds]): void;
|
|
252
301
|
getSceneMetadata(...args: [handle: AquaClientHandle, metadata: SceneMetadata]): number;
|
|
253
302
|
getSceneObjectParent(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
303
|
+
getStreamStatus(...args: [handle: AquaClientHandle, streamObjectId: number]): StreamStatus;
|
|
254
304
|
getSceneObjectType(...args: [handle: AquaClientHandle, sceneObjectId: number]): SceneObjectType;
|
|
255
305
|
getLocalTransform(...args: [
|
|
256
306
|
handle: AquaClientHandle,
|
|
@@ -302,8 +352,11 @@ declare class Engine {
|
|
|
302
352
|
farPlane: number,
|
|
303
353
|
viewportHeightPixels: number
|
|
304
354
|
]): AquaStatus;
|
|
355
|
+
setStreamFetchMode(...args: [handle: AquaClientHandle, streamObjectId: number, mode: number]): boolean;
|
|
356
|
+
getStreamFetchMode(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
305
357
|
setMaxCacheSize(...args: [maxSizeBytes: number]): void;
|
|
306
358
|
setPreferSharkEncodingProfiles(...args: [preferShark: boolean]): void;
|
|
359
|
+
setPadSplatAttributes(usePadding: boolean): void;
|
|
307
360
|
setSceneObjectTransform(...args: [
|
|
308
361
|
handle: AquaClientHandle,
|
|
309
362
|
sceneObjectId: number,
|
|
@@ -332,9 +385,16 @@ declare class Engine {
|
|
|
332
385
|
* displayed frame per context, before the per-client updateSceneExecution() calls.
|
|
333
386
|
* `previousFrameTimeMs` is how long the previous frame took; pass 0 when there is no plausible
|
|
334
387
|
* measurement (first frame, or a resume from a stall) and the frame advances without recording
|
|
335
|
-
*
|
|
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.
|
|
336
391
|
*/
|
|
337
|
-
beginFrame(...args: [
|
|
392
|
+
beginFrame(...args: [
|
|
393
|
+
contextHandle: AquaContextHandle,
|
|
394
|
+
previousFrameTimeMs: number,
|
|
395
|
+
primsResident: number,
|
|
396
|
+
primCapacity: number
|
|
397
|
+
]): AquaStatus;
|
|
338
398
|
createDeserializeWorker(_url: string, _workerUrl: string, poolSize: number): boolean;
|
|
339
399
|
cancelRequest(requestIdLow: number, requestIdHigh: number): boolean;
|
|
340
400
|
submitToWorker(requestIdLow: number, requestIdHigh: number, descriptorBuffer: ArrayBuffer, contextPtr: number): boolean;
|
|
@@ -348,6 +408,52 @@ declare type EngineMethodParameters<E extends Engine = Engine> = {
|
|
|
348
408
|
[Key in keyof E]: E[Key] extends (...args: any[]) => any ? Parameters<E[Key]> : never;
|
|
349
409
|
};
|
|
350
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
|
+
|
|
351
457
|
export declare class Lod {
|
|
352
458
|
#private;
|
|
353
459
|
readonly id: LodInit["id"];
|
|
@@ -378,10 +484,14 @@ export declare class Lod {
|
|
|
378
484
|
get transform(): Float32Array<ArrayBuffer> | null;
|
|
379
485
|
get _drawnOctantMask(): number;
|
|
380
486
|
set _drawnOctantMask(mask: number);
|
|
487
|
+
get _octantLocalBounds(): Float32Array<ArrayBuffer> | null;
|
|
488
|
+
set _octantLocalBounds(bounds: Float32Array<ArrayBuffer> | null);
|
|
381
489
|
get _octantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
382
490
|
get _hasOctantOffsets(): boolean;
|
|
383
491
|
get _surfelOctantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
384
492
|
get _surfelCount(): number;
|
|
493
|
+
get _surfelOwnerGroups(): Uint32Array<ArrayBuffer> | null;
|
|
494
|
+
get _octantCell(): Uint32Array<ArrayBuffer> | null;
|
|
385
495
|
_readOctantOffsets(engine: Engine): void;
|
|
386
496
|
hasAttribute(attributeName: string): boolean;
|
|
387
497
|
getDataFromAttribute(engine: Engine, attributeName: string, attributeInfo: AttributeInfo): CachedAttribute | null;
|
|
@@ -409,8 +519,13 @@ export declare class LodStore {
|
|
|
409
519
|
deleteId(id: number): void;
|
|
410
520
|
}
|
|
411
521
|
|
|
412
|
-
declare interface MainModule {
|
|
522
|
+
declare interface MainModule extends SharkModule {
|
|
413
523
|
AttributeInfo: new () => AttributeInfo;
|
|
524
|
+
CompressionType: {
|
|
525
|
+
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
526
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE: unknown;
|
|
527
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE_V2: unknown;
|
|
528
|
+
};
|
|
414
529
|
Handedness: { Right: number; Left: number };
|
|
415
530
|
HEAPF32: Float32Array<ArrayBuffer>;
|
|
416
531
|
HEAPU8: Uint8Array<ArrayBuffer>;
|
|
@@ -439,6 +554,7 @@ declare interface MainModule {
|
|
|
439
554
|
remaskedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
440
555
|
deletedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
441
556
|
GetDrawnOctantMask(handle: number, sceneObjectId: number): number;
|
|
557
|
+
GetOctantLocalBoundingBoxes(handle: number, sceneObjectId: number): number[];
|
|
442
558
|
GetAssetsAsync(handle: number, tags: StringVector): unknown[];
|
|
443
559
|
GetSceneChanges(handle: number, sceneChangeIds: SceneChangeIds): void;
|
|
444
560
|
GetSceneChangesCounts(handle: number, sceneChangeIds: SceneChangeIds): void;
|
|
@@ -451,10 +567,17 @@ declare interface MainModule {
|
|
|
451
567
|
GetDrMapLadderRoughnessLevels(handle: number, sceneObjectId: number): number[];
|
|
452
568
|
SetClientSpatialFormat(handle: number, spatialFormat: SpatialFormat): { value: number };
|
|
453
569
|
SetRuntimeSettings(handle: number, settings: RuntimeSettings): { value: number };
|
|
570
|
+
SetStreamFetchMode(handle: number, streamObjectId: number, mode: number): boolean;
|
|
571
|
+
GetStreamFetchMode(handle: number, streamObjectId: number): number;
|
|
454
572
|
TakeEvictedClientSideAttributeIds(handle: number): EmbindVector<bigint>;
|
|
455
573
|
GetActiveClientSideIdsCheckSum(): number;
|
|
456
574
|
TakeRenderRequired(handle: number): boolean;
|
|
457
|
-
BeginFrame(
|
|
575
|
+
BeginFrame(
|
|
576
|
+
contextHandle: number,
|
|
577
|
+
previousFrameTimeMs: number,
|
|
578
|
+
primsResident: number,
|
|
579
|
+
primCapacity: number,
|
|
580
|
+
): number;
|
|
458
581
|
modifiedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
459
582
|
setMaxCacheSize(maxSizeBytes: number): void;
|
|
460
583
|
SetPreferSharkEncodingProfiles(prefer: boolean): void;
|
|
@@ -496,15 +619,20 @@ export declare class Miris {
|
|
|
496
619
|
static readonly _XR_TARGET_FRAME_RATE = 43;
|
|
497
620
|
/* Excluded from this release type: _XR_SPLAT_COUNT_BUDGET */
|
|
498
621
|
/* Excluded from this release type: _SHARK_SPLAT_CAPACITY_MOBILE */
|
|
499
|
-
static readonly _SHARK_SPLAT_CAPACITY_DESKTOP
|
|
622
|
+
static readonly _SHARK_SPLAT_CAPACITY_DESKTOP: number;
|
|
500
623
|
/* Excluded from this release type: _SHARK_SPLAT_BUDGET_CAP_MOBILE */
|
|
501
|
-
static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP =
|
|
624
|
+
static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP = 2400000;
|
|
502
625
|
/* Excluded from this release type: _isMobileDevice */
|
|
503
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 */
|
|
630
|
+
/* Excluded from this release type: _limitSharkSplatCapacity */
|
|
504
631
|
/* Excluded from this release type: _sharkSplatBudgetCap */
|
|
505
632
|
/* Excluded from this release type: _setTargetFrameRate */
|
|
506
633
|
/* Excluded from this release type: _setXRModeActive */
|
|
507
634
|
/* Excluded from this release type: _setSplatCountBudgetOverride */
|
|
635
|
+
/* Excluded from this release type: _reportRendererPrims */
|
|
508
636
|
/* Excluded from this release type: _update */
|
|
509
637
|
getLocalTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
510
638
|
getWorldTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
@@ -541,9 +669,9 @@ export declare type ModelRootInit = {
|
|
|
541
669
|
* The byte-exact counterpart of getRawUint32Attribute above: same no-padding, no-takeAttribute
|
|
542
670
|
* contract, returning bytes rather than words.
|
|
543
671
|
*
|
|
544
|
-
* Use this rather than that one wherever the stride is not a whole number of words:
|
|
545
|
-
*
|
|
546
|
-
* 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.
|
|
547
675
|
*/
|
|
548
676
|
export declare type RawByteAttributeWithBounds = {
|
|
549
677
|
bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -559,6 +687,72 @@ export declare type RawByteAttributeWithBounds = {
|
|
|
559
687
|
};
|
|
560
688
|
};
|
|
561
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
|
+
|
|
562
756
|
declare type RequestAnimationFrameFn = ((callback: FrameRequestCallback) => number) | ((callback: XRFrameRequestCallback) => void);
|
|
563
757
|
|
|
564
758
|
declare interface RuntimeSettings extends EmbindObject {
|
|
@@ -617,6 +811,8 @@ export declare class Scene extends EventTarget {
|
|
|
617
811
|
/* Excluded from this release type: _getDrMap */
|
|
618
812
|
/* Excluded from this release type: _onDrMapLadder */
|
|
619
813
|
/* Excluded from this release type: _onFeatureData */
|
|
814
|
+
/* Excluded from this release type: _applyStreamFetchModes */
|
|
815
|
+
/* Excluded from this release type: _updateStreamStatuses */
|
|
620
816
|
/* Excluded from this release type: _onSceneLoaded */
|
|
621
817
|
delete(stream: Stream): void;
|
|
622
818
|
close(): void;
|
|
@@ -640,12 +836,117 @@ declare interface SceneMetadata extends EmbindObject {
|
|
|
640
836
|
readonly inputColorSpace: string;
|
|
641
837
|
}
|
|
642
838
|
|
|
643
|
-
declare
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
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
|
+
}
|
|
647
947
|
|
|
648
|
-
|
|
948
|
+
/** @deprecated Use clientAttributeList. */
|
|
949
|
+
export declare const sparkAttributeList: Record<string, ClientAttributeInfo>;
|
|
649
950
|
|
|
650
951
|
declare interface SpatialFormat extends EmbindObject {
|
|
651
952
|
metersPerUnit: number;
|
|
@@ -654,6 +955,86 @@ declare interface SpatialFormat extends EmbindObject {
|
|
|
654
955
|
handedness: number;
|
|
655
956
|
}
|
|
656
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
|
+
|
|
657
1038
|
export declare class Stream extends EventTarget {
|
|
658
1039
|
#private;
|
|
659
1040
|
static readonly _idMap: Map<number, Stream>;
|
|
@@ -676,6 +1057,9 @@ export declare class Stream extends EventTarget {
|
|
|
676
1057
|
set matrix(matrix: Matrix4x4Tuple);
|
|
677
1058
|
get opacity(): number;
|
|
678
1059
|
set opacity(opacity: number);
|
|
1060
|
+
get fetchMode(): StreamFetchMode;
|
|
1061
|
+
set fetchMode(fetchMode: StreamFetchMode);
|
|
1062
|
+
/* Excluded from this release type: _applyFetchMode */
|
|
679
1063
|
get boundingBox(): {
|
|
680
1064
|
min: {
|
|
681
1065
|
x: number;
|
|
@@ -708,11 +1092,23 @@ export declare class Stream extends EventTarget {
|
|
|
708
1092
|
/* Excluded from this release type: _onStreamLoaded */
|
|
709
1093
|
getDefaultCameraTransform(): Float32Array<ArrayBuffer> | null | undefined;
|
|
710
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 */
|
|
711
1098
|
/* Excluded from this release type: _onRootLoaded */
|
|
712
1099
|
add(modelRoot: ModelRoot): void;
|
|
713
1100
|
end(): void;
|
|
714
1101
|
}
|
|
715
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
|
+
|
|
716
1112
|
export declare type StreamInit = {
|
|
717
1113
|
uuid: string;
|
|
718
1114
|
scene: Scene;
|
|
@@ -722,6 +1118,10 @@ export declare type StreamInit = {
|
|
|
722
1118
|
|
|
723
1119
|
declare type StringVector = EmbindVector<string>;
|
|
724
1120
|
|
|
1121
|
+
declare interface TextureFormatValue {
|
|
1122
|
+
value: number;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
725
1125
|
/** Recursive variant tree node from WASM. */
|
|
726
1126
|
export declare type VariantNode = {
|
|
727
1127
|
id: number;
|
|
@@ -732,4 +1132,18 @@ export declare type VariantNode = {
|
|
|
732
1132
|
nestedSets?: VariantNode[];
|
|
733
1133
|
};
|
|
734
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
|
+
|
|
735
1149
|
export { }
|