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