Bump dist build

This commit is contained in:
sparkjsdev[bot] committed 2025-06-30 21:56:33 +00:00
1 parent 16bc076db7
commit 666f246d05
11 files changed
+369 -388

No files matched your search

@@ -1 +1 @@
{"version":3,"file":"worker-iMUBmfPd.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/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../node_modules/@jsquash/webp/utils.js","../node_modules/@jsquash/webp/codec/dec/webp_dec.js","../node_modules/@jsquash/webp/decode.js","../src/pcsogs.ts","../src/ply.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/vecmat.ts","../src/dyno/transform.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/splatWorker.ts","../src/SplatLoader.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} 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 * @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) {\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);\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 =Line truncated
{"version":3,"file":"worker-BQC_XO3H.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/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../node_modules/@jsquash/webp/utils.js","../node_modules/@jsquash/webp/codec/dec/webp_dec.js","../node_modules/@jsquash/webp/decode.js","../src/pcsogs.ts","../src/ply.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/vecmat.ts","../src/dyno/transform.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/splatWorker.ts","../src/SplatLoader.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} 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 * @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) {\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);\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 =Line truncated
@@ -1 +1 @@
{"version":3,"file":"worker-SD7QwawG.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/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../node_modules/@jsquash/webp/utils.js","../node_modules/@jsquash/webp/codec/dec/webp_dec.js","../node_modules/@jsquash/webp/decode.js","../src/pcsogs.ts","../src/ply.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/vecmat.ts","../src/dyno/transform.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/splatWorker.ts","../src/SplatLoader.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} 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 * @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) {\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);\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 =Line truncated
{"version":3,"file":"worker-DHg79V6G.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/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../node_modules/@jsquash/webp/utils.js","../node_modules/@jsquash/webp/codec/dec/webp_dec.js","../node_modules/@jsquash/webp/decode.js","../src/pcsogs.ts","../src/ply.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/vecmat.ts","../src/dyno/transform.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/splatWorker.ts","../src/SplatLoader.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} 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 * @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) {\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);\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 =Line truncated
-1
View File
@@ -1 +0,0 @@
ca9e50ce4b73ef622e296d40449f7b8f0c9a4681
+18 -24
View File
@@ -7730,15 +7730,9 @@ const _PlyReader = class _PlyReader {
min_scale_z,
max_scale_x,
max_scale_y,
max_scale_z,
min_r,
min_g,
min_b,
max_r,
max_g,
max_b
max_scale_z
} = element.properties;
if (!min_x || !min_y || !min_z || !max_x || !max_y || !max_z || !min_scale_x || !min_scale_y || !min_scale_z || !max_scale_x || !max_scale_y || !max_scale_z || !min_r || !min_g || !min_b || !max_r || !max_g || !max_b) {
if (!min_x || !min_y || !min_z || !max_x || !max_y || !max_z || !min_scale_x || !min_scale_y || !min_scale_z || !max_scale_x || !max_scale_y || !max_scale_z) {
throw new Error("Missing PLY chunk properties");
}
isSuperSplat = true;
@@ -7756,12 +7750,12 @@ const _PlyReader = class _PlyReader {
max_scale_x: max_scale_x2,
max_scale_y: max_scale_y2,
max_scale_z: max_scale_z2,
min_r: min_r2,
min_g: min_g2,
min_b: min_b2,
max_r: max_r2,
max_g: max_g2,
max_b: max_b2
min_r,
min_g,
min_b,
max_r,
max_g,
max_b
} = item;
ssChunks.push({
min_x: min_x2,
@@ -7776,12 +7770,12 @@ const _PlyReader = class _PlyReader {
max_scale_x: max_scale_x2,
max_scale_y: max_scale_y2,
max_scale_z: max_scale_z2,
min_r: min_r2,
min_g: min_g2,
min_b: min_b2,
max_r: max_r2,
max_g: max_g2,
max_b: max_b2
min_r,
min_g,
min_b,
max_r,
max_g,
max_b
});
};
}
@@ -7848,9 +7842,9 @@ const _PlyReader = class _PlyReader {
const scaleZ = Math.exp(
(packed_scale2 & 2047) / 2047 * (max_scale_z - min_scale_z) + min_scale_z
);
const r = (packed_color2 >>> 24 & 255) / 255 * (max_r - min_r) + min_r;
const g = (packed_color2 >>> 16 & 255) / 255 * (max_g - min_g) + min_g;
const b = (packed_color2 >>> 8 & 255) / 255 * (max_b - min_b) + min_b;
const r = (packed_color2 >>> 24 & 255) / 255 * ((max_r ?? 1) - (min_r ?? 0)) + (min_r ?? 0);
const g = (packed_color2 >>> 16 & 255) / 255 * ((max_g ?? 1) - (min_g ?? 0)) + (min_g ?? 0);
const b = (packed_color2 >>> 8 & 255) / 255 * ((max_b ?? 1) - (min_b ?? 0)) + (min_b ?? 0);
const opacity = (packed_color2 & 255) / 255;
splatCallback(
index,
@@ -8145,7 +8139,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 raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid) {\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);\n return ret;\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 = instanLine 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 raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid) {\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);\n return ret;\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 = instanLine 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":["../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","../node_modules/fflate/esm/browser.js","../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":["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} 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 * @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) {\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);\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(arg0Line truncated
{"version":3,"file":"spark.cjs.js","sources":["../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","../node_modules/fflate/esm/browser.js","../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":["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} 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 * @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) {\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);\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(arg0Line truncated
+12 -12
View File
@@ -1,4 +1,4 @@
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const eA=require("three");var NI=typeof document<"u"?document.currentScript:null;function sQ(t){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const I in t)if(I!=="default"){const g=Object.getOwnPropertyDescriptor(t,I);Object.defineProperty(A,I,g.get?g:{enumerable:!0,get:()=>t[I]})}}return A.default=t,Object.freeze(A)}const n=sQ(eA);let WA;const Cg=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Cg.decode();let Ft=null;function QQ(){return(Ft===null||Ft.byteLength===0)&&(Ft=new Uint8Array(WA.memory.buffer)),Ft}function CQ(t,A){return t=t>>>0,Cg.decode(QQ().subarray(t,t+A))}function EQ(t,A,I,g,B,i,e,s,Q,E,a){return WA.raycast_splats(t,A,I,g,B,i,e,s,Q,E,a)}async function aQ(t,A){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,A)}catch(g){if(t.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",g);else throw g}const I=await t.arrayBuffer();return await WebAssembly.instantiate(I,A)}else{const I=await WebAssembly.instantiate(t,A);return I instanceof WebAssembly.Instance?{instance:I,module:t}:I}}function nQ(){const t={};return t.wbg={},t.wbg.__wbg_buffer_609cc3eee51ed158=function(A){return A.buffer},t.wbg.__wbg_length_3b4f022188ae8db6=function(A){return A.length},t.wbg.__wbg_length_6ca527665d89694d=function(A){return A.length},t.wbg.__wbg_length_8cfd2c6409af88ad=function(A){return A.length},t.wbg.__wbg_new_9fee97a409b32b68=function(A){return new Uint16Array(A)},t.wbg.__wbg_new_e3b321dcfef89fc7=function(A){return new Uint32Array(A)},t.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354=function(A,I,g){return new Float32Array(A,I>>>0,g>>>0)},t.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(A,I,g){return new Uint32Array(A,I>>>0,g>>>0)},t.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(A){return new Float32Array(A>>>0)},t.wbg.__wbg_set_10bad9bee0e9c58b=function(A,I,g){A.set(I,g>>>0)},t.wbg.__wbg_set_d23661d19148b229=function(A,I,g){A.set(I,g>>>0)},t.wbg.__wbg_set_f4f1f0daa30696fc=function(A,I,g){A.set(I,g>>>0)},t.wbg.__wbg_subarray_3aaeec89bb2544f0=function(A,I,g){return A.subarray(I>>>0,g>>>0)},t.wbg.__wbg_subarray_769e1e0f81bb259b=function(A,I,g){return A.subarray(I>>>0,g>>>0)},t.wbg.__wbindgen_init_externref_table=function(){const A=WA.__wbindgen_export_0,I=A.grow(4);A.set(0,void 0),A.set(I+0,void 0),A.set(I+1,null),A.set(I+2,!0),A.set(I+3,!1)},t.wbg.__wbindgen_memory=function(){return WA.memory},t.wbg.__wbindgen_throw=function(A,I){throw new Error(CQ(A,I))},t}function oQ(t,A){return WA=t.exports,Eg.__wbindgen_wasm_module=A,Ft=null,WA.__wbindgen_start(),WA}async function Eg(t){if(WA!==void 0)return WA;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("data:application/wasm;base64,AGFzbQEAAAAB9wEkYAJ/fwF/YAN/f38Bf2ACf38AYAN/f38AYAF/AX9gAX8AYAV/f39/fwBgA29/fwFvYAV/f39/fwF/YAR/f39/AGABbwFvYANvb38AYAFvAX9gAAF/YAAAYAd/f39/f39/AX9gAX0BfWAGf39/f39/AGAEf39/fwF/YAF/AW9gAAFvYAd/f39/f39/AGACf34Bf2ADf35+AGACf34AYAt9fX19fX19fX9vfwFvYAZ/f39/f38Bf2AFf399f38AYAR/fX9/AGAFf39+f38AYAR/fn9/AGAFf398f38AYAR/fH9/AGADf35+AX9gA39vbwF/YAJ9fQF9AvIEEQN3YmcdX193YmdfYnVmZmVyXzYwOWNjM2VlZTUxZWQxNTgACgN3YmcaX193YmdfbmV3XzlmZWU5N2E0MDliMzJiNjgACgN3YmcaX193Ymdfc2V0X2Y0ZjFmMGRhYTMwNjk2ZmMACwN3YmcdX193YmdfbGVuZ3RoXzhjZmQyYzY0MDlhZjg4YWQADAN3YmcxX193YmdfbmV3d2l0aGJ5dGVvZmZzZXRhbmRsZW5ndGhfZjFkZWFkNDRkMWZjNzIxMgAHA3diZxpfX3diZ19uZXdfZTNiMzIxZGNmZWY4OWZjNwAKA3diZxpfX3diZ19zZXRfZDIzNjYxZDE5MTQ4YjIyOQALA3diZx1fX3diZ19sZW5ndGhfNmNhNTI3NjY1ZDg5Njk0ZAAMA3diZzFfX3diZ19uZXd3aXRoYnl0ZW9mZnNldGFuZGxlbmd0aF9lNmI3ZTY5YWNkNGM3MzU0AAcDd2JnGl9fd2JnX3NldF8xMGJhZDliZWUwZTljNThiAAsDd2JnHV9fd2JnX2xlbmd0aF8zYjRmMDIyMTg4YWU4ZGI2AAwDd2JnH19fd2JnX3N1YmFycmF5Xzc2OWUxZTBmODFiYjI1OWIABwN3YmcfX193Ymdfc3ViYXJyYXlfM2FhZWVjODliYjI1NDRmMAAHA3diZyRfX3diZ19uZXd3aXRobGVuZ3RoXzVhNWVmZTMxM2NmZDU5ZjEAEwN3YmcQX193YmluZGdlbl90aHJvdwACA3diZxFfX3diaW5kZ2VuX21lbW9yeQAUA3diZx9fX3diaW5kZ2VuX2luaXRfZXh0ZXJucmVmX3RhYmxlAA4DvAG6AQQAAAYABAQEAg8AAQIEBAMIAgMFAwEEAQABAQACFRACAgQEAgACAwACAAACEQ8AAAINCQAAAwACAgMGAAUBAgAGAwQCFgIFDREAAgkFAAUXBAAYBgUBAAMCAAMBAQ4BAQACAgMBAgAIAgADABkCGgAGGx0fCAUhCQEiBQMjBQQCEgABAAAGDQICAgICAAAAAgIAAgAAAAADAwEDAwMABQAAAAEAAAIAAAACAAAAAAAAAgABAgAEBBAEAwQJAnABaWlvAIABBQMBABEGCQF/AUGAgMAACwdTBQZtZW1vcnkCAAtzb3J0X3NwbGF0cwCKAQ5yYXljYXN0X3NwbGF0cwB9E19fd2JpbmRnZW5fZXhwb3J0XzABARBfX3diaW5kZ2VuX3N0YXJ0ABAJrwEBAEEBC2iLAZ4BnQHEAZsBmAHEAcoBX3zFAXKcAZgBcsoBXZABmQFPhwFgyQGuAbUBiwGaAcoLine truncated
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const eA=require("three");var NI=typeof document<"u"?document.currentScript:null;function sQ(t){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const I in t)if(I!=="default"){const g=Object.getOwnPropertyDescriptor(t,I);Object.defineProperty(A,I,g.get?g:{enumerable:!0,get:()=>t[I]})}}return A.default=t,Object.freeze(A)}const n=sQ(eA);let WA;const Cg=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Cg.decode();let Ft=null;function QQ(){return(Ft===null||Ft.byteLength===0)&&(Ft=new Uint8Array(WA.memory.buffer)),Ft}function CQ(t,A){return t=t>>>0,Cg.decode(QQ().subarray(t,t+A))}function EQ(t,A,I,g,B,i,e,s,Q,E,a){return WA.raycast_splats(t,A,I,g,B,i,e,s,Q,E,a)}async function aQ(t,A){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,A)}catch(g){if(t.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",g);else throw g}const I=await t.arrayBuffer();return await WebAssembly.instantiate(I,A)}else{const I=await WebAssembly.instantiate(t,A);return I instanceof WebAssembly.Instance?{instance:I,module:t}:I}}function nQ(){const t={};return t.wbg={},t.wbg.__wbg_buffer_609cc3eee51ed158=function(A){return A.buffer},t.wbg.__wbg_length_3b4f022188ae8db6=function(A){return A.length},t.wbg.__wbg_length_6ca527665d89694d=function(A){return A.length},t.wbg.__wbg_length_8cfd2c6409af88ad=function(A){return A.length},t.wbg.__wbg_new_9fee97a409b32b68=function(A){return new Uint16Array(A)},t.wbg.__wbg_new_e3b321dcfef89fc7=function(A){return new Uint32Array(A)},t.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354=function(A,I,g){return new Float32Array(A,I>>>0,g>>>0)},t.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(A,I,g){return new Uint32Array(A,I>>>0,g>>>0)},t.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(A){return new Float32Array(A>>>0)},t.wbg.__wbg_set_10bad9bee0e9c58b=function(A,I,g){A.set(I,g>>>0)},t.wbg.__wbg_set_d23661d19148b229=function(A,I,g){A.set(I,g>>>0)},t.wbg.__wbg_set_f4f1f0daa30696fc=function(A,I,g){A.set(I,g>>>0)},t.wbg.__wbg_subarray_3aaeec89bb2544f0=function(A,I,g){return A.subarray(I>>>0,g>>>0)},t.wbg.__wbg_subarray_769e1e0f81bb259b=function(A,I,g){return A.subarray(I>>>0,g>>>0)},t.wbg.__wbindgen_init_externref_table=function(){const A=WA.__wbindgen_export_0,I=A.grow(4);A.set(0,void 0),A.set(I+0,void 0),A.set(I+1,null),A.set(I+2,!0),A.set(I+3,!1)},t.wbg.__wbindgen_memory=function(){return WA.memory},t.wbg.__wbindgen_throw=function(A,I){throw new Error(CQ(A,I))},t}function oQ(t,A){return WA=t.exports,Eg.__wbindgen_wasm_module=A,Ft=null,WA.__wbindgen_start(),WA}async function Eg(t){if(WA!==void 0)return WA;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("data:application/wasm;base64,AGFzbQEAAAAB9wEkYAJ/fwF/YAN/f38Bf2ACf38AYAN/f38AYAF/AX9gAX8AYAV/f39/fwBgA29/fwFvYAV/f39/fwF/YAR/f39/AGABbwFvYANvb38AYAFvAX9gAAF/YAAAYAd/f39/f39/AX9gAX0BfWAGf39/f39/AGAEf39/fwF/YAF/AW9gAAFvYAd/f39/f39/AGACf34Bf2ADf35+AGACf34AYAt9fX19fX19fX9vfwFvYAZ/f39/f38Bf2AFf399f38AYAR/fX9/AGAFf39+f38AYAR/fn9/AGAFf398f38AYAR/fH9/AGADf35+AX9gA39vbwF/YAJ9fQF9AvIEEQN3YmcdX193YmdfYnVmZmVyXzYwOWNjM2VlZTUxZWQxNTgACgN3YmcaX193YmdfbmV3XzlmZWU5N2E0MDliMzJiNjgACgN3YmcaX193Ymdfc2V0X2Y0ZjFmMGRhYTMwNjk2ZmMACwN3YmcdX193YmdfbGVuZ3RoXzhjZmQyYzY0MDlhZjg4YWQADAN3YmcxX193YmdfbmV3d2l0aGJ5dGVvZmZzZXRhbmRsZW5ndGhfZjFkZWFkNDRkMWZjNzIxMgAHA3diZxpfX3diZ19uZXdfZTNiMzIxZGNmZWY4OWZjNwAKA3diZxpfX3diZ19zZXRfZDIzNjYxZDE5MTQ4YjIyOQALA3diZx1fX3diZ19sZW5ndGhfNmNhNTI3NjY1ZDg5Njk0ZAAMA3diZzFfX3diZ19uZXd3aXRoYnl0ZW9mZnNldGFuZGxlbmd0aF9lNmI3ZTY5YWNkNGM3MzU0AAcDd2JnGl9fd2JnX3NldF8xMGJhZDliZWUwZTljNThiAAsDd2JnHV9fd2JnX2xlbmd0aF8zYjRmMDIyMTg4YWU4ZGI2AAwDd2JnH19fd2JnX3N1YmFycmF5Xzc2OWUxZTBmODFiYjI1OWIABwN3YmcfX193Ymdfc3ViYXJyYXlfM2FhZWVjODliYjI1NDRmMAAHA3diZyRfX3diZ19uZXd3aXRobGVuZ3RoXzVhNWVmZTMxM2NmZDU5ZjEAEwN3YmcQX193YmluZGdlbl90aHJvdwACA3diZxFfX3diaW5kZ2VuX21lbW9yeQAUA3diZx9fX3diaW5kZ2VuX2luaXRfZXh0ZXJucmVmX3RhYmxlAA4DvAG6AQQAAAYABAQEAg8AAQIEBAMIAgMFAwEEAQABAQACFRACAgQEAgACAwACAAACEQ8AAAINCQAAAwACAgMGAAUBAgAGAwQCFgIFDREAAgkFAAUXBAAYBgUBAAMCAAMBAQ4BAQACAgMBAgAIAgADABkCGgAGGx0fCAUhCQEiBQMjBQQCEgABAAAGDQICAgICAAAAAgIAAgAAAAADAwEDAwMABQAAAAEAAAIAAAACAAAAAAAAAgABAgAEBBAEAwQJAnABaWlvAIABBQMBABEGCQF/AUGAgMAACwdTBQZtZW1vcnkCAAtzb3J0X3NwbGF0cwCKAQ5yYXljYXN0X3NwbGF0cwB9E19fd2JpbmRnZW5fZXhwb3J0XzABARBfX3diaW5kZ2VuX3N0YXJ0ABAJrwEBAEEBC2iLAZ4BnQHEAZsBmAHEAcoBX3zFAXKcAZgBcsoBXZABmQFPhwFgyQGuAbUBiwGaAcoLine truncated
`).map(e=>{const s=e.trimEnd();return A?s:s.length>0?(A=!0,s):null}).filter(e=>e!=null);for(;I.length>0&&I[I.length-1].length===0;)I.pop();if(I.length===0)return[];const g=(i=I[0].match(/^\s*/))==null?void 0:i[0];if(!g)return I;const B=new RegExp(`^${g}`);return I.map(e=>e.replace(B,""))}function rA(t){return UA(t).join(`
`)}class S extends W{constructor({a:A,outKey:I,outTypeFunc:g}){const B={a:z(A)},i=g(z(A)),e={[I]:i};super({inTypes:B,outTypes:e,inputs:{a:A}}),this.outKey=I}dynoOut(){return new q(this,this.outKey)}}class _ extends W{constructor({a:A,b:I,outKey:g,outTypeFunc:B}){const i={a:z(A),b:z(I)},e=B(z(A),z(I)),s={[g]:e};super({inTypes:i,outTypes:s,inputs:{a:A,b:I}}),this.outKey=g}dynoOut(){return new q(this,this.outKey)}}class nt extends W{constructor({a:A,b:I,c:g,outKey:B,outTypeFunc:i}){const e={a:z(A),b:z(I),c:z(g)},s=i(z(A),z(I),z(g)),Q={[B]:s};super({inTypes:e,outTypes:Q,inputs:{a:A,b:I,c:g}}),this.outKey=B}dynoOut(){return new q(this,this.outKey)}}const X={type:"Gsplat"},qt={type:"PackedSplats"},dQ=t=>new wg({packedSplats:t}),Rt=(t,A)=>new dg({packedSplats:t,index:A}),Dg=(t,A,I,g)=>new pg({packedSplats:t,index:A,base:I,count:g}),st=t=>new fg({gsplat:t}),At=({gsplat:t,flags:A,index:I,center:g,scales:B,quaternion:i,rgba:e,rgb:s,opacity:Q,x:E,y:a,z:C,r:o,g:r,b:h})=>new Ng({gsplat:t,flags:A,index:I,center:g,scales:B,quaternion:i,rgba:e,rgb:s,opacity:Q,x:E,y:a,z:C,r:o,g:r,b:h}),mI=t=>new Gg({gsplat:t}),KI=(t,{scale:A,rotate:I,translate:g,recolor:B})=>new Sg({gsplat:t,scale:A,rotate:I,translate:g,recolor:B}),MA=rA(`
struct Gsplat {
@@ -63,7 +63,7 @@
} else {
${B} = uvec4(0u, 0u, 0u, 0u);
}
`):[`${B} = uvec4(0u, 0u, 0u, 0u);`]}})}dynoOut(){return new q(this,"output")}}class TI extends W{constructor({rgba8:A}){super({inTypes:{rgba8:"vec4"},inputs:{rgba8:A},statements:({inputs:I,outputs:g})=>[`target = ${I.rgba8??"vec4(0.0, 0.0, 0.0, 0.0)"};`]})}dynoOut(){return new q(this,"rgba8")}}const fQ=(t,A,I)=>new k({key:t,type:A,value:I}),NQ=(t=!1,A)=>new gI({key:A,value:t}),FQ=(t=0,A)=>new kg({key:A,value:t}),GQ=(t=0,A)=>new Ut({key:A,value:t}),bA=(t=0,A)=>new Qt({key:A,value:t}),SQ=(t,A)=>new xg({key:A,value:t}),MQ=(t,A)=>new Rg({key:A,value:t}),mQ=(t,A)=>new Ug({key:A,value:t}),kQ=(t,A)=>new Yg({key:A,value:t}),xQ=(t,A)=>new Jg({key:A,value:t}),RQ=(t,A)=>new Lg({key:A,value:t}),UQ=(t,A)=>new Hg({key:A,value:t}),jA=(t,A)=>new yt({key:A,value:t}),YQ=(t,A)=>new bg({key:A,value:t}),JQ=(t,A)=>new Kg({key:A,value:t}),LQ=(t,A)=>new Tg({key:A,value:t}),HQ=(t,A)=>new Zt({key:A,value:t}),bQ=(t,A)=>new vg({key:A,value:t}),KQ=(t,A)=>new qg({key:A,value:t}),TQ=(t,A)=>new Zg({key:A,value:t}),vQ=(t,A)=>new zg({key:A,value:t}),qQ=(t,A)=>new Wg({key:A,value:t}),ZQ=(t,A)=>new Vg({key:A,value:t}),zQ=(t,A)=>new Og({key:A,value:t}),WQ=(t,A)=>new jg({key:A,value:t}),VQ=(t,A)=>new Pg({key:A,value:t}),OQ=(t,A)=>new Xg({key:A,value:t}),jQ=(t,A)=>new _g({key:A,value:t}),PQ=(t,A)=>new $g({key:A,value:t}),XQ=(t,A)=>new AB({key:A,value:t}),_Q=(t,A)=>new tB({key:A,value:t}),$Q=(t,A)=>new IB({key:A,value:t}),AC=(t,A)=>new Mt({key:A,value:t}),tC=(t,A)=>new gB({key:t,value:A}),IC=(t,A)=>new BB({key:A,value:t}),gC=(t,A)=>new iB({key:A,value:t}),BC=(t,A)=>new eB({key:A,value:t}),iC=(t,A)=>new sB({key:A,value:t}),eC=(t,A)=>new QB({key:A,value:t}),sC=(t,A)=>new CB({key:A,value:t}),QC=(t,A)=>new EB({key:A,value:t}),CC=(t,A)=>new aB({key:A,value:t}),EC=(t,A)=>new nB({key:A,value:t}),aC=(t,A)=>new oB({key:A,value:t});class k extends W{constructor({key:A,type:I,count:g,value:B,update:i,globals:e}){A=A??"value",super({outTypes:{[A]:I},update:()=>{if(i){const s=i(this.value);s!==void 0&&(this.value=s)}this.uniform.value=this.value},generate:({inputs:s,outputs:Q})=>{const E=(e==null?void 0:e({inputs:s,outputs:Q}))??[],a={},C=Q[A];return C&&(E.push(`uniform ${bI(C,I,g)};`),a[C]=this.uniform),{globals:E,uniforms:a}}}),this.type=I,this.count=g,this.value=B,this.uniform={value:B},this.outKey=A}dynoOut(){return new q(this,this.outKey)}}class gI extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"bool",value:I,update:g})}}class kg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"uint",value:I,update:g})}}class Ut extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"int",value:I,update:g})}}class Qt extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"float",value:I,update:g})}}class xg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"bvec2",value:I,update:g})}}class Rg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"uvec2",value:I,update:g})}}class Ug extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"ivec2",value:I,update:g})}}class Yg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"vec2",value:I,update:g})}}class Jg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"bvec3",value:I,update:g})}}class Lg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"uvec3",value:I,update:g})}}class Hg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"ivec3",value:I,update:g})}}class yt extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"vec3",value:I,update:g})}}class bg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"bvec4",value:I,update:g})}}class Kg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"uvec4",value:I,update:g})}}class Tg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"ivec4",value:I,update:g})}}class Zt extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"vec4",value:I,update:g})}}class vg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat2",value:I,update:g})}}class qg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat2x2",value:I,update:g})}}class Zg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat2x3",value:I,update:g})}}class zg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat2x4",value:I,update:g})}}class Wg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat3",value:I,update:g})}}class Vg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat3x2",value:I,update:g})}}class Og extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat3x3",value:I,update:g})}}class jg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat3x4",value:I,update:g})}}class Pg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat4",value:I,update:g})}}class Xg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat4x2" Line truncated
`):[`${B} = uvec4(0u, 0u, 0u, 0u);`]}})}dynoOut(){return new q(this,"output")}}class TI extends W{constructor({rgba8:A}){super({inTypes:{rgba8:"vec4"},inputs:{rgba8:A},statements:({inputs:I,outputs:g})=>[`target = ${I.rgba8??"vec4(0.0, 0.0, 0.0, 0.0)"};`]})}dynoOut(){return new q(this,"rgba8")}}const fQ=(t,A,I)=>new k({key:t,type:A,value:I}),NQ=(t=!1,A)=>new gI({key:A,value:t}),FQ=(t=0,A)=>new kg({key:A,value:t}),GQ=(t=0,A)=>new Ut({key:A,value:t}),LA=(t=0,A)=>new Qt({key:A,value:t}),SQ=(t,A)=>new xg({key:A,value:t}),MQ=(t,A)=>new Rg({key:A,value:t}),mQ=(t,A)=>new Ug({key:A,value:t}),kQ=(t,A)=>new Yg({key:A,value:t}),xQ=(t,A)=>new Jg({key:A,value:t}),RQ=(t,A)=>new Lg({key:A,value:t}),UQ=(t,A)=>new Hg({key:A,value:t}),jA=(t,A)=>new yt({key:A,value:t}),YQ=(t,A)=>new bg({key:A,value:t}),JQ=(t,A)=>new Kg({key:A,value:t}),LQ=(t,A)=>new Tg({key:A,value:t}),HQ=(t,A)=>new Zt({key:A,value:t}),bQ=(t,A)=>new vg({key:A,value:t}),KQ=(t,A)=>new qg({key:A,value:t}),TQ=(t,A)=>new Zg({key:A,value:t}),vQ=(t,A)=>new zg({key:A,value:t}),qQ=(t,A)=>new Wg({key:A,value:t}),ZQ=(t,A)=>new Vg({key:A,value:t}),zQ=(t,A)=>new Og({key:A,value:t}),WQ=(t,A)=>new jg({key:A,value:t}),VQ=(t,A)=>new Pg({key:A,value:t}),OQ=(t,A)=>new Xg({key:A,value:t}),jQ=(t,A)=>new _g({key:A,value:t}),PQ=(t,A)=>new $g({key:A,value:t}),XQ=(t,A)=>new AB({key:A,value:t}),_Q=(t,A)=>new tB({key:A,value:t}),$Q=(t,A)=>new IB({key:A,value:t}),AC=(t,A)=>new Mt({key:A,value:t}),tC=(t,A)=>new gB({key:t,value:A}),IC=(t,A)=>new BB({key:A,value:t}),gC=(t,A)=>new iB({key:A,value:t}),BC=(t,A)=>new eB({key:A,value:t}),iC=(t,A)=>new sB({key:A,value:t}),eC=(t,A)=>new QB({key:A,value:t}),sC=(t,A)=>new CB({key:A,value:t}),QC=(t,A)=>new EB({key:A,value:t}),CC=(t,A)=>new aB({key:A,value:t}),EC=(t,A)=>new nB({key:A,value:t}),aC=(t,A)=>new oB({key:A,value:t});class k extends W{constructor({key:A,type:I,count:g,value:B,update:i,globals:e}){A=A??"value",super({outTypes:{[A]:I},update:()=>{if(i){const s=i(this.value);s!==void 0&&(this.value=s)}this.uniform.value=this.value},generate:({inputs:s,outputs:Q})=>{const E=(e==null?void 0:e({inputs:s,outputs:Q}))??[],a={},C=Q[A];return C&&(E.push(`uniform ${bI(C,I,g)};`),a[C]=this.uniform),{globals:E,uniforms:a}}}),this.type=I,this.count=g,this.value=B,this.uniform={value:B},this.outKey=A}dynoOut(){return new q(this,this.outKey)}}class gI extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"bool",value:I,update:g})}}class kg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"uint",value:I,update:g})}}class Ut extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"int",value:I,update:g})}}class Qt extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"float",value:I,update:g})}}class xg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"bvec2",value:I,update:g})}}class Rg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"uvec2",value:I,update:g})}}class Ug extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"ivec2",value:I,update:g})}}class Yg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"vec2",value:I,update:g})}}class Jg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"bvec3",value:I,update:g})}}class Lg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"uvec3",value:I,update:g})}}class Hg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"ivec3",value:I,update:g})}}class yt extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"vec3",value:I,update:g})}}class bg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"bvec4",value:I,update:g})}}class Kg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"uvec4",value:I,update:g})}}class Tg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"ivec4",value:I,update:g})}}class Zt extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"vec4",value:I,update:g})}}class vg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat2",value:I,update:g})}}class qg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat2x2",value:I,update:g})}}class Zg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat2x3",value:I,update:g})}}class zg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat2x4",value:I,update:g})}}class Wg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat3",value:I,update:g})}}class Vg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat3x2",value:I,update:g})}}class Og extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat3x3",value:I,update:g})}}class jg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat3x4",value:I,update:g})}}class Pg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat4",value:I,update:g})}}class Xg extends k{constructor({key:A,value:I,update:g}){super({key:A,type:"mat4x2" Line truncated
precision highp float;
in vec3 position;
@@ -71,10 +71,10 @@
void main() {
gl_Position = vec4(position.xy, 0.0, 1.0);
}
`);function RB(t){const A=new n.Vector3;for(const I of t)A.add(I);return A.divideScalar(t.length)}function UB(t){if(t.length===0)return new n.Quaternion;const A=t[0].clone();for(let I=1;I<t.length;I++)t[I].dot(t[0])<0?(A.x-=t[I].x,A.y-=t[I].y,A.z-=t[I].z,A.w-=t[I].w):(A.x+=t[I].x,A.y+=t[I].y,A.z+=t[I].z,A.w+=t[I].w);return A.normalize()}function YB(t,A){const I=new n.Vector3(0,0,0).applyMatrix4(t),g=new n.Vector3(0,0,0).applyMatrix4(A),B=new n.Vector3(0,0,-1).applyMatrix4(t).sub(I).normalize(),i=new n.Vector3(0,0,-1).applyMatrix4(A).sub(g).normalize(),e=I.distanceTo(g),s=B.dot(i);return{distance:e,coincidence:s}}function ZC({matrix1:t,matrix2:A,maxDistance:I}){const g=new n.Vector3(0,0,0).applyMatrix4(t),B=new n.Vector3(0,0,0).applyMatrix4(A);return g.distanceTo(B)<=I}function zC({matrix1:t,matrix2:A,maxDistance:I,minCoincidence:g}){const{distance:B,coincidence:i}=YB(t,A);return B<=I&&(g==null||i>=g)}function JB(t,A){const[I,g]=[new n.Vector3,new n.Quaternion],[B,i]=[new n.Vector3,new n.Quaternion];t.decompose(I,g,new n.Vector3),A.decompose(B,i,new n.Vector3);const e=I.distanceTo(B),s=Math.abs(g.dot(i));return{distance:e,coorient:s}}function eI({matrix1:t,matrix2:A,maxDistance:I,minCoorient:g}){const{distance:B,coorient:i}=JB(t,A);return B<=I&&(g==null||i>=g)}function WC(t,A=.001){return Math.abs(t)<A?0:Math.sign(t)}function VC(t){const A=t.w<0,I=kt(A?-t.x:t.x),g=kt(A?-t.y:t.y),B=kt(A?-t.z:t.z),i=I&255,e=g&255,s=B&255;return i|e<<8|s<<16}function OC(t,A){const I=t<<24>>24,g=t<<16>>24,B=t<<8>>24;A.set(I/127,g/127,B/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 vI(t){const A=t.clone().normalize();A.w<0&&A.set(-A.x,-A.y,-A.z,-A.w);const I=2*Math.acos(A.w),g=Math.sqrt(A.x*A.x+A.y*A.y+A.z*A.z),B=g<1e-6?new n.Vector3(1,0,0):new n.Vector3(A.x,A.y,A.z).divideScalar(g),i=Math.abs(B.x)+Math.abs(B.y)+Math.abs(B.z);let e=B.x/i,s=B.y/i;if(B.z<0){const r=e;e=(1-Math.abs(s))*(e>=0?1:-1),s=(1-Math.abs(r))*(s>=0?1:-1)}const Q=e*.5+.5,E=s*.5+.5,a=Math.round(Q*255),C=Math.round(E*255);return Math.round(I*(255/Math.PI))<<16|C<<8|a}function LB(t,A){const I=t&255,g=t>>>8&255,B=t>>>16&255,i=I/255,e=g/255;let s=(i-.5)*2,Q=(e-.5)*2;const E=1-(Math.abs(s)+Math.abs(Q)),a=Math.max(-E,0);s+=s>=0?-a:a,Q+=Q>=0?-a:a;const C=new n.Vector3(s,Q,E).normalize(),r=B/255*Math.PI*.5,h=Math.sin(r),c=Math.cos(r);return A.set(C.x*h,C.y*h,C.z*h,c),A}function jC(t){const A=t.clone().normalize(),I=2*(A.w*A.x+A.y*A.z),g=1-2*(A.x*A.x+A.y*A.y),B=Math.atan2(I,g),i=2*(A.w*A.y-A.z*A.x),e=Math.abs(i)>=1?Math.sign(i)*(Math.PI/2):Math.asin(i),s=2*(A.w*A.z+A.x*A.y),Q=1-2*(A.y*A.y+A.z*A.z),E=Math.atan2(s,Q),a=(B+Math.PI)/(2*Math.PI),C=(e+Math.PI)/(2*Math.PI),o=(E+Math.PI)/(2*Math.PI),r=Math.round(a*255),h=Math.round(C*255);return Math.round(o*255)<<16|h<<8|r}function PC(t,A){const I=t&255,g=t>>>8&255,B=t>>>16&255,i=I/255,e=g/255,s=B/255,Q=i*(2*Math.PI)-Math.PI,E=e*(2*Math.PI)-Math.PI,a=s*(2*Math.PI)-Math.PI,C=Math.cos(Q*.5),o=Math.sin(Q*.5),r=Math.cos(E*.5),h=Math.sin(E*.5),c=Math.cos(a*.5),l=Math.sin(a*.5);return A.w=C*r*c+o*h*l,A.x=o*r*c-C*h*l,A.y=C*h*c+o*r*l,A.z=C*r*l-o*h*c,A.normalize(),A}function Ot(t,A,I,g){const B=Math.max(-127,Math.min(127,t*127)),i=Math.max(-127,Math.min(127,A*127)),e=Math.max(-127,Math.min(127,I*127)),s=Math.max(-127,Math.min(127,g*127));return B&255|(i&255)<<8|(e&255)<<16|(s&255)<<24}function XC(t,A,I){const g=A*2;for(let B=0;B<9;++B){const i=Math.max(-63,Math.min(63,I[B]*63))&127,e=B*7,s=e+7,Q=Math.floor(e/32),E=e-Q*32,a=i<<E&4294967295;if(t[g+Q]|=a,s>Q*32+32){const C=i>>>32-E&4294967295;t[g+Q+1]|=C}}}function _C(t,A,I){t[A*4+0]=Ot(I[0],I[1],I[2],I[3]),t[A*4+1]=Ot(I[4],I[5],I[6],I[7]),t[A*4+2]=Ot(I[8],I[9],I[10],I[11]),t[A*4+3]=Ot(I[12],I[13],I[14],0)}function $C(t,A,I){const g=A*4;for(let B=0;B<21;++B){const i=Math.max(-31,Math.min(31,I[B]*31))&63,e=B*6,s=e+6,Q=Math.floor(e/32),E=e-Q*32,a=i<<E&4294967295;if(t[g+Q]|=a,s>Q*32+32){const C=i>>>32-E&4294967295;t[g+Q+1]|=C}}}function HB(t,A){const I=[];let g=0,B=null;const i=new yB((Q,E)=>{if(I.push(Q),g+=Q.length,E||g>=A){const a=new Uint8Array(g);let C=0;for(const o of I)a.set(o,C),C+=o.length;B=a.slice(0,A)}}),e=1024;let s=0;for(;B==null&&s<t.length;){const Q=t.slice(s,s+e);i.push(Q,!1),s+=e}if(B==null&&(i.push(new Uint8Array,!0),B==null))throw new Error("Failed to decompress partial gzip");return B}class bB{constructor({fileBytes:A,chunkBytes:I=64*1024}){this.fileBytes=A,this.chunkBytes=I,this.offset=0,this.chunks=[],this.totalBytes=0,this.gunzip=new yB((g,B)=>{this.chunks.push(g),this.totalBytes+=g.length})}read(A){for(;this.totalBytes<A&&this.offset<this.fileBytes.length;){const i=Math.min(this.offset+this.chunkBytes,this.fileBytes.length);this.gunzip.push(this.fileBytes.subarray(this.offset,i),!1),this.offset=i}if(this.totalBytes<A&&this.offset>=this.fileBytes.length&&this.gunzip.push(new Uint8Array(0),!0),this.totalBytes<A)throw new Error(`Unexpected EOF: needed ${A}, got ${this.totalBytes}`);const I=new Uint8Array(this.totalBytes);let g=0 Line truncated
`);function RB(t){const A=new n.Vector3;for(const I of t)A.add(I);return A.divideScalar(t.length)}function UB(t){if(t.length===0)return new n.Quaternion;const A=t[0].clone();for(let I=1;I<t.length;I++)t[I].dot(t[0])<0?(A.x-=t[I].x,A.y-=t[I].y,A.z-=t[I].z,A.w-=t[I].w):(A.x+=t[I].x,A.y+=t[I].y,A.z+=t[I].z,A.w+=t[I].w);return A.normalize()}function YB(t,A){const I=new n.Vector3(0,0,0).applyMatrix4(t),g=new n.Vector3(0,0,0).applyMatrix4(A),B=new n.Vector3(0,0,-1).applyMatrix4(t).sub(I).normalize(),i=new n.Vector3(0,0,-1).applyMatrix4(A).sub(g).normalize(),e=I.distanceTo(g),s=B.dot(i);return{distance:e,coincidence:s}}function ZC({matrix1:t,matrix2:A,maxDistance:I}){const g=new n.Vector3(0,0,0).applyMatrix4(t),B=new n.Vector3(0,0,0).applyMatrix4(A);return g.distanceTo(B)<=I}function zC({matrix1:t,matrix2:A,maxDistance:I,minCoincidence:g}){const{distance:B,coincidence:i}=YB(t,A);return B<=I&&(g==null||i>=g)}function JB(t,A){const[I,g]=[new n.Vector3,new n.Quaternion],[B,i]=[new n.Vector3,new n.Quaternion];t.decompose(I,g,new n.Vector3),A.decompose(B,i,new n.Vector3);const e=I.distanceTo(B),s=Math.abs(g.dot(i));return{distance:e,coorient:s}}function eI({matrix1:t,matrix2:A,maxDistance:I,minCoorient:g}){const{distance:B,coorient:i}=JB(t,A);return B<=I&&(g==null||i>=g)}function WC(t,A=.001){return Math.abs(t)<A?0:Math.sign(t)}function VC(t){const A=t.w<0,I=kt(A?-t.x:t.x),g=kt(A?-t.y:t.y),B=kt(A?-t.z:t.z),i=I&255,e=g&255,s=B&255;return i|e<<8|s<<16}function OC(t,A){const I=t<<24>>24,g=t<<16>>24,B=t<<8>>24;A.set(I/127,g/127,B/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 vI(t){const A=t.clone().normalize();A.w<0&&A.set(-A.x,-A.y,-A.z,-A.w);const I=2*Math.acos(A.w),g=Math.sqrt(A.x*A.x+A.y*A.y+A.z*A.z),B=g<1e-6?new n.Vector3(1,0,0):new n.Vector3(A.x,A.y,A.z).divideScalar(g),i=Math.abs(B.x)+Math.abs(B.y)+Math.abs(B.z);let e=B.x/i,s=B.y/i;if(B.z<0){const r=e;e=(1-Math.abs(s))*(e>=0?1:-1),s=(1-Math.abs(r))*(s>=0?1:-1)}const Q=e*.5+.5,E=s*.5+.5,a=Math.round(Q*255),C=Math.round(E*255);return Math.round(I*(255/Math.PI))<<16|C<<8|a}function LB(t,A){const I=t&255,g=t>>>8&255,B=t>>>16&255,i=I/255,e=g/255;let s=(i-.5)*2,Q=(e-.5)*2;const E=1-(Math.abs(s)+Math.abs(Q)),a=Math.max(-E,0);s+=s>=0?-a:a,Q+=Q>=0?-a:a;const C=new n.Vector3(s,Q,E).normalize(),r=B/255*Math.PI*.5,h=Math.sin(r),c=Math.cos(r);return A.set(C.x*h,C.y*h,C.z*h,c),A}function jC(t){const A=t.clone().normalize(),I=2*(A.w*A.x+A.y*A.z),g=1-2*(A.x*A.x+A.y*A.y),B=Math.atan2(I,g),i=2*(A.w*A.y-A.z*A.x),e=Math.abs(i)>=1?Math.sign(i)*(Math.PI/2):Math.asin(i),s=2*(A.w*A.z+A.x*A.y),Q=1-2*(A.y*A.y+A.z*A.z),E=Math.atan2(s,Q),a=(B+Math.PI)/(2*Math.PI),C=(e+Math.PI)/(2*Math.PI),o=(E+Math.PI)/(2*Math.PI),r=Math.round(a*255),h=Math.round(C*255);return Math.round(o*255)<<16|h<<8|r}function PC(t,A){const I=t&255,g=t>>>8&255,B=t>>>16&255,i=I/255,e=g/255,s=B/255,Q=i*(2*Math.PI)-Math.PI,E=e*(2*Math.PI)-Math.PI,a=s*(2*Math.PI)-Math.PI,C=Math.cos(Q*.5),o=Math.sin(Q*.5),r=Math.cos(E*.5),h=Math.sin(E*.5),c=Math.cos(a*.5),l=Math.sin(a*.5);return A.w=C*r*c+o*h*l,A.x=o*r*c-C*h*l,A.y=C*h*c+o*r*l,A.z=C*r*l-o*h*c,A.normalize(),A}function Ot(t,A,I,g){const B=Math.max(-127,Math.min(127,t*127)),i=Math.max(-127,Math.min(127,A*127)),e=Math.max(-127,Math.min(127,I*127)),s=Math.max(-127,Math.min(127,g*127));return B&255|(i&255)<<8|(e&255)<<16|(s&255)<<24}function XC(t,A,I){const g=A*2;for(let B=0;B<9;++B){const i=Math.max(-63,Math.min(63,I[B]*63))&127,e=B*7,s=e+7,Q=Math.floor(e/32),E=e-Q*32,a=i<<E&4294967295;if(t[g+Q]|=a,s>Q*32+32){const C=i>>>32-E&4294967295;t[g+Q+1]|=C}}}function _C(t,A,I){t[A*4+0]=Ot(I[0],I[1],I[2],I[3]),t[A*4+1]=Ot(I[4],I[5],I[6],I[7]),t[A*4+2]=Ot(I[8],I[9],I[10],I[11]),t[A*4+3]=Ot(I[12],I[13],I[14],0)}function $C(t,A,I){const g=A*4;for(let B=0;B<21;++B){const i=Math.max(-31,Math.min(31,I[B]*31))&63,e=B*6,s=e+6,Q=Math.floor(e/32),E=e-Q*32,a=i<<E&4294967295;if(t[g+Q]|=a,s>Q*32+32){const C=i>>>32-E&4294967295;t[g+Q+1]|=C}}}function HB(t,A){const I=[];let g=0,B=null;const i=new yB((Q,E)=>{if(I.push(Q),g+=Q.length,E||g>=A){const a=new Uint8Array(g);let C=0;for(const o of I)a.set(o,C),C+=o.length;B=a.slice(0,A)}}),e=1024;let s=0;for(;B==null&&s<t.length;){const Q=t.slice(s,s+e);i.push(Q,!1),s+=e}if(B==null&&(i.push(new Uint8Array,!0),B==null))throw new Error("Failed to decompress partial gzip");return B}class bB{constructor({fileBytes:A,chunkBytes:I=64*1024}){this.fileBytes=A,this.chunkBytes=I,this.offset=0,this.chunks=[],this.totalBytes=0,this.gunzip=new yB((g,B)=>{this.chunks.push(g),this.totalBytes+=g.length})}read(A){for(;this.totalBytes<A&&this.offset<this.fileBytes.length;){const i=Math.min(this.offset+this.chunkBytes,this.fileBytes.length);this.gunzip.push(this.fileBytes.subarray(this.offset,i),!1),this.offset=i}if(this.totalBytes<A&&this.offset>=this.fileBytes.length&&this.gunzip.push(new Uint8Array(0),!0),this.totalBytes<A)throw new Error(`Unexpected EOF: needed ${A}, got ${this.totalBytes}`);const I=new Uint8Array(this.totalBytes);let g=0 Line truncated
`)+this.between+I.map(g=>this.indent+g).join(`
`)+this.after}}const tg=new Map;function tE(t){let A=tg.get(t);return A||(A=new n.RawShaderMaterial({glslVersion:n.GLSL3,vertexShader:xB,fragmentShader:t.shader,uniforms:t.uniforms}),tg.set(t,A),A)}function zI(t,A,I="add"){const g=()=>{throw new Error(`Invalid ${I} types: ${t}, ${A}`)};if(t===A)return t;if(t==="int"){if(uA(A))return A;g()}if(A==="int"){if(uA(t))return t;g()}if(t==="uint"){if(DA(A))return A;g()}if(A==="uint"){if(DA(t))return t;g()}if(t==="float"){if(It(A))return A;g()}if(A==="float"){if(It(t))return t;g()}throw new Error(`Invalid ${I} types: ${t}, ${A}`)}function IE(t,A){return zI(t,A,"sub")}function gE(t,A){const I=()=>{throw new Error(`Invalid mul types: ${t}, ${A}`)},g=B=>B;if(t==="int"){if(uA(A))return g(A);I()}if(A==="int"){if(uA(t))return g(t);I()}if(t==="uint"){if(DA(A))return g(A);I()}if(A==="uint"){if(DA(t))return g(t);I()}if(t==="float"){if(It(A))return g(A);I()}if(A==="float"){if(It(t))return g(t);I()}if(uA(t)||DA(t)||uA(A)||DA(A)){if(t===A)return g(t);I()}if(t==="vec2"){if(A==="vec2"||gt(A))return g("vec2");if(A==="mat3x2")return g("vec3");if(A==="mat4x2")return g("vec4");I()}if(t==="vec3"){if(A==="mat2x3")return g("vec2");if(A==="vec3"||Bt(A))return g("vec3");if(A==="mat4x3")return g("vec4");I()}if(t==="vec4"){if(A==="mat2x4")return g("vec2");if(A==="mat3x4")return g("vec3");if(A==="vec4"||it(A))return g("vec4");I()}if(A==="vec2"){if(gt(t))return g("vec2");if(t==="mat2x3")return g("vec3");if(t==="mat2x4")return g("vec4");I()}if(A==="vec3"){if(t==="mat3x2")return g("vec2");if(Bt(t))return g("vec3");if(t==="mat3x4")return g("vec4");I()}if(A==="vec4"){if(t==="mat4x2")return g("vec2");if(t==="mat4x3")return g("vec3");if(it(t))return g("vec4");I()}if(gt(t)){if(gt(A))return g("mat2");if(A==="mat3x2")return g("mat3x2");if(A==="mat4x2")return g("mat4x2");I()}if(t==="mat2x3"){if(gt(A))return g("mat2x3");if(A==="mat3x2")return g("mat3");if(A==="mat4x2")return g("mat4x3");I()}if(t==="mat2x4"){if(gt(A))return g("mat2x4");if(A==="mat3x2")return g("mat3x4");if(A==="mat4x2")return g("mat4");I()}if(t==="mat3x2"){if(A==="mat2x3")return g("mat2");if(Bt(A))return g("mat3x2");if(A==="mat4x3")return g("mat4x2");I()}if(Bt(t)){if(A==="mat2x3")return g("mat2x3");if(Bt(A))return g("mat3");if(A==="mat4x3")return g("mat4x3");I()}if(t==="mat3x4"){if(A==="mat2x3")return g("mat2x4");if(Bt(A))return g("mat3x4");if(A==="mat4x3")return g("mat4");I()}if(t==="mat4x2"){if(A==="mat2x4")return g("mat2");if(A==="mat3x4")return g("mat3x2");if(it(A))return g("mat4x2");I()}if(t==="mat4x3"){if(A==="mat2x4")return g("mat2x3");if(A==="mat3x4")return g("mat3");if(it(A))return g("mat4x3");I()}if(it(t)){if(A==="mat2x4")return g("mat2x4");if(A==="mat3x4")return g("mat3x4");if(it(A))return g("mat4");I()}throw new Error(`Invalid mul types: ${t}, ${A}`)}function BE(t,A){return zI(t,A,"div")}function iE(t,A){if(t===A)return t;if(t==="int"){if(uA(A))return A}else if(A==="int"){if(uA(t))return t}else if(t==="uint"){if(DA(A))return A}else if(A==="uint"&&DA(t))return t;throw new Error(`Invalid imod types: ${t}, ${A}`)}function eE(t,A){if(t===A||A==="float")return t;throw new Error(`Invalid mod types: ${t}, ${A}`)}function sE(t){return t}function QE(t){return t}function CE(t){return t}function EE(t){return t}function aE(t){return t}function nE(t){return t}function oE(t){return t}function rE(t){return t}function cE(t){return t}function hE(t){return t}function lE(t){return t}function uE(t){return t}function DE(t){return t}function wE(t){return t}function yE(t){return t}function dE(t){return t}function KB(t,A,I="min"){if(t===A)return t;if(A==="float"){if(Kt(t))return t}else if(A==="int"){if(uA(t))return t}else if(A==="uint"&&DA(t))return t;throw new Error(`Invalid ${I} types: ${t}, ${A}`)}function pE(t,A){return KB(t,A,"max")}function fE(t,A,I){if(A==="float"){if(Kt(t))return t}else if(A==="int"){if(uA(t))return t}else if(A==="uint"&&DA(t))return t;throw new Error(`Invalid clamp types: ${t}, ${A}`)}function NE(t,A,I){if(I===t||I==="float"||I==="bool"&&t==="float"||I==="bvec2"&&t==="vec2"||I==="bvec3"&&t==="vec3"||I==="bvec4"&&t==="vec4")return t;throw new Error(`Invalid mix types: ${t}, ${A}, ${I}`)}function FE(t,A){if(t===A||A==="float")return A;throw new Error(`Invalid step types: ${t}, ${A}`)}function GE(t,A,I){if(t===A&&(t===I||t==="float"))return I;throw new Error(`Invalid smoothstep types: ${t}, ${A}, ${I}`)}function TB(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 SE(t){return TB(t,"isInf")}const FA=(t,A)=>new zB({a:t,b:A}),dt=(t,A)=>new WB({a:t,b:A}),oA=(t,A)=>new VB({a:t,b:A}),$t=(t,A)=>new OB({a:t,b:A}),xI=(t,A)=>new jB({a:t,b:A}),vB=(t,A)=>new PB({a:t,b:A}),ME=t=>new XB({a:t}).outputs,WI=t=>new _B({a:t}),mE=t=>new $B({a:t}),kE=t=>new Ai({a:t}),xE=t=>new ti({a:t}),RE=t=>new Ii({a:t}),UE=t=>new gi({a:t}),YE=t=>new Bi({a:t}),AI=t=>new ii({a:t}),JE=(t,A)=>new ei({a:t,b:A}),LE=t=>new si({a:t}),HE=t=>ne Line truncated
`)+this.after}}const tg=new Map;function tE(t){let A=tg.get(t);return A||(A=new n.RawShaderMaterial({glslVersion:n.GLSL3,vertexShader:xB,fragmentShader:t.shader,uniforms:t.uniforms}),tg.set(t,A),A)}function zI(t,A,I="add"){const g=()=>{throw new Error(`Invalid ${I} types: ${t}, ${A}`)};if(t===A)return t;if(t==="int"){if(lA(A))return A;g()}if(A==="int"){if(lA(t))return t;g()}if(t==="uint"){if(uA(A))return A;g()}if(A==="uint"){if(uA(t))return t;g()}if(t==="float"){if(It(A))return A;g()}if(A==="float"){if(It(t))return t;g()}throw new Error(`Invalid ${I} types: ${t}, ${A}`)}function IE(t,A){return zI(t,A,"sub")}function gE(t,A){const I=()=>{throw new Error(`Invalid mul types: ${t}, ${A}`)},g=B=>B;if(t==="int"){if(lA(A))return g(A);I()}if(A==="int"){if(lA(t))return g(t);I()}if(t==="uint"){if(uA(A))return g(A);I()}if(A==="uint"){if(uA(t))return g(t);I()}if(t==="float"){if(It(A))return g(A);I()}if(A==="float"){if(It(t))return g(t);I()}if(lA(t)||uA(t)||lA(A)||uA(A)){if(t===A)return g(t);I()}if(t==="vec2"){if(A==="vec2"||gt(A))return g("vec2");if(A==="mat3x2")return g("vec3");if(A==="mat4x2")return g("vec4");I()}if(t==="vec3"){if(A==="mat2x3")return g("vec2");if(A==="vec3"||Bt(A))return g("vec3");if(A==="mat4x3")return g("vec4");I()}if(t==="vec4"){if(A==="mat2x4")return g("vec2");if(A==="mat3x4")return g("vec3");if(A==="vec4"||it(A))return g("vec4");I()}if(A==="vec2"){if(gt(t))return g("vec2");if(t==="mat2x3")return g("vec3");if(t==="mat2x4")return g("vec4");I()}if(A==="vec3"){if(t==="mat3x2")return g("vec2");if(Bt(t))return g("vec3");if(t==="mat3x4")return g("vec4");I()}if(A==="vec4"){if(t==="mat4x2")return g("vec2");if(t==="mat4x3")return g("vec3");if(it(t))return g("vec4");I()}if(gt(t)){if(gt(A))return g("mat2");if(A==="mat3x2")return g("mat3x2");if(A==="mat4x2")return g("mat4x2");I()}if(t==="mat2x3"){if(gt(A))return g("mat2x3");if(A==="mat3x2")return g("mat3");if(A==="mat4x2")return g("mat4x3");I()}if(t==="mat2x4"){if(gt(A))return g("mat2x4");if(A==="mat3x2")return g("mat3x4");if(A==="mat4x2")return g("mat4");I()}if(t==="mat3x2"){if(A==="mat2x3")return g("mat2");if(Bt(A))return g("mat3x2");if(A==="mat4x3")return g("mat4x2");I()}if(Bt(t)){if(A==="mat2x3")return g("mat2x3");if(Bt(A))return g("mat3");if(A==="mat4x3")return g("mat4x3");I()}if(t==="mat3x4"){if(A==="mat2x3")return g("mat2x4");if(Bt(A))return g("mat3x4");if(A==="mat4x3")return g("mat4");I()}if(t==="mat4x2"){if(A==="mat2x4")return g("mat2");if(A==="mat3x4")return g("mat3x2");if(it(A))return g("mat4x2");I()}if(t==="mat4x3"){if(A==="mat2x4")return g("mat2x3");if(A==="mat3x4")return g("mat3");if(it(A))return g("mat4x3");I()}if(it(t)){if(A==="mat2x4")return g("mat2x4");if(A==="mat3x4")return g("mat3x4");if(it(A))return g("mat4");I()}throw new Error(`Invalid mul types: ${t}, ${A}`)}function BE(t,A){return zI(t,A,"div")}function iE(t,A){if(t===A)return t;if(t==="int"){if(lA(A))return A}else if(A==="int"){if(lA(t))return t}else if(t==="uint"){if(uA(A))return A}else if(A==="uint"&&uA(t))return t;throw new Error(`Invalid imod types: ${t}, ${A}`)}function eE(t,A){if(t===A||A==="float")return t;throw new Error(`Invalid mod types: ${t}, ${A}`)}function sE(t){return t}function QE(t){return t}function CE(t){return t}function EE(t){return t}function aE(t){return t}function nE(t){return t}function oE(t){return t}function rE(t){return t}function cE(t){return t}function hE(t){return t}function lE(t){return t}function uE(t){return t}function DE(t){return t}function wE(t){return t}function yE(t){return t}function dE(t){return t}function KB(t,A,I="min"){if(t===A)return t;if(A==="float"){if(Kt(t))return t}else if(A==="int"){if(lA(t))return t}else if(A==="uint"&&uA(t))return t;throw new Error(`Invalid ${I} types: ${t}, ${A}`)}function pE(t,A){return KB(t,A,"max")}function fE(t,A,I){if(A==="float"){if(Kt(t))return t}else if(A==="int"){if(lA(t))return t}else if(A==="uint"&&uA(t))return t;throw new Error(`Invalid clamp types: ${t}, ${A}`)}function NE(t,A,I){if(I===t||I==="float"||I==="bool"&&t==="float"||I==="bvec2"&&t==="vec2"||I==="bvec3"&&t==="vec3"||I==="bvec4"&&t==="vec4")return t;throw new Error(`Invalid mix types: ${t}, ${A}, ${I}`)}function FE(t,A){if(t===A||A==="float")return A;throw new Error(`Invalid step types: ${t}, ${A}`)}function GE(t,A,I){if(t===A&&(t===I||t==="float"))return I;throw new Error(`Invalid smoothstep types: ${t}, ${A}, ${I}`)}function TB(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 SE(t){return TB(t,"isInf")}const NA=(t,A)=>new zB({a:t,b:A}),dt=(t,A)=>new WB({a:t,b:A}),oA=(t,A)=>new VB({a:t,b:A}),$t=(t,A)=>new OB({a:t,b:A}),xI=(t,A)=>new jB({a:t,b:A}),vB=(t,A)=>new PB({a:t,b:A}),ME=t=>new XB({a:t}).outputs,WI=t=>new _B({a:t}),mE=t=>new $B({a:t}),kE=t=>new Ai({a:t}),xE=t=>new ti({a:t}),RE=t=>new Ii({a:t}),UE=t=>new gi({a:t}),YE=t=>new Bi({a:t}),AI=t=>new ii({a:t}),JE=(t,A)=>new ei({a:t,b:A}),LE=t=>new si({a:t}),HE=t=>ne Line truncated
uint pcg_next(uint state) {
return state * 747796405u + 2891336453u;
}
@@ -96,7 +96,7 @@
uint pcg_mix(uvec4 value) {
return value.x + 0x9e3779b9u * value.y + 0x85ebca6bu * value.z + 0xc2b2ae35u * value.w;
}
`)],statements:({inputs:B,outputs:i})=>{const e=DA(I)?`${B.value}`:uA(I)?`${g}(${B.value})`:`floatBitsToUint(${B.value})`;return[`${g} bits = ${e};`,`${i.state} = pcg_mix(bits);`]}})}dynoOut(){return new q(this,"state")}}class Oe extends qA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"uint"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");let g=new Nt({value:I}).outputs.state;return g=new xA({state:g}).outputs.state,new RA({state:g}).outputs}})}dynoOut(){return new q(this,"hash")}}class je extends qA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"uvec2"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");let g=new Nt({value:I}).outputs.state;g=new xA({state:g}).outputs.state;const B=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const i=new RA({state:g}).outputs.hash;return{hash:TA({vectorType:"uvec2",x:B,y:i})}}})}dynoOut(){return new q(this,"hash")}}class Pe extends qA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"uvec3"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");let g=new Nt({value:I}).outputs.state;g=new xA({state:g}).outputs.state;const B=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const i=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const e=new RA({state:g}).outputs.hash;return{hash:TA({vectorType:"uvec3",x:B,y:i,z:e})}}})}dynoOut(){return new q(this,"hash")}}class Xe extends qA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"uvec4"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");let g=new Nt({value:I}).outputs.state;g=new xA({state:g}).outputs.state;const B=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const i=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const e=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const s=new RA({state:g}).outputs.hash;return{hash:TA({vectorType:"uvec4",x:B,y:i,z:e,w:s})}}})}dynoOut(){return new q(this,"hash")}}class _e extends qA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"float"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");const g=Te(I);return{hash:oA(Hi(g),v("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class $e extends qA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"vec2"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");const g=ve(I);return{hash:oA(bi(g),v("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class As extends qA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"vec3"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");const g=qe(I);return{hash:oA(Ct(g),v("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class ts extends qA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"vec4"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");const g=Ze(I);return{hash:oA(Ki(g),v("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class Is extends W{constructor({z:A,zNear:I,zFar:g}){super({inTypes:{z:"float",zNear:"float",zFar:"float"},outTypes:{depth:"float"},inputs:{z:A,zNear:I,zFar:g},statements:({inputs:B,outputs:i})=>[`float clamped = clamp(${B.z}, ${B.zNear}, ${B.zFar});`,`${i.depth} = (log2(clamped + 1.0) - log2(${B.zNear} + 1.0)) / (log2(${B.zFar} + 1.0) - log2(${B.zNear} + 1.0));`]})}dynoOut(){return new q(this,"depth")}}const gs=(t,{scale:A,scales:I,rotate:g,translate:B})=>new is({position:t,scale:A,scales:I,rotate:g,translate:B}).outputs.position,Bs=(t,{scale:A,scales:I,rotate:g})=>new es({dir:t,scale:A,scales:I,rotate:g}).outputs.dir,Bn=(t,{rotate:A})=>new ss({quaternion:t,rotate:A}).outputs.quaternion;class is extends W{constructor({position:A,scale:I,scales:g,rotate:B,translate:i}){super({inTypes:{position:"vec3",scale:"float",scales:"vec3",rotate:"vec4",translate:"vec3"},outTypes:{position:"vec3"},inputs:{position:A,scale:I,scales:g,rotate:B,translate:i},statements:({inputs:e,outputs:s})=>{const{position:Q}=s;if(!Q)return[];const{scale:E,scales:a,rotate:C,translate:o}=e;return[`${Q} = ${e.position??"vec3(0.0, 0.0, 0.0)"};`,E?`${Q} *= ${E};`:null,a?`${Q} *= ${a};`:null,C?`${Q} = quatVec(${C}, ${Q});`:null,o?`${Q} += ${o};`:null].filter(Boolean)}})}}class es extends W{constructor({dir:A,scale:I,scales:g,rotate:B}){super({inTypes:{dir:"vec3",scale:"float",scales:"vec3",rotate:"vec4"},outTypes:{dir:"vec3"},inputs:{dir:A,scale:I,scales:g,rotate:B},statements:({inputs:i,outputs:e})=>{const{dir:s}=e;if(!s)return[];const{scale:Q,scales:E,rotate:a}=i;return[`${s} = ${i.dir??"vec3(0.0, 0.0, 0.0)"};`,Q?`${s} *= ${Q};`:null,E?`${s} *= ${E};`:null,a?`${s} = quatVec(${a}, ${s});`:null].filter(Boolean)}})}}class ss extends W{constructor({quaternion:A,rotate:I}){super({ Line truncated
`)],statements:({inputs:B,outputs:i})=>{const e=uA(I)?`${B.value}`:lA(I)?`${g}(${B.value})`:`floatBitsToUint(${B.value})`;return[`${g} bits = ${e};`,`${i.state} = pcg_mix(bits);`]}})}dynoOut(){return new q(this,"state")}}class Oe extends TA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"uint"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");let g=new Nt({value:I}).outputs.state;return g=new xA({state:g}).outputs.state,new RA({state:g}).outputs}})}dynoOut(){return new q(this,"hash")}}class je extends TA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"uvec2"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");let g=new Nt({value:I}).outputs.state;g=new xA({state:g}).outputs.state;const B=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const i=new RA({state:g}).outputs.hash;return{hash:bA({vectorType:"uvec2",x:B,y:i})}}})}dynoOut(){return new q(this,"hash")}}class Pe extends TA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"uvec3"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");let g=new Nt({value:I}).outputs.state;g=new xA({state:g}).outputs.state;const B=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const i=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const e=new RA({state:g}).outputs.hash;return{hash:bA({vectorType:"uvec3",x:B,y:i,z:e})}}})}dynoOut(){return new q(this,"hash")}}class Xe extends TA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"uvec4"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");let g=new Nt({value:I}).outputs.state;g=new xA({state:g}).outputs.state;const B=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const i=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const e=new RA({state:g}).outputs.hash;g=new xA({state:g}).outputs.state;const s=new RA({state:g}).outputs.hash;return{hash:bA({vectorType:"uvec4",x:B,y:i,z:e,w:s})}}})}dynoOut(){return new q(this,"hash")}}class _e extends TA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"float"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");const g=Te(I);return{hash:oA(Hi(g),v("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class $e extends TA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"vec2"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");const g=ve(I);return{hash:oA(bi(g),v("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class As extends TA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"vec3"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");const g=qe(I);return{hash:oA(Ct(g),v("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class ts extends TA{constructor({value:A}){super({inTypes:{value:z(A)},outTypes:{hash:"vec4"},inputs:{value:A},construct:({value:I})=>{if(!I)throw new Error("value is required");const g=Ze(I);return{hash:oA(Ki(g),v("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class Is extends W{constructor({z:A,zNear:I,zFar:g}){super({inTypes:{z:"float",zNear:"float",zFar:"float"},outTypes:{depth:"float"},inputs:{z:A,zNear:I,zFar:g},statements:({inputs:B,outputs:i})=>[`float clamped = clamp(${B.z}, ${B.zNear}, ${B.zFar});`,`${i.depth} = (log2(clamped + 1.0) - log2(${B.zNear} + 1.0)) / (log2(${B.zFar} + 1.0) - log2(${B.zNear} + 1.0));`]})}dynoOut(){return new q(this,"depth")}}const gs=(t,{scale:A,scales:I,rotate:g,translate:B})=>new is({position:t,scale:A,scales:I,rotate:g,translate:B}).outputs.position,Bs=(t,{scale:A,scales:I,rotate:g})=>new es({dir:t,scale:A,scales:I,rotate:g}).outputs.dir,Bn=(t,{rotate:A})=>new ss({quaternion:t,rotate:A}).outputs.quaternion;class is extends W{constructor({position:A,scale:I,scales:g,rotate:B,translate:i}){super({inTypes:{position:"vec3",scale:"float",scales:"vec3",rotate:"vec4",translate:"vec3"},outTypes:{position:"vec3"},inputs:{position:A,scale:I,scales:g,rotate:B,translate:i},statements:({inputs:e,outputs:s})=>{const{position:Q}=s;if(!Q)return[];const{scale:E,scales:a,rotate:C,translate:o}=e;return[`${Q} = ${e.position??"vec3(0.0, 0.0, 0.0)"};`,E?`${Q} *= ${E};`:null,a?`${Q} *= ${a};`:null,C?`${Q} = quatVec(${C}, ${Q});`:null,o?`${Q} += ${o};`:null].filter(Boolean)}})}}class es extends W{constructor({dir:A,scale:I,scales:g,rotate:B}){super({inTypes:{dir:"vec3",scale:"float",scales:"vec3",rotate:"vec4"},outTypes:{dir:"vec3"},inputs:{dir:A,scale:I,scales:g,rotate:B},statements:({inputs:i,outputs:e})=>{const{dir:s}=e;if(!s)return[];const{scale:Q,scales:E,rotate:a}=i;return[`${s} = ${i.dir??"vec3(0.0, 0.0, 0.0)"};`,Q?`${s} *= ${Q};`:null,E?`${s} *= ${E};`:null,a?`${s} = quatVec(${a}, ${s});`:null].filter(Boolean)}})}}class ss extends W{constructor({quaternion:A,rotate:I}){super({ Line truncated
precision highp int;
precision highp sampler2D;
precision highp usampler2D;
@@ -131,7 +131,7 @@ void main() {
} else {
target = vec4(0.0, 0.0, 0.0, 0.0);
}
}`;const aA=class aA{constructor({renderer:A}={}){this.renderer=A,this.capacity=0,this.count=0}dispose(){this.target&&(this.target.dispose(),this.target=void 0)}ensureBuffer(A,I){const B=Math.ceil(Math.max(1,A)/P)*P*4;if(I.byteLength>=B)return I;const i=new ArrayBuffer(B);if(I instanceof ArrayBuffer)return i;const e=I.constructor;return new e(i)}ensureCapacity(A){const{width:I,height:g,depth:B,maxSplats:i}=GA(A);(!this.target||i>this.capacity)&&(this.dispose(),this.capacity=i,this.target=new n.WebGLArrayRenderTarget(I,g,B,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,magFilter:n.NearestFilter,minFilter:n.NearestFilter}),this.target.texture.format=n.RGBAFormat,this.target.texture.type=n.UnsignedByteType,this.target.texture.internalFormat="RGBA8")}prepareProgramMaterial(A){let I=aA.readbackProgram.get(A);if(!I){const B=mA({index:"int"},{rgba8:"vec4"},({index:i})=>(A.inputs.index=i,{rgba8:new TI({rgba8:A.outputs.rgba8})}));aA.programTemplate||(aA.programTemplate=new ZI(kn)),I=new qI({graph:B,inputs:{index:"index"},outputs:{rgba8:"target"},template:aA.programTemplate}),Object.assign(I.uniforms,{targetLayer:{value:0},targetBase:{value:0},targetCount:{value:0}}),aA.readbackProgram.set(A,I)}const g=I.prepareMaterial();return aA.mesh.material=g,{program:I,material:g}}saveRenderState(A){return{xrPresenting:A.xr.isPresenting,autoClear:A.autoClear,scissorTest:A.getScissorTest(),pixelRatio:A.getPixelRatio()}}resetRenderState(A,I){A.setRenderTarget(null),A.setPixelRatio(I.pixelRatio),A.xr.isPresenting=I.xrPresenting,A.autoClear=I.autoClear,A.setScissorTest(I.scissorTest)}process({count:A,material:I}){const g=this.renderer;if(!g)throw new Error("No renderer");if(!this.target)throw new Error("No target");const B=P*_A;I.uniforms.targetBase.value=0,I.uniforms.targetCount.value=A;let i=0;for(;i<A;){const e=Math.floor(i/B),s=e*B,Q=Math.min(_A,Math.ceil((A-s)/P));I.uniforms.targetLayer.value=e,g.setPixelRatio(1),g.setRenderTarget(this.target,e),g.xr.isPresenting=!1,g.autoClear=!1,g.setScissorTest(!0),g.setScissor(0,0,P,Q),g.render(aA.scene,aA.camera),i+=P*Q}this.count=A}async read({readback:A}){const I=this.renderer;if(!I)throw new Error("No renderer");if(!this.target)throw new Error("No target");const g=Math.ceil(this.count/P)*P;if(A.byteLength<g*4)throw new Error(`Readback buffer too small: ${A.byteLength} < ${g*4}`);const B=new Uint8Array(A instanceof ArrayBuffer?A:A.buffer),i=P*_A;let e=0;const s=[];for(;e<this.count;){const Q=Math.floor(e/i),E=Q*i,a=Math.min(_A,Math.ceil((this.count-E)/P));I.setPixelRatio(1),I.setRenderTarget(this.target,Q);const C=P*a*4,o=B.subarray(E*4,E*4+C),r=I==null?void 0:I.readRenderTargetPixelsAsync(this.target,0,0,P,a,o);s.push(r),e+=P*a}return Promise.all(s).then(()=>A)}render({reader:A,count:I,renderer:g}){if(this.renderer=g||this.renderer,!this.renderer)throw new Error("No renderer");this.ensureCapacity(I);const{program:B,material:i}=this.prepareProgramMaterial(A);B.update();const e=this.saveRenderState(this.renderer);this.process({count:I,material:i}),this.resetRenderState(this.renderer,e)}async readback({readback:A}){if(!this.renderer)throw new Error("No renderer");const I=this.saveRenderState(this.renderer),g=this.read({readback:A});return this.resetRenderState(this.renderer,I),g}async renderReadback({reader:A,count:I,renderer:g,readback:B}){if(this.renderer=g||this.renderer,!this.renderer)throw new Error("No renderer");this.ensureCapacity(I);const{program:i,material:e}=this.prepareProgramMaterial(A);i.update();const s=this.saveRenderState(this.renderer);this.process({count:I,material:e});const Q=this.read({readback:B});return this.resetRenderState(this.renderer,s),Q}getTexture(){var A;return(A=this.target)==null?void 0:A.texture}};aA.programTemplate=null,aA.readbackProgram=new Map,aA.geometry=new n.PlaneGeometry(2,2),aA.mesh=new n.Mesh(aA.geometry,new n.RawShaderMaterial({visible:!1})),aA.scene=new n.Scene().add(aA.mesh),aA.camera=new n.Camera;let Yt=aA;const nA=class nA{constructor(A={}){this.capacity=0,this.count=0,this.array=null,this.readback=null,this.source=null,this.needsUpdate=!0,this.dyno=new k({key:"rgbaArray",type:Ss,globals:()=>[Ms],value:{texture:nA.getEmpty(),count:0},update:I=>{var g;return I.texture=((g=this.readback)==null?void 0:g.getTexture())??this.source??nA.getEmpty(),I.count=this.count,I}}),A.array?(this.array=A.array,this.capacity=Math.floor(this.array.length/4),this.capacity=Math.floor(this.capacity/P)*P,this.count=Math.min(this.capacity,A.count??Number.POSITIVE_INFINITY)):(this.capacity=A.capacity??0,this.count=0)}dispose(){this.readback&&(this.readback.dispose(),this.readback=null),this.source&&(this.source.dispose(),this.source=null)}ensureCapacity(A){var I;if(!this.array||A>(((I=this.array)==null?void 0:I.length)??0)/4){this.capacity=GA(A).maxSplats;const g=new Uint8Array(this.capacity*4);this.array&&g.set(this.array),this.array=g}return this.array}getTexture(){var I;let A=(I=this.readback)==null?void 0:I.getTexture();return(this.source||this.array)&&(A= Line truncated
}`;const aA=class aA{constructor({renderer:A}={}){this.renderer=A,this.capacity=0,this.count=0}dispose(){this.target&&(this.target.dispose(),this.target=void 0)}ensureBuffer(A,I){const B=Math.ceil(Math.max(1,A)/P)*P*4;if(I.byteLength>=B)return I;const i=new ArrayBuffer(B);if(I instanceof ArrayBuffer)return i;const e=I.constructor;return new e(i)}ensureCapacity(A){const{width:I,height:g,depth:B,maxSplats:i}=FA(A);(!this.target||i>this.capacity)&&(this.dispose(),this.capacity=i,this.target=new n.WebGLArrayRenderTarget(I,g,B,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,magFilter:n.NearestFilter,minFilter:n.NearestFilter}),this.target.texture.format=n.RGBAFormat,this.target.texture.type=n.UnsignedByteType,this.target.texture.internalFormat="RGBA8")}prepareProgramMaterial(A){let I=aA.readbackProgram.get(A);if(!I){const B=mA({index:"int"},{rgba8:"vec4"},({index:i})=>(A.inputs.index=i,{rgba8:new TI({rgba8:A.outputs.rgba8})}));aA.programTemplate||(aA.programTemplate=new ZI(kn)),I=new qI({graph:B,inputs:{index:"index"},outputs:{rgba8:"target"},template:aA.programTemplate}),Object.assign(I.uniforms,{targetLayer:{value:0},targetBase:{value:0},targetCount:{value:0}}),aA.readbackProgram.set(A,I)}const g=I.prepareMaterial();return aA.mesh.material=g,{program:I,material:g}}saveRenderState(A){return{xrPresenting:A.xr.isPresenting,autoClear:A.autoClear,scissorTest:A.getScissorTest(),pixelRatio:A.getPixelRatio()}}resetRenderState(A,I){A.setRenderTarget(null),A.setPixelRatio(I.pixelRatio),A.xr.isPresenting=I.xrPresenting,A.autoClear=I.autoClear,A.setScissorTest(I.scissorTest)}process({count:A,material:I}){const g=this.renderer;if(!g)throw new Error("No renderer");if(!this.target)throw new Error("No target");const B=P*_A;I.uniforms.targetBase.value=0,I.uniforms.targetCount.value=A;let i=0;for(;i<A;){const e=Math.floor(i/B),s=e*B,Q=Math.min(_A,Math.ceil((A-s)/P));I.uniforms.targetLayer.value=e,g.setPixelRatio(1),g.setRenderTarget(this.target,e),g.xr.isPresenting=!1,g.autoClear=!1,g.setScissorTest(!0),g.setScissor(0,0,P,Q),g.render(aA.scene,aA.camera),i+=P*Q}this.count=A}async read({readback:A}){const I=this.renderer;if(!I)throw new Error("No renderer");if(!this.target)throw new Error("No target");const g=Math.ceil(this.count/P)*P;if(A.byteLength<g*4)throw new Error(`Readback buffer too small: ${A.byteLength} < ${g*4}`);const B=new Uint8Array(A instanceof ArrayBuffer?A:A.buffer),i=P*_A;let e=0;const s=[];for(;e<this.count;){const Q=Math.floor(e/i),E=Q*i,a=Math.min(_A,Math.ceil((this.count-E)/P));I.setPixelRatio(1),I.setRenderTarget(this.target,Q);const C=P*a*4,o=B.subarray(E*4,E*4+C),r=I==null?void 0:I.readRenderTargetPixelsAsync(this.target,0,0,P,a,o);s.push(r),e+=P*a}return Promise.all(s).then(()=>A)}render({reader:A,count:I,renderer:g}){if(this.renderer=g||this.renderer,!this.renderer)throw new Error("No renderer");this.ensureCapacity(I);const{program:B,material:i}=this.prepareProgramMaterial(A);B.update();const e=this.saveRenderState(this.renderer);this.process({count:I,material:i}),this.resetRenderState(this.renderer,e)}async readback({readback:A}){if(!this.renderer)throw new Error("No renderer");const I=this.saveRenderState(this.renderer),g=this.read({readback:A});return this.resetRenderState(this.renderer,I),g}async renderReadback({reader:A,count:I,renderer:g,readback:B}){if(this.renderer=g||this.renderer,!this.renderer)throw new Error("No renderer");this.ensureCapacity(I);const{program:i,material:e}=this.prepareProgramMaterial(A);i.update();const s=this.saveRenderState(this.renderer);this.process({count:I,material:e});const Q=this.read({readback:B});return this.resetRenderState(this.renderer,s),Q}getTexture(){var A;return(A=this.target)==null?void 0:A.texture}};aA.programTemplate=null,aA.readbackProgram=new Map,aA.geometry=new n.PlaneGeometry(2,2),aA.mesh=new n.Mesh(aA.geometry,new n.RawShaderMaterial({visible:!1})),aA.scene=new n.Scene().add(aA.mesh),aA.camera=new n.Camera;let Yt=aA;const nA=class nA{constructor(A={}){this.capacity=0,this.count=0,this.array=null,this.readback=null,this.source=null,this.needsUpdate=!0,this.dyno=new k({key:"rgbaArray",type:Ss,globals:()=>[Ms],value:{texture:nA.getEmpty(),count:0},update:I=>{var g;return I.texture=((g=this.readback)==null?void 0:g.getTexture())??this.source??nA.getEmpty(),I.count=this.count,I}}),A.array?(this.array=A.array,this.capacity=Math.floor(this.array.length/4),this.capacity=Math.floor(this.capacity/P)*P,this.count=Math.min(this.capacity,A.count??Number.POSITIVE_INFINITY)):(this.capacity=A.capacity??0,this.count=0)}dispose(){this.readback&&(this.readback.dispose(),this.readback=null),this.source&&(this.source.dispose(),this.source=null)}ensureCapacity(A){var I;if(!this.array||A>(((I=this.array)==null?void 0:I.length)??0)/4){this.capacity=FA(A).maxSplats;const g=new Uint8Array(this.capacity*4);this.array&&g.set(this.array),this.array=g}return this.array}getTexture(){var I;let A=(I=this.readback)==null?void 0:I.getTexture();return(this.source||this.array)&&(A= Line truncated
struct RgbaArray {
sampler2DArray texture;
int count;
@@ -375,7 +375,7 @@ void main() {
);
}
}
`)}}).outputs.gsplat}const ot=new Float32Array(1);class Ls{constructor(A){this.modifier=A,this.cache=new Map}apply(A){let I=this.cache.get(A);return I||(I=mA({index:"int"},{gsplat:X},({index:g})=>{const{gsplat:B}=A.apply({index:g});return this.modifier.apply({gsplat:B})}),this.cache.set(A,I)),I}}class et{constructor(){this.scale=new Qt({value:Number.NEGATIVE_INFINITY}),this.rotate=new Zt({value:new n.Quaternion(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}),this.translate=new yt({value:new n.Vector3(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)})}apply(A){return gs(A,{scale:this.scale,rotate:this.rotate,translate:this.translate})}applyDir(A){return Bs(A,{rotate:this.rotate})}applyGsplat(A){return KI(A,{scale:this.scale,rotate:this.rotate,translate:this.translate})}updateFromMatrix(A){const I=new n.Vector3,g=new n.Quaternion,B=new n.Vector3;A.decompose(B,g,I);const i=(I.x+I.y+I.z)/3;let e=!1;return i!==this.scale.value&&(this.scale.value=i,e=!0),B.equals(this.translate.value)||(this.translate.value.copy(B),e=!0),g.equals(this.rotate.value)||(this.rotate.value.copy(g),e=!0),e}update(A){return A.updateMatrixWorld(),this.updateFromMatrix(A.matrixWorld)}}class Vt extends n.Object3D{constructor({numSplats:A,generator:I,construct:g,update:B}){if(super(),this.numSplats=A??0,this.generator=I,this.frameUpdate=B,this.version=0,g){const i=g(this);Object.assign(this,i)}}updateVersion(){this.version+=1}set needsUpdate(A){A&&this.updateVersion()}}const PA=class PA extends Vt{constructor(A={}){const I=new et,g=new et,B=new et,i=new et,e=new Zt({value:new n.Vector4(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY)}),s=new Qt({value:0}),Q=new Qt({value:0}),E={transform:I,viewToWorld:g,worldToView:B,viewToObject:i,recolor:e,time:s,deltaTime:Q};if(super({update:({time:a,deltaTime:C,viewToWorld:o,globalEdits:r})=>this.update({time:a,deltaTime:C,viewToWorld:o,globalEdits:r})}),this.isInitialized=!1,this.recolor=new n.Color(1,1,1),this.opacity=1,this.enableViewToObject=!1,this.enableViewToWorld=!1,this.enableWorldToView=!1,this.skinning=null,this.edits=null,this.rgbaDisplaceEdits=null,this.splatRgba=null,this.maxSh=3,this.packedSplats=A.packedSplats??new HA,this.numSplats=this.packedSplats.numSplats,this.editable=A.editable??!0,this.onFrame=A.onFrame,this.context=E,this.objectModifier=A.objectModifier,this.worldModifier=A.worldModifier,this.updateGenerator(),A.url||A.fileBytes||A.constructSplats||A.packedSplats&&!A.packedSplats.isInitialized)this.initialized=this.asyncInitialize(A).then(async()=>{if(this.updateGenerator(),this.isInitialized=!0,A.onLoad){const a=A.onLoad(this);a instanceof Promise&&await a}return this});else if(this.isInitialized=!0,this.initialized=Promise.resolve(this),A.onLoad){const a=A.onLoad(this);a instanceof Promise&&(this.initialized=a.then(()=>this))}}async asyncInitialize(A){const{url:I,fileBytes:g,fileType:B,fileName:i,maxSplats:e,constructSplats:s}=A;if(I||g||s){const Q={url:I,fileBytes:g,fileType:B,fileName:i,maxSplats:e,construct:s};this.packedSplats.reinitialize(Q)}this.packedSplats&&(await this.packedSplats.initialized,this.numSplats=this.packedSplats.numSplats,this.updateGenerator())}static async staticInitialize(){await Eg(),PA.isStaticInitialized=!0}pushSplat(A,I,g,B,i){this.packedSplats.pushSplat(A,I,g,B,i)}forEachSplat(A){this.packedSplats.forEachSplat(A)}dispose(){this.packedSplats.dispose()}constructGenerator(A){const{transform:I,viewToObject:g,recolor:B}=A,i=mA({index:"int"},{gsplat:X},({index:e})=>{if(!e)throw new Error("index is undefined");let s=Rt(this.packedSplats.dyno,e);if(this.maxSh>=1){const{sh1Texture:E,sh2Texture:a,sh3Texture:C}=this.ensureShTextures();if(E){const o=g.translate,{center:r}=st(s).outputs,h=ye(dt(r,o));let c=bn(s,E,h);this.maxSh>=2&&a&&(c=FA(c,Kn(s,a,h))),this.maxSh>=3&&C&&(c=FA(c,Tn(s,C,h)));let{rgba:l}=st(s).outputs;l=FA(l,de(c,v("float",0))),s=At({gsplat:s,rgba:l})}}if(this.splatRgba){const E=xn(this.splatRgba.dyno,e);s=At({gsplat:s,rgba:E})}this.skinning&&(s=this.skinning.modify(s)),this.objectModifier&&(s=this.objectModifier.apply({gsplat:s}).gsplat),s=I.applyGsplat(s);const Q=oA(B,st(s).outputs.rgba);return s=At({gsplat:s,rgba:Q}),this.rgbaDisplaceEdits&&(s=this.rgbaDisplaceEdits.modify(s)),this.worldModifier&&(s=this.worldModifier.apply({gsplat:s}).gsplat),{gsplat:s}});this.generator=i}updateGenerator(){this.constructGenerator(this.context)}update({time:A,viewToWorld:I,deltaTime:g,globalEdits:B}){var l;this.numSplats=this.packedSplats.numSplats,this.context.time.value=A,this.context.deltaTime.value=g,PA.dynoTime.value=A;const{transform:i,viewToObject:e,recolor:s}=this.context;let Q=i.update(this);this.context.viewToWorld.updateFromMatrix(I)&&this.enableViewToWorld&&(Q=!0);const E=I.clone().invert();this.context.worldToView.updateFromMatrix(E)&&this.enableWorldToView&&(Q=!0);const o=new n.Matrix4().compose(i.translate Line truncated
`)}}).outputs.gsplat}const ot=new Float32Array(1);class Ls{constructor(A){this.modifier=A,this.cache=new Map}apply(A){let I=this.cache.get(A);return I||(I=mA({index:"int"},{gsplat:X},({index:g})=>{const{gsplat:B}=A.apply({index:g});return this.modifier.apply({gsplat:B})}),this.cache.set(A,I)),I}}class et{constructor(){this.scale=new Qt({value:Number.NEGATIVE_INFINITY}),this.rotate=new Zt({value:new n.Quaternion(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}),this.translate=new yt({value:new n.Vector3(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)})}apply(A){return gs(A,{scale:this.scale,rotate:this.rotate,translate:this.translate})}applyDir(A){return Bs(A,{rotate:this.rotate})}applyGsplat(A){return KI(A,{scale:this.scale,rotate:this.rotate,translate:this.translate})}updateFromMatrix(A){const I=new n.Vector3,g=new n.Quaternion,B=new n.Vector3;A.decompose(B,g,I);const i=(I.x+I.y+I.z)/3;let e=!1;return i!==this.scale.value&&(this.scale.value=i,e=!0),B.equals(this.translate.value)||(this.translate.value.copy(B),e=!0),g.equals(this.rotate.value)||(this.rotate.value.copy(g),e=!0),e}update(A){return A.updateMatrixWorld(),this.updateFromMatrix(A.matrixWorld)}}class Vt extends n.Object3D{constructor({numSplats:A,generator:I,construct:g,update:B}){if(super(),this.numSplats=A??0,this.generator=I,this.frameUpdate=B,this.version=0,g){const i=g(this);Object.assign(this,i)}}updateVersion(){this.version+=1}set needsUpdate(A){A&&this.updateVersion()}}const PA=class PA extends Vt{constructor(A={}){const I=new et,g=new et,B=new et,i=new et,e=new Zt({value:new n.Vector4(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY)}),s=new Qt({value:0}),Q=new Qt({value:0}),E={transform:I,viewToWorld:g,worldToView:B,viewToObject:i,recolor:e,time:s,deltaTime:Q};if(super({update:({time:a,deltaTime:C,viewToWorld:o,globalEdits:r})=>this.update({time:a,deltaTime:C,viewToWorld:o,globalEdits:r})}),this.isInitialized=!1,this.recolor=new n.Color(1,1,1),this.opacity=1,this.enableViewToObject=!1,this.enableViewToWorld=!1,this.enableWorldToView=!1,this.skinning=null,this.edits=null,this.rgbaDisplaceEdits=null,this.splatRgba=null,this.maxSh=3,this.packedSplats=A.packedSplats??new JA,this.numSplats=this.packedSplats.numSplats,this.editable=A.editable??!0,this.onFrame=A.onFrame,this.context=E,this.objectModifier=A.objectModifier,this.worldModifier=A.worldModifier,this.updateGenerator(),A.url||A.fileBytes||A.constructSplats||A.packedSplats&&!A.packedSplats.isInitialized)this.initialized=this.asyncInitialize(A).then(async()=>{if(this.updateGenerator(),this.isInitialized=!0,A.onLoad){const a=A.onLoad(this);a instanceof Promise&&await a}return this});else if(this.isInitialized=!0,this.initialized=Promise.resolve(this),A.onLoad){const a=A.onLoad(this);a instanceof Promise&&(this.initialized=a.then(()=>this))}}async asyncInitialize(A){const{url:I,fileBytes:g,fileType:B,fileName:i,maxSplats:e,constructSplats:s}=A;if(I||g||s){const Q={url:I,fileBytes:g,fileType:B,fileName:i,maxSplats:e,construct:s};this.packedSplats.reinitialize(Q)}this.packedSplats&&(await this.packedSplats.initialized,this.numSplats=this.packedSplats.numSplats,this.updateGenerator())}static async staticInitialize(){await Eg(),PA.isStaticInitialized=!0}pushSplat(A,I,g,B,i){this.packedSplats.pushSplat(A,I,g,B,i)}forEachSplat(A){this.packedSplats.forEachSplat(A)}dispose(){this.packedSplats.dispose()}constructGenerator(A){const{transform:I,viewToObject:g,recolor:B}=A,i=mA({index:"int"},{gsplat:X},({index:e})=>{if(!e)throw new Error("index is undefined");let s=Rt(this.packedSplats.dyno,e);if(this.maxSh>=1){const{sh1Texture:E,sh2Texture:a,sh3Texture:C}=this.ensureShTextures();if(E){const o=g.translate,{center:r}=st(s).outputs,h=ye(dt(r,o));let c=bn(s,E,h);this.maxSh>=2&&a&&(c=NA(c,Kn(s,a,h))),this.maxSh>=3&&C&&(c=NA(c,Tn(s,C,h)));let{rgba:l}=st(s).outputs;l=NA(l,de(c,v("float",0))),s=At({gsplat:s,rgba:l})}}if(this.splatRgba){const E=xn(this.splatRgba.dyno,e);s=At({gsplat:s,rgba:E})}this.skinning&&(s=this.skinning.modify(s)),this.objectModifier&&(s=this.objectModifier.apply({gsplat:s}).gsplat),s=I.applyGsplat(s);const Q=oA(B,st(s).outputs.rgba);return s=At({gsplat:s,rgba:Q}),this.rgbaDisplaceEdits&&(s=this.rgbaDisplaceEdits.modify(s)),this.worldModifier&&(s=this.worldModifier.apply({gsplat:s}).gsplat),{gsplat:s}});this.generator=i}updateGenerator(){this.constructGenerator(this.context)}update({time:A,viewToWorld:I,deltaTime:g,globalEdits:B}){var l;this.numSplats=this.packedSplats.numSplats,this.context.time.value=A,this.context.deltaTime.value=g,PA.dynoTime.value=A;const{transform:i,viewToObject:e,recolor:s}=this.context;let Q=i.update(this);this.context.viewToWorld.updateFromMatrix(I)&&this.enableViewToWorld&&(Q=!0);const E=I.clone().invert();this.context.worldToView.updateFromMatrix(E)&&this.enableWorldToView&&(Q=!0);const o=new n.Matrix4().compose(i.translate Line truncated
vec3 evaluateSH1(Gsplat gsplat, usampler2DArray sh1, vec3 viewDir) {
// Extract sint7 values packed into 2 x uint32
uvec2 packed = texelFetch(sh1, splatTexCoord(gsplat.index), 0).rg;
@@ -510,7 +510,7 @@ void main() {
}
`)}).outputs.rgb}const ut=class ut{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 I=new ReadableStream({start:e=>{e.enqueue(this.fileBytes.slice(0,65536)),e.close()}}).pipeThrough(new TextDecoderStream).getReader();this.header="";const g=`end_header
`;for(;;){const{value:e,done:s}=await I.read();if(s)throw new Error("Failed to read header");this.header+=e;const Q=this.header.indexOf(g);if(Q>=0){this.header=this.header.slice(0,Q+g.length);break}}const B=new TextEncoder().encode(this.header).length;this.data=new DataView(this.fileBytes.buffer,B),this.elements={};let i=null;this.comments=[],this.header.trim().split(`
`).forEach((e,s)=>{const Q=e.trim();if(s===0){if(Q!=="ply")throw new Error("Invalid PLY header");return}if(Q.length===0)return;const E=Q.split(" ");switch(E[0]){case"format":if(E[1]==="binary_little_endian")this.littleEndian=!0;else if(E[1]==="binary_big_endian")this.littleEndian=!1;else throw new Error(`Unsupported PLY format: ${E[1]}`);if(E[2]!=="1.0")throw new Error(`Unsupported PLY version: ${E[2]}`);break;case"end_header":break;case"comment":this.comments.push(Q.slice(8));break;case"element":{const a=E[1];i={name:a,count:Number.parseInt(E[2]),properties:{}},this.elements[a]=i;break}case"property":if(i==null)throw new Error("Property must be inside an element");E[1]==="list"?i.properties[E[4]]={isList:!0,type:E[3],countType:E[2]}:i.properties[E[2]]={isList:!1,type:E[1]};break}}),this.elements.vertex&&(this.numSplats=this.elements.vertex.count)}parseData(A){let I=0;const g=this.data;if(g==null)throw new Error("No data to parse");for(const B in this.elements){const i=this.elements[B],{count:e,properties:s}=i,Q={},E=[];for(const[C,o]of Object.entries(s))o.isList?(Q[C]=[],E.push(()=>{const r=Q[C];r.length=Pt[o.countType](g,I,this.littleEndian),I+=rt[o.countType];for(let h=0;h<r.length;h++)r[h]=Pt[o.type](g,I,this.littleEndian),I+=rt[o.type]})):(Q[C]=0,E.push(()=>{Q[C]=Pt[o.type](g,I,this.littleEndian),I+=rt[o.type]}));const a=A(i)??(()=>{});for(let C=0;C<e;C++){for(const o of E)o();a(C,Q)}}}parseSplats(A,I){if(this.elements.vertex==null)throw new Error("No vertex element found");let g=!1;const B=[];let i=0,e=[],s=[],Q=[],E,a,C;function o(){const u=qn[i];e=new Array(3).fill(null).flatMap((w,D)=>[0,1,2].map((d,y)=>`f_rest_${D+y*u/3}`)),s=new Array(5).fill(null).flatMap((w,D)=>[0,1,2].map((d,y)=>`f_rest_${3+D+y*u/3}`)),Q=new Array(7).fill(null).flatMap((w,D)=>[0,1,2].map((d,y)=>`f_rest_${8+D+y*u/3}`)),E=i>=1?new Float32Array(3*3):void 0,a=i>=2?new Float32Array(5*3):void 0,C=i>=3?new Float32Array(7*3):void 0}function r(u,w){if(!E)throw new Error("Missing sh1");for(const[D,d]of e.entries())E[D]=w[d]*8/255-4;if(a)for(const[D,d]of s.entries())a[D]=w[d]*8/255-4;if(C)for(const[D,d]of Q.entries())C[D]=w[d]*8/255-4;I==null||I(u,E,a,C)}function h(u){const{min_x:w,min_y:D,min_z:d,max_x:y,max_y:f,max_z:M,min_scale_x:N,min_scale_y:p,min_scale_z:U,max_scale_x:G,max_scale_y:F,max_scale_z:Y,min_r:m,min_g:x,min_b:R,max_r:b,max_g:$,max_b:L}=u.properties;if(!w||!D||!d||!y||!f||!M||!N||!p||!U||!G||!F||!Y||!m||!x||!R||!b||!$||!L)throw new Error("Missing PLY chunk properties");return g=!0,(Z,V)=>{const{min_x:BA,min_y:AA,min_z:tA,max_x:j,max_y:O,max_z:J,min_scale_x:dA,min_scale_y:iA,min_scale_z:pA,max_scale_x:fA,max_scale_y:H,max_scale_z:cA,min_r:YA,min_g:wA,min_b:JA,max_r:hA,max_g:K,max_b:sA}=V;B.push({min_x:BA,min_y:AA,min_z:tA,max_x:j,max_y:O,max_z:J,min_scale_x:dA,min_scale_y:iA,min_scale_z:pA,max_scale_x:fA,max_scale_y:H,max_scale_z:cA,min_r:YA,min_g:wA,min_b:JA,max_r:hA,max_g:K,max_b:sA})}}function c(u){if(I&&u.name==="sh")return i=gg(u.properties),o(),r;if(u.name!=="vertex")return null;const{packed_position:w,packed_rotation:D,packed_scale:d,packed_color:y}=u.properties;if(!w||!D||!d||!y)throw new Error("Missing PLY properties: packed_position, packed_rotation, packed_scale, packed_color");const f=Math.sqrt(2);return(M,N)=>{const p=B[M>>>8];if(p==null)throw new Error("Missing PLY chunk");const{min_x:U,min_y:G,min_z:F,max_x:Y,max_y:m,max_z:x,min_scale_x:R,min_scale_y:b,min_scale_z:$,max_scale_x:L,max_scale_y:Z,max_scale_z:V,min_r:BA,min_g:AA,min_b:tA,max_r:j,max_g:O,max_b:J}=p,{packed_position:dA,packed_rotation:iA,packed_scale:pA,packed_color:fA}=N,H=(dA>>>21&2047)/2047*(Y-U)+U,cA=(dA>>>11&1023)/1023*(m-G)+G,YA=(dA&2047)/2047*(x-F)+F,wA=((iA>>>20&1023)/1023-.5)*f,JA=((iA>>>10&1023)/1023-.5)*f,hA=((iA&1023)/1023-.5)*f,K=Math.sqrt(Math.max(0,1-wA*wA-JA*JA-hA*hA)),sA=iA>>>30,ZA=sA===0?wA:sA===1?K:JA,cI=sA<=1?JA:sA===2?K:hA,hI=sA<=2?hA:K,lI=sA===0?K:wA,uI=Math.exp((pA>>>21&2047)/2047*(L-R)+R),DI=Math.exp((pA>>>11&1023)/1023*(Z-b)+b),wI=Math.exp((pA&2047)/2047*(V-$)+$),yI=(fA>>>24&255)/255*(j-BA)+BA,dI=(fA>>>16&255)/255*(O-AA)+AA,pI=(fA>>>8&255)/255*(J-tA)+tA,fI=(fA&255)/255;A(M,H,cA,YA,uI,DI,wI,ZA,cI,hI,lI,fI,yI,dI,pI)}}const l=u=>{if(u.name==="chunk")return h(u);if(g)return c(u);if(u.name!=="vertex")return null;const{x:w,y:D,z:d,scale_0:y,scale_1:f,scale_2:M,rot_0:N,rot_1:p,rot_2:U,rot_3:G,opacity:F,f_dc_0:Y,f_dc_1:m,f_dc_2:x,red:R,green:b,blue:$,alpha:L}=u.properties;if(!w||!D||!d)throw new Error("Missing PLY properties: x, y, z");const Z=y&&f&&M,V=N&&p&&U&&G,BA=L!=null?Xt[L.type]:1,AA=R!=null?Xt[R.type]:1,tA=b!=null?Xt[b.type]:1,j=$!=null?Xt[$.type]:1;return i=gg(u.properties),o(),(O,J)=>{const dA=Z?Math.exp(J.scale_0):ut.defaultPointScale,iA=Z?Math.exp(J.scale_1):ut.defaultPointScale,pA=Z?Math.exp(J.scale_2):ut.defaultPointScale,fA=V?J.rot_1:0,H=V?J.rot_2:0,cA=V?J.rot_3:0,YA=V?J.rot_0:1,wA=F!=null?1/(1+Math.exp(-J.opacity)):L!=null?J.alpha/BA:1,JA=Y!=null?J.f_dc_0*jt+.5:R!=null?J.red/AA:1,hA=m!=null?J.f_dc_1*jt+.5:b!=null?J Line truncated
`).forEach((e,s)=>{const Q=e.trim();if(s===0){if(Q!=="ply")throw new Error("Invalid PLY header");return}if(Q.length===0)return;const E=Q.split(" ");switch(E[0]){case"format":if(E[1]==="binary_little_endian")this.littleEndian=!0;else if(E[1]==="binary_big_endian")this.littleEndian=!1;else throw new Error(`Unsupported PLY format: ${E[1]}`);if(E[2]!=="1.0")throw new Error(`Unsupported PLY version: ${E[2]}`);break;case"end_header":break;case"comment":this.comments.push(Q.slice(8));break;case"element":{const a=E[1];i={name:a,count:Number.parseInt(E[2]),properties:{}},this.elements[a]=i;break}case"property":if(i==null)throw new Error("Property must be inside an element");E[1]==="list"?i.properties[E[4]]={isList:!0,type:E[3],countType:E[2]}:i.properties[E[2]]={isList:!1,type:E[1]};break}}),this.elements.vertex&&(this.numSplats=this.elements.vertex.count)}parseData(A){let I=0;const g=this.data;if(g==null)throw new Error("No data to parse");for(const B in this.elements){const i=this.elements[B],{count:e,properties:s}=i,Q={},E=[];for(const[C,o]of Object.entries(s))o.isList?(Q[C]=[],E.push(()=>{const r=Q[C];r.length=Pt[o.countType](g,I,this.littleEndian),I+=rt[o.countType];for(let h=0;h<r.length;h++)r[h]=Pt[o.type](g,I,this.littleEndian),I+=rt[o.type]})):(Q[C]=0,E.push(()=>{Q[C]=Pt[o.type](g,I,this.littleEndian),I+=rt[o.type]}));const a=A(i)??(()=>{});for(let C=0;C<e;C++){for(const o of E)o();a(C,Q)}}}parseSplats(A,I){if(this.elements.vertex==null)throw new Error("No vertex element found");let g=!1;const B=[];let i=0,e=[],s=[],Q=[],E,a,C;function o(){const u=qn[i];e=new Array(3).fill(null).flatMap((w,D)=>[0,1,2].map((d,y)=>`f_rest_${D+y*u/3}`)),s=new Array(5).fill(null).flatMap((w,D)=>[0,1,2].map((d,y)=>`f_rest_${3+D+y*u/3}`)),Q=new Array(7).fill(null).flatMap((w,D)=>[0,1,2].map((d,y)=>`f_rest_${8+D+y*u/3}`)),E=i>=1?new Float32Array(3*3):void 0,a=i>=2?new Float32Array(5*3):void 0,C=i>=3?new Float32Array(7*3):void 0}function r(u,w){if(!E)throw new Error("Missing sh1");for(const[D,d]of e.entries())E[D]=w[d]*8/255-4;if(a)for(const[D,d]of s.entries())a[D]=w[d]*8/255-4;if(C)for(const[D,d]of Q.entries())C[D]=w[d]*8/255-4;I==null||I(u,E,a,C)}function h(u){const{min_x:w,min_y:D,min_z:d,max_x:y,max_y:f,max_z:M,min_scale_x:N,min_scale_y:p,min_scale_z:U,max_scale_x:G,max_scale_y:F,max_scale_z:Y}=u.properties;if(!w||!D||!d||!y||!f||!M||!N||!p||!U||!G||!F||!Y)throw new Error("Missing PLY chunk properties");return g=!0,(m,x)=>{const{min_x:R,min_y:b,min_z:$,max_x:L,max_y:T,max_z:V,min_scale_x:BA,min_scale_y:AA,min_scale_z:tA,max_scale_x:j,max_scale_y:O,max_scale_z:J,min_r:wA,min_g:iA,min_b:yA,max_r:dA,max_g:H,max_b:cA}=x;B.push({min_x:R,min_y:b,min_z:$,max_x:L,max_y:T,max_z:V,min_scale_x:BA,min_scale_y:AA,min_scale_z:tA,max_scale_x:j,max_scale_y:O,max_scale_z:J,min_r:wA,min_g:iA,min_b:yA,max_r:dA,max_g:H,max_b:cA})}}function c(u){if(I&&u.name==="sh")return i=gg(u.properties),o(),r;if(u.name!=="vertex")return null;const{packed_position:w,packed_rotation:D,packed_scale:d,packed_color:y}=u.properties;if(!w||!D||!d||!y)throw new Error("Missing PLY properties: packed_position, packed_rotation, packed_scale, packed_color");const f=Math.sqrt(2);return(M,N)=>{const p=B[M>>>8];if(p==null)throw new Error("Missing PLY chunk");const{min_x:U,min_y:G,min_z:F,max_x:Y,max_y:m,max_z:x,min_scale_x:R,min_scale_y:b,min_scale_z:$,max_scale_x:L,max_scale_y:T,max_scale_z:V,min_r:BA,min_g:AA,min_b:tA,max_r:j,max_g:O,max_b:J}=p,{packed_position:wA,packed_rotation:iA,packed_scale:yA,packed_color:dA}=N,H=(wA>>>21&2047)/2047*(Y-U)+U,cA=(wA>>>11&1023)/1023*(m-G)+G,vA=(wA&2047)/2047*(x-F)+F,GA=((iA>>>20&1023)/1023-.5)*f,qA=((iA>>>10&1023)/1023-.5)*f,pA=((iA&1023)/1023-.5)*f,Z=Math.sqrt(Math.max(0,1-GA*GA-qA*qA-pA*pA)),EA=iA>>>30,ZA=EA===0?GA:EA===1?Z:qA,cI=EA<=1?qA:EA===2?Z:pA,hI=EA<=2?pA:Z,lI=EA===0?Z:GA,uI=Math.exp((yA>>>21&2047)/2047*(L-R)+R),DI=Math.exp((yA>>>11&1023)/1023*(T-b)+b),wI=Math.exp((yA&2047)/2047*(V-$)+$),yI=(dA>>>24&255)/255*((j??1)-(BA??0))+(BA??0),dI=(dA>>>16&255)/255*((O??1)-(AA??0))+(AA??0),pI=(dA>>>8&255)/255*((J??1)-(tA??0))+(tA??0),fI=(dA&255)/255;A(M,H,cA,vA,uI,DI,wI,ZA,cI,hI,lI,fI,yI,dI,pI)}}const l=u=>{if(u.name==="chunk")return h(u);if(g)return c(u);if(u.name!=="vertex")return null;const{x:w,y:D,z:d,scale_0:y,scale_1:f,scale_2:M,rot_0:N,rot_1:p,rot_2:U,rot_3:G,opacity:F,f_dc_0:Y,f_dc_1:m,f_dc_2:x,red:R,green:b,blue:$,alpha:L}=u.properties;if(!w||!D||!d)throw new Error("Missing PLY properties: x, y, z");const T=y&&f&&M,V=N&&p&&U&&G,BA=L!=null?Xt[L.type]:1,AA=R!=null?Xt[R.type]:1,tA=b!=null?Xt[b.type]:1,j=$!=null?Xt[$.type]:1;return i=gg(u.properties),o(),(O,J)=>{const wA=T?Math.exp(J.scale_0):ut.defaultPointScale,iA=T?Math.exp(J.scale_1):ut.defaultPointScale,yA=T?Math.exp(J.scale_2):ut.defaultPointScale,dA=V?J.rot_1:0,H=V?J.rot_2:0,cA=V?J.rot_3:0,vA=V?J.rot_0:1,GA=F!=null?1/(1+Math.exp(-J.opacity)):L!=null?J.alpha/BA:1,qA=Y!=null?J.f_dc_0*jt+.5:R!=null?J.red/AA:1,pA=m!=null?J.f_dc_1*jt+.5:b!=null?J.green/tA:1,Z=x!=null?J.f_dc_2*jt+.5: Line truncated
precision highp int;
precision highp sampler2D;
precision highp usampler2D;
@@ -545,7 +545,7 @@ void main() {
} else {
target = uvec4(0u, 0u, 0u, 0u);
}
}`;const IA=class IA{constructor(A={}){this.maxSplats=0,this.numSplats=0,this.packedArray=null,this.isInitialized=!1,this.target=null,this.source=null,this.needsUpdate=!0,this.extra={},this.dyno=new PI({packedSplats:this}),this.initialized=Promise.resolve(this),this.reinitialize(A)}reinitialize(A){this.isInitialized=!1,A.url||A.fileBytes||A.construct?this.initialized=this.asyncInitialize(A).then(()=>(this.isInitialized=!0,this)):(this.initialize(A),this.isInitialized=!0,this.initialized=Promise.resolve(this))}initialize(A){A.packedArray?(this.packedArray=A.packedArray,this.maxSplats=Math.floor(this.packedArray.length/4),this.maxSplats=Math.floor(this.maxSplats/P)*P,this.numSplats=Math.min(this.maxSplats,A.numSplats??Number.POSITIVE_INFINITY)):(this.maxSplats=A.maxSplats??0,this.numSplats=0),this.extra=A.extra??{}}async asyncInitialize(A){const{url:I,fileBytes:g,construct:B}=A;if(I){const i=new vs;i.packedSplats=this,await i.loadAsync(I)}else if(g){const i=await jI({input:g,fileType:A.fileType,pathOrUrl:A.fileName??I});this.initialize(i)}if(B){const i=B(this);i instanceof Promise&&await i}}dispose(){this.target&&(this.target.dispose(),this.target=null),this.source&&(this.source.dispose(),this.source=null)}ensureSplats(A){const I=A<=this.maxSplats?this.maxSplats:Math.max(A,2*this.maxSplats),g=this.packedArray?this.packedArray.length/4:0;if(!this.packedArray||I>g){this.maxSplats=GA(I).maxSplats;const B=new Uint32Array(this.maxSplats*4);this.packedArray&&B.set(this.packedArray),this.packedArray=B}return this.packedArray}ensureSplatsSh(A,I){let g,B;if(A===0)return this.ensureSplats(I);if(A===1)g=2,B="sh1";else if(A===2)g=4,B="sh2";else if(A===3)g=4,B="sh3";else throw new Error(`Invalid level: ${A}`);let i=this.extra[B]?this.extra[B].length/g:0;const e=I<=i?i:Math.max(I,2*i);if(!this.extra[B]||e>i){i=GA(e).maxSplats;const s=new Uint32Array(i*g);this.extra[B]&&s.set(this.extra[B]),this.extra[B]=s}return this.extra[B]}getSplat(A){if(!this.packedArray||A>=this.numSplats)throw new Error("Invalid index");return iI(this.packedArray,A)}setSplat(A,I,g,B,i,e){const s=this.ensureSplats(A+1);BI(s,A,I.x,I.y,I.z,g.x,g.y,g.z,B.x,B.y,B.z,B.w,i,e.r,e.g,e.b),this.numSplats=Math.max(this.numSplats,A+1)}pushSplat(A,I,g,B,i){const e=this.ensureSplats(this.numSplats+1);BI(e,this.numSplats,A.x,A.y,A.z,I.x,I.y,I.z,g.x,g.y,g.z,g.w,B,i.r,i.g,i.b),++this.numSplats}forEachSplat(A){if(!(!this.packedArray||!this.numSplats))for(let I=0;I<this.numSplats;++I){const g=iI(this.packedArray,I);A(I,g.center,g.scales,g.quaternion,g.opacity,g.color)}}ensureGenerate(A){if(this.target&&(A??1)<=this.maxSplats)return!1;this.dispose();const I=GA(A??1),{width:g,height:B,depth:i}=I;return this.maxSplats=I.maxSplats,this.target=new n.WebGLArrayRenderTarget(g,B,i,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,magFilter:n.NearestFilter,minFilter:n.NearestFilter}),this.target.texture.format=n.RGBAIntegerFormat,this.target.texture.type=n.UnsignedIntType,this.target.texture.internalFormat="RGBA32UI",!0}generateMapping(A){let I=0;const g=A.map(B=>{const i=I,e=Math.ceil(B/P)*P;return I+=e,{base:i,count:B}});return{maxSplats:I,mapping:g}}getTexture(){return this.target?this.target.texture:this.source||this.packedArray?this.maybeUpdateSource():IA.getEmpty()}maybeUpdateSource(){if(!this.packedArray)throw new Error("No packed splats");if(this.needsUpdate||!this.source){if(this.needsUpdate=!1,this.source){const{width:A,height:I,depth:g}=this.source.image;this.maxSplats!==A*I*g&&(this.source.dispose(),this.source=null)}if(this.source)this.packedArray.buffer!==this.source.image.data.buffer&&(this.source.image.data=new Uint8Array(this.packedArray.buffer));else{const{width:A,height:I,depth:g}=GA(this.maxSplats);this.source=new n.DataArrayTexture(this.packedArray,A,I,g),this.source.format=n.RGBAIntegerFormat,this.source.type=n.UnsignedIntType,this.source.internalFormat="RGBA32UI",this.source.needsUpdate=!0}this.source.needsUpdate=!0}return this.source}static getEmpty(){if(!IA.emptySource){const{width:A,height:I,depth:g,maxSplats:B}=GA(1),i=new Uint32Array(B*4);IA.emptySource=new n.DataArrayTexture(i,A,I,g),IA.emptySource.format=n.RGBAIntegerFormat,IA.emptySource.type=n.UnsignedIntType,IA.emptySource.internalFormat="RGBA32UI",IA.emptySource.needsUpdate=!0}return IA.emptySource}prepareProgramMaterial(A){let I=IA.generatorProgram.get(A);if(!I){const B=mA({index:"int"},{output:"uvec4"},({index:i})=>{A.inputs.index=i;const e=A.outputs.gsplat;return{output:Mg(e)}});IA.programTemplate||(IA.programTemplate=new ZI(Xn)),I=new qI({graph:B,inputs:{index:"index"},outputs:{output:"target"},template:IA.programTemplate}),Object.assign(I.uniforms,{targetLayer:{value:0},targetBase:{value:0},targetCount:{value:0}}),IA.generatorProgram.set(A,I)}const g=I.prepareMaterial();return IA.mesh.material=g,{program:I,material:g}}saveRenderState(A){return{xrPresenting:A.xr.isPresenting,autoClear:A.autoClear,scissorTest:A.getScissorTest(),pixelRatio:A.getPixelRatio()}}resetRenderState(A,I){A.setRende Line truncated
}`;const IA=class IA{constructor(A={}){this.maxSplats=0,this.numSplats=0,this.packedArray=null,this.isInitialized=!1,this.target=null,this.source=null,this.needsUpdate=!0,this.extra={},this.dyno=new PI({packedSplats:this}),this.initialized=Promise.resolve(this),this.reinitialize(A)}reinitialize(A){this.isInitialized=!1,A.url||A.fileBytes||A.construct?this.initialized=this.asyncInitialize(A).then(()=>(this.isInitialized=!0,this)):(this.initialize(A),this.isInitialized=!0,this.initialized=Promise.resolve(this))}initialize(A){A.packedArray?(this.packedArray=A.packedArray,this.maxSplats=Math.floor(this.packedArray.length/4),this.maxSplats=Math.floor(this.maxSplats/P)*P,this.numSplats=Math.min(this.maxSplats,A.numSplats??Number.POSITIVE_INFINITY)):(this.maxSplats=A.maxSplats??0,this.numSplats=0),this.extra=A.extra??{}}async asyncInitialize(A){const{url:I,fileBytes:g,construct:B}=A;if(I){const i=new vs;i.packedSplats=this,await i.loadAsync(I)}else if(g){const i=await jI({input:g,fileType:A.fileType,pathOrUrl:A.fileName??I});this.initialize(i)}if(B){const i=B(this);i instanceof Promise&&await i}}dispose(){this.target&&(this.target.dispose(),this.target=null),this.source&&(this.source.dispose(),this.source=null)}ensureSplats(A){const I=A<=this.maxSplats?this.maxSplats:Math.max(A,2*this.maxSplats),g=this.packedArray?this.packedArray.length/4:0;if(!this.packedArray||I>g){this.maxSplats=FA(I).maxSplats;const B=new Uint32Array(this.maxSplats*4);this.packedArray&&B.set(this.packedArray),this.packedArray=B}return this.packedArray}ensureSplatsSh(A,I){let g,B;if(A===0)return this.ensureSplats(I);if(A===1)g=2,B="sh1";else if(A===2)g=4,B="sh2";else if(A===3)g=4,B="sh3";else throw new Error(`Invalid level: ${A}`);let i=this.extra[B]?this.extra[B].length/g:0;const e=I<=i?i:Math.max(I,2*i);if(!this.extra[B]||e>i){i=FA(e).maxSplats;const s=new Uint32Array(i*g);this.extra[B]&&s.set(this.extra[B]),this.extra[B]=s}return this.extra[B]}getSplat(A){if(!this.packedArray||A>=this.numSplats)throw new Error("Invalid index");return iI(this.packedArray,A)}setSplat(A,I,g,B,i,e){const s=this.ensureSplats(A+1);BI(s,A,I.x,I.y,I.z,g.x,g.y,g.z,B.x,B.y,B.z,B.w,i,e.r,e.g,e.b),this.numSplats=Math.max(this.numSplats,A+1)}pushSplat(A,I,g,B,i){const e=this.ensureSplats(this.numSplats+1);BI(e,this.numSplats,A.x,A.y,A.z,I.x,I.y,I.z,g.x,g.y,g.z,g.w,B,i.r,i.g,i.b),++this.numSplats}forEachSplat(A){if(!(!this.packedArray||!this.numSplats))for(let I=0;I<this.numSplats;++I){const g=iI(this.packedArray,I);A(I,g.center,g.scales,g.quaternion,g.opacity,g.color)}}ensureGenerate(A){if(this.target&&(A??1)<=this.maxSplats)return!1;this.dispose();const I=FA(A??1),{width:g,height:B,depth:i}=I;return this.maxSplats=I.maxSplats,this.target=new n.WebGLArrayRenderTarget(g,B,i,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,magFilter:n.NearestFilter,minFilter:n.NearestFilter}),this.target.texture.format=n.RGBAIntegerFormat,this.target.texture.type=n.UnsignedIntType,this.target.texture.internalFormat="RGBA32UI",!0}generateMapping(A){let I=0;const g=A.map(B=>{const i=I,e=Math.ceil(B/P)*P;return I+=e,{base:i,count:B}});return{maxSplats:I,mapping:g}}getTexture(){return this.target?this.target.texture:this.source||this.packedArray?this.maybeUpdateSource():IA.getEmpty()}maybeUpdateSource(){if(!this.packedArray)throw new Error("No packed splats");if(this.needsUpdate||!this.source){if(this.needsUpdate=!1,this.source){const{width:A,height:I,depth:g}=this.source.image;this.maxSplats!==A*I*g&&(this.source.dispose(),this.source=null)}if(this.source)this.packedArray.buffer!==this.source.image.data.buffer&&(this.source.image.data=new Uint8Array(this.packedArray.buffer));else{const{width:A,height:I,depth:g}=FA(this.maxSplats);this.source=new n.DataArrayTexture(this.packedArray,A,I,g),this.source.format=n.RGBAIntegerFormat,this.source.type=n.UnsignedIntType,this.source.internalFormat="RGBA32UI",this.source.needsUpdate=!0}this.source.needsUpdate=!0}return this.source}static getEmpty(){if(!IA.emptySource){const{width:A,height:I,depth:g,maxSplats:B}=FA(1),i=new Uint32Array(B*4);IA.emptySource=new n.DataArrayTexture(i,A,I,g),IA.emptySource.format=n.RGBAIntegerFormat,IA.emptySource.type=n.UnsignedIntType,IA.emptySource.internalFormat="RGBA32UI",IA.emptySource.needsUpdate=!0}return IA.emptySource}prepareProgramMaterial(A){let I=IA.generatorProgram.get(A);if(!I){const B=mA({index:"int"},{output:"uvec4"},({index:i})=>{A.inputs.index=i;const e=A.outputs.gsplat;return{output:Mg(e)}});IA.programTemplate||(IA.programTemplate=new ZI(Xn)),I=new qI({graph:B,inputs:{index:"index"},outputs:{output:"target"},template:IA.programTemplate}),Object.assign(I.uniforms,{targetLayer:{value:0},targetBase:{value:0},targetCount:{value:0}}),IA.generatorProgram.set(A,I)}const g=I.prepareMaterial();return IA.mesh.material=g,{program:I,material:g}}saveRenderState(A){return{xrPresenting:A.xr.isPresenting,autoClear:A.autoClear,scissorTest:A.getScissorTest(),pixelRatio:A.getPixelRatio()}}resetRenderState(A,I){A.setRende Line truncated
float computeSort(Gsplat gsplat, bool sortRadial, vec3 sortOrigin, vec3 sortDirection, float sortDepthBias, bool sort360) {
if (!isGsplatActive(gsplat.flags)) {
return INFINITY;
@@ -561,7 +561,7 @@ void main() {
}
`);function ig({gsplat:t,sortRadial:A,sortOrigin:I,sortDirection:g,sortDepthBias:B,sort360:i}){return vt({inTypes:{gsplat:X,sortRadial:"bool",sortOrigin:"vec3",sortDirection:"vec3",sortDepthBias:"float",sort360:"bool"},outTypes:{metric:"float"},globals:()=>[MA,Ao],inputs:{gsplat:t,sortRadial:A,sortOrigin:I,sortDirection:g,sortDepthBias:B,sort360:i},statements:({inputs:e,outputs:s})=>{const{gsplat:Q,sortRadial:E,sortOrigin:a,sortDirection:C,sortDepthBias:o,sort360:r}=e;return UA(`
${s.metric} = computeSort(${Q}, ${E}, ${a}, ${C}, ${o}, ${r});
`)}}).outputs.metric}class tI{constructor(){this.splats=new HA,this.toWorld=new n.Matrix4,this.mapping=[],this.refCount=0,this.splatsVersion=-1,this.mappingVersion=-1}ensureGenerate(A){this.splats.ensureGenerate(A)&&(this.mapping=[])}generateSplats({renderer:A,modifier:I,generators:g,forceUpdate:B,originToWorld:i}){const e=this.mapping.reduce((E,a)=>(E.set(a.node,a),E),new Map);let s=0,Q=0;for(const{node:E,generator:a,version:C,base:o,count:r}of g){const h=e.get(E);if((B||a!==(h==null?void 0:h.generator)||C!==(h==null?void 0:h.version)||o!==(h==null?void 0:h.base)||r!==(h==null?void 0:h.count))&&a&&r>0){const c=I.apply(a);try{this.splats.generate({generator:c,base:o,count:r,renderer:A})}catch(l){E.generator=void 0,E.generatorError=l}s+=1}Q=Math.max(Q,o+r)}return this.splats.numSplats=Q,this.toWorld=i,this.mapping=g,s!==0}hasCorrespondence(A){return this.mapping.length!==A.mapping.length?!1:this.mapping.every(({node:I,base:g,count:B},i)=>{const{node:e,base:s,count:Q}=A.mapping[i];return I===e&&g===s&&B===Q})}}var to=`const float LN_SCALE_MIN = -9.0;
`)}}).outputs.metric}class tI{constructor(){this.splats=new JA,this.toWorld=new n.Matrix4,this.mapping=[],this.refCount=0,this.splatsVersion=-1,this.mappingVersion=-1}ensureGenerate(A){this.splats.ensureGenerate(A)&&(this.mapping=[])}generateSplats({renderer:A,modifier:I,generators:g,forceUpdate:B,originToWorld:i}){const e=this.mapping.reduce((E,a)=>(E.set(a.node,a),E),new Map);let s=0,Q=0;for(const{node:E,generator:a,version:C,base:o,count:r}of g){const h=e.get(E);if((B||a!==(h==null?void 0:h.generator)||C!==(h==null?void 0:h.version)||o!==(h==null?void 0:h.base)||r!==(h==null?void 0:h.count))&&a&&r>0){const c=I.apply(a);try{this.splats.generate({generator:c,base:o,count:r,renderer:A})}catch(l){E.generator=void 0,E.generatorError=l}s+=1}Q=Math.max(Q,o+r)}return this.splats.numSplats=Q,this.toWorld=i,this.mapping=g,s!==0}hasCorrespondence(A){return this.mapping.length!==A.mapping.length?!1:this.mapping.every(({node:I,base:g,count:B},i)=>{const{node:e,base:s,count:Q}=A.mapping[i];return I===e&&g===s&&B===Q})}}var to=`const float LN_SCALE_MIN = -9.0;
const float LN_SCALE_MAX = 9.0;
const float LN_RESCALE = (LN_SCALE_MAX - LN_SCALE_MIN) / 254.0;
@@ -1019,7 +1019,7 @@ void main() {
vSplatUv = position.xy * maxStdDev;
vNdc = ndc;
gl_Position = vec4(ndc.xy * clipCenter.w, clipCenter.zw);
}`;let MI=null;function Bo(){return MI||(n.ShaderChunk.splatDefines=to,MI={splatVertex:go,splatFragment:Io}),MI}const eg=5;let LI=!1,HI=!1,zs;function io(t){let A=!1;return t instanceof vA?!0:(t.traverse(I=>{A=A||I instanceof vA}),A)}const Ws=n.Scene.prototype.add;n.Scene.prototype.add=function(t){return LI=LI||io(t),HI=HI||t instanceof bt,Ws.call(this,t),this};const eo=n.Scene.prototype.onBeforeRender;n.Scene.prototype.onBeforeRender=function(t){if(LI){if(!HI){const A=zs||new bt({renderer:t});this.add(A)}n.Scene.prototype.onBeforeRender=eo,n.Scene.prototype.add=Ws}};const yA=class yA extends n.Mesh{constructor(A){const I=yA.makeUniforms(),g=Bo(),B=new n.ShaderMaterial({glslVersion:n.GLSL3,vertexShader:g.splatVertex,fragmentShader:g.splatFragment,uniforms:I,transparent:!0,blending:n.NormalBlending,depthTest:!0,depthWrite:!1,side:n.DoubleSide});super(sg,B),this.autoViewpoints=[],this.rotateToAccumulator=new Zt({value:new n.Quaternion}),this.translateToAccumulator=new yt({value:new n.Vector3}),this.lastFrame=-1,this.lastUpdateTime=null,this.defaultCameras=[],this.pendingUpdate=null,this.envViewpoint=null,this.frustumCulled=!1,this.renderer=A.renderer,this.material=B,this.uniforms=I;const i=mA({gsplat:X},{gsplat:X},({gsplat:e})=>{if(!e)throw new Error("gsplat not defined");return e=KI(e,{rotate:this.rotateToAccumulator,translate:this.translateToAccumulator}),{gsplat:e}});this.modifier=new Ls(i),this.autoUpdate=A.autoUpdate??!0,this.preUpdate=A.preUpdate??!1,this.originDistance=A.originDistance??1,this.maxStdDev=A.maxStdDev??Math.sqrt(8),this.enable2DGS=A.enable2DGS??!1,this.preBlurAmount=A.preBlurAmount??0,this.blurAmount=A.blurAmount??.3,this.focalDistance=A.focalDistance??0,this.apertureAngle=A.apertureAngle??0,this.falloff=A.falloff??1,this.clipXY=A.clipXY??1.4,this.active=new tI,this.accumulatorCount=1,this.freeAccumulators=[];for(let e=0;e<1;++e)this.freeAccumulators.push(new tI),this.accumulatorCount+=1;this.defaultView=new Ht({...A.view,autoUpdate:!0,spark:this}),this.viewpoint=this.defaultView,this.prepareViewpoint(this.viewpoint),this.clock=A.clock?kB(A.clock):new n.Clock,zs=this}static makeUniforms(){return{renderSize:{value:new n.Vector2},numSplats:{value:0},renderToViewQuat:{value:new n.Quaternion},renderToViewPos:{value:new n.Vector3},maxStdDev:{value:1},enable2DGS:{value:!1},preBlurAmount:{value:0},blurAmount:{value:.3},focalDistance:{value:0},apertureAngle:{value:0},falloff:{value:1},clipXY:{value:1.4},packedSplats:{type:"t",value:HA.getEmpty()},time:{value:0},deltaTime:{value:0},encodeLinear:{value:!1},debugFlag:{value:!1}}}canAllocAccumulator(){return this.freeAccumulators.length>0||this.accumulatorCount<eg}maybeAllocAccumulator(){let A=this.freeAccumulators.pop();if(A===void 0){if(this.accumulatorCount>=eg)return null;A=new tI,this.accumulatorCount+=1}return A.refCount=1,A}releaseAccumulator(A){A.refCount-=1,A.refCount===0&&this.freeAccumulators.push(A)}newViewpoint(A){return new Ht({...A,spark:this})}onBeforeRender(A,I,g){var o,r;const B=this.time??this.clock.getElapsedTime(),i=B-(this.viewpoint.lastTime??B);this.viewpoint.lastTime=B;const e=A.info.render.frame,s=e!==this.lastFrame;this.lastFrame=e;const Q=this.viewpoint;if(Q===this.defaultView){if(s)if(!A.xr.isPresenting)this.defaultView.viewToWorld=g.matrixWorld.clone(),this.defaultCameras=[this.defaultView.viewToWorld];else{const h=A.xr.getCamera().cameras;this.defaultCameras=h.map(c=>c.matrixWorld),this.defaultView.viewToWorld=so(this.defaultCameras)??new n.Matrix4}this.autoUpdate&&this.update({scene:I,viewToWorld:this.defaultView.viewToWorld})}if(s&&(this.uniforms.time.value=B,this.uniforms.deltaTime.value=i,this.uniforms.debugFlag.value=performance.now()/1e3%2<1),Q.target)this.uniforms.renderSize.value.set(Q.target.width,Q.target.height);else{const h=A.getDrawingBufferSize(this.uniforms.renderSize.value);if(h.x===1&&h.y===1){const c=(o=A.xr.getSession())==null?void 0:o.renderState.baseLayer;c&&(h.x=c.framebufferWidth,h.y=c.framebufferHeight)}}this.uniforms.encodeLinear.value=Q.encodeLinear,this.uniforms.maxStdDev.value=this.maxStdDev,this.uniforms.enable2DGS.value=this.enable2DGS,this.uniforms.preBlurAmount.value=this.preBlurAmount,this.uniforms.blurAmount.value=this.blurAmount,this.uniforms.focalDistance.value=this.focalDistance,this.uniforms.apertureAngle.value=this.apertureAngle,this.uniforms.falloff.value=this.falloff,this.uniforms.clipXY.value=this.clipXY;const E=((r=Q.display)==null?void 0:r.accumulator.toWorld)??new n.Matrix4,a=g.matrixWorld.clone().invert();E.clone().premultiply(a).decompose(this.uniforms.renderToViewPos.value,this.uniforms.renderToViewQuat.value,new n.Vector3)}prepareViewpoint(A){if(this.viewpoint=A??this.viewpoint,this.viewpoint.display){const{accumulator:I,geometry:g}=this.viewpoint.display;this.uniforms.numSplats.value=I.splats.numSplats,this.uniforms.packedSplats.value=I.splats.getTexture(),this.geometry=g}else this.uniforms.numSplats.value=0,this.uniforms.packedSplats.value=HA.getEmpty(),this.geometry=sg Line truncated
}`;let MI=null;function Bo(){return MI||(n.ShaderChunk.splatDefines=to,MI={splatVertex:go,splatFragment:Io}),MI}const eg=5;let LI=!1,HI=!1,zs;function io(t){let A=!1;return t instanceof KA?!0:(t.traverse(I=>{A=A||I instanceof KA}),A)}const Ws=n.Scene.prototype.add;n.Scene.prototype.add=function(t){return LI=LI||io(t),HI=HI||t instanceof bt,Ws.call(this,t),this};const eo=n.Scene.prototype.onBeforeRender;n.Scene.prototype.onBeforeRender=function(t){if(LI){if(!HI){const A=zs||new bt({renderer:t});this.add(A)}n.Scene.prototype.onBeforeRender=eo,n.Scene.prototype.add=Ws}};const DA=class DA extends n.Mesh{constructor(A){const I=DA.makeUniforms(),g=Bo(),B=new n.ShaderMaterial({glslVersion:n.GLSL3,vertexShader:g.splatVertex,fragmentShader:g.splatFragment,uniforms:I,transparent:!0,blending:n.NormalBlending,depthTest:!0,depthWrite:!1,side:n.DoubleSide});super(sg,B),this.autoViewpoints=[],this.rotateToAccumulator=new Zt({value:new n.Quaternion}),this.translateToAccumulator=new yt({value:new n.Vector3}),this.lastFrame=-1,this.lastUpdateTime=null,this.defaultCameras=[],this.pendingUpdate=null,this.envViewpoint=null,this.frustumCulled=!1,this.renderer=A.renderer,this.material=B,this.uniforms=I;const i=mA({gsplat:X},{gsplat:X},({gsplat:e})=>{if(!e)throw new Error("gsplat not defined");return e=KI(e,{rotate:this.rotateToAccumulator,translate:this.translateToAccumulator}),{gsplat:e}});this.modifier=new Ls(i),this.autoUpdate=A.autoUpdate??!0,this.preUpdate=A.preUpdate??!1,this.originDistance=A.originDistance??1,this.maxStdDev=A.maxStdDev??Math.sqrt(8),this.enable2DGS=A.enable2DGS??!1,this.preBlurAmount=A.preBlurAmount??0,this.blurAmount=A.blurAmount??.3,this.focalDistance=A.focalDistance??0,this.apertureAngle=A.apertureAngle??0,this.falloff=A.falloff??1,this.clipXY=A.clipXY??1.4,this.active=new tI,this.accumulatorCount=1,this.freeAccumulators=[];for(let e=0;e<1;++e)this.freeAccumulators.push(new tI),this.accumulatorCount+=1;this.defaultView=new Ht({...A.view,autoUpdate:!0,spark:this}),this.viewpoint=this.defaultView,this.prepareViewpoint(this.viewpoint),this.clock=A.clock?kB(A.clock):new n.Clock,zs=this}static makeUniforms(){return{renderSize:{value:new n.Vector2},numSplats:{value:0},renderToViewQuat:{value:new n.Quaternion},renderToViewPos:{value:new n.Vector3},maxStdDev:{value:1},enable2DGS:{value:!1},preBlurAmount:{value:0},blurAmount:{value:.3},focalDistance:{value:0},apertureAngle:{value:0},falloff:{value:1},clipXY:{value:1.4},packedSplats:{type:"t",value:JA.getEmpty()},time:{value:0},deltaTime:{value:0},encodeLinear:{value:!1},debugFlag:{value:!1}}}canAllocAccumulator(){return this.freeAccumulators.length>0||this.accumulatorCount<eg}maybeAllocAccumulator(){let A=this.freeAccumulators.pop();if(A===void 0){if(this.accumulatorCount>=eg)return null;A=new tI,this.accumulatorCount+=1}return A.refCount=1,A}releaseAccumulator(A){A.refCount-=1,A.refCount===0&&this.freeAccumulators.push(A)}newViewpoint(A){return new Ht({...A,spark:this})}onBeforeRender(A,I,g){var o,r;const B=this.time??this.clock.getElapsedTime(),i=B-(this.viewpoint.lastTime??B);this.viewpoint.lastTime=B;const e=A.info.render.frame,s=e!==this.lastFrame;this.lastFrame=e;const Q=this.viewpoint;if(Q===this.defaultView){if(s)if(!A.xr.isPresenting)this.defaultView.viewToWorld=g.matrixWorld.clone(),this.defaultCameras=[this.defaultView.viewToWorld];else{const h=A.xr.getCamera().cameras;this.defaultCameras=h.map(c=>c.matrixWorld),this.defaultView.viewToWorld=so(this.defaultCameras)??new n.Matrix4}this.autoUpdate&&this.update({scene:I,viewToWorld:this.defaultView.viewToWorld})}if(s&&(this.uniforms.time.value=B,this.uniforms.deltaTime.value=i,this.uniforms.debugFlag.value=performance.now()/1e3%2<1),Q.target)this.uniforms.renderSize.value.set(Q.target.width,Q.target.height);else{const h=A.getDrawingBufferSize(this.uniforms.renderSize.value);if(h.x===1&&h.y===1){const c=(o=A.xr.getSession())==null?void 0:o.renderState.baseLayer;c&&(h.x=c.framebufferWidth,h.y=c.framebufferHeight)}}this.uniforms.encodeLinear.value=Q.encodeLinear,this.uniforms.maxStdDev.value=this.maxStdDev,this.uniforms.enable2DGS.value=this.enable2DGS,this.uniforms.preBlurAmount.value=this.preBlurAmount,this.uniforms.blurAmount.value=this.blurAmount,this.uniforms.focalDistance.value=this.focalDistance,this.uniforms.apertureAngle.value=this.apertureAngle,this.uniforms.falloff.value=this.falloff,this.uniforms.clipXY.value=this.clipXY;const E=((r=Q.display)==null?void 0:r.accumulator.toWorld)??new n.Matrix4,a=g.matrixWorld.clone().invert();E.clone().premultiply(a).decompose(this.uniforms.renderToViewPos.value,this.uniforms.renderToViewQuat.value,new n.Vector3)}prepareViewpoint(A){if(this.viewpoint=A??this.viewpoint,this.viewpoint.display){const{accumulator:I,geometry:g}=this.viewpoint.display;this.uniforms.numSplats.value=I.splats.numSplats,this.uniforms.packedSplats.value=I.splats.getTexture(),this.geometry=g}else this.uniforms.numSplats.value=0,this.uniforms.packedSplats.value=JA.getEmpty(),this.geometry=sg Line truncated
struct GsplatSkinning {
int numSplats;
int numBones;
@@ -1095,5 +1095,5 @@ void main() {
);
}
`)}}).outputs.gsplat}function uo({splats:t,extents:A,stepSize:I=1,pointRadius:g=.01,pointShadowScale:B=2,opacity:i=1,color:e}){const Q=new n.Vector3,E=new n.Vector3,a=new n.Quaternion(0,0,0,1);e==null&&(e=(o,r)=>o.set(.55+.45*Math.cos(r.x*1),.55+.45*Math.cos(r.y*1),.55+.45*Math.cos(r.z*1)));const C=new n.Color;for(let o=A.min.z;o<A.max.z+1e-6;o+=I)for(let r=A.min.y;r<A.max.y+1e-6;r+=I)for(let h=A.min.x;h<A.max.x+1e-6;h+=I){Q.set(h,r,o);for(let c=0;c<2;++c)E.setScalar(g*(c?1:B)),c?typeof e=="function"?e(C,Q):C.copy(e):C.setScalar(0),t.pushSplat(Q,E,a,i,C)}}function Do({splats:t,scale:A=.25,axisRadius:I=.0075,axisShadowScale:g=2,origins:B=[new n.Vector3]}){const i=new n.Vector3,e=new n.Vector3,s=new n.Quaternion(0,0,0,1),Q=new n.Color,E=1;for(const a of B)for(let C=0;C<3;++C){i.set(a.x+(C===0?A:0),a.y+(C===1?A:0),a.z+(C===2?A:0));for(let o=0;o<2;++o)e.set((C===0?A:I)*(o?1:g),(C===1?A:I)*(o?1:g),(C===2?A:I)*(o?1:g)),Q.setRGB(o===0?0:C===0?1:0,o===0?0:C===1?1:0,o===0?0:C===2?1:0),t.pushSplat(i,e,s,E,Q)}}function wo({splats:t,origin:A=new n.Vector3,radius:I=1,maxDepth:g=3,filter:B=null,pointRadius:i=.02,pointThickness:e=.001,color:s=new n.Color(1,1,1)}){const Q={};function E(c){if(B&&!B(c))return;const l=`${c.x},${c.y},${c.z}`;Q[l]||(Q[l]=c)}function a(c,l,u,w){if(E(l),E(u),E(w),c>=g)return;const D=new n.Vector3().addVectors(l,u).normalize(),d=new n.Vector3().addVectors(u,w).normalize(),y=new n.Vector3().addVectors(w,l).normalize();a(c+1,l,D,y),a(c+1,D,u,d),a(c+1,y,d,w),a(c+1,D,d,y)}for(const c of[-1,1])for(const l of[-1,1])for(const u of[-1,1]){const w=new n.Vector3(c,0,0),D=new n.Vector3(0,l,0),d=new n.Vector3(0,0,u);a(0,w,D,d)}const C=Object.values(Q),o=new n.Vector3(i,i,e),r=new n.Quaternion,h=typeof s=="function"?new n.Color:s;for(const c of C)r.setFromUnitVectors(new n.Vector3(0,0,-1),c),typeof s=="function"&&s(h,c),c.multiplyScalar(I),c.add(A),t.pushSplat(c,o,r,1,h)}function yo({text:t,font:A,fontSize:I,color:g,rgb:B,dotRadius:i,textAlign:e,lineHeight:s,objectScale:Q}){A=A??"Arial",I=I??32,g=g??new n.Color(1,1,1),i=i??.8,e=e??"start",s=s??1,Q=Q??1;const E=t.split(`
`),a=document.createElement("canvas"),C=a.getContext("2d");if(!C)throw new Error("Failed to create canvas context");C.font=`${I}px ${A}`,C.textAlign=e;const o=C.measureText(""),r=o.fontBoundingBoxAscent+o.fontBoundingBoxDescent;let h=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let m=0;m<E.length;++m){const x=C.measureText(E[m]),R=r*s*m;h=Math.min(h,-x.actualBoundingBoxLeft),c=Math.max(c,x.actualBoundingBoxRight),l=Math.min(l,R-x.actualBoundingBoxAscent),u=Math.max(u,R+x.actualBoundingBoxDescent)}const w=Math.floor(h),D=Math.floor(l),d=Math.ceil(c)-w,y=Math.ceil(u)-D;a.width=d,a.height=y,C.font=`${I}px ${A}`,C.textAlign=e,C.textBaseline="alphabetic",C.fillStyle="#FFFFFF";for(let m=0;m<E.length;++m){const x=r*s*m-D;C.fillText(E[m],-w,x)}const f=C.getImageData(0,0,d,y),M=new Uint8Array(f.data.buffer),N=new HA,p=new n.Vector3,U=new n.Vector3().setScalar(i*Q),G=new n.Quaternion(0,0,0,1);B=B??new n.Color(1,1,1);let F=0;for(let m=0;m<y;++m)for(let x=0;x<d;++x){const R=M[F+3];if(R>0){const b=R/255;p.set(x-.5*(d-1),.5*(y-1)-m,0),p.multiplyScalar(Q),N.pushSplat(p,U,G,b,B)}F+=4}const Y=new vA({packedSplats:N});return Y.recolor=g,Y}function po({url:t,dotRadius:A,subXY:I,forEachSplat:g}){return A=A??.8,I=Math.max(1,Math.floor(I??1)),new vA({constructSplats:async B=>new Promise((i,e)=>{const s=new Image;s.crossOrigin="anonymous",s.onerror=e,s.onload=()=>{const{width:Q,height:E}=s,a=document.createElement("canvas");a.width=Q,a.height=E;const C=a.getContext("2d");if(!C){e(new Error("Failed to create canvas context"));return}C.imageSmoothingEnabled=!0,C.imageSmoothingQuality="high";const o=Math.round(Q/I),r=Math.round(E/I);C.drawImage(s,0,0,o,r);try{const h=C.getImageData(0,0,o,r),c=new Uint8Array(h.data.buffer),l=new n.Vector3,u=new n.Vector3().setScalar(A),w=new n.Quaternion(0,0,0,1),D=new n.Color;let d=0;for(let y=0;y<r;++y)for(let f=0;f<o;++f){const M=d*4,N=c[M+3];if(N>0){let p=N/255;D.set(c[M+0]/255,c[M+1]/255,c[M+2]/255),l.set(f-.5*(o-1),.5*(r-1)-y,0),u.setScalar(A),w.set(0,0,0,1);let U=!0;if(g){const G=g(o,r,d,l,u,w,p,D);p=G??p,U=G!==null}U&&B.pushSplat(l,u,w,p,D)}d+=1}i()}catch(h){e(h)}},s.src=t})})}function fo({box:t,cells:A,dotScale:I,color:g,opacity:B}){A.x=Math.max(1,Math.round(A.x)),A.y=Math.max(1,Math.round(A.y)),A.z=Math.max(1,Math.round(A.z)),B=B??1;const i=A.x*A.y*A.z,e=v("int",A.x),s=v("int",A.y);v("int",A.z);const Q=bA(0),E=new Vt({numSplats:i,generator:mA({index:"int"},{gsplat:X},({index:C})=>{if(!C)throw new Error("index is undefined");const o=xI(C,e),r=$t(C,e),h=xI(r,s),c=$t(r,s),l=TA({vectorType:"ivec3",x:o,y:h,z:c}),u=Ti(Q),w=TA({vectorType:"ivec2",x:C,y:u}),D=ze(w),d=v("vec3",t.min),y=v("vec3",t.max),f=dt(y,d),M=$t(FA(Ct(l),D),v("vec3",A));let N,p,U;g?(N=v("float",g.r),p=v("float",g.g),U=v("float",g.b)):{r:N,g:p,b:U}=wt(M).outputs;const G=TA({vectorType:"vec4",r:N,g:p,b:U,a:v("float",B)}),F=FA(d,oA(f,M)),Y=Ct(v("float",I)),m=v("vec4",new n.Quaternion(0,0,0,1));let x=At({flags:II("uint","GSPLAT_FLAG_ACTIVE"),index:C,center:F,scales:Y,quaternion:m,rgba:G});return x=a.applyGsplat(x),{gsplat:x}},{globals:()=>[MA]}),update:({time:C})=>{Q.value=C,a.update(E),E.updateVersion()}}),a=new et;return E}const No={box:new n.Box3(new n.Vector3(-1,-1,-1),new n.Vector3(1,1,1)),density:100,fallDirection:new n.Vector3(-1,-3,1).normalize(),fallVelocity:.02,wanderScale:.04,wanderVariance:2,color1:new n.Color(1,1,1),color2:new n.Color(.5,.5,1),minScale:.001,maxScale:.005,anisoScale:new n.Vector3(1,1,1)},Fo={box:new n.Box3(new n.Vector3(-2,-1,-2),new n.Vector3(2,5,2)),density:10,fallDirection:new n.Vector3(0,-1,0),fallVelocity:2,wanderScale:.1,wanderVariance:1,color1:new n.Color(1,1,1),color2:new n.Color(.25,.25,.5),minScale:.005,maxScale:.01,anisoScale:new n.Vector3(.1,1,.1)};function Go({box:t,minY:A,numSplats:I,density:g,anisoScale:B,minScale:i,maxScale:e,fallDirection:s,fallVelocity:Q,wanderScale:E,wanderVariance:a,color1:C,color2:o,opacity:r,onFrame:h}){t=t??new n.Box3(new n.Vector3(-1,-1,-1),new n.Vector3(1,1,1));const c=(t.max.x-t.min.x)*(t.max.y-t.min.y)*(t.max.z-t.min.z);g=g??100,I=I??Math.max(1,Math.min(1e6,Math.round(c*g)));const l=bA(i??.001),u=bA(e??.005),w=jA(((B==null?void 0:B.clone())??new n.Vector3(1,1,1)).normalize()),D=jA((s??new n.Vector3(0,-1,0)).normalize()),d=bA(Q??.02),y=bA(E??.01),f=bA(a??2),M=jA(C??new n.Color(1,1,1)),N=jA(o??new n.Color(.5,.5,1)),p=bA(r??1),U=bA(0),G=jA(new n.Vector3(0,0,0)),F=jA(t.min),Y=jA(t.max),m=bA(A??Number.NEGATIVE_INFINITY),x=dt(Y,F),R=new Vt({numSplats:I,generator:mA({index:"int"},{gsplat:X},({index:$})=>{if(!$)throw new Error("index not defined");const L=RI($),Z=wt(L).outputs.w;let V=Ct(L),BA=AI(oA(Z,v("float",100)));BA=UI(oA(II("float","PI"),BA)),BA=FA(l,oA(BA,dt(u,l)));const AA=oA(BA,w),tA=AI(oA(Z,v("float",10))),j=AI(Z),O=ZB(M,N,j),J=oA(O,tA),dA=RI(TA({vectorType:"ivec2",x:$,y:v("int",6837)}));let iA=Ct(dA),pA=oA(wt(dA).outputs.w,f);pA=FA(U,pA),V=FA(V,G);const fA=vB(V,v("vec3",new n.Vector3(1,1,1))); Line truncated
`),a=document.createElement("canvas"),C=a.getContext("2d");if(!C)throw new Error("Failed to create canvas context");C.font=`${I}px ${A}`,C.textAlign=e;const o=C.measureText(""),r=o.fontBoundingBoxAscent+o.fontBoundingBoxDescent;let h=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let m=0;m<E.length;++m){const x=C.measureText(E[m]),R=r*s*m;h=Math.min(h,-x.actualBoundingBoxLeft),c=Math.max(c,x.actualBoundingBoxRight),l=Math.min(l,R-x.actualBoundingBoxAscent),u=Math.max(u,R+x.actualBoundingBoxDescent)}const w=Math.floor(h),D=Math.floor(l),d=Math.ceil(c)-w,y=Math.ceil(u)-D;a.width=d,a.height=y,C.font=`${I}px ${A}`,C.textAlign=e,C.textBaseline="alphabetic",C.fillStyle="#FFFFFF";for(let m=0;m<E.length;++m){const x=r*s*m-D;C.fillText(E[m],-w,x)}const f=C.getImageData(0,0,d,y),M=new Uint8Array(f.data.buffer),N=new JA,p=new n.Vector3,U=new n.Vector3().setScalar(i*Q),G=new n.Quaternion(0,0,0,1);B=B??new n.Color(1,1,1);let F=0;for(let m=0;m<y;++m)for(let x=0;x<d;++x){const R=M[F+3];if(R>0){const b=R/255;p.set(x-.5*(d-1),.5*(y-1)-m,0),p.multiplyScalar(Q),N.pushSplat(p,U,G,b,B)}F+=4}const Y=new KA({packedSplats:N});return Y.recolor=g,Y}function po({url:t,dotRadius:A,subXY:I,forEachSplat:g}){return A=A??.8,I=Math.max(1,Math.floor(I??1)),new KA({constructSplats:async B=>new Promise((i,e)=>{const s=new Image;s.crossOrigin="anonymous",s.onerror=e,s.onload=()=>{const{width:Q,height:E}=s,a=document.createElement("canvas");a.width=Q,a.height=E;const C=a.getContext("2d");if(!C){e(new Error("Failed to create canvas context"));return}C.imageSmoothingEnabled=!0,C.imageSmoothingQuality="high";const o=Math.round(Q/I),r=Math.round(E/I);C.drawImage(s,0,0,o,r);try{const h=C.getImageData(0,0,o,r),c=new Uint8Array(h.data.buffer),l=new n.Vector3,u=new n.Vector3().setScalar(A),w=new n.Quaternion(0,0,0,1),D=new n.Color;let d=0;for(let y=0;y<r;++y)for(let f=0;f<o;++f){const M=d*4,N=c[M+3];if(N>0){let p=N/255;D.set(c[M+0]/255,c[M+1]/255,c[M+2]/255),l.set(f-.5*(o-1),.5*(r-1)-y,0),u.setScalar(A),w.set(0,0,0,1);let U=!0;if(g){const G=g(o,r,d,l,u,w,p,D);p=G??p,U=G!==null}U&&B.pushSplat(l,u,w,p,D)}d+=1}i()}catch(h){e(h)}},s.src=t})})}function fo({box:t,cells:A,dotScale:I,color:g,opacity:B}){A.x=Math.max(1,Math.round(A.x)),A.y=Math.max(1,Math.round(A.y)),A.z=Math.max(1,Math.round(A.z)),B=B??1;const i=A.x*A.y*A.z,e=v("int",A.x),s=v("int",A.y);v("int",A.z);const Q=LA(0),E=new Vt({numSplats:i,generator:mA({index:"int"},{gsplat:X},({index:C})=>{if(!C)throw new Error("index is undefined");const o=xI(C,e),r=$t(C,e),h=xI(r,s),c=$t(r,s),l=bA({vectorType:"ivec3",x:o,y:h,z:c}),u=Ti(Q),w=bA({vectorType:"ivec2",x:C,y:u}),D=ze(w),d=v("vec3",t.min),y=v("vec3",t.max),f=dt(y,d),M=$t(NA(Ct(l),D),v("vec3",A));let N,p,U;g?(N=v("float",g.r),p=v("float",g.g),U=v("float",g.b)):{r:N,g:p,b:U}=wt(M).outputs;const G=bA({vectorType:"vec4",r:N,g:p,b:U,a:v("float",B)}),F=NA(d,oA(f,M)),Y=Ct(v("float",I)),m=v("vec4",new n.Quaternion(0,0,0,1));let x=At({flags:II("uint","GSPLAT_FLAG_ACTIVE"),index:C,center:F,scales:Y,quaternion:m,rgba:G});return x=a.applyGsplat(x),{gsplat:x}},{globals:()=>[MA]}),update:({time:C})=>{Q.value=C,a.update(E),E.updateVersion()}}),a=new et;return E}const No={box:new n.Box3(new n.Vector3(-1,-1,-1),new n.Vector3(1,1,1)),density:100,fallDirection:new n.Vector3(-1,-3,1).normalize(),fallVelocity:.02,wanderScale:.04,wanderVariance:2,color1:new n.Color(1,1,1),color2:new n.Color(.5,.5,1),minScale:.001,maxScale:.005,anisoScale:new n.Vector3(1,1,1)},Fo={box:new n.Box3(new n.Vector3(-2,-1,-2),new n.Vector3(2,5,2)),density:10,fallDirection:new n.Vector3(0,-1,0),fallVelocity:2,wanderScale:.1,wanderVariance:1,color1:new n.Color(1,1,1),color2:new n.Color(.25,.25,.5),minScale:.005,maxScale:.01,anisoScale:new n.Vector3(.1,1,.1)};function Go({box:t,minY:A,numSplats:I,density:g,anisoScale:B,minScale:i,maxScale:e,fallDirection:s,fallVelocity:Q,wanderScale:E,wanderVariance:a,color1:C,color2:o,opacity:r,onFrame:h}){t=t??new n.Box3(new n.Vector3(-1,-1,-1),new n.Vector3(1,1,1));const c=(t.max.x-t.min.x)*(t.max.y-t.min.y)*(t.max.z-t.min.z);g=g??100,I=I??Math.max(1,Math.min(1e6,Math.round(c*g)));const l=LA(i??.001),u=LA(e??.005),w=jA(((B==null?void 0:B.clone())??new n.Vector3(1,1,1)).normalize()),D=jA((s??new n.Vector3(0,-1,0)).normalize()),d=LA(Q??.02),y=LA(E??.01),f=LA(a??2),M=jA(C??new n.Color(1,1,1)),N=jA(o??new n.Color(.5,.5,1)),p=LA(r??1),U=LA(0),G=jA(new n.Vector3(0,0,0)),F=jA(t.min),Y=jA(t.max),m=LA(A??Number.NEGATIVE_INFINITY),x=dt(Y,F),R=new Vt({numSplats:I,generator:mA({index:"int"},{gsplat:X},({index:$})=>{if(!$)throw new Error("index not defined");const L=RI($),T=wt(L).outputs.w;let V=Ct(L),BA=AI(oA(T,v("float",100)));BA=UI(oA(II("float","PI"),BA)),BA=NA(l,oA(BA,dt(u,l)));const AA=oA(BA,w),tA=AI(oA(T,v("float",10))),j=AI(T),O=ZB(M,N,j),J=oA(O,tA),wA=RI(bA({vectorType:"ivec2",x:$,y:v("int",6837)}));let iA=Ct(wA),yA=oA(wt(wA).outputs.w,f);yA=NA(U,yA),V=NA(V,G);const dA=vB(V,v("vec3",new n.Vector3(1,1,1))); Line truncated
//# sourceMappingURL=spark.cjs.min.js.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"spark.cjs.min.js","sources":["../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","../node_modules/fflate/esm/browser.js","../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":["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} 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 * @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) {\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);\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(Line truncated
{"version":3,"file":"spark.cjs.min.js","sources":["../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","../node_modules/fflate/esm/browser.js","../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":["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} 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 * @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) {\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);\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(Line truncated
+18 -24
View File
@@ -7711,15 +7711,9 @@ const _PlyReader = class _PlyReader {
min_scale_z,
max_scale_x,
max_scale_y,
max_scale_z,
min_r,
min_g,
min_b,
max_r,
max_g,
max_b
max_scale_z
} = element.properties;
if (!min_x || !min_y || !min_z || !max_x || !max_y || !max_z || !min_scale_x || !min_scale_y || !min_scale_z || !max_scale_x || !max_scale_y || !max_scale_z || !min_r || !min_g || !min_b || !max_r || !max_g || !max_b) {
if (!min_x || !min_y || !min_z || !max_x || !max_y || !max_z || !min_scale_x || !min_scale_y || !min_scale_z || !max_scale_x || !max_scale_y || !max_scale_z) {
throw new Error("Missing PLY chunk properties");
}
isSuperSplat = true;
@@ -7737,12 +7731,12 @@ const _PlyReader = class _PlyReader {
max_scale_x: max_scale_x2,
max_scale_y: max_scale_y2,
max_scale_z: max_scale_z2,
min_r: min_r2,
min_g: min_g2,
min_b: min_b2,
max_r: max_r2,
max_g: max_g2,
max_b: max_b2
min_r,
min_g,
min_b,
max_r,
max_g,
max_b
} = item;
ssChunks.push({
min_x: min_x2,
@@ -7757,12 +7751,12 @@ const _PlyReader = class _PlyReader {
max_scale_x: max_scale_x2,
max_scale_y: max_scale_y2,
max_scale_z: max_scale_z2,
min_r: min_r2,
min_g: min_g2,
min_b: min_b2,
max_r: max_r2,
max_g: max_g2,
max_b: max_b2
min_r,
min_g,
min_b,
max_r,
max_g,
max_b
});
};
}
@@ -7829,9 +7823,9 @@ const _PlyReader = class _PlyReader {
const scaleZ = Math.exp(
(packed_scale2 & 2047) / 2047 * (max_scale_z - min_scale_z) + min_scale_z
);
const r = (packed_color2 >>> 24 & 255) / 255 * (max_r - min_r) + min_r;
const g = (packed_color2 >>> 16 & 255) / 255 * (max_g - min_g) + min_g;
const b = (packed_color2 >>> 8 & 255) / 255 * (max_b - min_b) + min_b;
const r = (packed_color2 >>> 24 & 255) / 255 * ((max_r ?? 1) - (min_r ?? 0)) + (min_r ?? 0);
const g = (packed_color2 >>> 16 & 255) / 255 * ((max_g ?? 1) - (min_g ?? 0)) + (min_g ?? 0);
const b = (packed_color2 >>> 8 & 255) / 255 * ((max_b ?? 1) - (min_b ?? 0)) + (min_b ?? 0);
const opacity = (packed_color2 & 255) / 255;
splatCallback(
index,
@@ -8126,7 +8120,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 raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid) {\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);\n return ret;\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 = instanLine 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 raycast_splats(origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, near, far, num_splats, packed_splats, raycast_ellipsoid) {\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);\n return ret;\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 = instanLine 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":["../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","../node_modules/fflate/esm/browser.js","../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":["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} 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 * @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) {\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);\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(aLine truncated
{"version":3,"file":"spark.module.js","sources":["../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","../node_modules/fflate/esm/browser.js","../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":["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} 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 * @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) {\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);\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(aLine truncated
+315 -321
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"spark.module.min.js","sources":["../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","../node_modules/fflate/esm/browser.js","../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":["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} 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 * @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) {\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);\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 = functiLine truncated
{"version":3,"file":"spark.module.min.js","sources":["../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","../node_modules/fflate/esm/browser.js","../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":["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} 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 * @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) {\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);\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 = functiLine truncated