@miris-inc/core 0.0.8-655ef21 → 0.0.8-65fc419
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/LICENSE +201 -0
- package/README.md +82 -0
- package/banner.svg +34 -0
- package/dist/AquaApi.wasm +0 -0
- package/dist/aqua-parser.wasm +0 -0
- package/dist/core.d.ts +698 -0
- package/dist/core.js +2304 -0
- package/dist/core.prod.js +1 -0
- package/dist/core.standalone.js +5947 -0
- package/dist/core.standalone.prod.js +1 -0
- package/package.json +56 -6
- package/webshark.d.ts +201 -0
- package/core.js +0 -6318
- package/icon-black.svg +0 -10
- package/icon-white.svg +0 -11
- package/social-card.png +0 -3
package/package.json
CHANGED
|
@@ -1,16 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miris-inc/core",
|
|
3
|
+
"version": "0.0.8-65fc419",
|
|
4
|
+
"description": "Core scene-graph runtime for the Miris 3D streaming SDK. WASM-backed Engine, Client, Scene, Stream, and LOD primitives shared by all higher-level packages.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"3d",
|
|
7
|
+
"3dgs",
|
|
8
|
+
"4dgs",
|
|
9
|
+
"gaussian-splatting",
|
|
10
|
+
"miris",
|
|
11
|
+
"splats",
|
|
12
|
+
"streaming",
|
|
13
|
+
"wasm"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://miris.com",
|
|
3
16
|
"license": "Apache-2.0",
|
|
4
|
-
"
|
|
17
|
+
"author": "Miris, Inc.",
|
|
18
|
+
"files": [
|
|
19
|
+
"banner.svg",
|
|
20
|
+
"webshark.d.ts",
|
|
21
|
+
"webshark.js",
|
|
22
|
+
"webshark.wasm",
|
|
23
|
+
"dist/*.js",
|
|
24
|
+
"dist/*.d.ts",
|
|
25
|
+
"dist/*.wasm",
|
|
26
|
+
"!dist/**/*.map"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"main": "./dist/core.prod.js",
|
|
31
|
+
"module": "./dist/core.prod.js",
|
|
32
|
+
"types": "./dist/core.d.ts",
|
|
33
|
+
"unpkg": "./dist/core.standalone.prod.js",
|
|
34
|
+
"jsdelivr": "./dist/core.standalone.prod.js",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"source": "./index.ts",
|
|
38
|
+
"types": "./dist/core.d.ts",
|
|
39
|
+
"development": "./dist/core.js",
|
|
40
|
+
"import": "./dist/core.prod.js",
|
|
41
|
+
"default": "./dist/core.prod.js"
|
|
42
|
+
},
|
|
43
|
+
"./webshark": {
|
|
44
|
+
"types": "./webshark.d.ts",
|
|
45
|
+
"default": "./webshark.js"
|
|
46
|
+
},
|
|
47
|
+
"./standalone": {
|
|
48
|
+
"types": "./dist/core.d.ts",
|
|
49
|
+
"development": "./dist/core.standalone.js",
|
|
50
|
+
"import": "./dist/core.standalone.prod.js",
|
|
51
|
+
"default": "./dist/core.standalone.prod.js"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
5
57
|
"scripts": {
|
|
6
58
|
"d": "bun dev",
|
|
7
59
|
"dev": "vite",
|
|
8
60
|
"b": "cd ../.. && vite build --mode packages/core",
|
|
9
61
|
"build": "cd ../.. && vite build --mode packages/core"
|
|
10
62
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
"version": "0.0.8-655ef21"
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=18"
|
|
65
|
+
}
|
|
16
66
|
}
|
package/webshark.d.ts
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
export interface Camera {
|
|
2
|
+
dir: vec4;
|
|
3
|
+
U: vec4;
|
|
4
|
+
V: vec4;
|
|
5
|
+
eye: vec4;
|
|
6
|
+
l: number;
|
|
7
|
+
fov: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SortTypeValue {
|
|
11
|
+
value: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TextureFormatValue {
|
|
15
|
+
value: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface SharkRenderInfo {
|
|
19
|
+
triangles: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SharkInfo {
|
|
23
|
+
renderCalls: number;
|
|
24
|
+
render: SharkRenderInfo;
|
|
25
|
+
reset(): void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface RendererWGPU {
|
|
29
|
+
getProgramCount(): number;
|
|
30
|
+
getTextureCount(): number;
|
|
31
|
+
getEstimatedTextureSize(): number;
|
|
32
|
+
getTotalBufferSize(): number;
|
|
33
|
+
info: SharkInfo;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface RenderState {
|
|
37
|
+
initRenderState(
|
|
38
|
+
renderer: RendererWGPU,
|
|
39
|
+
width: number,
|
|
40
|
+
height: number,
|
|
41
|
+
vertices: number,
|
|
42
|
+
splats: number,
|
|
43
|
+
cubes: number,
|
|
44
|
+
sortThreads: number,
|
|
45
|
+
sortGroupSize: number,
|
|
46
|
+
sortKeySize: number,
|
|
47
|
+
): void;
|
|
48
|
+
initGraphicsState(
|
|
49
|
+
width: number,
|
|
50
|
+
height: number,
|
|
51
|
+
renderTextureFormat: TextureFormatValue,
|
|
52
|
+
depthTextureFormat: TextureFormatValue,
|
|
53
|
+
): void;
|
|
54
|
+
updateRenderDetails(
|
|
55
|
+
width: number,
|
|
56
|
+
height: number,
|
|
57
|
+
splatTriangles: number,
|
|
58
|
+
): void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface vec4 {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
z: number;
|
|
65
|
+
w: number;
|
|
66
|
+
delete(): void;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface SplatSet {
|
|
70
|
+
splatCount: number;
|
|
71
|
+
// Number of splats actually drawn: ordering[0, activeSplats) holds the unmasked splat indices.
|
|
72
|
+
// Set alongside orderingView() to restrict the draw to unmasked octant ranges.
|
|
73
|
+
activeSplats: number;
|
|
74
|
+
// Selects which ellipsoid layout to allocate and what ellipsoidsView() exposes:
|
|
75
|
+
// packed (16 bytes/splat) or uncompressed (48). Must be set before the first resize.
|
|
76
|
+
usePackedEllipsoids: boolean;
|
|
77
|
+
// direct-write upload: resize -> write into the views -> finalize.
|
|
78
|
+
// views are valid only until the next resize.
|
|
79
|
+
resize(splatCount: number): void;
|
|
80
|
+
ellipsoidsView(): Uint32Array;
|
|
81
|
+
colorsView(): Uint32Array;
|
|
82
|
+
sh1View(): Uint32Array;
|
|
83
|
+
sh2View(): Uint32Array;
|
|
84
|
+
sh3aView(): Uint32Array;
|
|
85
|
+
sh3bView(): Uint32Array;
|
|
86
|
+
// Per-chunk fade (opacity multiplier), one float per chunk, defaults to 1.0.
|
|
87
|
+
// Also sizes the chunk slot to model root slot map below, since both are indexed by chunk slot
|
|
88
|
+
resizeChunkFades(chunkCount: number): void;
|
|
89
|
+
chunkFadesView(): Float32Array;
|
|
90
|
+
// Per-splat chunk index, defaults to slot 0. Write before finalize()
|
|
91
|
+
chunkIndicesView(): Int32Array;
|
|
92
|
+
// Model transforms, resolved per splat as
|
|
93
|
+
// modelRootTransforms[chunkModelRoots[chunkIndices[splat]]]
|
|
94
|
+
// Slot 0 of both tables is reserved as identity, so real slots start at 1 and a set that
|
|
95
|
+
// never writes them renders untransformed.
|
|
96
|
+
resizeModelRootSlots(modelRootCount: number): void;
|
|
97
|
+
// 16 floats per model root, COLUMN-major - i.e. write THREE's Matrix4.toArray() straight in
|
|
98
|
+
modelRootTransformsView(): Float32Array;
|
|
99
|
+
// The inverses, same slots and layout. The true-perspective projection (Project.glsl) transforms
|
|
100
|
+
// a quadratic form and needs them; writing a transform without its inverse leaves that path
|
|
101
|
+
// projecting the splat as if untransformed. Use Matrix4.invert() on a copy
|
|
102
|
+
modelRootInverseTransformsView(): Float32Array;
|
|
103
|
+
// Sized by resizeChunkFades. Defaults to slot 0 (identity) for every chunk
|
|
104
|
+
chunkModelRootsView(): Int32Array;
|
|
105
|
+
// int32 render-order buffer (sized 2*splatCount after finalize). Valid only until the next resize.
|
|
106
|
+
orderingView(): Int32Array;
|
|
107
|
+
finalize(): void;
|
|
108
|
+
// like finalize() but keeps splats in their delivered (octant-sorted) order — no kd-tree reorder —
|
|
109
|
+
// so sparse-octant range masking can index child-octant ranges directly. RADIX_SORT only.
|
|
110
|
+
finalizeBounds(): void;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface WebGPUInterface {
|
|
114
|
+
importJsAdapter(adapter: GPUAdapter, parentPtr?: number): number;
|
|
115
|
+
importJsDevice(device: GPUDevice, parentPtr?: number): number;
|
|
116
|
+
importJsTexture(obj: GPUTexture, parentPtr?: number): number;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface MainModule {
|
|
120
|
+
Camera: new () => Camera;
|
|
121
|
+
RenderState: new () => RenderState;
|
|
122
|
+
SplatSet: new () => SplatSet;
|
|
123
|
+
vec4: new (x: number, y: number, z: number, w: number) => vec4;
|
|
124
|
+
|
|
125
|
+
SortType: {
|
|
126
|
+
RADIX_SORT: SortTypeValue;
|
|
127
|
+
OCTREE_SORT: SortTypeValue;
|
|
128
|
+
KDTREE_SORT: SortTypeValue;
|
|
129
|
+
STD_SORT: SortTypeValue;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
TextureFormat: {
|
|
133
|
+
RGBA32_Float: TextureFormatValue;
|
|
134
|
+
RGBA16_Float: TextureFormatValue;
|
|
135
|
+
RG16_Float: TextureFormatValue;
|
|
136
|
+
RGBA32_UInt: TextureFormatValue;
|
|
137
|
+
RGBA32_SInt: TextureFormatValue;
|
|
138
|
+
RGBA16_UInt: TextureFormatValue;
|
|
139
|
+
RGBA16_SInt: TextureFormatValue;
|
|
140
|
+
RGBA8_UInt: TextureFormatValue;
|
|
141
|
+
RGBA8_SInt: TextureFormatValue;
|
|
142
|
+
RGBA8_UNorm: TextureFormatValue;
|
|
143
|
+
RGBA8_SNorm: TextureFormatValue;
|
|
144
|
+
RGBA16_UNorm: TextureFormatValue;
|
|
145
|
+
RGBA16_SNorm: TextureFormatValue;
|
|
146
|
+
BGRA8_UNorm: TextureFormatValue;
|
|
147
|
+
BC6HRGB_UFloat: TextureFormatValue;
|
|
148
|
+
BC6HRGB_Float: TextureFormatValue;
|
|
149
|
+
BC7RGBA_UNorm: TextureFormatValue;
|
|
150
|
+
BC7RGBA_UNormSrgb: TextureFormatValue;
|
|
151
|
+
BC3RGBA_UNorm: TextureFormatValue;
|
|
152
|
+
BC3RGBA_UNormSrgb: TextureFormatValue;
|
|
153
|
+
Depth16Unorm: TextureFormatValue;
|
|
154
|
+
Depth24Plus: TextureFormatValue;
|
|
155
|
+
Depth32Float: TextureFormatValue;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
WebGPU: WebGPUInterface;
|
|
159
|
+
|
|
160
|
+
uploadSplatSetData(
|
|
161
|
+
set: SplatSet,
|
|
162
|
+
renderState: RenderState,
|
|
163
|
+
start: number,
|
|
164
|
+
): void;
|
|
165
|
+
uploadChunkFades(set: SplatSet, renderState: RenderState): void;
|
|
166
|
+
// One mat4 per model root, so cheap enough to call every frame while an asset is moving
|
|
167
|
+
uploadModelRootTransforms(set: SplatSet, renderState: RenderState): void;
|
|
168
|
+
processSplatSet(
|
|
169
|
+
camera: Camera,
|
|
170
|
+
set: SplatSet,
|
|
171
|
+
renderState: RenderState,
|
|
172
|
+
width: number,
|
|
173
|
+
height: number,
|
|
174
|
+
triangles: number,
|
|
175
|
+
projectOnGPU: boolean,
|
|
176
|
+
cullEllipsoid: boolean,
|
|
177
|
+
useAffineApprox: boolean,
|
|
178
|
+
depthSortOnGPU: boolean,
|
|
179
|
+
useInvZ: boolean,
|
|
180
|
+
rasterizeWithCompute: boolean,
|
|
181
|
+
useSOGS: boolean,
|
|
182
|
+
sortType: SortTypeValue,
|
|
183
|
+
skipSort: boolean,
|
|
184
|
+
): number;
|
|
185
|
+
createRendererWGPUWithoutSurface(
|
|
186
|
+
colorTargetFormat: TextureFormatValue,
|
|
187
|
+
): RendererWGPU;
|
|
188
|
+
renderSplatSetToSceneTextures(
|
|
189
|
+
splatSet: SplatSet,
|
|
190
|
+
renderState: RenderState,
|
|
191
|
+
colorTarget: number,
|
|
192
|
+
depthTarget: number,
|
|
193
|
+
renderGES: boolean,
|
|
194
|
+
): void;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
declare function WebShark(
|
|
198
|
+
moduleArg?: Record<string, unknown>,
|
|
199
|
+
): Promise<MainModule>;
|
|
200
|
+
|
|
201
|
+
export default WebShark;
|