@miris-inc/core 0.0.8-e627096 → 0.0.8-e68f11f

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miris-inc/core",
3
- "version": "0.0.8-e627096",
3
+ "version": "0.0.8-e68f11f",
4
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
5
  "keywords": [
6
6
  "3d",
package/webshark.d.ts CHANGED
@@ -5,6 +5,9 @@ export interface Camera {
5
5
  eye: vec4;
6
6
  l: number;
7
7
  fov: number;
8
+ zNear: number;
9
+ zFar: number;
10
+ delete(): void;
8
11
  }
9
12
 
10
13
  export interface SortTypeValue {
@@ -31,9 +34,11 @@ export interface RendererWGPU {
31
34
  getEstimatedTextureSize(): number;
32
35
  getTotalBufferSize(): number;
33
36
  info: SharkInfo;
37
+ delete(): void;
34
38
  }
35
39
 
36
40
  export interface RenderState {
41
+ delete(): void;
37
42
  initRenderState(
38
43
  renderer: RendererWGPU,
39
44
  width: number,
@@ -69,9 +74,12 @@ export interface RenderState {
69
74
  // the last uploadSplatSetData declared. Pass SplatSet.hasReflectionParams().
70
75
  uploadReflectionLadderParams(reflectionsEnabled: boolean): void;
71
76
  // Debug controls. Drop the reflection term, or replace the surfel colour with one of the layers
72
- // it is shaded from (0 off, 1 world normals, 2 reflectance, 3 roughness, 4 reflection,
73
- // 6 base colour, 18 surfel index).
77
+ // it is shaded from, numbered as RenderViewModes.h's AOV_* defines. setRenderView below sets
78
+ // the AOV together with the rest of a named view.
74
79
  setReflectionsEnabled(enabled: boolean): void;
80
+ // Render textured gaussians on pixels no surfel covers, resolved as fvdb's open gate does.
81
+ // Off by default: those pixels show the clear colour.
82
+ setSurfelLessTextureSplatsEnabled(enabled: boolean): void;
75
83
  setDebugAovMode(mode: number): void;
76
84
  }
77
85
 
@@ -123,6 +131,15 @@ export interface SplatSet {
123
131
  modelRootInverseTransformsView(): Float32Array;
124
132
  // Sized by resizeChunkFades. Defaults to slot 0 (identity) for every chunk
125
133
  chunkModelRootsView(): Int32Array;
134
+ // resizeModelRootSlots resets every slot to the absolute decode. False for a slot outside the table
135
+ setModelRootRootRelativeDecode(
136
+ slot: number,
137
+ originX: number,
138
+ originY: number,
139
+ originZ: number,
140
+ step: number,
141
+ lnScaleOffset: number,
142
+ ): boolean;
126
143
  // int32 render-order buffer (sized 2*splatCount after finalize). Valid only until the next resize.
127
144
  orderingView(): Int32Array;
128
145
  finalize(): void;
@@ -132,11 +149,13 @@ export interface SplatSet {
132
149
  // Whether the asset carries per-surfel reflectance records, which is what decides whether
133
150
  // reflections are shaded at all. Pass to RenderState.uploadReflectionLadderParams.
134
151
  hasReflectionParams(): boolean;
135
- // Widens packed 26-byte reflectanceDataV1 records into the per-splat GPU records at
136
- // bufferOffset. wirePtr must address THIS module's heap - _malloc here and copy the bytes in,
137
- // since the attribute lives in the engine module's. Records cover a node's surfel range, which
138
- // starts at its first splat. Returns the records written; 0 if the data was rejected.
152
+ // Widens packed reflectance records - recordVersion 2 for 18-byte reflectanceDataV2, 1 for
153
+ // 26-byte reflectanceDataV1 - into the per-splat GPU records at bufferOffset. wirePtr must
154
+ // address THIS module's heap - _malloc here and copy the bytes in, since the attribute lives in
155
+ // the engine module's. Records cover a node's surfel range, which starts at its first splat.
156
+ // Returns the records written; 0 if the data was rejected.
139
157
  decodeReflectionParams(
158
+ recordVersion: number,
140
159
  wirePtr: number,
141
160
  wireSizeBytes: number,
142
161
  elementCount: number,
@@ -149,6 +168,47 @@ export interface SplatSet {
149
168
  clearReflectionParams(startSplat: number, endSplat: number): void;
150
169
  // Splats in [0, count) holding a non-zero record. Diagnostic.
151
170
  populatedReflectionParamCount(count: number): number;
171
+ delete(): void;
172
+ }
173
+
174
+ export interface GlassMeshRegistry {
175
+ // Decodes one octree node's glass payload and registers it, replacing any previous entry for
176
+ // that object. False for a malformed or empty payload, leaving the registry unchanged.
177
+ //
178
+ // The two slot arguments are different numbers here, unlike on the native path, and swapping
179
+ // them renders glass that does not follow its asset: modelRootSlot scopes the panel dedupe to
180
+ // one asset instance, while chunkModelRootIndex is stamped into every vertex and read back as
181
+ // chunkModelRoots[pos.w], so that one takes the chunk's fade slot.
182
+ //
183
+ // geometryPtr/panelPtr address THIS module's heap - _malloc here and copy the bytes in, since
184
+ // the attributes live in the engine module's. The AABB is the geometry attribute's own range.
185
+ registerObject(
186
+ objectId: number,
187
+ lodIndex: number,
188
+ modelRootSlot: number,
189
+ chunkModelRootIndex: number,
190
+ geometryPtr: number,
191
+ geometryByteCount: number,
192
+ panelPtr: number,
193
+ panelByteCount: number,
194
+ aabbMinX: number,
195
+ aabbMinY: number,
196
+ aabbMinZ: number,
197
+ aabbMaxX: number,
198
+ aabbMaxY: number,
199
+ aabbMaxZ: number,
200
+ ): boolean;
201
+ // Returns true if the object had glass, which is what says the buffers need rebuilding.
202
+ removeObject(objectId: number): boolean;
203
+ clear(): void;
204
+ isDirty(): boolean;
205
+ // Rebuilds the flattened buffers, keeping each panel from its deepest resident LOD. Stays dirty
206
+ // so uploadIfDirty still fires. Walks every registered object, so not per frame.
207
+ flattenIfDirty(): void;
208
+ uploadIfDirty(renderState: RenderState): void;
209
+ vertexCount(): number;
210
+ panelCount(): number;
211
+ delete(): void;
152
212
  }
153
213
 
154
214
  export interface WebGPUInterface {
@@ -161,6 +221,7 @@ export interface MainModule {
161
221
  Camera: new () => Camera;
162
222
  RenderState: new () => RenderState;
163
223
  SplatSet: new () => SplatSet;
224
+ GlassMeshRegistry: new () => GlassMeshRegistry;
164
225
  vec4: new (x: number, y: number, z: number, w: number) => vec4;
165
226
 
166
227
  SortType: {
@@ -233,6 +294,8 @@ export interface MainModule {
233
294
  createRendererWGPUWithoutSurface(
234
295
  colorTargetFormat: TextureFormatValue,
235
296
  ): RendererWGPU;
297
+ /// Gives back the reference WebGPU.importJsTexture returned for a texture.
298
+ releaseImportedTexture(texture: number): void;
236
299
  renderSplatSetToSceneTextures(
237
300
  splatSet: SplatSet,
238
301
  renderState: RenderState,
@@ -240,6 +303,15 @@ export interface MainModule {
240
303
  depthTarget: number,
241
304
  renderGES: boolean,
242
305
  ): void;
306
+ // Render view registry, indexed as RenderViews.h orders it. setRenderView ignores an index
307
+ // Shark cannot produce.
308
+ setRenderView(viewIndex: number): void;
309
+ renderView(): number;
310
+ renderViewCount(): number;
311
+ renderViewName(viewIndex: number): string;
312
+ renderViewSupported(viewIndex: number): boolean;
313
+ // The next supported view, forwards for direction 1 and backwards for -1.
314
+ stepRenderView(from: number, direction: number): number;
243
315
  }
244
316
 
245
317
  declare function WebShark(