Bump dist build

This commit is contained in:
sparkjsdev[bot] committed 2025-07-31 22:52:19 +00:00
1 parent 7fb5d7920b
commit 0e6fe62eef
11 files changed
+20 -21

No files matched your search

@@ -1 +1 @@
{"version":3,"file":"worker-rg3xXXjB.js","sources":["../rust/spark-internal-rs/pkg/spark_internal_rs.js","../node_modules/fflate/esm/browser.js","../node_modules/three/build/three.core.js","../src/defines.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../src/ply.ts","../src/SplatLoader.ts","../src/pcsogs.ts","../src/spz.ts","../src/worker.ts"],"sourcesContent":["let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * @param {number} num_splats\n * @param {Uint16Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} num_splats\n * @param {Uint32Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} origin_x\n * @param {number} origin_y\n * @param {number} origin_z\n * @param {number} dir_x\n * @param {number} dir_y\n * @param {number} dir_z\n * @param {number} near\n * @param {number} far\n * @param {number} num_splats\n * @param {Uint32Array} packed_splats\n * @param {boolean} raycast_ellipsoid\n * @param {number} ln_scale_min\n * @param {number} ln_scale_max\n * @returns {Float32Array}\n */\nexport function raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid, ln_scale_min, ln_scale_max) {\n const ret = wasm.raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid, ln_scale_min, ln_scale_max);\n return ret;\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0)Line truncated
{"version":3,"file":"worker-BPZWK3_F.js","sources":["../rust/spark-internal-rs/pkg/spark_internal_rs.js","../node_modules/fflate/esm/browser.js","../node_modules/three/build/three.core.js","../src/defines.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../src/ply.ts","../src/SplatLoader.ts","../src/pcsogs.ts","../src/spz.ts","../src/worker.ts"],"sourcesContent":["let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * @param {number} num_splats\n * @param {Uint16Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} num_splats\n * @param {Uint32Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} origin_x\n * @param {number} origin_y\n * @param {number} origin_z\n * @param {number} dir_x\n * @param {number} dir_y\n * @param {number} dir_z\n * @param {number} near\n * @param {number} far\n * @param {number} num_splats\n * @param {Uint32Array} packed_splats\n * @param {boolean} raycast_ellipsoid\n * @param {number} ln_scale_min\n * @param {number} ln_scale_max\n * @returns {Float32Array}\n */\nexport function raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid, ln_scale_min, ln_scale_max) {\n const ret = wasm.raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid, ln_scale_min, ln_scale_max);\n return ret;\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0)Line truncated
@@ -1 +1 @@
{"version":3,"file":"worker-OGTaIThB.js","sources":["../rust/spark-internal-rs/pkg/spark_internal_rs.js","../node_modules/fflate/esm/browser.js","../node_modules/three/build/three.core.js","../src/defines.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../src/ply.ts","../src/SplatLoader.ts","../src/pcsogs.ts","../src/spz.ts","../src/worker.ts"],"sourcesContent":["let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * @param {number} num_splats\n * @param {Uint16Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} num_splats\n * @param {Uint32Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} origin_x\n * @param {number} origin_y\n * @param {number} origin_z\n * @param {number} dir_x\n * @param {number} dir_y\n * @param {number} dir_z\n * @param {number} near\n * @param {number} far\n * @param {number} num_splats\n * @param {Uint32Array} packed_splats\n * @param {boolean} raycast_ellipsoid\n * @param {number} ln_scale_min\n * @param {number} ln_scale_max\n * @returns {Float32Array}\n */\nexport function raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid, ln_scale_min, ln_scale_max) {\n const ret = wasm.raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid, ln_scale_min, ln_scale_max);\n return ret;\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0)Line truncated
{"version":3,"file":"worker-Dxyljp7D.js","sources":["../rust/spark-internal-rs/pkg/spark_internal_rs.js","../node_modules/fflate/esm/browser.js","../node_modules/three/build/three.core.js","../src/defines.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../src/ply.ts","../src/SplatLoader.ts","../src/pcsogs.ts","../src/spz.ts","../src/worker.ts"],"sourcesContent":["let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * @param {number} num_splats\n * @param {Uint16Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} num_splats\n * @param {Uint32Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} origin_x\n * @param {number} origin_y\n * @param {number} origin_z\n * @param {number} dir_x\n * @param {number} dir_y\n * @param {number} dir_z\n * @param {number} near\n * @param {number} far\n * @param {number} num_splats\n * @param {Uint32Array} packed_splats\n * @param {boolean} raycast_ellipsoid\n * @param {number} ln_scale_min\n * @param {number} ln_scale_max\n * @returns {Float32Array}\n */\nexport function raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid, ln_scale_min, ln_scale_max) {\n const ret = wasm.raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid, ln_scale_min, ln_scale_max);\n return ret;\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0)Line truncated
-1
View File
@@ -1 +0,0 @@
7b1decc2ef8815f68e63c7f492e08cc134e25240
+4 -4
View File
@@ -3036,7 +3036,7 @@ function encodeSh1Rgb(sh1Array, index, sh1Rgb, encoding) {
const sh1Min = (encoding == null ? void 0 : encoding.sh1Min) ?? -1;
const sh1Max = (encoding == null ? void 0 : encoding.sh1Max) ?? 1;
const sh1Mid = 0.5 * (sh1Min + sh1Max);
const sh1Scale = 63 / (sh1Max - sh1Min);
const sh1Scale = 126 / (sh1Max - sh1Min);
const base = index * 2;
for (let i = 0; i < 9; ++i) {
const s = (sh1Rgb[i] - sh1Mid) * sh1Scale;
@@ -3057,7 +3057,7 @@ function encodeSh2Rgb(sh2Array, index, sh2Rgb, encoding) {
const sh2Min = (encoding == null ? void 0 : encoding.sh2Min) ?? -1;
const sh2Max = (encoding == null ? void 0 : encoding.sh2Max) ?? 1;
const sh2Mid = 0.5 * (sh2Min + sh2Max);
const sh2Scale = 0.5 / (sh2Max - sh2Min);
const sh2Scale = 2 / (sh2Max - sh2Min);
sh2Array[index * 4 + 0] = packSint8Bytes(
(sh2Rgb[0] - sh2Mid) * sh2Scale,
(sh2Rgb[1] - sh2Mid) * sh2Scale,
@@ -3087,7 +3087,7 @@ function encodeSh3Rgb(sh3Array, index, sh3Rgb, encoding) {
const sh3Min = (encoding == null ? void 0 : encoding.sh3Min) ?? -1;
const sh3Max = (encoding == null ? void 0 : encoding.sh3Max) ?? 1;
const sh3Mid = 0.5 * (sh3Min + sh3Max);
const sh3Scale = 31 / (sh3Max - sh3Min);
const sh3Scale = 62 / (sh3Max - sh3Min);
const base = index * 4;
for (let i = 0; i < 21; ++i) {
const s = (sh3Rgb[i] - sh3Mid) * sh3Scale;
@@ -8395,7 +8395,7 @@ function getNumSh(properties) {
}
return numSh;
}
const jsContent = '(function() {\n "use strict";\n let wasm;\n const cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {\n throw Error("TextDecoder not available");\n } };\n if (typeof TextDecoder !== "undefined") {\n cachedTextDecoder.decode();\n }\n let cachedUint8ArrayMemory0 = null;\n function getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n }\n function getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n }\n function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n async function __wbg_load(module, imports) {\n if (typeof Response === "function" && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === "function") {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n if (module.headers.get("Content-Type") != "application/wasm") {\n console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n", e);\n } else {\n throw e;\n }\n }\n }\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n }\n function __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_set_10bad9bee0e9c58b = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_d23661d19148b229 = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_f4f1f0daa30696fc = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_subarray_3aaeec89bb2544f0 = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_subarray_769e1e0f81bb259b = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_0;\n const offset = table.grow(4);\n table.set(0, void 0);\n table.set(offset + 0, void 0);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n };\n imports.wbg.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return ret;\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n return imports;\n }\n function __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n Line truncated
const jsContent = '(function() {\n "use strict";\n let wasm;\n const cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {\n throw Error("TextDecoder not available");\n } };\n if (typeof TextDecoder !== "undefined") {\n cachedTextDecoder.decode();\n }\n let cachedUint8ArrayMemory0 = null;\n function getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n }\n function getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n }\n function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n async function __wbg_load(module, imports) {\n if (typeof Response === "function" && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === "function") {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n if (module.headers.get("Content-Type") != "application/wasm") {\n console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n", e);\n } else {\n throw e;\n }\n }\n }\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n }\n function __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_set_10bad9bee0e9c58b = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_d23661d19148b229 = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_f4f1f0daa30696fc = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_subarray_3aaeec89bb2544f0 = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_subarray_769e1e0f81bb259b = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_0;\n const offset = table.grow(4);\n table.set(0, void 0);\n table.set(offset + 0, void 0);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n };\n imports.wbg.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return ret;\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n return imports;\n }\n function __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n Line truncated
const blob = typeof self !== "undefined" && self.Blob && new Blob([jsContent], { type: "text/javascript;charset=utf-8" });
function WorkerWrapper(options) {
let objURL;
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"spark.cjs.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, Line truncated
{"version":3,"file":"spark.cjs.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, Line truncated
+2 -2
View File
@@ -72,7 +72,7 @@
void main() {
gl_Position = vec4(position.xy, 0.0, 1.0);
}
`);function jn(t){const A=new u.Vector3;for(const e of t)A.add(e);return A.divideScalar(t.length)}function Xn(t){if(t.length===0)return new u.Quaternion;const A=t[0].clone();for(let e=1;e<t.length;e++)t[e].dot(t[0])<0?(A.x-=t[e].x,A.y-=t[e].y,A.z-=t[e].z,A.w-=t[e].w):(A.x+=t[e].x,A.y+=t[e].y,A.z+=t[e].z,A.w+=t[e].w);return A.normalize()}function Wn(t,A){const e=new u.Vector3(0,0,0).applyMatrix4(t),s=new u.Vector3(0,0,0).applyMatrix4(A),n=new u.Vector3(0,0,-1).applyMatrix4(t).sub(e).normalize(),i=new u.Vector3(0,0,-1).applyMatrix4(A).sub(s).normalize(),r=e.distanceTo(s),a=n.dot(i);return{distance:r,coincidence:a}}function Dg({matrix1:t,matrix2:A,maxDistance:e}){const s=new u.Vector3(0,0,0).applyMatrix4(t),n=new u.Vector3(0,0,0).applyMatrix4(A);return s.distanceTo(n)<=e}function Mg({matrix1:t,matrix2:A,maxDistance:e,minCoincidence:s}){const{distance:n,coincidence:i}=Wn(t,A);return n<=e&&(s==null||i>=s)}function Ai(t,A){const[e,s]=[new u.Vector3,new u.Quaternion],[n,i]=[new u.Vector3,new u.Quaternion];t.decompose(e,s,new u.Vector3),A.decompose(n,i,new u.Vector3);const r=e.distanceTo(n),a=Math.abs(s.dot(i));return{distance:r,coorient:a}}function Ee({matrix1:t,matrix2:A,maxDistance:e,minCoorient:s}){const{distance:n,coorient:i}=Ai(t,A);return n<=e&&(s==null||i>=s)}function vg(t,A=.001){return Math.abs(t)<A?0:Math.sign(t)}function bg(t){const A=t.w<0,e=Kt(A?-t.x:t.x),s=Kt(A?-t.y:t.y),n=Kt(A?-t.z:t.z),i=e&255,r=s&255,a=n&255;return i|r<<8|a<<16}function Fg(t,A){const e=t<<24>>24,s=t<<16>>24,n=t<<8>>24;A.set(e/127,s/127,n/127,0);const i=A.x*A.x+A.y*A.y+A.z*A.z;return A.w=Math.sqrt(Math.max(0,1-i)),A}function es(t){const A=t.clone().normalize();A.w<0&&A.set(-A.x,-A.y,-A.z,-A.w);const e=2*Math.acos(A.w),s=Math.sqrt(A.x*A.x+A.y*A.y+A.z*A.z),n=s<1e-6?new u.Vector3(1,0,0):new u.Vector3(A.x,A.y,A.z).divideScalar(s),i=Math.abs(n.x)+Math.abs(n.y)+Math.abs(n.z);let r=n.x/i,a=n.y/i;if(n.z<0){const h=r;r=(1-Math.abs(a))*(r>=0?1:-1),a=(1-Math.abs(h))*(a>=0?1:-1)}const o=r*.5+.5,g=a*.5+.5,l=Math.round(o*255),c=Math.round(g*255);return Math.round(e*(255/Math.PI))<<16|c<<8|l}function ti(t,A){const e=t&255,s=t>>>8&255,n=t>>>16&255,i=e/255,r=s/255;let a=(i-.5)*2,o=(r-.5)*2;const g=1-(Math.abs(a)+Math.abs(o)),l=Math.max(-g,0);a+=a>=0?-l:l,o+=o>=0?-l:l;const c=new u.Vector3(a,o,g).normalize(),h=n/255*Math.PI*.5,B=Math.sin(h),C=Math.cos(h);return A.set(c.x*B,c.y*B,c.z*B,C),A}function Ng(t){const A=t.clone().normalize(),e=2*(A.w*A.x+A.y*A.z),s=1-2*(A.x*A.x+A.y*A.y),n=Math.atan2(e,s),i=2*(A.w*A.y-A.z*A.x),r=Math.abs(i)>=1?Math.sign(i)*(Math.PI/2):Math.asin(i),a=2*(A.w*A.z+A.x*A.y),o=1-2*(A.y*A.y+A.z*A.z),g=Math.atan2(a,o),l=(n+Math.PI)/(2*Math.PI),c=(r+Math.PI)/(2*Math.PI),I=(g+Math.PI)/(2*Math.PI),h=Math.round(l*255),B=Math.round(c*255);return Math.round(I*255)<<16|B<<8|h}function Tg(t,A){const e=t&255,s=t>>>8&255,n=t>>>16&255,i=e/255,r=s/255,a=n/255,o=i*(2*Math.PI)-Math.PI,g=r*(2*Math.PI)-Math.PI,l=a*(2*Math.PI)-Math.PI,c=Math.cos(o*.5),I=Math.sin(o*.5),h=Math.cos(g*.5),B=Math.sin(g*.5),C=Math.cos(l*.5),E=Math.sin(l*.5);return A.w=c*h*C+I*B*E,A.x=I*h*C-c*B*E,A.y=c*B*C+I*h*E,A.z=c*h*E-I*B*C,A.normalize(),A}function re(t,A,e,s){const n=Math.max(-127,Math.min(127,t*127)),i=Math.max(-127,Math.min(127,A*127)),r=Math.max(-127,Math.min(127,e*127)),a=Math.max(-127,Math.min(127,s*127));return n&255|(i&255)<<8|(r&255)<<16|(a&255)<<24}function kg(t,A,e,s){const n=(s==null?void 0:s.sh1Min)??-1,i=(s==null?void 0:s.sh1Max)??1,r=.5*(n+i),a=63/(i-n),o=A*2;for(let g=0;g<9;++g){const l=(e[g]-r)*a,c=Math.round(Math.max(-63,Math.min(63,l)))&127,I=g*7,h=I+7,B=Math.floor(I/32),C=I-B*32,E=c<<C&4294967295;if(t[o+B]|=E,h>B*32+32){const Q=c>>>32-C&4294967295;t[o+B+1]|=Q}}}function Ug(t,A,e,s){const n=(s==null?void 0:s.sh2Min)??-1,i=(s==null?void 0:s.sh2Max)??1,r=.5*(n+i),a=.5/(i-n);t[A*4+0]=re((e[0]-r)*a,(e[1]-r)*a,(e[2]-r)*a,(e[3]-r)*a),t[A*4+1]=re((e[4]-r)*a,(e[5]-r)*a,(e[6]-r)*a,(e[7]-r)*a),t[A*4+2]=re((e[8]-r)*a,(e[9]-r)*a,(e[10]-r)*a,(e[11]-r)*a),t[A*4+3]=re((e[12]-r)*a,(e[13]-r)*a,(e[14]-r)*a,0)}function Gg(t,A,e,s){const n=(s==null?void 0:s.sh3Min)??-1,i=(s==null?void 0:s.sh3Max)??1,r=.5*(n+i),a=31/(i-n),o=A*4;for(let g=0;g<21;++g){const l=(e[g]-r)*a,c=Math.round(Math.max(-31,Math.min(31,l)))&63,I=g*6,h=I+6,B=Math.floor(I/32),C=I-B*32,E=c<<C&4294967295;if(t[o+B]|=E,h>B*32+32){const Q=c>>>32-C&4294967295;t[o+B+1]|=Q}}}function ei(t,A){const e=[];let s=0,n=null;const i=new Ns((o,g)=>{if(e.push(o),s+=o.length,g||s>=A){const l=new Uint8Array(s);let c=0;for(const I of e)l.set(I,c),c+=I.length;n=l.slice(0,A)}}),r=1024;let a=0;for(;n==null&&a<t.length;){const o=t.slice(a,a+r);i.push(o,!1),a+=r}if(n==null&&(i.push(new Uint8Array,!0),n==null))throw new Error("Failed to decompress partial gzip");return n}class si{constructor({fileBytes:A,chunkBytes:e=64*1024}){this.fileBytes=A,this.chunkBytes=e,this.offset=0,this.chunks=[],this.totalBytes=0,this.gunzip=new Ns((s,n)=>{this.chunks.push(s),this.totalBytes+=s.length})}read(A){for(;this.totalBytes<A&&this.offset<this Line truncated
`);function jn(t){const A=new u.Vector3;for(const e of t)A.add(e);return A.divideScalar(t.length)}function Xn(t){if(t.length===0)return new u.Quaternion;const A=t[0].clone();for(let e=1;e<t.length;e++)t[e].dot(t[0])<0?(A.x-=t[e].x,A.y-=t[e].y,A.z-=t[e].z,A.w-=t[e].w):(A.x+=t[e].x,A.y+=t[e].y,A.z+=t[e].z,A.w+=t[e].w);return A.normalize()}function Wn(t,A){const e=new u.Vector3(0,0,0).applyMatrix4(t),s=new u.Vector3(0,0,0).applyMatrix4(A),n=new u.Vector3(0,0,-1).applyMatrix4(t).sub(e).normalize(),i=new u.Vector3(0,0,-1).applyMatrix4(A).sub(s).normalize(),r=e.distanceTo(s),a=n.dot(i);return{distance:r,coincidence:a}}function Dg({matrix1:t,matrix2:A,maxDistance:e}){const s=new u.Vector3(0,0,0).applyMatrix4(t),n=new u.Vector3(0,0,0).applyMatrix4(A);return s.distanceTo(n)<=e}function Mg({matrix1:t,matrix2:A,maxDistance:e,minCoincidence:s}){const{distance:n,coincidence:i}=Wn(t,A);return n<=e&&(s==null||i>=s)}function Ai(t,A){const[e,s]=[new u.Vector3,new u.Quaternion],[n,i]=[new u.Vector3,new u.Quaternion];t.decompose(e,s,new u.Vector3),A.decompose(n,i,new u.Vector3);const r=e.distanceTo(n),a=Math.abs(s.dot(i));return{distance:r,coorient:a}}function Ee({matrix1:t,matrix2:A,maxDistance:e,minCoorient:s}){const{distance:n,coorient:i}=Ai(t,A);return n<=e&&(s==null||i>=s)}function vg(t,A=.001){return Math.abs(t)<A?0:Math.sign(t)}function bg(t){const A=t.w<0,e=Kt(A?-t.x:t.x),s=Kt(A?-t.y:t.y),n=Kt(A?-t.z:t.z),i=e&255,r=s&255,a=n&255;return i|r<<8|a<<16}function Fg(t,A){const e=t<<24>>24,s=t<<16>>24,n=t<<8>>24;A.set(e/127,s/127,n/127,0);const i=A.x*A.x+A.y*A.y+A.z*A.z;return A.w=Math.sqrt(Math.max(0,1-i)),A}function es(t){const A=t.clone().normalize();A.w<0&&A.set(-A.x,-A.y,-A.z,-A.w);const e=2*Math.acos(A.w),s=Math.sqrt(A.x*A.x+A.y*A.y+A.z*A.z),n=s<1e-6?new u.Vector3(1,0,0):new u.Vector3(A.x,A.y,A.z).divideScalar(s),i=Math.abs(n.x)+Math.abs(n.y)+Math.abs(n.z);let r=n.x/i,a=n.y/i;if(n.z<0){const h=r;r=(1-Math.abs(a))*(r>=0?1:-1),a=(1-Math.abs(h))*(a>=0?1:-1)}const o=r*.5+.5,g=a*.5+.5,l=Math.round(o*255),c=Math.round(g*255);return Math.round(e*(255/Math.PI))<<16|c<<8|l}function ti(t,A){const e=t&255,s=t>>>8&255,n=t>>>16&255,i=e/255,r=s/255;let a=(i-.5)*2,o=(r-.5)*2;const g=1-(Math.abs(a)+Math.abs(o)),l=Math.max(-g,0);a+=a>=0?-l:l,o+=o>=0?-l:l;const c=new u.Vector3(a,o,g).normalize(),h=n/255*Math.PI*.5,B=Math.sin(h),C=Math.cos(h);return A.set(c.x*B,c.y*B,c.z*B,C),A}function Ng(t){const A=t.clone().normalize(),e=2*(A.w*A.x+A.y*A.z),s=1-2*(A.x*A.x+A.y*A.y),n=Math.atan2(e,s),i=2*(A.w*A.y-A.z*A.x),r=Math.abs(i)>=1?Math.sign(i)*(Math.PI/2):Math.asin(i),a=2*(A.w*A.z+A.x*A.y),o=1-2*(A.y*A.y+A.z*A.z),g=Math.atan2(a,o),l=(n+Math.PI)/(2*Math.PI),c=(r+Math.PI)/(2*Math.PI),I=(g+Math.PI)/(2*Math.PI),h=Math.round(l*255),B=Math.round(c*255);return Math.round(I*255)<<16|B<<8|h}function Tg(t,A){const e=t&255,s=t>>>8&255,n=t>>>16&255,i=e/255,r=s/255,a=n/255,o=i*(2*Math.PI)-Math.PI,g=r*(2*Math.PI)-Math.PI,l=a*(2*Math.PI)-Math.PI,c=Math.cos(o*.5),I=Math.sin(o*.5),h=Math.cos(g*.5),B=Math.sin(g*.5),C=Math.cos(l*.5),E=Math.sin(l*.5);return A.w=c*h*C+I*B*E,A.x=I*h*C-c*B*E,A.y=c*B*C+I*h*E,A.z=c*h*E-I*B*C,A.normalize(),A}function re(t,A,e,s){const n=Math.max(-127,Math.min(127,t*127)),i=Math.max(-127,Math.min(127,A*127)),r=Math.max(-127,Math.min(127,e*127)),a=Math.max(-127,Math.min(127,s*127));return n&255|(i&255)<<8|(r&255)<<16|(a&255)<<24}function kg(t,A,e,s){const n=(s==null?void 0:s.sh1Min)??-1,i=(s==null?void 0:s.sh1Max)??1,r=.5*(n+i),a=126/(i-n),o=A*2;for(let g=0;g<9;++g){const l=(e[g]-r)*a,c=Math.round(Math.max(-63,Math.min(63,l)))&127,I=g*7,h=I+7,B=Math.floor(I/32),C=I-B*32,E=c<<C&4294967295;if(t[o+B]|=E,h>B*32+32){const Q=c>>>32-C&4294967295;t[o+B+1]|=Q}}}function Ug(t,A,e,s){const n=(s==null?void 0:s.sh2Min)??-1,i=(s==null?void 0:s.sh2Max)??1,r=.5*(n+i),a=2/(i-n);t[A*4+0]=re((e[0]-r)*a,(e[1]-r)*a,(e[2]-r)*a,(e[3]-r)*a),t[A*4+1]=re((e[4]-r)*a,(e[5]-r)*a,(e[6]-r)*a,(e[7]-r)*a),t[A*4+2]=re((e[8]-r)*a,(e[9]-r)*a,(e[10]-r)*a,(e[11]-r)*a),t[A*4+3]=re((e[12]-r)*a,(e[13]-r)*a,(e[14]-r)*a,0)}function Gg(t,A,e,s){const n=(s==null?void 0:s.sh3Min)??-1,i=(s==null?void 0:s.sh3Max)??1,r=.5*(n+i),a=62/(i-n),o=A*4;for(let g=0;g<21;++g){const l=(e[g]-r)*a,c=Math.round(Math.max(-31,Math.min(31,l)))&63,I=g*6,h=I+6,B=Math.floor(I/32),C=I-B*32,E=c<<C&4294967295;if(t[o+B]|=E,h>B*32+32){const Q=c>>>32-C&4294967295;t[o+B+1]|=Q}}}function ei(t,A){const e=[];let s=0,n=null;const i=new Ns((o,g)=>{if(e.push(o),s+=o.length,g||s>=A){const l=new Uint8Array(s);let c=0;for(const I of e)l.set(I,c),c+=I.length;n=l.slice(0,A)}}),r=1024;let a=0;for(;n==null&&a<t.length;){const o=t.slice(a,a+r);i.push(o,!1),a+=r}if(n==null&&(i.push(new Uint8Array,!0),n==null))throw new Error("Failed to decompress partial gzip");return n}class si{constructor({fileBytes:A,chunkBytes:e=64*1024}){this.fileBytes=A,this.chunkBytes=e,this.offset=0,this.chunks=[],this.totalBytes=0,this.gunzip=new Ns((s,n)=>{this.chunks.push(s),this.totalBytes+=s.length})}read(A){for(;this.totalBytes<A&&this.offset<this Line truncated
`)+this.between+e.map(s=>this.indent+s).join(`
`)+this.after}}const Cs=new Map;function Yg(t){let A=Cs.get(t);return A||(A=new u.RawShaderMaterial({glslVersion:u.GLSL3,vertexShader:On,fragmentShader:t.shader,uniforms:t.uniforms}),Cs.set(t,A),A)}function is(t,A,e="add"){const s=()=>{throw new Error(`Invalid ${e} types: ${t}, ${A}`)};if(t===A)return t;if(t==="int"){if(EA(A))return A;s()}if(A==="int"){if(EA(t))return t;s()}if(t==="uint"){if(QA(A))return A;s()}if(A==="uint"){if(QA(t))return t;s()}if(t==="float"){if(ot(A))return A;s()}if(A==="float"){if(ot(t))return t;s()}throw new Error(`Invalid ${e} types: ${t}, ${A}`)}function Jg(t,A){return is(t,A,"sub")}function _g(t,A){const e=()=>{throw new Error(`Invalid mul types: ${t}, ${A}`)},s=n=>n;if(t==="int"){if(EA(A))return s(A);e()}if(A==="int"){if(EA(t))return s(t);e()}if(t==="uint"){if(QA(A))return s(A);e()}if(A==="uint"){if(QA(t))return s(t);e()}if(t==="float"){if(ot(A))return s(A);e()}if(A==="float"){if(ot(t))return s(t);e()}if(EA(t)||QA(t)||EA(A)||QA(A)){if(t===A)return s(t);e()}if(t==="vec2"){if(A==="vec2"||ct(A))return s("vec2");if(A==="mat3x2")return s("vec3");if(A==="mat4x2")return s("vec4");e()}if(t==="vec3"){if(A==="mat2x3")return s("vec2");if(A==="vec3"||gt(A))return s("vec3");if(A==="mat4x3")return s("vec4");e()}if(t==="vec4"){if(A==="mat2x4")return s("vec2");if(A==="mat3x4")return s("vec3");if(A==="vec4"||lt(A))return s("vec4");e()}if(A==="vec2"){if(ct(t))return s("vec2");if(t==="mat2x3")return s("vec3");if(t==="mat2x4")return s("vec4");e()}if(A==="vec3"){if(t==="mat3x2")return s("vec2");if(gt(t))return s("vec3");if(t==="mat3x4")return s("vec4");e()}if(A==="vec4"){if(t==="mat4x2")return s("vec2");if(t==="mat4x3")return s("vec3");if(lt(t))return s("vec4");e()}if(ct(t)){if(ct(A))return s("mat2");if(A==="mat3x2")return s("mat3x2");if(A==="mat4x2")return s("mat4x2");e()}if(t==="mat2x3"){if(ct(A))return s("mat2x3");if(A==="mat3x2")return s("mat3");if(A==="mat4x2")return s("mat4x3");e()}if(t==="mat2x4"){if(ct(A))return s("mat2x4");if(A==="mat3x2")return s("mat3x4");if(A==="mat4x2")return s("mat4");e()}if(t==="mat3x2"){if(A==="mat2x3")return s("mat2");if(gt(A))return s("mat3x2");if(A==="mat4x3")return s("mat4x2");e()}if(gt(t)){if(A==="mat2x3")return s("mat2x3");if(gt(A))return s("mat3");if(A==="mat4x3")return s("mat4x3");e()}if(t==="mat3x4"){if(A==="mat2x3")return s("mat2x4");if(gt(A))return s("mat3x4");if(A==="mat4x3")return s("mat4");e()}if(t==="mat4x2"){if(A==="mat2x4")return s("mat2");if(A==="mat3x4")return s("mat3x2");if(lt(A))return s("mat4x2");e()}if(t==="mat4x3"){if(A==="mat2x4")return s("mat2x3");if(A==="mat3x4")return s("mat3");if(lt(A))return s("mat4x3");e()}if(lt(t)){if(A==="mat2x4")return s("mat2x4");if(A==="mat3x4")return s("mat3x4");if(lt(A))return s("mat4");e()}throw new Error(`Invalid mul types: ${t}, ${A}`)}function Lg(t,A){return is(t,A,"div")}function zg(t,A){if(t===A)return t;if(t==="int"){if(EA(A))return A}else if(A==="int"){if(EA(t))return t}else if(t==="uint"){if(QA(A))return A}else if(A==="uint"&&QA(t))return t;throw new Error(`Invalid imod types: ${t}, ${A}`)}function Hg(t,A){if(t===A||A==="float")return t;throw new Error(`Invalid mod types: ${t}, ${A}`)}function qg(t){return t}function Kg(t){return t}function $g(t){return t}function Vg(t){return t}function Pg(t){return t}function Zg(t){return t}function Og(t){return t}function jg(t){return t}function Xg(t){return t}function Wg(t){return t}function Al(t){return t}function tl(t){return t}function el(t){return t}function sl(t){return t}function nl(t){return t}function il(t){return t}function ni(t,A,e="min"){if(t===A)return t;if(A==="float"){if(Ae(t))return t}else if(A==="int"){if(EA(t))return t}else if(A==="uint"&&QA(t))return t;throw new Error(`Invalid ${e} types: ${t}, ${A}`)}function rl(t,A){return ni(t,A,"max")}function al(t,A,e){if(A==="float"){if(Ae(t))return t}else if(A==="int"){if(EA(t))return t}else if(A==="uint"&&QA(t))return t;throw new Error(`Invalid clamp types: ${t}, ${A}`)}function ol(t,A,e){if(e===t||e==="float"||e==="bool"&&t==="float"||e==="bvec2"&&t==="vec2"||e==="bvec3"&&t==="vec3"||e==="bvec4"&&t==="vec4")return t;throw new Error(`Invalid mix types: ${t}, ${A}, ${e}`)}function cl(t,A){if(t===A||A==="float")return A;throw new Error(`Invalid step types: ${t}, ${A}`)}function gl(t,A,e){if(t===A&&(t===e||t==="float"))return e;throw new Error(`Invalid smoothstep types: ${t}, ${A}, ${e}`)}function ii(t,A="isNan"){if(t==="float")return"bool";if(t==="vec2")return"bvec2";if(t==="vec3")return"bvec3";if(t==="vec4")return"bvec4";throw new Error(`Invalid ${A} types: ${t}`)}function ll(t){return ii(t,"isInf")}const BA=(t,A)=>new ci({a:t,b:A}),pt=(t,A)=>new gi({a:t,b:A}),rA=(t,A)=>new li({a:t,b:A}),ge=(t,A)=>new Ii({a:t,b:A}),ze=(t,A)=>new ui({a:t,b:A}),ri=(t,A)=>new hi({a:t,b:A}),Il=t=>new Ci({a:t}).outputs,rs=t=>new Bi({a:t}),ul=t=>new Ei({a:t}),hl=t=>new Qi({a:t}),Cl=t=>new pi({a:t}),Bl=t=>new fi({a:t}),El=t=>new di({a:t}),Ql=t=>new yi({a:t}),le=t=>new mi({a:t}),pl=(t,A)=>new wi({a:t,b:A}),fl=t=>new xi({a:t}),dl=t=>ne Line truncated
@@ -511,7 +511,7 @@ void main() {
}
`)}).outputs.rgb}const Dt=class Dt{constructor({fileBytes:A}){this.header="",this.littleEndian=!0,this.elements={},this.comments=[],this.data=null,this.numSplats=0,this.fileBytes=A instanceof ArrayBuffer?new Uint8Array(A):A}async parseHeader(){const e=new ReadableStream({start:r=>{r.enqueue(this.fileBytes.slice(0,65536)),r.close()}}).pipeThrough(new TextDecoderStream).getReader();this.header="";const s=`end_header
`;for(;;){const{value:r,done:a}=await e.read();if(a)throw new Error("Failed to read header");this.header+=r;const o=this.header.indexOf(s);if(o>=0){this.header=this.header.slice(0,o+s.length);break}}const n=new TextEncoder().encode(this.header).length;this.data=new DataView(this.fileBytes.buffer,n),this.elements={};let i=null;this.comments=[],this.header.trim().split(`
`).forEach((r,a)=>{const o=r.trim();if(a===0){if(o!=="ply")throw new Error("Invalid PLY header");return}if(o.length===0)return;const g=o.split(" ");switch(g[0]){case"format":if(g[1]==="binary_little_endian")this.littleEndian=!0;else if(g[1]==="binary_big_endian")this.littleEndian=!1;else throw new Error(`Unsupported PLY format: ${g[1]}`);if(g[2]!=="1.0")throw new Error(`Unsupported PLY version: ${g[2]}`);break;case"end_header":break;case"comment":this.comments.push(o.slice(8));break;case"element":{const l=g[1];i={name:l,count:Number.parseInt(g[2]),properties:{}},this.elements[l]=i;break}case"property":if(i==null)throw new Error("Property must be inside an element");g[1]==="list"?i.properties[g[4]]={isList:!0,type:g[3],countType:g[2]}:i.properties[g[2]]={isList:!1,type:g[1]};break}}),this.elements.vertex&&(this.numSplats=this.elements.vertex.count)}parseData(A){let e=0;const s=this.data;if(s==null)throw new Error("No data to parse");for(const n in this.elements){const i=this.elements[n],{count:r,properties:a}=i,o={},g=[];for(const[c,I]of Object.entries(a))I.isList?(o[c]=[],g.push(()=>{const h=o[c];h.length=oe[I.countType](s,e,this.littleEndian),e+=wt[I.countType];for(let B=0;B<h.length;B++)h[B]=oe[I.type](s,e,this.littleEndian),e+=wt[I.type]})):(o[c]=0,g.push(()=>{o[c]=oe[I.type](s,e,this.littleEndian),e+=wt[I.type]}));const l=A(i)??(()=>{});for(let c=0;c<r;c++){for(const I of g)I();l(c,o)}}}parseSplats(A,e){if(this.elements.vertex==null)throw new Error("No vertex element found");let s=!1;const n=[];let i=0,r=[],a=[],o=[],g,l,c;function I(){const Q=wu[i];r=new Array(3).fill(null).flatMap((p,f)=>[0,1,2].map((d,m)=>`f_rest_${f+m*Q/3}`)),a=new Array(5).fill(null).flatMap((p,f)=>[0,1,2].map((d,m)=>`f_rest_${3+f+m*Q/3}`)),o=new Array(7).fill(null).flatMap((p,f)=>[0,1,2].map((d,m)=>`f_rest_${8+f+m*Q/3}`)),g=i>=1?new Float32Array(3*3):void 0,l=i>=2?new Float32Array(5*3):void 0,c=i>=3?new Float32Array(7*3):void 0}function h(Q,p){if(!g)throw new Error("Missing sh1");for(const[f,d]of r.entries())g[f]=p[d]*8/255-4;if(l)for(const[f,d]of a.entries())l[f]=p[d]*8/255-4;if(c)for(const[f,d]of o.entries())c[f]=p[d]*8/255-4;e==null||e(Q,g,l,c)}function B(Q){const{min_x:p,min_y:f,min_z:d,max_x:m,max_y:D,max_z:x,min_scale_x:y,min_scale_y:w,min_scale_z:T,max_scale_x:M,max_scale_y:S,max_scale_z:U}=Q.properties;if(!p||!f||!d||!m||!D||!x||!y||!w||!T||!M||!S||!U)throw new Error("Missing PLY chunk properties");return s=!0,(F,b)=>{const{min_x:k,min_y:R,min_z:O,max_x:_,max_y:eA,max_z:q,min_scale_x:j,min_scale_y:L,min_scale_z:X,max_scale_x:P,max_scale_y:W,max_scale_z:G,min_r:dA,min_g:lA,min_b:yA,max_r:mA,max_g:SA,max_b:CA}=b;n.push({min_x:k,min_y:R,min_z:O,max_x:_,max_y:eA,max_z:q,min_scale_x:j,min_scale_y:L,min_scale_z:X,max_scale_x:P,max_scale_y:W,max_scale_z:G,min_r:dA,min_g:lA,min_b:yA,max_r:mA,max_g:SA,max_b:CA})}}function C(Q){if(e&&Q.name==="sh")return i=Es(Q.properties),I(),h;if(Q.name!=="vertex")return null;const{packed_position:p,packed_rotation:f,packed_scale:d,packed_color:m}=Q.properties;if(!p||!f||!d||!m)throw new Error("Missing PLY properties: packed_position, packed_rotation, packed_scale, packed_color");const D=Math.sqrt(2);return(x,y)=>{const w=n[x>>>8];if(w==null)throw new Error("Missing PLY chunk");const{min_x:T,min_y:M,min_z:S,max_x:U,max_y:F,max_z:b,min_scale_x:k,min_scale_y:R,min_scale_z:O,max_scale_x:_,max_scale_y:eA,max_scale_z:q,min_r:j,min_g:L,min_b:X,max_r:P,max_g:W,max_b:G}=w,{packed_position:dA,packed_rotation:lA,packed_scale:yA,packed_color:mA}=y,SA=(dA>>>21&2047)/2047*(U-T)+T,CA=(dA>>>11&1023)/1023*(F-M)+M,YA=(dA&2047)/2047*(b-S)+S,DA=((lA>>>20&1023)/1023-.5)*D,XA=((lA>>>10&1023)/1023-.5)*D,WA=((lA&1023)/1023-.5)*D,Y=Math.sqrt(Math.max(0,1-DA*DA-XA*XA-WA*WA)),pA=lA>>>30,PA=pA===0?DA:pA===1?Y:XA,Rt=pA<=1?XA:pA===2?Y:WA,ie=pA<=2?WA:Y,MA=pA===0?Y:DA,z=Math.exp((yA>>>21&2047)/2047*(_-k)+k),ZA=Math.exp((yA>>>11&1023)/1023*(eA-R)+R),De=Math.exp((yA&2047)/2047*(q-O)+O),Me=(mA>>>24&255)/255*((P??1)-(j??0))+(j??0),ve=(mA>>>16&255)/255*((W??1)-(L??0))+(L??0),be=(mA>>>8&255)/255*((G??1)-(X??0))+(X??0),Fe=(mA&255)/255;A(x,SA,CA,YA,z,ZA,De,PA,Rt,ie,MA,Fe,Me,ve,be)}}const E=Q=>{if(Q.name==="chunk")return B(Q);if(s)return C(Q);if(Q.name!=="vertex")return null;const{x:p,y:f,z:d,scale_0:m,scale_1:D,scale_2:x,rot_0:y,rot_1:w,rot_2:T,rot_3:M,opacity:S,f_dc_0:U,f_dc_1:F,f_dc_2:b,red:k,green:R,blue:O,alpha:_}=Q.properties;if(!p||!f||!d)throw new Error("Missing PLY properties: x, y, z");const eA=m&&D&&x,q=y&&w&&T&&M,j=_!=null?ce[_.type]:1,L=k!=null?ce[k.type]:1,X=R!=null?ce[R.type]:1,P=O!=null?ce[O.type]:1;return i=Es(Q.properties),I(),(W,G)=>{const dA=eA?Math.exp(G.scale_0):Dt.defaultPointScale,lA=eA?Math.exp(G.scale_1):Dt.defaultPointScale,yA=eA?Math.exp(G.scale_2):Dt.defaultPointScale,mA=q?G.rot_1:0,SA=q?G.rot_2:0,CA=q?G.rot_3:0,YA=q?G.rot_0:1,DA=S!=null?1/(1+Math.exp(-G.opacity)):_!=null?G.alpha/j:1,XA=U!=null?G.f_dc_0*ae+.5:k!=null?G.red/L:1,WA=F!=null?G.f_dc_1*ae+.5:R!=null?G.green/X:1,Y=b!=null?G.f_dc_2*ae+.5:O!=null?G. Line truncated
`).forEach((r,a)=>{const o=r.trim();if(a===0){if(o!=="ply")throw new Error("Invalid PLY header");return}if(o.length===0)return;const g=o.split(" ");switch(g[0]){case"format":if(g[1]==="binary_little_endian")this.littleEndian=!0;else if(g[1]==="binary_big_endian")this.littleEndian=!1;else throw new Error(`Unsupported PLY format: ${g[1]}`);if(g[2]!=="1.0")throw new Error(`Unsupported PLY version: ${g[2]}`);break;case"end_header":break;case"comment":this.comments.push(o.slice(8));break;case"element":{const l=g[1];i={name:l,count:Number.parseInt(g[2]),properties:{}},this.elements[l]=i;break}case"property":if(i==null)throw new Error("Property must be inside an element");g[1]==="list"?i.properties[g[4]]={isList:!0,type:g[3],countType:g[2]}:i.properties[g[2]]={isList:!1,type:g[1]};break}}),this.elements.vertex&&(this.numSplats=this.elements.vertex.count)}parseData(A){let e=0;const s=this.data;if(s==null)throw new Error("No data to parse");for(const n in this.elements){const i=this.elements[n],{count:r,properties:a}=i,o={},g=[];for(const[c,I]of Object.entries(a))I.isList?(o[c]=[],g.push(()=>{const h=o[c];h.length=oe[I.countType](s,e,this.littleEndian),e+=wt[I.countType];for(let B=0;B<h.length;B++)h[B]=oe[I.type](s,e,this.littleEndian),e+=wt[I.type]})):(o[c]=0,g.push(()=>{o[c]=oe[I.type](s,e,this.littleEndian),e+=wt[I.type]}));const l=A(i)??(()=>{});for(let c=0;c<r;c++){for(const I of g)I();l(c,o)}}}parseSplats(A,e){if(this.elements.vertex==null)throw new Error("No vertex element found");let s=!1;const n=[];let i=0,r=[],a=[],o=[],g,l,c;function I(){const Q=wu[i];r=new Array(3).fill(null).flatMap((p,f)=>[0,1,2].map((d,m)=>`f_rest_${f+m*Q/3}`)),a=new Array(5).fill(null).flatMap((p,f)=>[0,1,2].map((d,m)=>`f_rest_${3+f+m*Q/3}`)),o=new Array(7).fill(null).flatMap((p,f)=>[0,1,2].map((d,m)=>`f_rest_${8+f+m*Q/3}`)),g=i>=1?new Float32Array(3*3):void 0,l=i>=2?new Float32Array(5*3):void 0,c=i>=3?new Float32Array(7*3):void 0}function h(Q,p){if(!g)throw new Error("Missing sh1");for(const[f,d]of r.entries())g[f]=p[d]*8/255-4;if(l)for(const[f,d]of a.entries())l[f]=p[d]*8/255-4;if(c)for(const[f,d]of o.entries())c[f]=p[d]*8/255-4;e==null||e(Q,g,l,c)}function B(Q){const{min_x:p,min_y:f,min_z:d,max_x:m,max_y:D,max_z:x,min_scale_x:y,min_scale_y:w,min_scale_z:T,max_scale_x:M,max_scale_y:S,max_scale_z:U}=Q.properties;if(!p||!f||!d||!m||!D||!x||!y||!w||!T||!M||!S||!U)throw new Error("Missing PLY chunk properties");return s=!0,(F,b)=>{const{min_x:k,min_y:R,min_z:O,max_x:_,max_y:eA,max_z:q,min_scale_x:j,min_scale_y:L,min_scale_z:X,max_scale_x:P,max_scale_y:W,max_scale_z:G,min_r:dA,min_g:lA,min_b:yA,max_r:mA,max_g:SA,max_b:CA}=b;n.push({min_x:k,min_y:R,min_z:O,max_x:_,max_y:eA,max_z:q,min_scale_x:j,min_scale_y:L,min_scale_z:X,max_scale_x:P,max_scale_y:W,max_scale_z:G,min_r:dA,min_g:lA,min_b:yA,max_r:mA,max_g:SA,max_b:CA})}}function C(Q){if(e&&Q.name==="sh")return i=Es(Q.properties),I(),h;if(Q.name!=="vertex")return null;const{packed_position:p,packed_rotation:f,packed_scale:d,packed_color:m}=Q.properties;if(!p||!f||!d||!m)throw new Error("Missing PLY properties: packed_position, packed_rotation, packed_scale, packed_color");const D=Math.sqrt(2);return(x,y)=>{const w=n[x>>>8];if(w==null)throw new Error("Missing PLY chunk");const{min_x:T,min_y:M,min_z:S,max_x:U,max_y:F,max_z:b,min_scale_x:k,min_scale_y:R,min_scale_z:O,max_scale_x:_,max_scale_y:eA,max_scale_z:q,min_r:j,min_g:L,min_b:X,max_r:P,max_g:W,max_b:G}=w,{packed_position:dA,packed_rotation:lA,packed_scale:yA,packed_color:mA}=y,SA=(dA>>>21&2047)/2047*(U-T)+T,CA=(dA>>>11&1023)/1023*(F-M)+M,YA=(dA&2047)/2047*(b-S)+S,DA=((lA>>>20&1023)/1023-.5)*D,XA=((lA>>>10&1023)/1023-.5)*D,WA=((lA&1023)/1023-.5)*D,Y=Math.sqrt(Math.max(0,1-DA*DA-XA*XA-WA*WA)),pA=lA>>>30,PA=pA===0?DA:pA===1?Y:XA,Rt=pA<=1?XA:pA===2?Y:WA,ie=pA<=2?WA:Y,MA=pA===0?Y:DA,z=Math.exp((yA>>>21&2047)/2047*(_-k)+k),ZA=Math.exp((yA>>>11&1023)/1023*(eA-R)+R),De=Math.exp((yA&2047)/2047*(q-O)+O),Me=(mA>>>24&255)/255*((P??1)-(j??0))+(j??0),ve=(mA>>>16&255)/255*((W??1)-(L??0))+(L??0),be=(mA>>>8&255)/255*((G??1)-(X??0))+(X??0),Fe=(mA&255)/255;A(x,SA,CA,YA,z,ZA,De,PA,Rt,ie,MA,Fe,Me,ve,be)}}const E=Q=>{if(Q.name==="chunk")return B(Q);if(s)return C(Q);if(Q.name!=="vertex")return null;const{x:p,y:f,z:d,scale_0:m,scale_1:D,scale_2:x,rot_0:y,rot_1:w,rot_2:T,rot_3:M,opacity:S,f_dc_0:U,f_dc_1:F,f_dc_2:b,red:k,green:R,blue:O,alpha:_}=Q.properties;if(!p||!f||!d)throw new Error("Missing PLY properties: x, y, z");const eA=m&&D&&x,q=y&&w&&T&&M,j=_!=null?ce[_.type]:1,L=k!=null?ce[k.type]:1,X=R!=null?ce[R.type]:1,P=O!=null?ce[O.type]:1;return i=Es(Q.properties),I(),(W,G)=>{const dA=eA?Math.exp(G.scale_0):Dt.defaultPointScale,lA=eA?Math.exp(G.scale_1):Dt.defaultPointScale,yA=eA?Math.exp(G.scale_2):Dt.defaultPointScale,mA=q?G.rot_1:0,SA=q?G.rot_2:0,CA=q?G.rot_3:0,YA=q?G.rot_0:1,DA=S!=null?1/(1+Math.exp(-G.opacity)):_!=null?G.alpha/j:1,XA=U!=null?G.f_dc_0*ae+.5:k!=null?G.red/L:1,WA=F!=null?G.f_dc_1*ae+.5:R!=null?G.green/X:1,Y=b!=null?G.f_dc_2*ae+.5:O!=null?G. Line truncated
precision highp int;
precision highp sampler2D;
precision highp usampler2D;
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"spark.cjs.min.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2,Line truncated
{"version":3,"file":"spark.cjs.min.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2,Line truncated
+4 -4
View File
@@ -3017,7 +3017,7 @@ function encodeSh1Rgb(sh1Array, index, sh1Rgb, encoding) {
const sh1Min = (encoding == null ? void 0 : encoding.sh1Min) ?? -1;
const sh1Max = (encoding == null ? void 0 : encoding.sh1Max) ?? 1;
const sh1Mid = 0.5 * (sh1Min + sh1Max);
const sh1Scale = 63 / (sh1Max - sh1Min);
const sh1Scale = 126 / (sh1Max - sh1Min);
const base = index * 2;
for (let i = 0; i < 9; ++i) {
const s = (sh1Rgb[i] - sh1Mid) * sh1Scale;
@@ -3038,7 +3038,7 @@ function encodeSh2Rgb(sh2Array, index, sh2Rgb, encoding) {
const sh2Min = (encoding == null ? void 0 : encoding.sh2Min) ?? -1;
const sh2Max = (encoding == null ? void 0 : encoding.sh2Max) ?? 1;
const sh2Mid = 0.5 * (sh2Min + sh2Max);
const sh2Scale = 0.5 / (sh2Max - sh2Min);
const sh2Scale = 2 / (sh2Max - sh2Min);
sh2Array[index * 4 + 0] = packSint8Bytes(
(sh2Rgb[0] - sh2Mid) * sh2Scale,
(sh2Rgb[1] - sh2Mid) * sh2Scale,
@@ -3068,7 +3068,7 @@ function encodeSh3Rgb(sh3Array, index, sh3Rgb, encoding) {
const sh3Min = (encoding == null ? void 0 : encoding.sh3Min) ?? -1;
const sh3Max = (encoding == null ? void 0 : encoding.sh3Max) ?? 1;
const sh3Mid = 0.5 * (sh3Min + sh3Max);
const sh3Scale = 31 / (sh3Max - sh3Min);
const sh3Scale = 62 / (sh3Max - sh3Min);
const base = index * 4;
for (let i = 0; i < 21; ++i) {
const s = (sh3Rgb[i] - sh3Mid) * sh3Scale;
@@ -8376,7 +8376,7 @@ function getNumSh(properties) {
}
return numSh;
}
const jsContent = '(function() {\n "use strict";\n let wasm;\n const cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {\n throw Error("TextDecoder not available");\n } };\n if (typeof TextDecoder !== "undefined") {\n cachedTextDecoder.decode();\n }\n let cachedUint8ArrayMemory0 = null;\n function getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n }\n function getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n }\n function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n async function __wbg_load(module, imports) {\n if (typeof Response === "function" && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === "function") {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n if (module.headers.get("Content-Type") != "application/wasm") {\n console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n", e);\n } else {\n throw e;\n }\n }\n }\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n }\n function __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_set_10bad9bee0e9c58b = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_d23661d19148b229 = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_f4f1f0daa30696fc = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_subarray_3aaeec89bb2544f0 = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_subarray_769e1e0f81bb259b = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_0;\n const offset = table.grow(4);\n table.set(0, void 0);\n table.set(offset + 0, void 0);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n };\n imports.wbg.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return ret;\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n return imports;\n }\n function __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n Line truncated
const jsContent = '(function() {\n "use strict";\n let wasm;\n const cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {\n throw Error("TextDecoder not available");\n } };\n if (typeof TextDecoder !== "undefined") {\n cachedTextDecoder.decode();\n }\n let cachedUint8ArrayMemory0 = null;\n function getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n }\n function getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n }\n function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n async function __wbg_load(module, imports) {\n if (typeof Response === "function" && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === "function") {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n if (module.headers.get("Content-Type") != "application/wasm") {\n console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n", e);\n } else {\n throw e;\n }\n }\n }\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n }\n function __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_set_10bad9bee0e9c58b = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_d23661d19148b229 = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_f4f1f0daa30696fc = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_subarray_3aaeec89bb2544f0 = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_subarray_769e1e0f81bb259b = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_0;\n const offset = table.grow(4);\n table.set(0, void 0);\n table.set(offset + 0, void 0);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n };\n imports.wbg.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return ret;\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n return imports;\n }\n function __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n Line truncated
const blob = typeof self !== "undefined" && self.Blob && new Blob([jsContent], { type: "text/javascript;charset=utf-8" });
function WorkerWrapper(options) {
let objURL;
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"spark.module.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, Line truncated
{"version":3,"file":"spark.module.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, Line truncated
+4 -4
View File
@@ -2289,7 +2289,7 @@ function Wt(t, A, e, s) {
return n & 255 | (i & 255) << 8 | (r & 255) << 16 | (a & 255) << 24;
}
function vg(t, A, e, s) {
const n = (s == null ? void 0 : s.sh1Min) ?? -1, i = (s == null ? void 0 : s.sh1Max) ?? 1, r = 0.5 * (n + i), a = 63 / (i - n), o = A * 2;
const n = (s == null ? void 0 : s.sh1Min) ?? -1, i = (s == null ? void 0 : s.sh1Max) ?? 1, r = 0.5 * (n + i), a = 126 / (i - n), o = A * 2;
for (let g = 0; g < 9; ++g) {
const l = (e[g] - r) * a, c = Math.round(Math.max(-63, Math.min(63, l))) & 127, I = g * 7, h = I + 7, B = Math.floor(I / 32), C = I - B * 32, E = c << C & 4294967295;
if (t[o + B] |= E, h > B * 32 + 32) {
@@ -2299,7 +2299,7 @@ function vg(t, A, e, s) {
}
}
function bg(t, A, e, s) {
const n = (s == null ? void 0 : s.sh2Min) ?? -1, i = (s == null ? void 0 : s.sh2Max) ?? 1, r = 0.5 * (n + i), a = 0.5 / (i - n);
const n = (s == null ? void 0 : s.sh2Min) ?? -1, i = (s == null ? void 0 : s.sh2Max) ?? 1, r = 0.5 * (n + i), a = 2 / (i - n);
t[A * 4 + 0] = Wt(
(e[0] - r) * a,
(e[1] - r) * a,
@@ -2323,7 +2323,7 @@ function bg(t, A, e, s) {
);
}
function Fg(t, A, e, s) {
const n = (s == null ? void 0 : s.sh3Min) ?? -1, i = (s == null ? void 0 : s.sh3Max) ?? 1, r = 0.5 * (n + i), a = 31 / (i - n), o = A * 4;
const n = (s == null ? void 0 : s.sh3Min) ?? -1, i = (s == null ? void 0 : s.sh3Max) ?? 1, r = 0.5 * (n + i), a = 62 / (i - n), o = A * 4;
for (let g = 0; g < 21; ++g) {
const l = (e[g] - r) * a, c = Math.round(Math.max(-31, Math.min(31, l))) & 63, I = g * 6, h = I + 6, B = Math.floor(I / 32), C = I - B * 32, E = c << C & 4294967295;
if (t[o + B] |= E, h > B * 32 + 32) {
@@ -6579,7 +6579,7 @@ function Bs(t) {
throw new Error(`Unsupported number of SH coefficients: ${A}`);
return e;
}
const Ha = '(function(){"use strict";let xA;const ss=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&ss.decode();let VA=null;function js(){return(VA===null||VA.byteLength===0)&&(VA=new Uint8Array(xA.memory.buffer)),VA}function Vs(e,A){return e=e>>>0,ss.decode(js().subarray(e,e+A))}function Os(e,A,t){return xA.sort_splats(e,A,t)>>>0}function $s(e,A,t){return xA.sort32_splats(e,A,t)>>>0}async function Ae(e,A){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,A)}catch(s){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n",s);else throw s}const t=await e.arrayBuffer();return await WebAssembly.instantiate(t,A)}else{const t=await WebAssembly.instantiate(e,A);return t instanceof WebAssembly.Instance?{instance:t,module:e}:t}}function te(){const e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(A){return A.buffer},e.wbg.__wbg_length_3b4f022188ae8db6=function(A){return A.length},e.wbg.__wbg_length_6ca527665d89694d=function(A){return A.length},e.wbg.__wbg_length_8cfd2c6409af88ad=function(A){return A.length},e.wbg.__wbg_new_9fee97a409b32b68=function(A){return new Uint16Array(A)},e.wbg.__wbg_new_e3b321dcfef89fc7=function(A){return new Uint32Array(A)},e.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354=function(A,t,s){return new Float32Array(A,t>>>0,s>>>0)},e.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(A,t,s){return new Uint32Array(A,t>>>0,s>>>0)},e.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(A){return new Float32Array(A>>>0)},e.wbg.__wbg_set_10bad9bee0e9c58b=function(A,t,s){A.set(t,s>>>0)},e.wbg.__wbg_set_d23661d19148b229=function(A,t,s){A.set(t,s>>>0)},e.wbg.__wbg_set_f4f1f0daa30696fc=function(A,t,s){A.set(t,s>>>0)},e.wbg.__wbg_subarray_3aaeec89bb2544f0=function(A,t,s){return A.subarray(t>>>0,s>>>0)},e.wbg.__wbg_subarray_769e1e0f81bb259b=function(A,t,s){return A.subarray(t>>>0,s>>>0)},e.wbg.__wbindgen_init_externref_table=function(){const A=xA.__wbindgen_export_0,t=A.grow(4);A.set(0,void 0),A.set(t+0,void 0),A.set(t+1,null),A.set(t+2,!0),A.set(t+3,!1)},e.wbg.__wbindgen_memory=function(){return xA.memory},e.wbg.__wbindgen_throw=function(A,t){throw new Error(Vs(A,t))},e}function se(e,A){return xA=e.exports,es.__wbindgen_wasm_module=A,VA=null,xA.__wbindgen_start(),xA}async function es(e){if(xA!==void 0)return xA;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("data:application/wasm;base64,AGFzbQEAAAABzAEeYAJ/fwF/YAJ/fwBgA39/fwF/YAN/f38AYAF/AX9gAX8AYANvf38Bb2AFf39/f38Bf2AFf39/f38AYAFvAW9gA29vfwBgAW8Bf2AAAGAAAX9gBH9/f38AYAR/f39/AX9gA39vbwF/YAF/AW9gAAFvYAF9AX1gBn9/f39/fwBgDX19fX19fX19f29/fX0Bb2AGf39/f39/AX9gBX9/fX9/AGAEf31/fwBgBX9/fn9/AGAEf35/fwBgBX9/fH9/AGAEf3x/fwBgAn19AX0C8gQRA3diZx1fX3diZ19idWZmZXJfNjA5Y2MzZWVlNTFlZDE1OAAJA3diZxpfX3diZ19uZXdfOWZlZTk3YTQwOWIzMmI2OAAJA3diZxpfX3diZ19zZXRfZjRmMWYwZGFhMzA2OTZmYwAKA3diZx1fX3diZ19sZW5ndGhfOGNmZDJjNjQwOWFmODhhZAALA3diZzFfX3diZ19uZXd3aXRoYnl0ZW9mZnNldGFuZGxlbmd0aF9mMWRlYWQ0NGQxZmM3MjEyAAYDd2JnGl9fd2JnX25ld19lM2IzMjFkY2ZlZjg5ZmM3AAkDd2JnGl9fd2JnX3NldF9kMjM2NjFkMTkxNDhiMjI5AAoDd2JnHV9fd2JnX2xlbmd0aF82Y2E1Mjc2NjVkODk2OTRkAAsDd2JnMV9fd2JnX25ld3dpdGhieXRlb2Zmc2V0YW5kbGVuZ3RoX2U2YjdlNjlhY2Q0YzczNTQABgN3YmcaX193Ymdfc2V0XzEwYmFkOWJlZTBlOWM1OGIACgN3YmcdX193YmdfbGVuZ3RoXzNiNGYwMjIxODhhZThkYjYACwN3YmcfX193Ymdfc3ViYXJyYXlfNzY5ZTFlMGY4MWJiMjU5YgAGA3diZx9fX3diZ19zdWJhcnJheV8zYWFlZWM4OWJiMjU0NGYwAAYDd2JnJF9fd2JnX25ld3dpdGhsZW5ndGhfNWE1ZWZlMzEzY2ZkNTlmMQARA3diZxBfX3diaW5kZ2VuX3Rocm93AAEDd2JnEV9fd2JpbmRnZW5fbWVtb3J5ABIDd2JnH19fd2JpbmRnZW5faW5pdF9leHRlcm5yZWZfdGFibGUADANeXQQAAQcFAgMCEwEBAAABAQAADQABAwgIAwEBBQ0BFA4DAAMBAwIMDAIBAQcDABUBFhcIGQcbBQ4CEBAFAx0FBA8AAgQEBAANAAABAQEAAAADAQIDAAEAAQAAAQEEBAQJAnABLi5vAIABBQMBABEGCQF/AUGAgMAACwdiBgZtZW1vcnkCAAtzb3J0X3NwbGF0cwBJDXNvcnQzMl9zcGxhdHMASg5yYXljYXN0X3NwbGF0cwA+E19fd2JpbmRnZW5fZXhwb3J0XzABARBfX3diaW5kZ2VuX3N0YXJ0ABAJMwEAQQELLVRTVVhkRC5CREBIR0JCQUVDTj0zSzUgZltaXTlcZ0YxJCprSzghaGlRVl5fIwwBAwrm2gFdmyQCCX8BfiMAQRBrIggkAAJ/AkACQAJAAkACQAJAIABB9QFPBEBBACAAQcz/e0sNBxogAEELaiIBQXhxIQVB0JrAACgCACIJRQ0EQR8hB0EAIAVrIQQgAEH0//8HTQRAIAVBBiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBwsgB0ECdEG0l8AAaigCACIBRQRAQQAhAAwCC0EAIQAgBUEZIAdBAXZrQQAgB0EfRxt0IQMDQAJAIAEoAgRBeHEiBiAFSQ0AIAYgBWsiBiAETw0AIAEhAiAGIgQNAEEAIQQgASEADAQLIAEoAhQiBiAAIAYgASADQR12QQRxaigCECIBRxsgACAGGyEAIANBAXQhAyABDQALDAELQcyawAAoAgAiAkEQIABBC2pB+ANxIABBC0kbIgVBA3YiAHYiAUEDcQRAAkAgAUF/c0EBcSAAaiIGQQN0IgBBxJjAAGoiAyAAQcyYwABqKAIAIgEoAggiBEcEQCAEIAM2AgwgAyAENgIIDAELQcyawAAgAkF+IAZ3cTYCAAsgASAA Line truncated
const Ha = '(function(){"use strict";let xA;const ss=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&ss.decode();let VA=null;function js(){return(VA===null||VA.byteLength===0)&&(VA=new Uint8Array(xA.memory.buffer)),VA}function Vs(e,A){return e=e>>>0,ss.decode(js().subarray(e,e+A))}function Os(e,A,t){return xA.sort_splats(e,A,t)>>>0}function $s(e,A,t){return xA.sort32_splats(e,A,t)>>>0}async function Ae(e,A){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,A)}catch(s){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n",s);else throw s}const t=await e.arrayBuffer();return await WebAssembly.instantiate(t,A)}else{const t=await WebAssembly.instantiate(e,A);return t instanceof WebAssembly.Instance?{instance:t,module:e}:t}}function te(){const e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(A){return A.buffer},e.wbg.__wbg_length_3b4f022188ae8db6=function(A){return A.length},e.wbg.__wbg_length_6ca527665d89694d=function(A){return A.length},e.wbg.__wbg_length_8cfd2c6409af88ad=function(A){return A.length},e.wbg.__wbg_new_9fee97a409b32b68=function(A){return new Uint16Array(A)},e.wbg.__wbg_new_e3b321dcfef89fc7=function(A){return new Uint32Array(A)},e.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354=function(A,t,s){return new Float32Array(A,t>>>0,s>>>0)},e.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(A,t,s){return new Uint32Array(A,t>>>0,s>>>0)},e.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(A){return new Float32Array(A>>>0)},e.wbg.__wbg_set_10bad9bee0e9c58b=function(A,t,s){A.set(t,s>>>0)},e.wbg.__wbg_set_d23661d19148b229=function(A,t,s){A.set(t,s>>>0)},e.wbg.__wbg_set_f4f1f0daa30696fc=function(A,t,s){A.set(t,s>>>0)},e.wbg.__wbg_subarray_3aaeec89bb2544f0=function(A,t,s){return A.subarray(t>>>0,s>>>0)},e.wbg.__wbg_subarray_769e1e0f81bb259b=function(A,t,s){return A.subarray(t>>>0,s>>>0)},e.wbg.__wbindgen_init_externref_table=function(){const A=xA.__wbindgen_export_0,t=A.grow(4);A.set(0,void 0),A.set(t+0,void 0),A.set(t+1,null),A.set(t+2,!0),A.set(t+3,!1)},e.wbg.__wbindgen_memory=function(){return xA.memory},e.wbg.__wbindgen_throw=function(A,t){throw new Error(Vs(A,t))},e}function se(e,A){return xA=e.exports,es.__wbindgen_wasm_module=A,VA=null,xA.__wbindgen_start(),xA}async function es(e){if(xA!==void 0)return xA;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("data:application/wasm;base64,AGFzbQEAAAABzAEeYAJ/fwF/YAJ/fwBgA39/fwF/YAN/f38AYAF/AX9gAX8AYANvf38Bb2AFf39/f38Bf2AFf39/f38AYAFvAW9gA29vfwBgAW8Bf2AAAGAAAX9gBH9/f38AYAR/f39/AX9gA39vbwF/YAF/AW9gAAFvYAF9AX1gBn9/f39/fwBgDX19fX19fX19f29/fX0Bb2AGf39/f39/AX9gBX9/fX9/AGAEf31/fwBgBX9/fn9/AGAEf35/fwBgBX9/fH9/AGAEf3x/fwBgAn19AX0C8gQRA3diZx1fX3diZ19idWZmZXJfNjA5Y2MzZWVlNTFlZDE1OAAJA3diZxpfX3diZ19uZXdfOWZlZTk3YTQwOWIzMmI2OAAJA3diZxpfX3diZ19zZXRfZjRmMWYwZGFhMzA2OTZmYwAKA3diZx1fX3diZ19sZW5ndGhfOGNmZDJjNjQwOWFmODhhZAALA3diZzFfX3diZ19uZXd3aXRoYnl0ZW9mZnNldGFuZGxlbmd0aF9mMWRlYWQ0NGQxZmM3MjEyAAYDd2JnGl9fd2JnX25ld19lM2IzMjFkY2ZlZjg5ZmM3AAkDd2JnGl9fd2JnX3NldF9kMjM2NjFkMTkxNDhiMjI5AAoDd2JnHV9fd2JnX2xlbmd0aF82Y2E1Mjc2NjVkODk2OTRkAAsDd2JnMV9fd2JnX25ld3dpdGhieXRlb2Zmc2V0YW5kbGVuZ3RoX2U2YjdlNjlhY2Q0YzczNTQABgN3YmcaX193Ymdfc2V0XzEwYmFkOWJlZTBlOWM1OGIACgN3YmcdX193YmdfbGVuZ3RoXzNiNGYwMjIxODhhZThkYjYACwN3YmcfX193Ymdfc3ViYXJyYXlfNzY5ZTFlMGY4MWJiMjU5YgAGA3diZx9fX3diZ19zdWJhcnJheV8zYWFlZWM4OWJiMjU0NGYwAAYDd2JnJF9fd2JnX25ld3dpdGhsZW5ndGhfNWE1ZWZlMzEzY2ZkNTlmMQARA3diZxBfX3diaW5kZ2VuX3Rocm93AAEDd2JnEV9fd2JpbmRnZW5fbWVtb3J5ABIDd2JnH19fd2JpbmRnZW5faW5pdF9leHRlcm5yZWZfdGFibGUADANeXQQAAQcFAgMCEwEBAAABAQAADQABAwgIAwEBBQ0BFA4DAAMBAwIMDAIBAQcDABUBFhcIGQcbBQ4CEBAFAx0FBA8AAgQEBAANAAABAQEAAAADAQIDAAEAAQAAAQEEBAQJAnABLi5vAIABBQMBABEGCQF/AUGAgMAACwdiBgZtZW1vcnkCAAtzb3J0X3NwbGF0cwBJDXNvcnQzMl9zcGxhdHMASg5yYXljYXN0X3NwbGF0cwA+E19fd2JpbmRnZW5fZXhwb3J0XzABARBfX3diaW5kZ2VuX3N0YXJ0ABAJMwEAQQELLVRTVVhkRC5CREBIR0JCQUVDTj0zSzUgZltaXTlcZ0YxJCprSzghaGlRVl5fIwwBAwrm2gFdmyQCCX8BfiMAQRBrIggkAAJ/AkACQAJAAkACQAJAIABB9QFPBEBBACAAQcz/e0sNBxogAEELaiIBQXhxIQVB0JrAACgCACIJRQ0EQR8hB0EAIAVrIQQgAEH0//8HTQRAIAVBBiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBwsgB0ECdEG0l8AAaigCACIBRQRAQQAhAAwCC0EAIQAgBUEZIAdBAXZrQQAgB0EfRxt0IQMDQAJAIAEoAgRBeHEiBiAFSQ0AIAYgBWsiBiAETw0AIAEhAiAGIgQNAEEAIQQgASEADAQLIAEoAhQiBiAAIAYgASADQR12QQRxaigCECIBRxsgACAGGyEAIANBAXQhAyABDQALDAELQcyawAAoAgAiAkEQIABBC2pB+ANxIABBC0kbIgVBA3YiAHYiAUEDcQRAAkAgAUF/c0EBcSAAaiIGQQN0IgBBxJjAAGoiAyAAQcyYwABqKAIAIgEoAggiBEcEQCAEIAM2AgwgAyAENgIIDAELQcyawAAgAkF+IAZ3cTYCAAsgASAA Line truncated
function mu(t) {
let A;
try {
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"spark.module.min.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2,Line truncated
{"version":3,"file":"spark.module.min.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2,Line truncated