@miris-inc/core 0.0.8-1d4ce14 → 0.0.8-1db29d5
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 +385 -11
- package/dist/core.js +235 -70
- package/dist/core.prod.js +1 -1
- package/dist/core.standalone.js +3763 -2069
- package/dist/core.standalone.prod.js +1 -1
- package/package.json +1 -5
- package/dist/webshark.d.ts +0 -321
- package/dist/webshark.js +0 -2
- package/dist/webshark.wasm +0 -0
package/dist/AquaApi.wasm
CHANGED
|
Binary file
|
package/dist/aqua-parser.wasm
CHANGED
|
Binary file
|
package/dist/core.d.ts
CHANGED
|
@@ -70,6 +70,18 @@ export declare class Camera {
|
|
|
70
70
|
constructor({ aspect, fov, near, far, matrix, scene, viewportHeight, }: CameraInit);
|
|
71
71
|
}
|
|
72
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
|
+
|
|
73
85
|
export declare type CameraInit = {
|
|
74
86
|
aspect: number;
|
|
75
87
|
fov: number;
|
|
@@ -115,6 +127,7 @@ declare class Client {
|
|
|
115
127
|
getSceneObjectType(...args: ClientMethodParameters["getSceneObjectType"]): SceneObjectType;
|
|
116
128
|
getStreamStatus(...args: ClientMethodParameters["getStreamStatus"]): StreamStatus;
|
|
117
129
|
getDrawnOctantMask(...args: ClientMethodParameters["getDrawnOctantMask"]): number;
|
|
130
|
+
getOctantLocalBoundingBoxes(...args: ClientMethodParameters["getOctantLocalBoundingBoxes"]): number[];
|
|
118
131
|
getLocalTransform(...args: ClientMethodParameters["getLocalTransform"]): AquaStatus;
|
|
119
132
|
getWorldTransform(...args: ClientMethodParameters["getWorldTransform"]): AquaStatus;
|
|
120
133
|
hasAttribute(...args: ClientMethodParameters["hasAttribute"]): boolean;
|
|
@@ -124,6 +137,8 @@ declare class Client {
|
|
|
124
137
|
setAssetViewerKey(...args: ClientMethodParameters["setAssetViewerKey"]): AquaStatus;
|
|
125
138
|
setClientSpatialFormat(...args: ClientMethodParameters["setClientSpatialFormat"]): AquaStatus;
|
|
126
139
|
setRuntimeSettings(...args: ClientMethodParameters["setRuntimeSettings"]): AquaStatus;
|
|
140
|
+
setStreamFetchMode(...args: ClientMethodParameters["setStreamFetchMode"]): boolean;
|
|
141
|
+
getStreamFetchMode(...args: ClientMethodParameters["getStreamFetchMode"]): number;
|
|
127
142
|
setMainCameraTransform(...args: ClientMethodParameters["setMainCameraTransform"]): AquaStatus;
|
|
128
143
|
setMainCameraViewFrustum(...args: ClientMethodParameters["setMainCameraViewFrustum"]): AquaStatus;
|
|
129
144
|
setSceneObjectTransform(...args: ClientMethodParameters["setSceneObjectTransform"]): AquaStatus;
|
|
@@ -141,6 +156,14 @@ declare class Client {
|
|
|
141
156
|
updateSceneExecution(...args: ClientMethodParameters["updateSceneExecution"]): AquaStatus;
|
|
142
157
|
}
|
|
143
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
|
+
|
|
144
167
|
declare type ClientInit = {
|
|
145
168
|
engine: Engine;
|
|
146
169
|
context?: AquaContextHandle;
|
|
@@ -190,6 +213,7 @@ declare class Engine {
|
|
|
190
213
|
readonly DrMap: 0;
|
|
191
214
|
readonly ReflMesh: 1;
|
|
192
215
|
readonly GlassMesh: 2;
|
|
216
|
+
readonly RenderAsPointCloud: 3;
|
|
193
217
|
};
|
|
194
218
|
static FeatureState: {
|
|
195
219
|
readonly NotLoaded: 0;
|
|
@@ -204,6 +228,11 @@ declare class Engine {
|
|
|
204
228
|
readonly Ready: 3;
|
|
205
229
|
readonly Failed: 4;
|
|
206
230
|
};
|
|
231
|
+
static StreamFetchMode: {
|
|
232
|
+
readonly Regular: 0;
|
|
233
|
+
readonly Prefetch: 1;
|
|
234
|
+
readonly Parked: 2;
|
|
235
|
+
};
|
|
207
236
|
readonly ready: Promise<this>;
|
|
208
237
|
readonly pending: boolean;
|
|
209
238
|
get module(): MainModule;
|
|
@@ -234,6 +263,7 @@ declare class Engine {
|
|
|
234
263
|
Y: number;
|
|
235
264
|
Z: number;
|
|
236
265
|
};
|
|
266
|
+
get UsePadding(): boolean;
|
|
237
267
|
activatedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
238
268
|
addStreamById(...args: [
|
|
239
269
|
handle: AquaClientHandle,
|
|
@@ -251,6 +281,7 @@ declare class Engine {
|
|
|
251
281
|
deactivatedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
252
282
|
remaskedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
253
283
|
getDrawnOctantMask(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
284
|
+
getOctantLocalBoundingBoxes(...args: [handle: AquaClientHandle, sceneObjectId: number]): number[];
|
|
254
285
|
destroyClient(...args: [handle: AquaClientHandle]): AquaStatus;
|
|
255
286
|
free(...args: [size: number]): number;
|
|
256
287
|
getAssetsAsync(...args: [handle: AquaClientHandle, tags: StringVector]): AssetInfo[];
|
|
@@ -321,8 +352,11 @@ declare class Engine {
|
|
|
321
352
|
farPlane: number,
|
|
322
353
|
viewportHeightPixels: number
|
|
323
354
|
]): AquaStatus;
|
|
355
|
+
setStreamFetchMode(...args: [handle: AquaClientHandle, streamObjectId: number, mode: number]): boolean;
|
|
356
|
+
getStreamFetchMode(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
324
357
|
setMaxCacheSize(...args: [maxSizeBytes: number]): void;
|
|
325
358
|
setPreferSharkEncodingProfiles(...args: [preferShark: boolean]): void;
|
|
359
|
+
setPadSplatAttributes(usePadding: boolean): void;
|
|
326
360
|
setSceneObjectTransform(...args: [
|
|
327
361
|
handle: AquaClientHandle,
|
|
328
362
|
sceneObjectId: number,
|
|
@@ -351,9 +385,16 @@ declare class Engine {
|
|
|
351
385
|
* displayed frame per context, before the per-client updateSceneExecution() calls.
|
|
352
386
|
* `previousFrameTimeMs` is how long the previous frame took; pass 0 when there is no plausible
|
|
353
387
|
* measurement (first frame, or a resume from a stall) and the frame advances without recording
|
|
354
|
-
*
|
|
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.
|
|
355
391
|
*/
|
|
356
|
-
beginFrame(...args: [
|
|
392
|
+
beginFrame(...args: [
|
|
393
|
+
contextHandle: AquaContextHandle,
|
|
394
|
+
previousFrameTimeMs: number,
|
|
395
|
+
primsResident: number,
|
|
396
|
+
primCapacity: number
|
|
397
|
+
]): AquaStatus;
|
|
357
398
|
createDeserializeWorker(_url: string, _workerUrl: string, poolSize: number): boolean;
|
|
358
399
|
cancelRequest(requestIdLow: number, requestIdHigh: number): boolean;
|
|
359
400
|
submitToWorker(requestIdLow: number, requestIdHigh: number, descriptorBuffer: ArrayBuffer, contextPtr: number): boolean;
|
|
@@ -367,6 +408,46 @@ declare type EngineMethodParameters<E extends Engine = Engine> = {
|
|
|
367
408
|
[Key in keyof E]: E[Key] extends (...args: any[]) => any ? Parameters<E[Key]> : never;
|
|
368
409
|
};
|
|
369
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
|
+
|
|
370
451
|
export declare const HaveData = 2;
|
|
371
452
|
|
|
372
453
|
export declare const HaveMetadata = 1;
|
|
@@ -403,6 +484,8 @@ export declare class Lod {
|
|
|
403
484
|
get transform(): Float32Array<ArrayBuffer> | null;
|
|
404
485
|
get _drawnOctantMask(): number;
|
|
405
486
|
set _drawnOctantMask(mask: number);
|
|
487
|
+
get _octantLocalBounds(): Float32Array<ArrayBuffer> | null;
|
|
488
|
+
set _octantLocalBounds(bounds: Float32Array<ArrayBuffer> | null);
|
|
406
489
|
get _octantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
407
490
|
get _hasOctantOffsets(): boolean;
|
|
408
491
|
get _surfelOctantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
@@ -436,7 +519,7 @@ export declare class LodStore {
|
|
|
436
519
|
deleteId(id: number): void;
|
|
437
520
|
}
|
|
438
521
|
|
|
439
|
-
declare interface MainModule {
|
|
522
|
+
declare interface MainModule extends SharkModule {
|
|
440
523
|
AttributeInfo: new () => AttributeInfo;
|
|
441
524
|
CompressionType: {
|
|
442
525
|
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
@@ -471,6 +554,7 @@ declare interface MainModule {
|
|
|
471
554
|
remaskedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
472
555
|
deletedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
473
556
|
GetDrawnOctantMask(handle: number, sceneObjectId: number): number;
|
|
557
|
+
GetOctantLocalBoundingBoxes(handle: number, sceneObjectId: number): number[];
|
|
474
558
|
GetAssetsAsync(handle: number, tags: StringVector): unknown[];
|
|
475
559
|
GetSceneChanges(handle: number, sceneChangeIds: SceneChangeIds): void;
|
|
476
560
|
GetSceneChangesCounts(handle: number, sceneChangeIds: SceneChangeIds): void;
|
|
@@ -483,10 +567,17 @@ declare interface MainModule {
|
|
|
483
567
|
GetDrMapLadderRoughnessLevels(handle: number, sceneObjectId: number): number[];
|
|
484
568
|
SetClientSpatialFormat(handle: number, spatialFormat: SpatialFormat): { value: number };
|
|
485
569
|
SetRuntimeSettings(handle: number, settings: RuntimeSettings): { value: number };
|
|
570
|
+
SetStreamFetchMode(handle: number, streamObjectId: number, mode: number): boolean;
|
|
571
|
+
GetStreamFetchMode(handle: number, streamObjectId: number): number;
|
|
486
572
|
TakeEvictedClientSideAttributeIds(handle: number): EmbindVector<bigint>;
|
|
487
573
|
GetActiveClientSideIdsCheckSum(): number;
|
|
488
574
|
TakeRenderRequired(handle: number): boolean;
|
|
489
|
-
BeginFrame(
|
|
575
|
+
BeginFrame(
|
|
576
|
+
contextHandle: number,
|
|
577
|
+
previousFrameTimeMs: number,
|
|
578
|
+
primsResident: number,
|
|
579
|
+
primCapacity: number,
|
|
580
|
+
): number;
|
|
490
581
|
modifiedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
491
582
|
setMaxCacheSize(maxSizeBytes: number): void;
|
|
492
583
|
SetPreferSharkEncodingProfiles(prefer: boolean): void;
|
|
@@ -528,16 +619,20 @@ export declare class Miris {
|
|
|
528
619
|
static readonly _XR_TARGET_FRAME_RATE = 43;
|
|
529
620
|
/* Excluded from this release type: _XR_SPLAT_COUNT_BUDGET */
|
|
530
621
|
/* Excluded from this release type: _SHARK_SPLAT_CAPACITY_MOBILE */
|
|
531
|
-
static readonly _SHARK_SPLAT_CAPACITY_DESKTOP
|
|
622
|
+
static readonly _SHARK_SPLAT_CAPACITY_DESKTOP: number;
|
|
532
623
|
/* Excluded from this release type: _SHARK_SPLAT_BUDGET_CAP_MOBILE */
|
|
533
|
-
static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP =
|
|
624
|
+
static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP = 2400000;
|
|
534
625
|
/* Excluded from this release type: _isMobileDevice */
|
|
535
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 */
|
|
536
630
|
/* Excluded from this release type: _limitSharkSplatCapacity */
|
|
537
631
|
/* Excluded from this release type: _sharkSplatBudgetCap */
|
|
538
632
|
/* Excluded from this release type: _setTargetFrameRate */
|
|
539
633
|
/* Excluded from this release type: _setXRModeActive */
|
|
540
634
|
/* Excluded from this release type: _setSplatCountBudgetOverride */
|
|
635
|
+
/* Excluded from this release type: _reportRendererPrims */
|
|
541
636
|
/* Excluded from this release type: _update */
|
|
542
637
|
getLocalTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
543
638
|
getWorldTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
@@ -595,6 +690,69 @@ export declare type RawByteAttributeWithBounds = {
|
|
|
595
690
|
declare type ReadyState_2 = typeof HaveNothing | typeof HaveMetadata | typeof HaveData;
|
|
596
691
|
export { ReadyState_2 as ReadyState }
|
|
597
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
|
+
|
|
598
756
|
declare type RequestAnimationFrameFn = ((callback: FrameRequestCallback) => number) | ((callback: XRFrameRequestCallback) => void);
|
|
599
757
|
|
|
600
758
|
declare interface RuntimeSettings extends EmbindObject {
|
|
@@ -653,6 +811,7 @@ export declare class Scene extends EventTarget {
|
|
|
653
811
|
/* Excluded from this release type: _getDrMap */
|
|
654
812
|
/* Excluded from this release type: _onDrMapLadder */
|
|
655
813
|
/* Excluded from this release type: _onFeatureData */
|
|
814
|
+
/* Excluded from this release type: _applyStreamFetchModes */
|
|
656
815
|
/* Excluded from this release type: _updateStreamStatuses */
|
|
657
816
|
/* Excluded from this release type: _onSceneLoaded */
|
|
658
817
|
delete(stream: Stream): void;
|
|
@@ -677,12 +836,117 @@ declare interface SceneMetadata extends EmbindObject {
|
|
|
677
836
|
readonly inputColorSpace: string;
|
|
678
837
|
}
|
|
679
838
|
|
|
680
|
-
declare
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
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;
|
|
684
851
|
|
|
685
|
-
|
|
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
|
+
}
|
|
947
|
+
|
|
948
|
+
/** @deprecated Use clientAttributeList. */
|
|
949
|
+
export declare const sparkAttributeList: Record<string, ClientAttributeInfo>;
|
|
686
950
|
|
|
687
951
|
declare interface SpatialFormat extends EmbindObject {
|
|
688
952
|
metersPerUnit: number;
|
|
@@ -691,6 +955,86 @@ declare interface SpatialFormat extends EmbindObject {
|
|
|
691
955
|
handedness: number;
|
|
692
956
|
}
|
|
693
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
|
+
|
|
694
1038
|
export declare class Stream extends EventTarget {
|
|
695
1039
|
#private;
|
|
696
1040
|
static readonly _idMap: Map<number, Stream>;
|
|
@@ -713,6 +1057,9 @@ export declare class Stream extends EventTarget {
|
|
|
713
1057
|
set matrix(matrix: Matrix4x4Tuple);
|
|
714
1058
|
get opacity(): number;
|
|
715
1059
|
set opacity(opacity: number);
|
|
1060
|
+
get fetchMode(): StreamFetchMode;
|
|
1061
|
+
set fetchMode(fetchMode: StreamFetchMode);
|
|
1062
|
+
/* Excluded from this release type: _applyFetchMode */
|
|
716
1063
|
get boundingBox(): {
|
|
717
1064
|
min: {
|
|
718
1065
|
x: number;
|
|
@@ -753,6 +1100,15 @@ export declare class Stream extends EventTarget {
|
|
|
753
1100
|
end(): void;
|
|
754
1101
|
}
|
|
755
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
|
+
|
|
756
1112
|
export declare type StreamInit = {
|
|
757
1113
|
uuid: string;
|
|
758
1114
|
scene: Scene;
|
|
@@ -762,6 +1118,10 @@ export declare type StreamInit = {
|
|
|
762
1118
|
|
|
763
1119
|
declare type StringVector = EmbindVector<string>;
|
|
764
1120
|
|
|
1121
|
+
declare interface TextureFormatValue {
|
|
1122
|
+
value: number;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
765
1125
|
/** Recursive variant tree node from WASM. */
|
|
766
1126
|
export declare type VariantNode = {
|
|
767
1127
|
id: number;
|
|
@@ -772,4 +1132,18 @@ export declare type VariantNode = {
|
|
|
772
1132
|
nestedSets?: VariantNode[];
|
|
773
1133
|
};
|
|
774
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
|
+
|
|
775
1149
|
export { }
|