@miris-inc/core 0.0.8-e3d6727 → 0.0.8-e3fcc2a

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-e3d6727",
3
+ "version": "0.0.8-e3fcc2a",
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
@@ -56,6 +56,23 @@ export interface RenderState {
56
56
  height: number,
57
57
  splatTriangles: number,
58
58
  ): void;
59
+ // Decodes Radiance .hdr bytes into roughness-ladder level `level` (0 is the sharp mirror).
60
+ // hdrPtr must address THIS module's heap - _malloc here and copy the bytes in.
61
+ // Returns false for bytes that are not a usable Radiance image, or a level out of range.
62
+ uploadEnvironmentLadderLevelFromHdr(
63
+ level: number,
64
+ sigmaDeg: number,
65
+ hdrPtr: number,
66
+ hdrSizeBytes: number,
67
+ ): boolean;
68
+ // Republish the ladder's shape. Call after any level lands, or it is sampled at whatever shape
69
+ // the last uploadSplatSetData declared. Pass SplatSet.hasReflectionParams().
70
+ uploadReflectionLadderParams(reflectionsEnabled: boolean): void;
71
+ // 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).
74
+ setReflectionsEnabled(enabled: boolean): void;
75
+ setDebugAovMode(mode: number): void;
59
76
  }
60
77
 
61
78
  export interface vec4 {
@@ -83,6 +100,10 @@ export interface SplatSet {
83
100
  sh2View(): Uint32Array;
84
101
  sh3aView(): Uint32Array;
85
102
  sh3bView(): Uint32Array;
103
+ // mod_depth is a half-float per primitive slot (dense, padded for non-surfels), so this is a
104
+ // Uint16Array unlike every other view here -- do not address it with the uint32 splat strides
105
+ // used for ellipsoids/colors/sh*.
106
+ modDepthView(): Uint16Array;
86
107
  // Per-chunk fade (opacity multiplier), one float per chunk, defaults to 1.0.
87
108
  // Also sizes the chunk slot to model root slot map below, since both are indexed by chunk slot
88
109
  resizeChunkFades(chunkCount: number): void;
@@ -108,6 +129,26 @@ export interface SplatSet {
108
129
  // like finalize() but keeps splats in their delivered (octant-sorted) order — no kd-tree reorder —
109
130
  // so sparse-octant range masking can index child-octant ranges directly. RADIX_SORT only.
110
131
  finalizeBounds(): void;
132
+ // Whether the asset carries per-surfel reflectance records, which is what decides whether
133
+ // reflections are shaded at all. Pass to RenderState.uploadReflectionLadderParams.
134
+ 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.
139
+ decodeReflectionParams(
140
+ wirePtr: number,
141
+ wireSizeBytes: number,
142
+ elementCount: number,
143
+ bufferOffset: number,
144
+ nodeSplatCount: number,
145
+ logId: number,
146
+ ): number;
147
+ // Zeroes records in [startSplat, endSplat). Needed wherever splats are re-packed at fresh
148
+ // offsets, or a reused slot shades its splat from the previous occupant's material.
149
+ clearReflectionParams(startSplat: number, endSplat: number): void;
150
+ // Splats in [0, count) holding a non-zero record. Diagnostic.
151
+ populatedReflectionParamCount(count: number): number;
111
152
  }
112
153
 
113
154
  export interface WebGPUInterface {
@@ -157,6 +198,13 @@ export interface MainModule {
157
198
 
158
199
  WebGPU: WebGPUInterface;
159
200
 
201
+ // Emscripten runtime, exported by modules/shark/CMakeLists.txt. The pointer-taking bindings
202
+ // above address THIS heap, so bytes from the engine module have to be staged through it.
203
+ // HEAPU8 is replaced whenever the heap grows, so read it fresh rather than caching it.
204
+ _malloc(byteCount: number): number;
205
+ _free(ptr: number): void;
206
+ readonly HEAPU8: Uint8Array;
207
+
160
208
  uploadSplatSetData(
161
209
  set: SplatSet,
162
210
  renderState: RenderState,