@kalyptos/narcissus 0.0.0 → 0.1.1
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/README.md +5 -0
- package/dist/cli/main.js +1 -1
- package/dist/{controls-5FaXzanr.js → controls-BCrDCO3z.js} +435 -379
- package/dist/element/index.js +1 -1
- package/dist/engine/gpu/buffers.d.ts +1 -0
- package/dist/engine/gpu/pool.d.ts +0 -1
- package/dist/engine/gpu/project.d.ts +1 -6
- package/dist/engine/gpu/sort.d.ts +1 -1
- package/dist/engine/plan/footprint.d.ts +4 -5
- package/dist/format/index.js +1 -1
- package/dist/{format-CxKTIugr.js → format-C3Vn0c2b.js} +75 -75
- package/dist/index.js +1 -1
- package/dist/{synthetic-BZcHRI1P.js → synthetic-BeGCzYIv.js} +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/{tools-DwOGah9N.js → tools-NykPVccD.js} +1 -1
- package/package.json +2 -2
package/dist/element/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export interface FrameBuffers {
|
|
|
5
5
|
uniforms: GPUBuffer;
|
|
6
6
|
/** counters and indirect args (WORK), then visible cluster ids */
|
|
7
7
|
work: GPUBuffer;
|
|
8
|
+
visible: GPUBuffer;
|
|
8
9
|
/** capacity Projected */
|
|
9
10
|
projected: GPUBuffer;
|
|
10
11
|
/** keys, values, keys', values': capacity u32 each */
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { Shade } from '../plugin.ts';
|
|
2
2
|
import { type FrameBuffers } from './buffers.ts';
|
|
3
3
|
import type { Pool } from './pool.ts';
|
|
4
|
-
/**
|
|
5
|
-
* one workgroup per visible cluster: decode, fade, sh1, shade hooks, project, drop what cannot
|
|
6
|
-
* show, append Projected with its key and value
|
|
7
|
-
*/
|
|
8
4
|
export declare class Project {
|
|
9
5
|
#private;
|
|
10
6
|
constructor(device: GPUDevice, pool: Pool, buffers: FrameBuffers);
|
|
@@ -13,6 +9,5 @@ export declare class Project {
|
|
|
13
9
|
shade: Shade;
|
|
14
10
|
slot: number;
|
|
15
11
|
}[]): void;
|
|
16
|
-
|
|
17
|
-
encode(encoder: GPUCommandEncoder, timestamps?: GPUComputePassTimestampWrites): void;
|
|
12
|
+
encode(encoder: GPUCommandEncoder, visible: number, timestamps?: GPUComputePassTimestampWrites): void;
|
|
18
13
|
}
|
|
@@ -8,6 +8,6 @@ export declare class Sort {
|
|
|
8
8
|
/** scratch bytes */
|
|
9
9
|
readonly bytes: number;
|
|
10
10
|
constructor(device: GPUDevice, buffers: FrameBuffers);
|
|
11
|
-
encode(encoder: GPUCommandEncoder, timestamps?: GPUComputePassTimestampWrites): void;
|
|
11
|
+
encode(encoder: GPUCommandEncoder, maxSplats: number, drawn: number, timestamps?: GPUComputePassTimestampWrites): void;
|
|
12
12
|
destroy(): void;
|
|
13
13
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export interface Footprint {
|
|
2
|
+
/** overlaps the viewport without the fringe */
|
|
3
|
+
shown: boolean;
|
|
2
4
|
/** unclipped projected area in pixels */
|
|
3
5
|
pixels: number;
|
|
4
6
|
/** 1 at the edges up to 16 at the centre */
|
|
@@ -6,8 +8,5 @@ export interface Footprint {
|
|
|
6
8
|
}
|
|
7
9
|
/** for a screen box in -1..1 coordinates */
|
|
8
10
|
export declare function centreWeight(left: number, right: number, bottom: number, top: number): number;
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
* tan(fov / 2); margin widens the screen (1.1 keeps a 10% fringe)
|
|
12
|
-
*/
|
|
13
|
-
export declare function footprint(box: ArrayLike<number>, m: ArrayLike<number>, width: number, height: number, tan: number, near: number, far: number, margin?: number, out?: Footprint): Footprint;
|
|
11
|
+
/** box shifted by origin into view m; tan is tan(fov / 2), margin widens the viewport */
|
|
12
|
+
export declare function footprint(box: ArrayLike<number>, m: ArrayLike<number>, width: number, height: number, tan: number, near: number, far: number, margin?: number, out?: Footprint, origin?: readonly [number, number, number]): Footprint;
|
package/dist/format/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { _ as BASE_PLANES, v as C0, y as C1, b as CHILD_BYTES, x as CLUSTER, S as COLOUR_WORDS, C as COL_CHANNELS, w as COL_HEADER, T as COL_MAGIC, E as DESCENDANT_BYTES, D as GEOMETRY_WORDS, O as IDX_HEADER, k as IDX_MAGIC, A as LEAF, j as PACK_MAGIC, M as PACK_TRAILER, N as PAGE_HEADER, P as PAGE_PARAMS, F as PAGE_SIDE, I as PARAMS, L as PLANES, R as PREFIX, z as ROW_BYTES, B as SH_COEFFS, V as VERSION, t as contentHash, n as decodePage, c as directory, g as inflate, u as namedUnits, i as pageHeader, o as parseCol, d as parseIdx, f as parseUnitPath, l as parseWorld, a as readSplat, p as rowAt, s as sampleCol, m as unitPath } from "../format-
|
|
1
|
+
export { _ as BASE_PLANES, v as C0, y as C1, b as CHILD_BYTES, x as CLUSTER, S as COLOUR_WORDS, C as COL_CHANNELS, w as COL_HEADER, T as COL_MAGIC, E as DESCENDANT_BYTES, D as GEOMETRY_WORDS, O as IDX_HEADER, k as IDX_MAGIC, A as LEAF, j as PACK_MAGIC, M as PACK_TRAILER, N as PAGE_HEADER, P as PAGE_PARAMS, F as PAGE_SIDE, I as PARAMS, L as PLANES, R as PREFIX, z as ROW_BYTES, B as SH_COEFFS, V as VERSION, t as contentHash, n as decodePage, c as directory, g as inflate, u as namedUnits, i as pageHeader, o as parseCol, d as parseIdx, f as parseUnitPath, l as parseWorld, a as readSplat, p as rowAt, s as sampleCol, m as unitPath } from "../format-C3Vn0c2b.js";
|
|
@@ -137,7 +137,7 @@ function F(e) {
|
|
|
137
137
|
}
|
|
138
138
|
//#endregion
|
|
139
139
|
//#region src/format/world.ts
|
|
140
|
-
var ee =
|
|
140
|
+
var ee = /* @__PURE__ */ new Set([
|
|
141
141
|
"version",
|
|
142
142
|
"crs",
|
|
143
143
|
"height",
|
|
@@ -160,7 +160,7 @@ function z(e, t) {
|
|
|
160
160
|
if (!Array.isArray(e) || e.length !== 2 || !e.every(Number.isFinite) || e[0] > e[1]) throw I(t);
|
|
161
161
|
return [e[0], e[1]];
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function te(e) {
|
|
164
164
|
let t = L(e, "an invalid root"), { level: n, e: r, n: i } = t;
|
|
165
165
|
if (!Number.isInteger(n) || !Number.isInteger(r) || !Number.isInteger(i) || n < 0) throw I("an invalid root");
|
|
166
166
|
let a = {
|
|
@@ -174,13 +174,13 @@ function ne(e) {
|
|
|
174
174
|
idx: s
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function ne(e) {
|
|
178
178
|
let t = e.split(/[?#]/)[0];
|
|
179
179
|
return t.slice(0, t.lastIndexOf("/") + 1);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function re(e) {
|
|
182
182
|
let t = L(e, "an unreadable world.json");
|
|
183
|
-
if (t.version !== 1
|
|
183
|
+
if (t.version !== 1) throw Error(`This world is version ${String(t.version)}; narcissus reads 1.`);
|
|
184
184
|
if (t.leaf !== 250) throw I(`${String(t.leaf)} m leaf units, not 250 m`);
|
|
185
185
|
if (!Array.isArray(t.roots) || t.roots.length === 0) throw I("no roots");
|
|
186
186
|
let n = L(t.extent, "no extent");
|
|
@@ -189,18 +189,18 @@ function ie(e) {
|
|
|
189
189
|
crs: R(t.crs, "no coordinate system"),
|
|
190
190
|
height: R(t.height, "no height datum"),
|
|
191
191
|
leaf: 250,
|
|
192
|
-
roots: t.roots.map(
|
|
192
|
+
roots: t.roots.map(te),
|
|
193
193
|
extent: {
|
|
194
194
|
e: z(n.e, "an invalid easting extent"),
|
|
195
195
|
n: z(n.n, "an invalid northing extent"),
|
|
196
196
|
h: z(n.h, "an invalid height extent")
|
|
197
197
|
},
|
|
198
|
-
extra: Object.fromEntries(Object.entries(t).filter(([e]) => !
|
|
198
|
+
extra: Object.fromEntries(Object.entries(t).filter(([e]) => !ee.has(e)))
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
//#endregion
|
|
202
202
|
//#region src/format/col.ts
|
|
203
|
-
async function
|
|
203
|
+
async function ie(e) {
|
|
204
204
|
let t = await O(e, o, ".col");
|
|
205
205
|
if (t.byteLength < 60) throw Error(".col header is cut off");
|
|
206
206
|
let n = t.getUint16(0, !0), r = 60 + 12 * n * n;
|
|
@@ -220,7 +220,7 @@ async function ae(e) {
|
|
|
220
220
|
values: i
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function ae(e, t, n, r) {
|
|
224
224
|
let { n: i, pitch: a, margin: o, values: s } = e, c = i - 1, l = Math.min(Math.max((t + o) / a - .5, 0), c), u = Math.min(Math.max((n + o) / a - .5, 0), c), d = Math.min(Math.floor(l), Math.max(c - 1, 0)), f = Math.min(Math.floor(u), Math.max(c - 1, 0)), p = Math.min(d + 1, c), m = Math.min(f + 1, c), h = l - d, g = u - f, _ = (1 - h) * (1 - g), v = h * (1 - g), y = (1 - h) * g, b = h * g, x = i * i;
|
|
225
225
|
for (let e = 0, t = 0; e < 12; e++, t += x) r[e] = s[t + f * i + d] * _ + s[t + f * i + p] * v + s[t + m * i + d] * y + s[t + m * i + p] * b;
|
|
226
226
|
return r;
|
|
@@ -228,20 +228,20 @@ function oe(e, t, n, r) {
|
|
|
228
228
|
//#endregion
|
|
229
229
|
//#region src/format/page.ts
|
|
230
230
|
var B = Float64Array.from({ length: 256 }, (e, t) => (t / 255 - .5) * Math.SQRT2);
|
|
231
|
-
function
|
|
231
|
+
function oe(e, t, n, r, i) {
|
|
232
232
|
let a = B[t], o = B[n], s = B[r];
|
|
233
233
|
i[e] = Math.sqrt(Math.max(0, 1 - a * a - o * o - s * s)), i[e > 0 ? 0 : 1] = a, i[e > 1 ? 1 : 2] = o, i[e > 2 ? 2 : 3] = s;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function se(e, t, n, r, i) {
|
|
236
236
|
let a = e[0], o = e[1], s = e[2], c = e[3], l = t * t, u = n * n, d = r * r, f = 1 - 2 * (s * s + c * c), p = 2 * (o * s - a * c), m = 2 * (o * c + a * s), h = 2 * (o * s + a * c), g = 1 - 2 * (o * o + c * c), _ = 2 * (s * c - a * o), v = 2 * (o * c - a * s), y = 2 * (s * c + a * o), b = 1 - 2 * (o * o + s * s);
|
|
237
237
|
i[0] = 3 * Math.sqrt(f * f * l + p * p * u + m * m * d), i[1] = 3 * Math.sqrt(h * h * l + g * g * u + _ * _ * d), i[2] = 3 * Math.sqrt(v * v * l + y * y * u + b * b * d);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function ce(e) {
|
|
240
240
|
if (e.length < 128) throw Error("page payload is shorter than its header");
|
|
241
241
|
return new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
let t =
|
|
243
|
+
function le(e) {
|
|
244
|
+
let t = ce(e), n = t.getUint32(0, !0), r = t.getUint16(16, !0), i = 128 + (17 + (r > 0 ? 2 : 0)) * n, a = i + r * 9;
|
|
245
245
|
if (e.length !== a) throw Error(`page payload holds ${e.length} bytes, its header needs ${a}`);
|
|
246
246
|
return {
|
|
247
247
|
view: t,
|
|
@@ -250,15 +250,15 @@ function ue(e) {
|
|
|
250
250
|
book: i
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function ue(e) {
|
|
254
254
|
return [
|
|
255
255
|
e.getUint32(4, !0),
|
|
256
256
|
e.getUint32(8, !0),
|
|
257
257
|
e.getUint32(12, !0)
|
|
258
258
|
];
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
let { view: n, count: r, k: i, book: a } =
|
|
260
|
+
function de(e, t) {
|
|
261
|
+
let { view: n, count: r, k: i, book: a } = le(e), o = /* @__PURE__ */ new Float32Array(27);
|
|
262
262
|
for (let e = 0; e < 27; e++) o[e] = n.getFloat32(20 + 4 * e, !0);
|
|
263
263
|
i === 0 && o.fill(0, C.shScale);
|
|
264
264
|
let s = new Uint32Array(r * 4), c = new Float32Array(Math.ceil(r / 256) * 6), l = /* @__PURE__ */ new Float64Array(768);
|
|
@@ -273,7 +273,7 @@ function fe(e, t) {
|
|
|
273
273
|
let t = e[p + n] | e[p + r + n] << 8;
|
|
274
274
|
x = x + (t >>> 1 ^ -(t & 1)) & 65535, t = e[p + 2 * r + n] | e[p + 3 * r + n] << 8, S = S + (t >>> 1 ^ -(t & 1)) & 65535, t = e[p + 4 * r + n] | e[p + 5 * r + n] << 8, w = w + (t >>> 1 ^ -(t & 1)) & 65535;
|
|
275
275
|
let c = e[h + n], E = e[g + n], D = e[g + r + n], O = e[g + 2 * r + n], k = e[v + n], A = e[v + r + n], j = e[v + 2 * r + n], M = n * 4;
|
|
276
|
-
s[M] = x | S << 16, s[M + 1] = w | e[m + n] << 16 | c << 24, s[M + 2] = E | D << 8 | O << 16 | k << 24, s[M + 3] = A | j << 8,
|
|
276
|
+
s[M] = x | S << 16, s[M + 1] = w | e[m + n] << 16 | c << 24, s[M + 2] = E | D << 8 | O << 16 | k << 24, s[M + 3] = A | j << 8, oe(c, E, D, O, y), se(y, l[k], l[256 + A], l[512 + j], b);
|
|
277
277
|
let N = x * u, P = S * d, F = w * f;
|
|
278
278
|
i = Math.min(i, N - b[0]), a = Math.min(a, P - b[1]), o = Math.min(o, F - b[2]), _ = Math.max(_, N + b[0]), C = Math.max(C, P + b[1]), T = Math.max(T, F + b[2]);
|
|
279
279
|
}
|
|
@@ -286,17 +286,17 @@ function fe(e, t) {
|
|
|
286
286
|
T
|
|
287
287
|
], t * 6);
|
|
288
288
|
}
|
|
289
|
-
let T = t ?
|
|
289
|
+
let T = t ? pe(e, r, i, a, s, o, t) : fe(e, r, i, a);
|
|
290
290
|
return {
|
|
291
291
|
count: r,
|
|
292
|
-
quadrants:
|
|
292
|
+
quadrants: ue(n),
|
|
293
293
|
geometry: s,
|
|
294
294
|
colour: T,
|
|
295
295
|
params: o,
|
|
296
296
|
clusters: c
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function fe(e, t, n, r) {
|
|
300
300
|
let i = new Uint32Array(t * 3), a = 128 + _.dc * t, o = 128 + _.label * t;
|
|
301
301
|
for (let s = 0; s < t; s++) {
|
|
302
302
|
let c = s * 3;
|
|
@@ -306,7 +306,7 @@ function pe(e, t, n, r) {
|
|
|
306
306
|
}
|
|
307
307
|
return i;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function pe(t, n, r, i, a, o, s) {
|
|
310
310
|
let c = 128 + _.dc * n, l = 128 + _.label * n, u = new Int8Array(t.buffer, t.byteOffset + i, r * 9), d = new Float32Array(n * 3), f = new Float32Array(n * 9), p = [
|
|
311
311
|
Infinity,
|
|
312
312
|
Infinity,
|
|
@@ -324,7 +324,7 @@ function me(t, n, r, i, a, o, s) {
|
|
|
324
324
|
for (let e = 0; e < r * 9; e++) w[e] = u[e] / 127 * o[C.shScale + e % 9];
|
|
325
325
|
for (let i = 0; i < n; i++) {
|
|
326
326
|
let o = a[i * 4];
|
|
327
|
-
|
|
327
|
+
ae(s, v + (o & 65535) * b, y + (o >>> 16) * x, g);
|
|
328
328
|
for (let r = 0; r < 3; r++) {
|
|
329
329
|
let a = i * 3 + r;
|
|
330
330
|
d[a] = S[r * 256 + t[c + r * n + i]] + g[r] / e, p[r] = Math.min(p[r], d[a]), m[r] = Math.max(m[r], d[a]);
|
|
@@ -362,11 +362,11 @@ function me(t, n, r, i, a, o, s) {
|
|
|
362
362
|
}
|
|
363
363
|
return O;
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
let t =
|
|
365
|
+
function me(e) {
|
|
366
|
+
let t = ce(e);
|
|
367
367
|
return {
|
|
368
368
|
count: t.getUint32(0, !0),
|
|
369
|
-
quadrants:
|
|
369
|
+
quadrants: ue(t)
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
372
|
function V(e) {
|
|
@@ -376,13 +376,13 @@ function V(e) {
|
|
|
376
376
|
e(2)
|
|
377
377
|
];
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function he(t, n) {
|
|
380
380
|
let r = t.params, i = t.geometry.subarray(n * 4, (n + 1) * 4), a = t.colour.subarray(n * 3, (n + 1) * 3), o = (e, t) => e[t >> 2] >>> 8 * (t & 3) & 255, s = (e, t, n, i) => r[e + n] + i / 255 * (r[t + n] - r[e + n]), c = [
|
|
381
381
|
i[0] & 65535,
|
|
382
382
|
i[0] >>> 16,
|
|
383
383
|
i[1] & 65535
|
|
384
384
|
], l = /* @__PURE__ */ new Float64Array(4);
|
|
385
|
-
|
|
385
|
+
oe(o(i, 7), o(i, 8), o(i, 9), o(i, 10), l);
|
|
386
386
|
let u = [];
|
|
387
387
|
for (let e = 0; e < 9; e++) u.push((o(a, e + 3) << 24 >> 24) / 127 * r[C.shScale + e]);
|
|
388
388
|
return {
|
|
@@ -401,7 +401,7 @@ function ge(t, n) {
|
|
|
401
401
|
}
|
|
402
402
|
//#endregion
|
|
403
403
|
//#region node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/utils.js
|
|
404
|
-
function
|
|
404
|
+
function ge(e) {
|
|
405
405
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in e && e.BYTES_PER_ELEMENT === 1;
|
|
406
406
|
}
|
|
407
407
|
var H = (e) => e ? `"${e}" ` : "";
|
|
@@ -411,27 +411,27 @@ function U(e, t = "") {
|
|
|
411
411
|
return e;
|
|
412
412
|
}
|
|
413
413
|
function W(e, t, n = "") {
|
|
414
|
-
if (
|
|
414
|
+
if (ge(e) && (t === void 0 || e.length === t)) return e;
|
|
415
415
|
t !== void 0 && U(t, "length");
|
|
416
|
-
let r =
|
|
416
|
+
let r = ge(e), i = t === void 0 ? "" : ` of length ${t}`, a = r ? `length=${e.length}` : `type=${typeof e}`, o = H(n) + "expected Uint8Array" + i + ", got " + a;
|
|
417
417
|
throw r ? RangeError(o) : TypeError(o);
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function _e(e) {
|
|
420
420
|
return Uint8Array.from(W(e));
|
|
421
421
|
}
|
|
422
|
-
var
|
|
422
|
+
var ve = (e, t) => {
|
|
423
423
|
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError((t === "object" ? "" : `"${t}" `) + "expected object, got type=" + typeof e);
|
|
424
|
-
},
|
|
425
|
-
|
|
424
|
+
}, ye = (e, t) => {
|
|
425
|
+
ve(e, t);
|
|
426
426
|
let n = Object.getPrototypeOf(e);
|
|
427
427
|
if (n !== Object.prototype && n !== null) throw TypeError(`"${t}" expected plain object`);
|
|
428
428
|
if (Object.hasOwn(e, "__proto__")) throw TypeError(`"${t}.__proto__" is not allowed`);
|
|
429
429
|
};
|
|
430
|
-
function
|
|
430
|
+
function be(e, t = !0) {
|
|
431
431
|
if (e.destroyed) throw Error("hash was destroyed");
|
|
432
432
|
if (t && e.finished) throw Error("digest() was already called");
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function xe(e, t) {
|
|
435
435
|
W(e, void 0, "output");
|
|
436
436
|
let n = t.outputLen;
|
|
437
437
|
if (!(e.length >= n)) throw RangeError("\"output\" expected length >= " + n);
|
|
@@ -442,34 +442,34 @@ function G(e) {
|
|
|
442
442
|
function K(...e) {
|
|
443
443
|
for (let t = 0; t < e.length; t++) e[t].fill(0);
|
|
444
444
|
}
|
|
445
|
-
var
|
|
446
|
-
function
|
|
445
|
+
var Se = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
446
|
+
function Ce(e) {
|
|
447
447
|
return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
|
|
448
448
|
}
|
|
449
|
-
var q =
|
|
450
|
-
function
|
|
451
|
-
for (let t = 0; t < e.length; t++) e[t] =
|
|
449
|
+
var q = Se ? (e) => e : (e) => Ce(e) >>> 0;
|
|
450
|
+
function we(e) {
|
|
451
|
+
for (let t = 0; t < e.length; t++) e[t] = Ce(e[t]);
|
|
452
452
|
return e;
|
|
453
453
|
}
|
|
454
|
-
var J =
|
|
455
|
-
function
|
|
456
|
-
if (W(e),
|
|
454
|
+
var J = Se ? (e) => e : we, Te = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", Ee = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
455
|
+
function De(e) {
|
|
456
|
+
if (W(e), Te) return e.toHex();
|
|
457
457
|
let t = "";
|
|
458
|
-
for (let n = 0; n < e.length; n++) t +=
|
|
458
|
+
for (let n = 0; n < e.length; n++) t += Ee[e[n]];
|
|
459
459
|
return t;
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
return
|
|
461
|
+
function Oe(e, t, n = "opts") {
|
|
462
|
+
return ye(e, "defaults"), t !== void 0 && ye(t, n), Object.assign(Object.create(null), e, t);
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function ke(e, t = {}) {
|
|
465
465
|
if (typeof e != "function") throw TypeError("\"hashCons\" expected function, got type=" + typeof e);
|
|
466
|
-
t =
|
|
466
|
+
t = Oe({}, t, "info");
|
|
467
467
|
let n = (t, n) => e(n).update(t).digest(), r = e(void 0);
|
|
468
468
|
return n.outputLen = r.outputLen, n.blockLen = r.blockLen, n.canXOF = r.canXOF, n.create = (t) => e(t), Object.assign(n, t), Object.freeze(n);
|
|
469
469
|
}
|
|
470
470
|
//#endregion
|
|
471
471
|
//#region node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/_blake.js
|
|
472
|
-
var
|
|
472
|
+
var Ae = /* @__PURE__ */ Uint8Array.from([
|
|
473
473
|
0,
|
|
474
474
|
1,
|
|
475
475
|
2,
|
|
@@ -726,15 +726,15 @@ var je = /* @__PURE__ */ Uint8Array.from([
|
|
|
726
726
|
14,
|
|
727
727
|
1,
|
|
728
728
|
9
|
|
729
|
-
]),
|
|
730
|
-
function
|
|
729
|
+
]), je = (e) => e / 2 ** 32 | 0, Me = (e) => e >>> 0, Ne = (e, t, n) => e >>> n | t << 32 - n, Pe = (e, t, n) => e << 32 - n | t >>> n, Fe = (e, t, n) => e << 64 - n | t >>> n - 32, Ie = (e, t, n) => e >>> n - 32 | t << 64 - n, Le = (e, t) => t, Re = (e, t) => e;
|
|
730
|
+
function Y(e, t, n, r) {
|
|
731
731
|
let i = (t >>> 0) + (r >>> 0);
|
|
732
732
|
return {
|
|
733
733
|
h: e + n + (i / 2 ** 32 | 0) | 0,
|
|
734
734
|
l: i | 0
|
|
735
735
|
};
|
|
736
736
|
}
|
|
737
|
-
var
|
|
737
|
+
var ze = (e, t, n) => (e >>> 0) + (t >>> 0) + (n >>> 0), Be = (e, t, n, r) => t + n + r + (e / 2 ** 32 | 0) | 0, X = /* @__PURE__ */ Uint32Array.from([
|
|
738
738
|
4089235720,
|
|
739
739
|
1779033703,
|
|
740
740
|
2227873595,
|
|
@@ -753,24 +753,24 @@ var Be = (e, t, n) => (e >>> 0) + (t >>> 0) + (n >>> 0), Ve = (e, t, n, r) => t
|
|
|
753
753
|
1541459225
|
|
754
754
|
]), Z = /* @__PURE__ */ new Uint32Array(32);
|
|
755
755
|
function Q(e, t, n, r, i, a) {
|
|
756
|
-
let o = i[a], s = i[a + 1], c = Z[2 * e], l = Z[2 * e + 1], u = Z[2 * t], d = Z[2 * t + 1], f = Z[2 * n], p = Z[2 * n + 1], m = Z[2 * r], h = Z[2 * r + 1], g =
|
|
757
|
-
l =
|
|
756
|
+
let o = i[a], s = i[a + 1], c = Z[2 * e], l = Z[2 * e + 1], u = Z[2 * t], d = Z[2 * t + 1], f = Z[2 * n], p = Z[2 * n + 1], m = Z[2 * r], h = Z[2 * r + 1], g = ze(c, u, o);
|
|
757
|
+
l = Be(g, l, d, s), c = g | 0;
|
|
758
758
|
let _ = h ^ l, v = m ^ c;
|
|
759
|
-
h = Le(_, v), m = Re(_, v), {h: p, l: f} =
|
|
759
|
+
h = Le(_, v), m = Re(_, v), {h: p, l: f} = Y(p, f, h, m), _ = d ^ p, v = u ^ f, d = Ne(_, v, 24), u = Pe(_, v, 24), Z[2 * e] = c, Z[2 * e + 1] = l, Z[2 * t] = u, Z[2 * t + 1] = d, Z[2 * n] = f, Z[2 * n + 1] = p, Z[2 * r] = m, Z[2 * r + 1] = h;
|
|
760
760
|
}
|
|
761
761
|
function $(e, t, n, r, i, a) {
|
|
762
|
-
let o = i[a], s = i[a + 1], c = Z[2 * e], l = Z[2 * e + 1], u = Z[2 * t], d = Z[2 * t + 1], f = Z[2 * n], p = Z[2 * n + 1], m = Z[2 * r], h = Z[2 * r + 1], g =
|
|
763
|
-
l =
|
|
762
|
+
let o = i[a], s = i[a + 1], c = Z[2 * e], l = Z[2 * e + 1], u = Z[2 * t], d = Z[2 * t + 1], f = Z[2 * n], p = Z[2 * n + 1], m = Z[2 * r], h = Z[2 * r + 1], g = ze(c, u, o);
|
|
763
|
+
l = Be(g, l, d, s), c = g | 0;
|
|
764
764
|
let _ = h ^ l, v = m ^ c;
|
|
765
|
-
h =
|
|
765
|
+
h = Ne(_, v, 16), m = Pe(_, v, 16), {h: p, l: f} = Y(p, f, h, m), _ = d ^ p, v = u ^ f, d = Fe(_, v, 63), u = Ie(_, v, 63), Z[2 * e] = c, Z[2 * e + 1] = l, Z[2 * t] = u, Z[2 * t + 1] = d, Z[2 * n] = f, Z[2 * n + 1] = p, Z[2 * r] = m, Z[2 * r + 1] = h;
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function Ve(e, t = {}, n, r, i) {
|
|
768
768
|
if (U(n), e <= 0 || e > n) throw Error("\"dkLen\" must be 1.." + n + ", got " + e);
|
|
769
769
|
let { key: a, salt: o, personalization: s } = t;
|
|
770
770
|
if (a !== void 0 && (a.length < 1 || a.length > n)) throw Error("\"key\" expected to be undefined or of length=1.." + n);
|
|
771
771
|
o !== void 0 && W(o, r, "salt"), s !== void 0 && W(s, i, "personalization");
|
|
772
772
|
}
|
|
773
|
-
var
|
|
773
|
+
var He = class {
|
|
774
774
|
buffer;
|
|
775
775
|
buffer32;
|
|
776
776
|
finished = !1;
|
|
@@ -784,7 +784,7 @@ var Ue = class {
|
|
|
784
784
|
U(e), U(t), this.blockLen = e, this.outputLen = t, this.buffer = new Uint8Array(e), this.buffer32 = G(this.buffer);
|
|
785
785
|
}
|
|
786
786
|
update(e) {
|
|
787
|
-
|
|
787
|
+
be(this), W(e);
|
|
788
788
|
let { blockLen: t, buffer: n, buffer32: r } = this, i = e.length, a = e.byteOffset, o = e.buffer;
|
|
789
789
|
for (let s = 0; s < i;) {
|
|
790
790
|
this.pos === t && (J(r), this.compress(r, 0, !1), J(r), this.pos = 0);
|
|
@@ -799,7 +799,7 @@ var Ue = class {
|
|
|
799
799
|
return this;
|
|
800
800
|
}
|
|
801
801
|
digestInto(e) {
|
|
802
|
-
if (
|
|
802
|
+
if (be(this), xe(e, this), e.byteOffset & 3) throw RangeError("\"output\" expected 4-byte aligned byteOffset, got " + e.byteOffset);
|
|
803
803
|
let { pos: t, buffer32: n } = this;
|
|
804
804
|
this.finished = !0, this.buffer.fill(0, t), J(n), this.compress(n, 0, !0), J(n);
|
|
805
805
|
let r = this.get(), i = e === this.buffer ? n : G(e), a = Math.floor(this.outputLen / 4);
|
|
@@ -822,7 +822,7 @@ var Ue = class {
|
|
|
822
822
|
clone() {
|
|
823
823
|
return this._cloneInto();
|
|
824
824
|
}
|
|
825
|
-
},
|
|
825
|
+
}, Ue = class extends He {
|
|
826
826
|
v0l = X[0] | 0;
|
|
827
827
|
v0h = X[1] | 0;
|
|
828
828
|
v1l = X[2] | 0;
|
|
@@ -840,18 +840,18 @@ var Ue = class {
|
|
|
840
840
|
v7l = X[14] | 0;
|
|
841
841
|
v7h = X[15] | 0;
|
|
842
842
|
constructor(e = {}) {
|
|
843
|
-
e =
|
|
843
|
+
e = Oe({}, e);
|
|
844
844
|
let t = e.dkLen === void 0 ? 64 : e.dkLen;
|
|
845
|
-
super(128, t),
|
|
845
|
+
super(128, t), Ve(t, e, 64, 16, 16);
|
|
846
846
|
let { key: n, personalization: r, salt: i } = e, a = 0;
|
|
847
847
|
if (n !== void 0 && (W(n, void 0, "key"), a = n.length), this.v0l ^= this.outputLen | a << 8 | 16842752, i !== void 0) {
|
|
848
848
|
W(i, void 0, "salt");
|
|
849
|
-
let e = G(
|
|
849
|
+
let e = G(_e(i));
|
|
850
850
|
this.v4l ^= q(e[0]), this.v4h ^= q(e[1]), this.v5l ^= q(e[2]), this.v5h ^= q(e[3]);
|
|
851
851
|
}
|
|
852
852
|
if (r !== void 0) {
|
|
853
853
|
W(r, void 0, "personalization");
|
|
854
|
-
let e = G(
|
|
854
|
+
let e = G(_e(r));
|
|
855
855
|
this.v6l ^= q(e[0]), this.v6h ^= q(e[1]), this.v7l ^= q(e[2]), this.v7h ^= q(e[3]);
|
|
856
856
|
}
|
|
857
857
|
if (n !== void 0) {
|
|
@@ -886,20 +886,20 @@ var Ue = class {
|
|
|
886
886
|
compress(e, t, n) {
|
|
887
887
|
let { v0l: r, v0h: i, v1l: a, v1h: o, v2l: s, v2h: c, v3l: l, v3h: u, v4l: d, v4h: f, v5l: p, v5h: m, v6l: h, v6h: g, v7l: _, v7h: v } = this;
|
|
888
888
|
Z[0] = r, Z[1] = i, Z[2] = a, Z[3] = o, Z[4] = s, Z[5] = c, Z[6] = l, Z[7] = u, Z[8] = d, Z[9] = f, Z[10] = p, Z[11] = m, Z[12] = h, Z[13] = g, Z[14] = _, Z[15] = v, Z.set(X, 16);
|
|
889
|
-
let y =
|
|
889
|
+
let y = Me(this.length), b = je(this.length);
|
|
890
890
|
Z[24] = X[8] ^ y, Z[25] = X[9] ^ b, n && (Z[28] = ~Z[28], Z[29] = ~Z[29]);
|
|
891
|
-
let x = 0, S =
|
|
891
|
+
let x = 0, S = Ae;
|
|
892
892
|
for (let n = 0; n < 12; n++) Q(0, 4, 8, 12, e, t + 2 * S[x++]), $(0, 4, 8, 12, e, t + 2 * S[x++]), Q(1, 5, 9, 13, e, t + 2 * S[x++]), $(1, 5, 9, 13, e, t + 2 * S[x++]), Q(2, 6, 10, 14, e, t + 2 * S[x++]), $(2, 6, 10, 14, e, t + 2 * S[x++]), Q(3, 7, 11, 15, e, t + 2 * S[x++]), $(3, 7, 11, 15, e, t + 2 * S[x++]), Q(0, 5, 10, 15, e, t + 2 * S[x++]), $(0, 5, 10, 15, e, t + 2 * S[x++]), Q(1, 6, 11, 12, e, t + 2 * S[x++]), $(1, 6, 11, 12, e, t + 2 * S[x++]), Q(2, 7, 8, 13, e, t + 2 * S[x++]), $(2, 7, 8, 13, e, t + 2 * S[x++]), Q(3, 4, 9, 14, e, t + 2 * S[x++]), $(3, 4, 9, 14, e, t + 2 * S[x++]);
|
|
893
893
|
this.v0l ^= Z[0] ^ Z[16], this.v0h ^= Z[1] ^ Z[17], this.v1l ^= Z[2] ^ Z[18], this.v1h ^= Z[3] ^ Z[19], this.v2l ^= Z[4] ^ Z[20], this.v2h ^= Z[5] ^ Z[21], this.v3l ^= Z[6] ^ Z[22], this.v3h ^= Z[7] ^ Z[23], this.v4l ^= Z[8] ^ Z[24], this.v4h ^= Z[9] ^ Z[25], this.v5l ^= Z[10] ^ Z[26], this.v5h ^= Z[11] ^ Z[27], this.v6l ^= Z[12] ^ Z[28], this.v6h ^= Z[13] ^ Z[29], this.v7l ^= Z[14] ^ Z[30], this.v7h ^= Z[15] ^ Z[31], K(Z);
|
|
894
894
|
}
|
|
895
895
|
destroy() {
|
|
896
896
|
this.destroyed = !0, K(this.buffer32), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
897
897
|
}
|
|
898
|
-
},
|
|
898
|
+
}, We = /* @__PURE__ */ ke((e) => new Ue(e));
|
|
899
899
|
//#endregion
|
|
900
900
|
//#region src/format/hash.ts
|
|
901
|
-
function
|
|
902
|
-
return
|
|
901
|
+
function Ge(e) {
|
|
902
|
+
return De(We(e, { dkLen: 8 }));
|
|
903
903
|
}
|
|
904
904
|
//#endregion
|
|
905
|
-
export { r as A, y as B, h as C, x as D, p as E, n as F, C as I, _ as L, l as M, g as N, u as O, w as P, c as R, S, o as T, s as V, v as _,
|
|
905
|
+
export { r as A, y as B, h as C, x as D, p as E, n as F, C as I, _ as L, l as M, g as N, u as O, w as P, c as R, S, o as T, s as V, v as _, he as a, f as b, ne as c, j as d, P as f, E as g, D as h, me as i, i as j, a as k, re as l, M as m, de as n, ie as o, A as p, se as r, ae as s, Ge as t, F as u, e as v, m as w, b as x, t as y, d as z };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./controls-
|
|
1
|
+
import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./controls-BCrDCO3z.js";
|
|
2
2
|
import { t as S } from "./ports-DZRKjdYD.js";
|
|
3
3
|
import { t as C } from "./http-DL7R39Nc.js";
|
|
4
4
|
//#region src/engine/plugins/grade.wgsl?raw
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as e, L as t, f as n, h as r, k as i, m as a, r as o, v as s } from "./format-
|
|
1
|
+
import { F as e, L as t, f as n, h as r, k as i, m as a, r as o, v as s } from "./format-C3Vn0c2b.js";
|
|
2
2
|
import { t as c } from "./ports-DZRKjdYD.js";
|
|
3
3
|
//#region src/format/encode.ts
|
|
4
4
|
var l = 5e-4, u = 2048, d = 256, f = (e, t, n) => Math.min(n, Math.max(t, e));
|
package/dist/tools/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as exportPly, r as info, o as openWorld, n as plySplat, i as probe, a as validate, s as walk } from "../tools-
|
|
1
|
+
export { t as exportPly, r as info, o as openWorld, n as plySplat, i as probe, a as validate, s as walk } from "../tools-NykPVccD.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, g as i, l as a, m as o, n as s, o as c, p as l, t as u, u as d, v as f } from "./format-
|
|
1
|
+
import { a as e, c as t, d as n, f as r, g as i, l as a, m as o, n as s, o as c, p as l, t as u, u as d, v as f } from "./format-C3Vn0c2b.js";
|
|
2
2
|
import { t as p } from "./ports-DZRKjdYD.js";
|
|
3
3
|
//#region src/tools/walk.ts
|
|
4
4
|
var m = 16;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalyptos/narcissus",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A WebGPU engine and tools for Guldmund Trees, streamed gaussian-splat scenes",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"repository": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
41
41
|
"@eslint/js": "^10.0.1",
|
|
42
42
|
"@noble/hashes": "^2.4.0",
|
|
43
|
-
"@types/node": "^
|
|
43
|
+
"@types/node": "^26",
|
|
44
44
|
"@webgpu/types": "^0.1.74",
|
|
45
45
|
"eslint": "^10.4.1",
|
|
46
46
|
"eslint-config-prettier": "^10.1.8",
|