Bump dist build

This commit is contained in:
sparkjsdev[bot] committed 2025-07-22 00:50:01 +00:00
1 parent 0bfb6c8963
commit d1b8c5687c
14 files changed
+2607 -2496

No files matched your search

-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"worker-BmUUE_U7.js","sources":["../rust/spark-internal-rs/pkg/spark_internal_rs.js","../node_modules/fflate/esm/browser.js","../node_modules/three/build/three.core.js","../src/defines.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../src/ply.ts","../src/SplatLoader.ts","../src/pcsogs.ts","../src/spz.ts","../src/worker.ts"],"sourcesContent":["let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * @param {number} num_splats\n * @param {Uint16Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} 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 = 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_sLine truncated
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"worker-By511x3e.js","sources":["../rust/spark-internal-rs/pkg/spark_internal_rs.js","../node_modules/fflate/esm/browser.js","../node_modules/three/build/three.core.js","../src/defines.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../src/ply.ts","../src/SplatLoader.ts","../src/pcsogs.ts","../src/spz.ts","../src/worker.ts"],"sourcesContent":["let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * @param {number} num_splats\n * @param {Uint16Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} num_splats\n * @param {Uint32Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} origin_x\n * @param {number} origin_y\n * @param {number} origin_z\n * @param {number} dir_x\n * @param {number} dir_y\n * @param {number} dir_z\n * @param {number} near\n * @param {number} far\n * @param {number} num_splats\n * @param {Uint32Array} packed_splats\n * @param {boolean} raycast_ellipsoid\n * @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 = 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.seLine truncated
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"worker-Di8Hg6Zl.js","sources":["../rust/spark-internal-rs/pkg/spark_internal_rs.js","../node_modules/fflate/esm/browser.js","../node_modules/three/build/three.core.js","../src/defines.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../src/ply.ts","../src/SplatLoader.ts","../src/pcsogs.ts","../src/spz.ts","../src/worker.ts"],"sourcesContent":["let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * @param {number} num_splats\n * @param {Uint16Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} num_splats\n * @param {Uint32Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} origin_x\n * @param {number} origin_y\n * @param {number} origin_z\n * @param {number} dir_x\n * @param {number} dir_y\n * @param {number} dir_z\n * @param {number} near\n * @param {number} far\n * @param {number} num_splats\n * @param {Uint32Array} packed_splats\n * @param {boolean} raycast_ellipsoid\n * @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 = 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.seLine truncated
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"worker-DkDUeNp7.js","sources":["../rust/spark-internal-rs/pkg/spark_internal_rs.js","../node_modules/fflate/esm/browser.js","../node_modules/three/build/three.core.js","../src/defines.ts","../src/dyno/base.ts","../src/utils.ts","../src/antisplat.ts","../src/ksplat.ts","../src/ply.ts","../src/SplatLoader.ts","../src/pcsogs.ts","../src/spz.ts","../src/worker.ts"],"sourcesContent":["let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * @param {number} num_splats\n * @param {Uint16Array} readback\n * @param {Uint32Array} ordering\n * @returns {number}\n */\nexport function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n}\n\n/**\n * @param {number} 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 = 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_sLine truncated
-1
View File
@@ -1 +0,0 @@
013c9c0ae13ab735b9cc85c94ef23657c993b65f
+52 -12
View File
@@ -703,7 +703,7 @@ async function __wbg_init(module_or_path) {
}
}
if (typeof module_or_path === "undefined") {
module_or_path = new URL("data:application/wasm;base64,AGFzbQEAAAAB8gEjYAJ/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+AGALfX19fX19fX1/b38Bb2AGf39/f39/AX9gBX9/fX9/AGAEf31/fwBgBX9/fn9/AGAEf35/fwBgBX9/fH9/AGAEf3x/fwBgA39+fgF/YAN/b28Bf2ACfX0BfQLyBBEDd2JnHV9fd2JnX2J1ZmZlcl82MDljYzNlZWU1MWVkMTU4AAoDd2JnGl9fd2JnX25ld185ZmVlOTdhNDA5YjMyYjY4AAoDd2JnGl9fd2JnX3NldF9mNGYxZjBkYWEzMDY5NmZjAAsDd2JnHV9fd2JnX2xlbmd0aF84Y2ZkMmM2NDA5YWY4OGFkAAwDd2JnMV9fd2JnX25ld3dpdGhieXRlb2Zmc2V0YW5kbGVuZ3RoX2YxZGVhZDQ0ZDFmYzcyMTIABwN3YmcaX193YmdfbmV3X2UzYjMyMWRjZmVmODlmYzcACgN3YmcaX193Ymdfc2V0X2QyMzY2MWQxOTE0OGIyMjkACwN3YmcdX193YmdfbGVuZ3RoXzZjYTUyNzY2NWQ4OTY5NGQADAN3YmcxX193YmdfbmV3d2l0aGJ5dGVvZmZzZXRhbmRsZW5ndGhfZTZiN2U2OWFjZDRjNzM1NAAHA3diZxpfX3diZ19zZXRfMTBiYWQ5YmVlMGU5YzU4YgALA3diZx1fX3diZ19sZW5ndGhfM2I0ZjAyMjE4OGFlOGRiNgAMA3diZx9fX3diZ19zdWJhcnJheV83NjllMWUwZjgxYmIyNTliAAcDd2JnH19fd2JnX3N1YmFycmF5XzNhYWVlYzg5YmIyNTQ0ZjAABwN3YmckX193YmdfbmV3d2l0aGxlbmd0aF81YTVlZmUzMTNjZmQ1OWYxABMDd2JnEF9fd2JpbmRnZW5fdGhyb3cAAgN3YmcRX193YmluZGdlbl9tZW1vcnkAFAN3YmcfX193YmluZGdlbl9pbml0X2V4dGVybnJlZl90YWJsZQAOA7wBugEEAAAGAAQCBAEADwQEAgMIAwUBAwABAQECBBUQAgICAAACBAIEEQIPBAACAAAADQkAAwACAgMGAgAABQECAAYDBAIWAgUNEQAJAwUCAAIFFwQABgUBAwIDAQEOAQIBAAICAwECAAgCAAMAGAIZABoGHAgeBSAJASEFAyIFBAISAAEAAAYNAgICAgIAAAACAgACAAAAAAADAwEDAwMABQAAAQAAAAIAAAACAAAAAAAAAAIAAQIABAQQBAMECQJwAWlpbwCAAQUDAQARBgkBfwFBgIDAAAsHUwUGbWVtb3J5AgALc29ydF9zcGxhdHMAiAEOcmF5Y2FzdF9zcGxhdHMAexNfX3diaW5kZ2VuX2V4cG9ydF8wAQEQX193YmluZGdlbl9zdGFydAAQCa8BAQBBAQtoiQGcAZsBxAGaAZYBxAHKAV96xQFwmQGWAXDKAVuOAZcBTYUBYMkBrQGzAYkBmAHKAShJsAGSAZwBiQFpPLQBsgGJAWk8ggFXgAGCAX2HAYYBgAGAAX+DAYEBjAG4AaABTme2AYkBaj23AWRMZZ8BngGiAXGhAbkBhAFiRFTEAaMBpAG6AXW7AX5zSrwBeL0BvgGJAW4+vwHAAZABkwGlAaYBJV1BJ2/CAQwBFArJmwS6AZskAgl/AX4jAEEQayIIJAACfwJAAkACQAJAAkACQCAAQfUBTwRAQQAgAEHM/3tLDQcaIABBC2oiAUF4cSEFQeDYwAAoAgAiCUUNBEEfIQdBACAFayEEIABB9P//B00EQCAFQQYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQcLIAdBAnRBxNXAAGooAgAiAUUEQEEAIQAMAgtBACEAIAVBGSAHQQF2a0EAIAdBH0cbdCEDA0ACQCABKAIEQXhxIgYgBUkNACAGIAVrIgYgBE8NACABIQIgBiIEDQBBACEEIAEhAAwECyABKAIUIgYgACAGIAEgA0EddkEEcWooAhAiAUcbIAAgBhshACADQQF0IQMgAQ0ACwwBC0Hc2MAAKAIAIgJBECAAQQtqQfgDcSAAQQtJGyIFQQN2IgB2IgFBA3EEQAJAIAFBf3NBAXEgAGoiBkEDdCIAQdTWwABqIgMgAEHc1sAAaigCACIBKAIIIgRHBEAgBCADNgIMIAMgBDYCCAwBC0Hc2MAAIAJBfiAGd3E2AgALIAEgAEEDcjYCBCAAIAFqIgAgACgCBEEBcjYCBCABQQhqDAcLIAVB5NjAACgCAE0NAwJAAkAgAUUEQEHg2MAAKAIAIgBFDQYgAGhBAnRBxNXAAGooAgAiAigCBEF4cSAFayEEIAIhAQNAAkAgAigCECIADQAgAigCFCIADQAgASgCGCEHAkACQCABIAEoAgwiAEYEQCABQRRBECABKAIUIgAbaigCACICDQFBACEADAILIAEoAggiAiAANgIMIAAgAjYCCAwBCyABQRRqIAFBEGogABshAwNAIAMhBiACIgBBFGogAEEQaiAAKAIUIgIbIQMgAEEUQRAgAhtqKAIAIgINAAsgBkEANgIACyAHRQ0EAkAgASgCHEECdEHE1cAAaiICKAIAIAFHBEAgASAHKAIQRwRAIAcgADYCFCAADQIMBwsgByAANgIQIAANAQwGCyACIAA2AgAgAEUNBAsgACAHNgIYIAEoAhAiAgRAIAAgAjYCECACIAA2AhgLIAEoAhQiAkUNBCAAIAI2AhQgAiAANgIYDAQLIAAoAgRBeHEgBWsiAiAEIAIgBEkiAhshBCAAIAEgAhshASAAIQIMAAsACwJAQQIgAHQiA0EAIANrciABIAB0cWgiBkEDdCIBQdTWwABqIgMgAUHc1sAAaigCACIAKAIIIgRHBEAgBCADNgIMIAMgBDYCCAwBC0Hc2MAAIAJBfiAGd3E2AgALIAAgBUEDcjYCBCAAIAVqIgYgASAFayIDQQFyNgIEIAAgAWogAzYCAEHk2MAAKAIAIgQEQCAEQXhxQdTWwABqIQFB7NjAACgCACECAn9B3NjAACgCACIFQQEgBEEDdnQiBHFFBEBB3NjAACAEIAVyNgIAIAEMAQsgASgCCAshBCABIAI2AgggBCACNgIMIAIgATYCDCACIAQ2AggLQezYwAAgBjYCAEHk2MAAIAM2AgAgAEEIagwIC0Hg2MAAQeDYwAAoAgBBfiABKAIcd3E2AgALAkACQCAEQRBPBEAgASAFQQNyNgIEIAEgBWoiAyAEQQFyNgIEIAMgBGogBDYCAEHk2MAAKAIAIgZFDQEgBkF4cUHU1sAAaiEAQezYwAAoAgAhAgJ/QdzYwAAoAgAiBUEBIAZBA3Z0IgZxRQRAQdzYwAAgBSAGcjYCACAADAELIAAoAggLIQYgACACNgIIIAYgAjYCDCACIAA2AgwgAiAGNgIIDAELIAEgBCAFaiIAQQNyNgIEIAAgAWoiACAAKAIEQQFyNgIEDAELQezYwAAgAzYCAEHk2MAAIAQ2AgALIAFBCGoMBgsgACACckUEQEEAIQJBAiAHdCIAQQAgAGtyIAlxIgBFDQMgAGhBAnRBxNXAAGooAgAhAAsgAEUNAQsDQCAAIAIgACgCBEF4cSIDIAVrIgYgBEkiBxshCSAAKAIQIgFFBEAgACgCFCEBCyACIAkgAyAFSSIAGyECIAQgBiAEIAcbIAAbIQQgASIADQALCyACRQ0AIAVB5NjAACgCACIATSAEIAAgBWtPcQ0AIAIoAhghBwJAAkAgAiACKAIMIgBGBEAgAkEUQRAgAigCFCIAG2ooAgAiAQ0BQQAhAAwCCyACKAIIIgEgADYCDCAAIAE2AggMAQsgAkEUaiACQRBqIAAbIQMDQCADIQYgASIAQRRqIABBEGogACgCFCIBGyEDIABBFEEQIAEbaigCACIBDQALIAZBADYCAAsgB0UNAgJAIAIoAhxBAnRBxNXAAGoiASgCACACRwRAIAIgBygCEEcEQCAHIAA2AhQgAA0CDAULIAcgADYCECAADQEMBAsgASAANgIAIABFDQILIAAgBzYCGCACKAIQIgEEQCAAIAE2AhAgASAANgIYCyACKAIUIgFFDQIgACABNgIUIAEgADYCGAwCCwJAAkACQAJAAkAgBUHk2MAAKAIAIgFLBEAgBUHo2MAAKAIAIgBPBEAgBUGvgARqQYCAfHEiAkEQdkAAIQAgCEEEaiIBQQA2AgggAUEAIAJBgIB8cSAAQX9GIgIbNgIEIAFBACAAQRB0IAIbNgIAQQAgCCgCBCIBRQ0JGiAIKAIMIQZB9NjAACAIKAIIIgRB9NjAACgCAGoiADYCAEH42MAAIABB+NjAACgCACICIAAgAksbNgIAAkACQEHw2MAAKAIAIgIEQEHE1sAAIQADQCABIAAoAgAiAyAAKAIEIgdqRg0CIAAoAggiAA0ACwwCC0GA2cAAKAIAIgBBACAAIAFNG0UEQEGA2cAAIAE2AgALQYTZwABB/x82AgBB0NbAACAGNgIAQcjWwAAgBDYCAEHE1sAAIAE2AgBB4NbAAEHU1sAANgIAQejWwABB3NbAADYCAEHc1sAAQdTWwAA2AgBB8NbAAEHk1sAANgIAQeTWwABB3NbAADYCAEH41sAAQezWwAA2AgBB7NbAAEHk1sAANgIAQYDXwABB9NbAADYCAEH01sAAQezWwAA2AgBBiNfAAEH81sAANgIAQfzWwABB9NbAADYCAEGQ18AAQYTXwAA2AgBBhNfAAEH81sAANgIAQZjXwABBjNfAADYC Line truncated
module_or_path = new URL("data:application/wasm;base64,AGFzbQEAAAAB8gEjYAJ/fwF/YAN/f38Bf2ACf38AYAN/f38AYAF/AX9gAX8AYAV/f39/fwBgA29/fwFvYAV/f39/fwF/YAR/f39/AGABbwFvYANvb38AYAFvAX9gAAF/YAAAYAd/f39/f39/AX9gAX0BfWAGf39/f39/AGAEf39/fwF/YAN/b28Bf2ABfwFvYAABb2AHf39/f39/fwBgAn9+AX9gA39+fgBgC319fX19fX19f29/AW9gBn9/f39/fwF/YAV/f31/fwBgBH99f38AYAV/f35/fwBgBH9+f38AYAV/f3x/fwBgBH98f38AYAN/fn4Bf2ACfX0BfQLyBBEDd2JnHV9fd2JnX2J1ZmZlcl82MDljYzNlZWU1MWVkMTU4AAoDd2JnGl9fd2JnX25ld185ZmVlOTdhNDA5YjMyYjY4AAoDd2JnGl9fd2JnX3NldF9mNGYxZjBkYWEzMDY5NmZjAAsDd2JnHV9fd2JnX2xlbmd0aF84Y2ZkMmM2NDA5YWY4OGFkAAwDd2JnMV9fd2JnX25ld3dpdGhieXRlb2Zmc2V0YW5kbGVuZ3RoX2YxZGVhZDQ0ZDFmYzcyMTIABwN3YmcaX193YmdfbmV3X2UzYjMyMWRjZmVmODlmYzcACgN3YmcaX193Ymdfc2V0X2QyMzY2MWQxOTE0OGIyMjkACwN3YmcdX193YmdfbGVuZ3RoXzZjYTUyNzY2NWQ4OTY5NGQADAN3YmcxX193YmdfbmV3d2l0aGJ5dGVvZmZzZXRhbmRsZW5ndGhfZTZiN2U2OWFjZDRjNzM1NAAHA3diZxpfX3diZ19zZXRfMTBiYWQ5YmVlMGU5YzU4YgALA3diZx1fX3diZ19sZW5ndGhfM2I0ZjAyMjE4OGFlOGRiNgAMA3diZx9fX3diZ19zdWJhcnJheV83NjllMWUwZjgxYmIyNTliAAcDd2JnH19fd2JnX3N1YmFycmF5XzNhYWVlYzg5YmIyNTQ0ZjAABwN3YmckX193YmdfbmV3d2l0aGxlbmd0aF81YTVlZmUzMTNjZmQ1OWYxABQDd2JnEF9fd2JpbmRnZW5fdGhyb3cAAgN3YmcRX193YmluZGdlbl9tZW1vcnkAFQN3YmcfX193YmluZGdlbl9pbml0X2V4dGVybnJlZl90YWJsZQAOA8ABvgEEAAAGAAQCBAEADwQE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 Line truncated
}
const imports = __wbg_get_imports();
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
@@ -8253,7 +8253,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 async function __wbg_load(module, imports) {\n if (typeof Response === "function" && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === "function") {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n if (module.headers.get("Content-Type") != "application/wasm") {\n console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n", e);\n } else {\n throw e;\n }\n }\n }\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n }\n function __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_set_10bad9bee0e9c58b = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_d23661d19148b229 = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_f4f1f0daa30696fc = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_subarray_3aaeec89bb2544f0 = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_subarray_769e1e0f81bb259b = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_0;\n const offset = table.grow(4);\n table.set(0, void 0);\n table.set(offset + 0, void 0);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n };\n imports.wbg.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return ret;\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n return imports;\n }\n function __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n }\n async function __wbg_init(module_or_path) {\n if (wasm !== void 0) return wasm;\n if (typeof module_or_path !== "undefined") {\n if (Object.Line truncated
const jsContent = '(function() {\n "use strict";\n let wasm;\n const cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {\n throw Error("TextDecoder not available");\n } };\n if (typeof TextDecoder !== "undefined") {\n cachedTextDecoder.decode();\n }\n let cachedUint8ArrayMemory0 = null;\n function getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n }\n function getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n }\n function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n async function __wbg_load(module, imports) {\n if (typeof Response === "function" && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === "function") {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n if (module.headers.get("Content-Type") != "application/wasm") {\n console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n", e);\n } else {\n throw e;\n }\n }\n }\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n }\n function __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_set_10bad9bee0e9c58b = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_d23661d19148b229 = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_f4f1f0daa30696fc = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_subarray_3aaeec89bb2544f0 = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_subarray_769e1e0f81bb259b = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_0;\n const offset = table.grow(4);\n table.set(0, void 0);\n table.set(offset + 0, void 0);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n };\n imports.wbg.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return ret;\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n return imports;\n }\n function __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n Line truncated
const blob = typeof self !== "undefined" && self.Blob && new Blob([jsContent], { type: "text/javascript;charset=utf-8" });
function WorkerWrapper(options) {
let objURL;
@@ -9301,7 +9301,8 @@ const _SparkViewpoint = class _SparkViewpoint {
this.sorting = null;
this.pending = null;
this.sortingCheck = false;
this.readback = new Uint16Array(0);
this.readback16 = new Uint16Array(0);
this.readback32 = new Uint32Array(0);
this.spark = options.spark;
this.camera = options.camera;
this.viewToWorld = options.viewToWorld ?? new THREE__namespace.Matrix4();
@@ -9340,6 +9341,7 @@ const _SparkViewpoint = class _SparkViewpoint {
this.sortCoorient = options.sortCoorient;
this.depthBias = options.depthBias;
this.sort360 = options.sort360;
this.sort32 = options.sort32;
this.orderingFreelist = new FreeList({
allocate: (maxSplats) => new Uint32Array(maxSplats),
valid: (ordering, maxSplats) => ordering.length === maxSplats
@@ -9628,6 +9630,7 @@ const _SparkViewpoint = class _SparkViewpoint {
const {
reader,
doubleSortReader,
sort32Reader,
dynoSortRadial,
dynoOrigin,
dynoDirection,
@@ -9635,8 +9638,16 @@ const _SparkViewpoint = class _SparkViewpoint {
dynoSort360,
dynoSplats
} = _SparkViewpoint.makeSorter();
const halfMaxSplats = Math.ceil(maxSplats / 2);
this.readback = reader.ensureBuffer(halfMaxSplats, this.readback);
const sort32 = this.sort32 ?? false;
let readback;
if (sort32) {
this.readback32 = reader.ensureBuffer(maxSplats, this.readback32);
readback = this.readback32;
} else {
const halfMaxSplats = Math.ceil(maxSplats / 2);
this.readback16 = reader.ensureBuffer(halfMaxSplats, this.readback16);
readback = this.readback16;
}
const worldToOrigin = accumulator.toWorld.clone().invert();
const viewToOrigin = viewToWorld.clone().premultiply(worldToOrigin);
dynoSortRadial.value = this.sort360 ? true : this.sortRadial;
@@ -9645,20 +9656,28 @@ const _SparkViewpoint = class _SparkViewpoint {
dynoDepthBias.value = this.depthBias ?? 1;
dynoSort360.value = this.sort360 ?? false;
dynoSplats.packedSplats = accumulator.splats;
const sortReader = sort32 ? sort32Reader : doubleSortReader;
const count = sort32 ? numSplats : Math.ceil(numSplats / 2);
await reader.renderReadback({
renderer: this.spark.renderer,
reader: doubleSortReader,
count: Math.ceil(numSplats / 2),
readback: this.readback
reader: sortReader,
count,
readback
});
const result = await withWorker(async (worker) => {
return worker.call("sortDoubleSplats", {
const rpcName = sort32 ? "sort32Splats" : "sortDoubleSplats";
return worker.call(rpcName, {
maxSplats,
numSplats,
readback: this.readback,
readback,
ordering
});
});
this.readback = result.readback;
if (sort32) {
this.readback32 = result.readback;
} else {
this.readback16 = result.readback;
}
ordering = result.ordering;
activeSplats = result.activeSplats;
}
@@ -9743,6 +9762,26 @@ const _SparkViewpoint = class _SparkViewpoint {
return { rgba8 };
}
);
const sort32Reader = dynoBlock(
{ index: "int" },
{ rgba8: "vec4" },
({ index }) => {
if (!index) {
throw new Error("No index");
}
const sortParams = {
sortRadial: dynoSortRadial,
sortOrigin: dynoOrigin,
sortDirection: dynoDirection,
sortDepthBias: dynoDepthBias,
sort360: dynoSort360
};
const gsplat = readPackedSplat(dynoSplats, index);
const metric = computeSortMetric({ gsplat, ...sortParams });
const rgba8 = uintToRgba8(floatBitsToUint(metric));
return { rgba8 };
}
);
_SparkViewpoint.dynos = {
dynoSortRadial,
dynoOrigin,
@@ -9751,7 +9790,8 @@ const _SparkViewpoint = class _SparkViewpoint {
dynoSort360,
dynoSplats,
reader,
doubleSortReader
doubleSortReader,
sort32Reader
};
}
return _SparkViewpoint.dynos;
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"spark.cjs.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, Line truncated
{"version":3,"file":"spark.cjs.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, Line truncated
+48 -48
View File
@@ -1,6 +1,6 @@
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const eA=require("three");var Ge=typeof document<"u"?document.currentScript:null;function pQ(t){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const g=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(A,e,g.get?g:{enumerable:!0,get:()=>t[e]})}}return A.default=t,Object.freeze(A)}const a=pQ(eA),fQ=new eA.OrthographicCamera(-1,1,1,-1,0,1);class dQ extends eA.BufferGeometry{constructor(){super(),this.setAttribute("position",new eA.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new eA.Float32BufferAttribute([0,2,0,0,2,0],2))}}const MQ=new dQ;class lg{constructor(A){this._mesh=new eA.Mesh(MQ,A)}dispose(){this._mesh.geometry.dispose()}render(A){A.render(this._mesh,fQ)}get material(){return this._mesh.material}set material(A){this._mesh.material=A}}var oA=Uint8Array,pt=Uint16Array,mQ=Int32Array,ug=new oA([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),wg=new oA([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),SQ=new oA([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dg=function(t,A){for(var e=new pt(31),g=0;g<31;++g)e[g]=A+=1<<t[g-1];for(var I=new mQ(e[30]),g=1;g<30;++g)for(var s=e[g];s<e[g+1];++s)I[s]=s-e[g]<<5|g;return{b:e,r:I}},yg=Dg(ug,2),pg=yg.b,NQ=yg.r;pg[28]=258,NQ[258]=28;var FQ=Dg(wg,0),GQ=FQ.b,Le=new pt(32768);for(var IA=0;IA<32768;++IA){var At=(IA&43690)>>1|(IA&21845)<<1;At=(At&52428)>>2|(At&13107)<<2,At=(At&61680)>>4|(At&3855)<<4,Le[IA]=((At&65280)>>8|(At&255)<<8)>>1}var Tt=function(t,A,e){for(var g=t.length,I=0,s=new pt(A);I<g;++I)t[I]&&++s[t[I]-1];var B=new pt(A);for(I=1;I<A;++I)B[I]=B[I-1]+s[I-1]<<1;var i;if(e){i=new pt(1<<A);var Q=15-A;for(I=0;I<g;++I)if(t[I])for(var C=I<<4|t[I],E=A-t[I],n=B[t[I]-1]++<<E,o=n|(1<<E)-1;n<=o;++n)i[Le[n]>>Q]=C}else for(i=new pt(g),I=0;I<g;++I)t[I]&&(i[I]=Le[B[t[I]-1]++]>>15-t[I]);return i},Pt=new oA(288);for(var IA=0;IA<144;++IA)Pt[IA]=8;for(var IA=144;IA<256;++IA)Pt[IA]=9;for(var IA=256;IA<280;++IA)Pt[IA]=7;for(var IA=280;IA<288;++IA)Pt[IA]=8;var fg=new oA(32);for(var IA=0;IA<32;++IA)fg[IA]=5;var kQ=Tt(Pt,9,1),xQ=Tt(fg,5,1),ke=function(t){for(var A=t[0],e=1;e<t.length;++e)t[e]>A&&(A=t[e]);return A},JA=function(t,A,e){var g=A/8|0;return(t[g]|t[g+1]<<8)>>(A&7)&e},xe=function(t,A){var e=A/8|0;return(t[e]|t[e+1]<<8|t[e+2]<<16)>>(A&7)},dg=function(t){return(t+7)/8|0},Mt=function(t,A,e){return(A==null||A<0)&&(A=0),(e==null||e>t.length)&&(e=t.length),new oA(t.subarray(A,e))},RQ=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],fA=function(t,A,e){var g=new Error(A||RQ[t]);if(g.code=t,Error.captureStackTrace&&Error.captureStackTrace(g,fA),!e)throw g;return g},Mg=function(t,A,e,g){var I=t.length,s=g?g.length:0;if(!I||A.f&&!A.l)return e||new oA(0);var B=!e,i=B||A.i!=2,Q=A.i;B&&(e=new oA(I*3));var C=function(pA){var mA=e.length;if(pA>mA){var cA=new oA(Math.max(mA*2,pA));cA.set(e),e=cA}},E=A.f||0,n=A.p||0,o=A.b||0,r=A.l,l=A.d,c=A.m,h=A.n,u=I*8;do{if(!r){E=JA(t,n,1);var D=JA(t,n+1,3);if(n+=3,D)if(D==1)r=kQ,l=xQ,c=9,h=5;else if(D==2){var S=JA(t,n,31)+257,M=JA(t,n+10,15)+4,d=S+JA(t,n+5,31)+1;n+=14;for(var p=new oA(d),R=new oA(19),N=0;N<M;++N)R[SQ[N]]=JA(t,n+N*3,7);n+=M*3;for(var m=ke(R),Y=(1<<m)-1,G=Tt(R,m,1),N=0;N<d;){var k=G[JA(t,n,Y)];n+=k&15;var w=k>>4;if(w<16)p[N++]=w;else{var U=0,J=0;for(w==16?(J=3+JA(t,n,3),n+=2,U=p[N-1]):w==17?(J=3+JA(t,n,7),n+=3):w==18&&(J=11+JA(t,n,127),n+=7);J--;)p[N++]=U}}var AA=p.subarray(0,S),z=p.subarray(S);c=ke(AA),h=ke(z),r=Tt(AA,c,1),l=Tt(z,h,1)}else fA(1);else{var w=dg(n)+4,y=t[w-4]|t[w-3]<<8,f=w+y;if(f>I){Q&&fA(0);break}i&&C(o+y),e.set(t.subarray(w,f),o),A.b=o+=y,A.p=n=f*8,A.f=E;continue}if(n>u){Q&&fA(0);break}}i&&C(o+131072);for(var gA=(1<<c)-1,tA=(1<<h)-1,_=n;;_=n){var U=r[xe(t,n)&gA],b=U>>4;if(n+=U&15,n>u){Q&&fA(0);break}if(U||fA(2),b<256)e[o++]=b;else if(b==256){_=n,r=null;break}else{var X=b-254;if(b>264){var N=b-257,Z=ug[N];X=JA(t,n,(1<<Z)-1)+pg[N],n+=Z}var O=l[xe(t,n)&tA],L=O>>4;O||fA(3),n+=O&15;var z=GQ[L];if(L>3){var Z=wg[L];z+=xe(t,n)&(1<<Z)-1,n+=Z}if(n>u){Q&&fA(0);break}i&&C(o+131072);var DA=o+X;if(o<z){var CA=s-z,yA=Math.min(z,DA);for(CA+o<0&&fA(3);o<yA;++o)e[o]=g[CA+o]}for(;o<DA;++o)e[o]=e[o-z]}}A.l=r,A.p=_,A.b=o,A.f=E,r&&(E=1,A.m=c,A.d=l,A.n=h)}while(!E);return o!=e.length&&B?Mt(e,0,o):e.subarray(0,o)},UQ=new oA(0),HA=function(t,A){return t[A]|t[A+1]<<8},vA=function(t,A){return(t[A]|t[A+1]<<8|t[A+2]<<16|t[A+3]<<24)>>>0},Re=function(t,A){return vA(t,A)+vA(t,A+4)*4294967296},YQ=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&fA(6,"invalid gzip data");var A=t[3],e=10;A&4&&(e+=(t[10]|t[11]<<8)+2);for(var g=(A>>3&1)+(A>>4&1);g>0;g-=!t[e++]);return e+(A&2)},Ue=function(){function t(A,e){typeof A=="function"&Line truncated
`).map(B=>{const i=B.trimEnd();return A?i:i.length>0?(A=!0,i):null}).filter(B=>B!=null);for(;e.length>0&&e[e.length-1].length===0;)e.pop();if(e.length===0)return[];const g=(s=e[0].match(/^\s*/))==null?void 0:s[0];if(!g)return e;const I=new RegExp(`^${g}`);return e.map(B=>B.replace(I,""))}function rA(t){return YA(t).join(`
`)}class F extends j{constructor({a:A,outKey:e,outTypeFunc:g}){const I={a:V(A)},s=g(V(A)),B={[e]:s};super({inTypes:I,outTypes:B,inputs:{a:A}}),this.outKey=e}dynoOut(){return new q(this,this.outKey)}}class $ extends j{constructor({a:A,b:e,outKey:g,outTypeFunc:I}){const s={a:V(A),b:V(e)},B=I(V(A),V(e)),i={[g]:B};super({inTypes:s,outTypes:i,inputs:{a:A,b:e}}),this.outKey=g}dynoOut(){return new q(this,this.outKey)}}class wt extends j{constructor({a:A,b:e,c:g,outKey:I,outTypeFunc:s}){const B={a:V(A),b:V(e),c:V(g)},i=s(V(A),V(e),V(g)),Q={[I]:i};super({inTypes:B,outTypes:Q,inputs:{a:A,b:e,c:g}}),this.outKey=I}dynoOut(){return new q(this,this.outKey)}}const W={type:"Gsplat"},te={type:"PackedSplats"},sn=t=>new vg({packedSplats:t}),zt=(t,A)=>new Tg({packedSplats:t,index:A}),Jg=(t,A,e,g)=>new Hg({packedSplats:t,index:A,base:e,count:g}),rt=t=>new Kg({gsplat:t}),Bt=({gsplat:t,flags:A,index:e,center:g,scales:I,quaternion:s,rgba:B,rgb:i,opacity:Q,x:C,y:E,z:n,r:o,g:r,b:l})=>new qg({gsplat:t,flags:A,index:e,center:g,scales:I,quaternion:s,rgba:B,rgb:i,opacity:Q,x:C,y:E,z:n,r:o,g:r,b:l}),ve=t=>new Vg({gsplat:t}),Ze=(t,{scale:A,rotate:e,translate:g,recolor:I})=>new jg({gsplat:t,scale:A,rotate:e,translate:g,recolor:I}),GA=rA(`
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const eA=require("three");var Ge=typeof document<"u"?document.currentScript:null;function pi(t){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const g=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(A,e,g.get?g:{enumerable:!0,get:()=>t[e]})}}return A.default=t,Object.freeze(A)}const a=pi(eA),fi=new eA.OrthographicCamera(-1,1,1,-1,0,1);class Ni extends eA.BufferGeometry{constructor(){super(),this.setAttribute("position",new eA.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new eA.Float32BufferAttribute([0,2,0,0,2,0],2))}}const Mi=new Ni;class ug{constructor(A){this._mesh=new eA.Mesh(Mi,A)}dispose(){this._mesh.geometry.dispose()}render(A){A.render(this._mesh,fi)}get material(){return this._mesh.material}set material(A){this._mesh.material=A}}var oA=Uint8Array,dt=Uint16Array,mi=Int32Array,wg=new oA([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),yg=new oA([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Si=new oA([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dg=function(t,A){for(var e=new dt(31),g=0;g<31;++g)e[g]=A+=1<<t[g-1];for(var I=new mi(e[30]),g=1;g<30;++g)for(var s=e[g];s<e[g+1];++s)I[s]=s-e[g]<<5|g;return{b:e,r:I}},dg=Dg(wg,2),pg=dg.b,Fi=dg.r;pg[28]=258,Fi[258]=28;var Gi=Dg(yg,0),xi=Gi.b,Je=new dt(32768);for(var IA=0;IA<32768;++IA){var At=(IA&43690)>>1|(IA&21845)<<1;At=(At&52428)>>2|(At&13107)<<2,At=(At&61680)>>4|(At&3855)<<4,Je[IA]=((At&65280)>>8|(At&255)<<8)>>1}var Tt=function(t,A,e){for(var g=t.length,I=0,s=new dt(A);I<g;++I)t[I]&&++s[t[I]-1];var Q=new dt(A);for(I=1;I<A;++I)Q[I]=Q[I-1]+s[I-1]<<1;var B;if(e){B=new dt(1<<A);var i=15-A;for(I=0;I<g;++I)if(t[I])for(var C=I<<4|t[I],E=A-t[I],n=Q[t[I]-1]++<<E,o=n|(1<<E)-1;n<=o;++n)B[Je[n]>>i]=C}else for(B=new dt(g),I=0;I<g;++I)t[I]&&(B[I]=Je[Q[t[I]-1]++]>>15-t[I]);return B},Ot=new oA(288);for(var IA=0;IA<144;++IA)Ot[IA]=8;for(var IA=144;IA<256;++IA)Ot[IA]=9;for(var IA=256;IA<280;++IA)Ot[IA]=7;for(var IA=280;IA<288;++IA)Ot[IA]=8;var fg=new oA(32);for(var IA=0;IA<32;++IA)fg[IA]=5;var ki=Tt(Ot,9,1),Ri=Tt(fg,5,1),xe=function(t){for(var A=t[0],e=1;e<t.length;++e)t[e]>A&&(A=t[e]);return A},JA=function(t,A,e){var g=A/8|0;return(t[g]|t[g+1]<<8)>>(A&7)&e},ke=function(t,A){var e=A/8|0;return(t[e]|t[e+1]<<8|t[e+2]<<16)>>(A&7)},Ng=function(t){return(t+7)/8|0},Nt=function(t,A,e){return(A==null||A<0)&&(A=0),(e==null||e>t.length)&&(e=t.length),new oA(t.subarray(A,e))},Ui=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],pA=function(t,A,e){var g=new Error(A||Ui[t]);if(g.code=t,Error.captureStackTrace&&Error.captureStackTrace(g,pA),!e)throw g;return g},Mg=function(t,A,e,g){var I=t.length,s=g?g.length:0;if(!I||A.f&&!A.l)return e||new oA(0);var Q=!e,B=Q||A.i!=2,i=A.i;Q&&(e=new oA(I*3));var C=function(dA){var MA=e.length;if(dA>MA){var cA=new oA(Math.max(MA*2,dA));cA.set(e),e=cA}},E=A.f||0,n=A.p||0,o=A.b||0,r=A.l,l=A.d,c=A.m,h=A.n,u=I*8;do{if(!r){E=JA(t,n,1);var y=JA(t,n+1,3);if(n+=3,y)if(y==1)r=ki,l=Ri,c=9,h=5;else if(y==2){var m=JA(t,n,31)+257,N=JA(t,n+10,15)+4,f=m+JA(t,n+5,31)+1;n+=14;for(var D=new oA(f),R=new oA(19),S=0;S<N;++S)R[Si[S]]=JA(t,n+S*3,7);n+=N*3;for(var M=xe(R),L=(1<<M)-1,G=Tt(R,M,1),S=0;S<f;){var x=G[JA(t,n,L)];n+=x&15;var w=x>>4;if(w<16)D[S++]=w;else{var U=0,J=0;for(w==16?(J=3+JA(t,n,3),n+=2,U=D[S-1]):w==17?(J=3+JA(t,n,7),n+=3):w==18&&(J=11+JA(t,n,127),n+=7);J--;)D[S++]=U}}var AA=D.subarray(0,m),z=D.subarray(m);c=xe(AA),h=xe(z),r=Tt(AA,c,1),l=Tt(z,h,1)}else pA(1);else{var w=Ng(n)+4,d=t[w-4]|t[w-3]<<8,p=w+d;if(p>I){i&&pA(0);break}B&&C(o+d),e.set(t.subarray(w,p),o),A.b=o+=d,A.p=n=p*8,A.f=E;continue}if(n>u){i&&pA(0);break}}B&&C(o+131072);for(var gA=(1<<c)-1,tA=(1<<h)-1,X=n;;X=n){var U=r[ke(t,n)&gA],v=U>>4;if(n+=U&15,n>u){i&&pA(0);break}if(U||pA(2),v<256)e[o++]=v;else if(v==256){X=n,r=null;break}else{var _=v-254;if(v>264){var S=v-257,j=wg[S];_=JA(t,n,(1<<j)-1)+pg[S],n+=j}var W=l[ke(t,n)&tA],Y=W>>4;W||pA(3),n+=W&15;var z=xi[Y];if(Y>3){var j=yg[Y];z+=ke(t,n)&(1<<j)-1,n+=j}if(n>u){i&&pA(0);break}B&&C(o+131072);var yA=o+_;if(o<z){var CA=s-z,DA=Math.min(z,yA);for(CA+o<0&&pA(3);o<DA;++o)e[o]=g[CA+o]}for(;o<yA;++o)e[o]=e[o-z]}}A.l=r,A.p=X,A.b=o,A.f=E,r&&(E=1,A.m=c,A.d=l,A.n=h)}while(!E);return o!=e.length&&Q?Nt(e,0,o):e.subarray(0,o)},Li=new oA(0),TA=function(t,A){return t[A]|t[A+1]<<8},bA=function(t,A){return(t[A]|t[A+1]<<8|t[A+2]<<16|t[A+3]<<24)>>>0},Re=function(t,A){return bA(t,A)+bA(t,A+4)*4294967296},Yi=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&pA(6,"invalid gzip data");var A=t[3],e=10;A&4&&(e+=(t[10]|t[11]<<8)+2);for(var g=(A>>3&1)+(A>>4&1);g>0;g-=!t[e++]);return e+(A&2)},Ue=function(){function t(A,e){typeof A=="function"&Line truncated
`).map(Q=>{const B=Q.trimEnd();return A?B:B.length>0?(A=!0,B):null}).filter(Q=>Q!=null);for(;e.length>0&&e[e.length-1].length===0;)e.pop();if(e.length===0)return[];const g=(s=e[0].match(/^\s*/))==null?void 0:s[0];if(!g)return e;const I=new RegExp(`^${g}`);return e.map(Q=>Q.replace(I,""))}function rA(t){return LA(t).join(`
`)}class F extends Z{constructor({a:A,outKey:e,outTypeFunc:g}){const I={a:V(A)},s=g(V(A)),Q={[e]:s};super({inTypes:I,outTypes:Q,inputs:{a:A}}),this.outKey=e}dynoOut(){return new q(this,this.outKey)}}class $ extends Z{constructor({a:A,b:e,outKey:g,outTypeFunc:I}){const s={a:V(A),b:V(e)},Q=I(V(A),V(e)),B={[g]:Q};super({inTypes:s,outTypes:B,inputs:{a:A,b:e}}),this.outKey=g}dynoOut(){return new q(this,this.outKey)}}class wt extends Z{constructor({a:A,b:e,c:g,outKey:I,outTypeFunc:s}){const Q={a:V(A),b:V(e),c:V(g)},B=s(V(A),V(e),V(g)),i={[I]:B};super({inTypes:Q,outTypes:i,inputs:{a:A,b:e,c:g}}),this.outKey=I}dynoOut(){return new q(this,this.outKey)}}const P={type:"Gsplat"},te={type:"PackedSplats"},Qn=t=>new vg({packedSplats:t}),St=(t,A)=>new Tg({packedSplats:t,index:A}),bg=(t,A,e,g)=>new Kg({packedSplats:t,index:A,base:e,count:g}),rt=t=>new qg({gsplat:t}),Qt=({gsplat:t,flags:A,index:e,center:g,scales:I,quaternion:s,rgba:Q,rgb:B,opacity:i,x:C,y:E,z:n,r:o,g:r,b:l})=>new zg({gsplat:t,flags:A,index:e,center:g,scales:I,quaternion:s,rgba:Q,rgb:B,opacity:i,x:C,y:E,z:n,r:o,g:r,b:l}),ve=t=>new Zg({gsplat:t}),_e=(t,{scale:A,rotate:e,translate:g,recolor:I})=>new jg({gsplat:t,scale:A,rotate:e,translate:g,recolor:I}),xA=rA(`
struct Gsplat {
vec3 center;
uint flags;
@@ -14,12 +14,12 @@
bool isGsplatActive(uint flags) {
return (flags & GSPLAT_FLAG_ACTIVE) != 0u;
}
`),ye=rA(`
`),De=rA(`
struct PackedSplats {
usampler2DArray texture;
int numSplats;
};
`);class vg extends F{constructor({packedSplats:A}){super({a:A,outKey:"numSplats",outTypeFunc:()=>"int"}),this.statements=({inputs:e,outputs:g})=>[`${g.numSplats} = ${e.a}.numSplats;`]}}const bg=rA(`
`);class vg extends F{constructor({packedSplats:A}){super({a:A,outKey:"numSplats",outTypeFunc:()=>"int"}),this.statements=({inputs:e,outputs:g})=>[`${g.numSplats} = ${e.a}.numSplats;`]}}const Hg=rA(`
bool readPackedSplat(usampler2DArray texture, int numSplats, int index, out Gsplat gsplat) {
if ((index >= 0) && (index < numSplats)) {
uvec4 packed = texelFetch(texture, splatTexCoord(index), 0);
@@ -29,22 +29,22 @@
return false;
}
}
`);class Tg extends j{constructor({packedSplats:A,index:e}){super({inTypes:{packedSplats:te,index:"int"},outTypes:{gsplat:W},inputs:{packedSplats:A,index:e},globals:()=>[GA,ye,bg],statements:({inputs:g,outputs:I})=>{const{gsplat:s}=I;if(!s)return[];const{packedSplats:B,index:i}=g;let Q;return B&&i?Q=YA(`
if (readPackedSplat(${B}.texture, ${B}.numSplats, ${i}, ${s})) {
`);class Tg extends Z{constructor({packedSplats:A,index:e}){super({inTypes:{packedSplats:te,index:"int"},outTypes:{gsplat:P},inputs:{packedSplats:A,index:e},globals:()=>[xA,De,Hg],statements:({inputs:g,outputs:I})=>{const{gsplat:s}=I;if(!s)return[];const{packedSplats:Q,index:B}=g;let i;return Q&&B?i=LA(`
if (readPackedSplat(${Q}.texture, ${Q}.numSplats, ${B}, ${s})) {
bool zeroSize = all(equal(${s}.scales, vec3(0.0, 0.0, 0.0)));
${s}.flags = zeroSize ? 0u : GSPLAT_FLAG_ACTIVE;
} else {
${s}.flags = 0u;
}
`):Q=[`${s}.flags = 0u;`],Q.push(`${s}.index = ${i??"0"};`),Q}})}dynoOut(){return new q(this,"gsplat")}}class Hg extends j{constructor({packedSplats:A,index:e,base:g,count:I}){super({inTypes:{packedSplats:te,index:"int",base:"int",count:"int"},outTypes:{gsplat:W},inputs:{packedSplats:A,index:e,base:g,count:I},globals:()=>[GA,ye,bg],statements:({inputs:s,outputs:B})=>{const{gsplat:i}=B;if(!i)return[];const{packedSplats:Q,index:C,base:E,count:n}=s;let o;return Q&&C&&E&&n?o=YA(`
${i}.flags = 0u;
`):i=[`${s}.flags = 0u;`],i.push(`${s}.index = ${B??"0"};`),i}})}dynoOut(){return new q(this,"gsplat")}}class Kg extends Z{constructor({packedSplats:A,index:e,base:g,count:I}){super({inTypes:{packedSplats:te,index:"int",base:"int",count:"int"},outTypes:{gsplat:P},inputs:{packedSplats:A,index:e,base:g,count:I},globals:()=>[xA,De,Hg],statements:({inputs:s,outputs:Q})=>{const{gsplat:B}=Q;if(!B)return[];const{packedSplats:i,index:C,base:E,count:n}=s;let o;return i&&C&&E&&n?o=LA(`
${B}.flags = 0u;
if ((${C} >= ${E}) && (${C} < (${E} + ${n}))) {
if (readPackedSplat(${Q}.texture, ${Q}.numSplats, ${C}, ${i})) {
bool zeroSize = all(equal(${i}.scales, vec3(0.0, 0.0, 0.0)));
${i}.flags = zeroSize ? 0u : GSPLAT_FLAG_ACTIVE;
if (readPackedSplat(${i}.texture, ${i}.numSplats, ${C}, ${B})) {
bool zeroSize = all(equal(${B}.scales, vec3(0.0, 0.0, 0.0)));
${B}.flags = zeroSize ? 0u : GSPLAT_FLAG_ACTIVE;
}
}
`):o=[`${i}.flags = 0u;`],o.push(`${i}.index = ${C??"0"};`),o}})}dynoOut(){return new q(this,"gsplat")}}class Kg extends j{constructor({gsplat:A}){super({inTypes:{gsplat:W},outTypes:{flags:"uint",active:"bool",index:"int",center:"vec3",scales:"vec3",quaternion:"vec4",rgba:"vec4",rgb:"vec3",opacity:"float",x:"float",y:"float",z:"float",r:"float",g:"float",b:"float"},inputs:{gsplat:A},globals:()=>[GA],statements:({inputs:e,outputs:g})=>{const{gsplat:I}=e,{flags:s,active:B,index:i,center:Q,scales:C,quaternion:E,rgba:n,rgb:o,opacity:r,x:l,y:c,z:h,r:u,g:D,b:w}=g;return[s?`${s} = ${I?`${I}.flags`:"0u"};`:null,B?`${B} = isGsplatActive(${I?`${I}.flags`:"0u"});`:null,i?`${i} = ${I?`${I}.index`:"0"};`:null,Q?`${Q} = ${I?`${I}.center`:"vec3(0.0, 0.0, 0.0)"};`:null,C?`${C} = ${I?`${I}.scales`:"vec3(0.0, 0.0, 0.0)"};`:null,E?`${E} = ${I?`${I}.quaternion`:"vec4(0.0, 0.0, 0.0, 1.0)"};`:null,n?`${n} = ${I?`${I}.rgba`:"vec4(0.0, 0.0, 0.0, 0.0)"};`:null,o?`${o} = ${I?`${I}.rgba.rgb`:"vec3(0.0, 0.0, 0.0)"};`:null,r?`${r} = ${I?`${I}.rgba.a`:"0.0"};`:null,l?`${l} = ${I?`${I}.center.x`:"0.0"};`:null,c?`${c} = ${I?`${I}.center.y`:"0.0"};`:null,h?`${h} = ${I?`${I}.center.z`:"0.0"};`:null,u?`${u} = ${I?`${I}.rgba.r`:"0.0"};`:null,D?`${D} = ${I?`${I}.rgba.g`:"0.0"};`:null,w?`${w} = ${I?`${I}.rgba.b`:"0.0"};`:null].filter(Boolean)}})}}class qg extends j{constructor({gsplat:A,flags:e,index:g,center:I,scales:s,quaternion:B,rgba:i,rgb:Q,opacity:C,x:E,y:n,z:o,r,g:l,b:c}){super({inTypes:{gsplat:W,flags:"uint",index:"int",center:"vec3",scales:"vec3",quaternion:"vec4",rgba:"vec4",rgb:"vec3",opacity:"float",x:"float",y:"float",z:"float",r:"float",g:"float",b:"float"},outTypes:{gsplat:W},inputs:{gsplat:A,flags:e,index:g,center:I,scales:s,quaternion:B,rgba:i,rgb:Q,opacity:C,x:E,y:n,z:o,r,g:l,b:c},globals:()=>[GA],statements:({inputs:h,outputs:u})=>{const{gsplat:D}=u;if(!D)return[];const{gsplat:w,flags:y,index:f,center:S,scales:M,quaternion:d,rgba:p,rgb:R,opacity:N,x:m,y:Y,z:G,r:k,g:U,b:J}=h;return[`${D}.flags = ${y??(w?`${w}.flags`:"0u")};`,`${D}.index = ${f??(w?`${w}.index`:"0")};`,`${D}.center = ${S??(w?`${w}.center`:"vec3(0.0, 0.0, 0.0)")};`,`${D}.scales = ${M??(w?`${w}.scales`:"vec3(0.0, 0.0, 0.0)")};`,`${D}.quaternion = ${d??(w?`${w}.quaternion`:"vec4(0.0, 0.0, 0.0, 1.0)")};`,`${D}.rgba = ${p??(w?`${w}.rgba`:"vec4(0.0, 0.0, 0.0, 0.0)")};`,R?`${D}.rgba.rgb = ${R};`:null,N?`${D}.rgba.a = ${N};`:null,m?`${D}.center.x = ${m};`:null,Y?`${D}.center.y = ${Y};`:null,G?`${D}.center.z = ${G};`:null,k?`${D}.rgba.r = ${k};`:null,U?`${D}.rgba.g = ${U};`:null,J?`${D}.rgba.b = ${J};`:null].filter(Boolean)}})}dynoOut(){return new q(this,"gsplat")}}const zg=rA(`
`):o=[`${B}.flags = 0u;`],o.push(`${B}.index = ${C??"0"};`),o}})}dynoOut(){return new q(this,"gsplat")}}class qg extends Z{constructor({gsplat:A}){super({inTypes:{gsplat:P},outTypes:{flags:"uint",active:"bool",index:"int",center:"vec3",scales:"vec3",quaternion:"vec4",rgba:"vec4",rgb:"vec3",opacity:"float",x:"float",y:"float",z:"float",r:"float",g:"float",b:"float"},inputs:{gsplat:A},globals:()=>[xA],statements:({inputs:e,outputs:g})=>{const{gsplat:I}=e,{flags:s,active:Q,index:B,center:i,scales:C,quaternion:E,rgba:n,rgb:o,opacity:r,x:l,y:c,z:h,r:u,g:y,b:w}=g;return[s?`${s} = ${I?`${I}.flags`:"0u"};`:null,Q?`${Q} = isGsplatActive(${I?`${I}.flags`:"0u"});`:null,B?`${B} = ${I?`${I}.index`:"0"};`:null,i?`${i} = ${I?`${I}.center`:"vec3(0.0, 0.0, 0.0)"};`:null,C?`${C} = ${I?`${I}.scales`:"vec3(0.0, 0.0, 0.0)"};`:null,E?`${E} = ${I?`${I}.quaternion`:"vec4(0.0, 0.0, 0.0, 1.0)"};`:null,n?`${n} = ${I?`${I}.rgba`:"vec4(0.0, 0.0, 0.0, 0.0)"};`:null,o?`${o} = ${I?`${I}.rgba.rgb`:"vec3(0.0, 0.0, 0.0)"};`:null,r?`${r} = ${I?`${I}.rgba.a`:"0.0"};`:null,l?`${l} = ${I?`${I}.center.x`:"0.0"};`:null,c?`${c} = ${I?`${I}.center.y`:"0.0"};`:null,h?`${h} = ${I?`${I}.center.z`:"0.0"};`:null,u?`${u} = ${I?`${I}.rgba.r`:"0.0"};`:null,y?`${y} = ${I?`${I}.rgba.g`:"0.0"};`:null,w?`${w} = ${I?`${I}.rgba.b`:"0.0"};`:null].filter(Boolean)}})}}class zg extends Z{constructor({gsplat:A,flags:e,index:g,center:I,scales:s,quaternion:Q,rgba:B,rgb:i,opacity:C,x:E,y:n,z:o,r,g:l,b:c}){super({inTypes:{gsplat:P,flags:"uint",index:"int",center:"vec3",scales:"vec3",quaternion:"vec4",rgba:"vec4",rgb:"vec3",opacity:"float",x:"float",y:"float",z:"float",r:"float",g:"float",b:"float"},outTypes:{gsplat:P},inputs:{gsplat:A,flags:e,index:g,center:I,scales:s,quaternion:Q,rgba:B,rgb:i,opacity:C,x:E,y:n,z:o,r,g:l,b:c},globals:()=>[xA],statements:({inputs:h,outputs:u})=>{const{gsplat:y}=u;if(!y)return[];const{gsplat:w,flags:d,index:p,center:m,scales:N,quaternion:f,rgba:D,rgb:R,opacity:S,x:M,y:L,z:G,r:x,g:U,b:J}=h;return[`${y}.flags = ${d??(w?`${w}.flags`:"0u")};`,`${y}.index = ${p??(w?`${w}.index`:"0")};`,`${y}.center = ${m??(w?`${w}.center`:"vec3(0.0, 0.0, 0.0)")};`,`${y}.scales = ${N??(w?`${w}.scales`:"vec3(0.0, 0.0, 0.0)")};`,`${y}.quaternion = ${f??(w?`${w}.quaternion`:"vec4(0.0, 0.0, 0.0, 1.0)")};`,`${y}.rgba = ${D??(w?`${w}.rgba`:"vec4(0.0, 0.0, 0.0, 0.0)")};`,R?`${y}.rgba.rgb = ${R};`:null,S?`${y}.rgba.a = ${S};`:null,M?`${y}.center.x = ${M};`:null,L?`${y}.center.y = ${L};`:null,G?`${y}.center.z = ${G};`:null,x?`${y}.rgba.r = ${x};`:null,U?`${y}.rgba.g = ${U};`:null,J?`${y}.rgba.b = ${J};`:null].filter(Boolean)}})}dynoOut(){return new q(this,"gsplat")}}const Vg=rA(`
vec3 gsplatNormal(vec3 scales, vec4 quaternion) {
float minScale = min(scales.x, min(scales.y, scales.z));
vec3 normal;
@@ -57,13 +57,13 @@
}
return quatVec(quaternion, normal);
}
`);class Vg extends F{constructor({gsplat:A}){super({a:A,outKey:"normal",outTypeFunc:()=>"vec3"}),this.globals=()=>[GA,zg],this.statements=({inputs:e,outputs:g})=>[`${g.normal} = gsplatNormal(${e.a}.scales, ${e.a}.quaternion);`]}}class jg extends j{constructor({gsplat:A,scale:e,rotate:g,translate:I,recolor:s}){super({inTypes:{gsplat:W,scale:"float",rotate:"vec4",translate:"vec3",recolor:"vec4"},outTypes:{gsplat:W},inputs:{gsplat:A,scale:e,rotate:g,translate:I,recolor:s},globals:()=>[GA],statements:({inputs:B,outputs:i,compile:Q})=>{const{gsplat:C}=i;if(!C||!B.gsplat)return[];const{scale:E,rotate:n,translate:o,recolor:r}=B,l=Q.indent;return[`${C} = ${B.gsplat};`,`if (isGsplatActive(${C}.flags)) {`,E?`${l}${C}.center *= ${E};`:null,n?`${l}${C}.center = quatVec(${n}, ${C}.center);`:null,o?`${l}${C}.center += ${o};`:null,E?`${l}${C}.scales *= ${E};`:null,n?`${l}${C}.quaternion = quatQuat(${n}, ${C}.quaternion);`:null,r?`${l}${C}.rgba *= ${r};`:null,"}"].filter(Boolean)}})}dynoOut(){return new q(this,"gsplat")}}const Zg=t=>new _g({gsplat:t}),Bn=t=>new _e({rgba8:t});class _g extends j{constructor({gsplat:A}){super({inTypes:{gsplat:W},inputs:{gsplat:A},globals:()=>[GA],statements:({inputs:e,outputs:g})=>{const{output:I}=g;if(!I)return[];const{gsplat:s}=e;return s?YA(`
`);class Zg extends F{constructor({gsplat:A}){super({a:A,outKey:"normal",outTypeFunc:()=>"vec3"}),this.globals=()=>[xA,Vg],this.statements=({inputs:e,outputs:g})=>[`${g.normal} = gsplatNormal(${e.a}.scales, ${e.a}.quaternion);`]}}class jg extends Z{constructor({gsplat:A,scale:e,rotate:g,translate:I,recolor:s}){super({inTypes:{gsplat:P,scale:"float",rotate:"vec4",translate:"vec3",recolor:"vec4"},outTypes:{gsplat:P},inputs:{gsplat:A,scale:e,rotate:g,translate:I,recolor:s},globals:()=>[xA],statements:({inputs:Q,outputs:B,compile:i})=>{const{gsplat:C}=B;if(!C||!Q.gsplat)return[];const{scale:E,rotate:n,translate:o,recolor:r}=Q,l=i.indent;return[`${C} = ${Q.gsplat};`,`if (isGsplatActive(${C}.flags)) {`,E?`${l}${C}.center *= ${E};`:null,n?`${l}${C}.center = quatVec(${n}, ${C}.center);`:null,o?`${l}${C}.center += ${o};`:null,E?`${l}${C}.scales *= ${E};`:null,n?`${l}${C}.quaternion = quatQuat(${n}, ${C}.quaternion);`:null,r?`${l}${C}.rgba *= ${r};`:null,"}"].filter(Boolean)}})}dynoOut(){return new q(this,"gsplat")}}const Xg=t=>new _g({gsplat:t}),Bn=t=>new We({rgba8:t});class _g extends Z{constructor({gsplat:A}){super({inTypes:{gsplat:P},inputs:{gsplat:A},globals:()=>[xA],statements:({inputs:e,outputs:g})=>{const{output:I}=g;if(!I)return[];const{gsplat:s}=e;return s?LA(`
if (isGsplatActive(${s}.flags)) {
${I} = packSplat(${s}.center, ${s}.scales, ${s}.quaternion, ${s}.rgba);
} else {
${I} = uvec4(0u, 0u, 0u, 0u);
}
`):[`${I} = uvec4(0u, 0u, 0u, 0u);`]}})}dynoOut(){return new q(this,"output")}}class _e extends j{constructor({rgba8:A}){super({inTypes:{rgba8:"vec4"},inputs:{rgba8:A},statements:({inputs:e,outputs:g})=>[`target = ${e.rgba8??"vec4(0.0, 0.0, 0.0, 0.0)"};`]})}dynoOut(){return new q(this,"rgba8")}}const Qn=(t,A,e)=>new x({key:t,type:A,value:e}),nn=(t=!1,A)=>new oe({key:A,value:t}),Cn=(t=0,A)=>new Xg({key:A,value:t}),En=(t=0,A)=>new Vt({key:A,value:t}),TA=(t=0,A)=>new ct({key:A,value:t}),an=(t,A)=>new Og({key:A,value:t}),on=(t,A)=>new Pg({key:A,value:t}),rn=(t,A)=>new Wg({key:A,value:t}),cn=(t,A)=>new $g({key:A,value:t}),hn=(t,A)=>new AI({key:A,value:t}),ln=(t,A)=>new tI({key:A,value:t}),un=(t,A)=>new eI({key:A,value:t}),tt=(t,A)=>new Ft({key:A,value:t}),wn=(t,A)=>new gI({key:A,value:t}),Dn=(t,A)=>new II({key:A,value:t}),yn=(t,A)=>new sI({key:A,value:t}),pn=(t,A)=>new ee({key:A,value:t}),fn=(t,A)=>new BI({key:A,value:t}),dn=(t,A)=>new iI({key:A,value:t}),Mn=(t,A)=>new QI({key:A,value:t}),mn=(t,A)=>new nI({key:A,value:t}),Sn=(t,A)=>new CI({key:A,value:t}),Nn=(t,A)=>new EI({key:A,value:t}),Fn=(t,A)=>new aI({key:A,value:t}),Gn=(t,A)=>new oI({key:A,value:t}),kn=(t,A)=>new rI({key:A,value:t}),xn=(t,A)=>new cI({key:A,value:t}),Rn=(t,A)=>new hI({key:A,value:t}),Un=(t,A)=>new lI({key:A,value:t}),Yn=(t,A)=>new uI({key:A,value:t}),Ln=(t,A)=>new wI({key:A,value:t}),Jn=(t,A)=>new DI({key:A,value:t}),vn=(t,A)=>new Ht({key:A,value:t}),bn=(t,A)=>new yI({key:t,value:A}),Tn=(t,A)=>new pI({key:A,value:t}),Hn=(t,A)=>new fI({key:A,value:t}),Kn=(t,A)=>new dI({key:A,value:t}),qn=(t,A)=>new MI({key:A,value:t}),zn=(t,A)=>new mI({key:A,value:t}),Vn=(t,A)=>new SI({key:A,value:t}),jn=(t,A)=>new NI({key:A,value:t}),Zn=(t,A)=>new FI({key:A,value:t}),_n=(t,A)=>new GI({key:A,value:t}),Xn=(t,A)=>new kI({key:A,value:t});class x extends j{constructor({key:A,type:e,count:g,value:I,update:s,globals:B}){A=A??"value",super({outTypes:{[A]:e},update:()=>{if(s){const i=s(this.value);i!==void 0&&(this.value=i)}this.uniform.value=this.value},generate:({inputs:i,outputs:Q})=>{const C=(B==null?void 0:B({inputs:i,outputs:Q}))??[],E={},n=Q[A];return n&&(C.push(`uniform ${je(n,e,g)};`),E[n]=this.uniform),{globals:C,uniforms:E}}}),this.type=e,this.count=g,this.value=I,this.uniform={value:I},this.outKey=A}dynoOut(){return new q(this,this.outKey)}}class oe extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"bool",value:e,update:g})}}class Xg extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"uint",value:e,update:g})}}class Vt extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"int",value:e,update:g})}}class ct extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"float",value:e,update:g})}}class Og extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"bvec2",value:e,update:g})}}class Pg extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"uvec2",value:e,update:g})}}class Wg extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"ivec2",value:e,update:g})}}class $g extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"vec2",value:e,update:g})}}class AI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"bvec3",value:e,update:g})}}class tI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"uvec3",value:e,update:g})}}class eI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"ivec3",value:e,update:g})}}class Ft extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"vec3",value:e,update:g})}}class gI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"bvec4",value:e,update:g})}}class II extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"uvec4",value:e,update:g})}}class sI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"ivec4",value:e,update:g})}}class ee extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"vec4",value:e,update:g})}}class BI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"mat2",value:e,update:g})}}class iI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"mat2x2",value:e,update:g})}}class QI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"mat2x3",value:e,update:g})}}class nI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"mat2x4",value:e,update:g})}}class CI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"mat3",value:e,update:g})}}class EI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"mat3x2",value:e,update:g})}}class aI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"mat3x3",value:e,update:g})}}class oI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"mat3x4",value:e,update:g})}}class rI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"mat4",value:e,update:g})}}class cI extends x{constructor({key:A,value:e,update:g}){super({key:A,type:"mat4x2" Line truncated
`):[`${I} = uvec4(0u, 0u, 0u, 0u);`]}})}dynoOut(){return new q(this,"output")}}class We extends Z{constructor({rgba8:A}){super({inTypes:{rgba8:"vec4"},inputs:{rgba8:A},statements:({inputs:e,outputs:g})=>[`target = ${e.rgba8??"vec4(0.0, 0.0, 0.0, 0.0)"};`]})}dynoOut(){return new q(this,"rgba8")}}const nn=(t,A,e)=>new k({key:t,type:A,value:e}),Cn=(t=!1,A)=>new oe({key:A,value:t}),En=(t=0,A)=>new Wg({key:A,value:t}),an=(t=0,A)=>new Vt({key:A,value:t}),HA=(t=0,A)=>new ct({key:A,value:t}),on=(t,A)=>new Og({key:A,value:t}),rn=(t,A)=>new Pg({key:A,value:t}),cn=(t,A)=>new $g({key:A,value:t}),hn=(t,A)=>new AI({key:A,value:t}),ln=(t,A)=>new tI({key:A,value:t}),un=(t,A)=>new eI({key:A,value:t}),wn=(t,A)=>new gI({key:A,value:t}),tt=(t,A)=>new Gt({key:A,value:t}),yn=(t,A)=>new II({key:A,value:t}),Dn=(t,A)=>new sI({key:A,value:t}),dn=(t,A)=>new QI({key:A,value:t}),pn=(t,A)=>new ee({key:A,value:t}),fn=(t,A)=>new BI({key:A,value:t}),Nn=(t,A)=>new iI({key:A,value:t}),Mn=(t,A)=>new nI({key:A,value:t}),mn=(t,A)=>new CI({key:A,value:t}),Sn=(t,A)=>new EI({key:A,value:t}),Fn=(t,A)=>new aI({key:A,value:t}),Gn=(t,A)=>new oI({key:A,value:t}),xn=(t,A)=>new rI({key:A,value:t}),kn=(t,A)=>new cI({key:A,value:t}),Rn=(t,A)=>new hI({key:A,value:t}),Un=(t,A)=>new lI({key:A,value:t}),Ln=(t,A)=>new uI({key:A,value:t}),Yn=(t,A)=>new wI({key:A,value:t}),Jn=(t,A)=>new yI({key:A,value:t}),bn=(t,A)=>new DI({key:A,value:t}),vn=(t,A)=>new Kt({key:A,value:t}),Hn=(t,A)=>new dI({key:t,value:A}),Tn=(t,A)=>new pI({key:A,value:t}),Kn=(t,A)=>new fI({key:A,value:t}),qn=(t,A)=>new NI({key:A,value:t}),zn=(t,A)=>new MI({key:A,value:t}),Vn=(t,A)=>new mI({key:A,value:t}),Zn=(t,A)=>new SI({key:A,value:t}),jn=(t,A)=>new FI({key:A,value:t}),Xn=(t,A)=>new GI({key:A,value:t}),_n=(t,A)=>new xI({key:A,value:t}),Wn=(t,A)=>new kI({key:A,value:t});class k extends Z{constructor({key:A,type:e,count:g,value:I,update:s,globals:Q}){A=A??"value",super({outTypes:{[A]:e},update:()=>{if(s){const B=s(this.value);B!==void 0&&(this.value=B)}this.uniform.value=this.value},generate:({inputs:B,outputs:i})=>{const C=(Q==null?void 0:Q({inputs:B,outputs:i}))??[],E={},n=i[A];return n&&(C.push(`uniform ${Xe(n,e,g)};`),E[n]=this.uniform),{globals:C,uniforms:E}}}),this.type=e,this.count=g,this.value=I,this.uniform={value:I},this.outKey=A}dynoOut(){return new q(this,this.outKey)}}class oe extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"bool",value:e,update:g})}}class Wg extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"uint",value:e,update:g})}}class Vt extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"int",value:e,update:g})}}class ct extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"float",value:e,update:g})}}class Og extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"bvec2",value:e,update:g})}}class Pg extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"uvec2",value:e,update:g})}}class $g extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"ivec2",value:e,update:g})}}class AI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"vec2",value:e,update:g})}}class tI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"bvec3",value:e,update:g})}}class eI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"uvec3",value:e,update:g})}}class gI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"ivec3",value:e,update:g})}}class Gt extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"vec3",value:e,update:g})}}class II extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"bvec4",value:e,update:g})}}class sI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"uvec4",value:e,update:g})}}class QI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"ivec4",value:e,update:g})}}class ee extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"vec4",value:e,update:g})}}class BI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"mat2",value:e,update:g})}}class iI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"mat2x2",value:e,update:g})}}class nI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"mat2x3",value:e,update:g})}}class CI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"mat2x4",value:e,update:g})}}class EI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"mat3",value:e,update:g})}}class aI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"mat3x2",value:e,update:g})}}class oI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"mat3x3",value:e,update:g})}}class rI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"mat3x4",value:e,update:g})}}class cI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"mat4",value:e,update:g})}}class hI extends k{constructor({key:A,value:e,update:g}){super({key:A,type:"mat4x2" Line truncated
precision highp float;
in vec3 position;
@@ -71,19 +71,19 @@
void main() {
gl_Position = vec4(position.xy, 0.0, 1.0);
}
`);function qI(t){const A=new a.Vector3;for(const e of t)A.add(e);return A.divideScalar(t.length)}function zI(t){if(t.length===0)return new a.Quaternion;const A=t[0].clone();for(let e=1;e<t.length;e++)t[e].dot(t[0])<0?(A.x-=t[e].x,A.y-=t[e].y,A.z-=t[e].z,A.w-=t[e].w):(A.x+=t[e].x,A.y+=t[e].y,A.z+=t[e].z,A.w+=t[e].w);return A.normalize()}function VI(t,A){const e=new a.Vector3(0,0,0).applyMatrix4(t),g=new a.Vector3(0,0,0).applyMatrix4(A),I=new a.Vector3(0,0,-1).applyMatrix4(t).sub(e).normalize(),s=new a.Vector3(0,0,-1).applyMatrix4(A).sub(g).normalize(),B=e.distanceTo(g),i=I.dot(s);return{distance:B,coincidence:i}}function cC({matrix1:t,matrix2:A,maxDistance:e}){const g=new a.Vector3(0,0,0).applyMatrix4(t),I=new a.Vector3(0,0,0).applyMatrix4(A);return g.distanceTo(I)<=e}function hC({matrix1:t,matrix2:A,maxDistance:e,minCoincidence:g}){const{distance:I,coincidence:s}=VI(t,A);return I<=e&&(g==null||s>=g)}function jI(t,A){const[e,g]=[new a.Vector3,new a.Quaternion],[I,s]=[new a.Vector3,new a.Quaternion];t.decompose(e,g,new a.Vector3),A.decompose(I,s,new a.Vector3);const B=e.distanceTo(I),i=Math.abs(g.dot(s));return{distance:B,coorient:i}}function he({matrix1:t,matrix2:A,maxDistance:e,minCoorient:g}){const{distance:I,coorient:s}=jI(t,A);return I<=e&&(g==null||s>=g)}function lC(t,A=.001){return Math.abs(t)<A?0:Math.sign(t)}function uC(t){const A=t.w<0,e=Kt(A?-t.x:t.x),g=Kt(A?-t.y:t.y),I=Kt(A?-t.z:t.z),s=e&255,B=g&255,i=I&255;return s|B<<8|i<<16}function wC(t,A){const e=t<<24>>24,g=t<<16>>24,I=t<<8>>24;A.set(e/127,g/127,I/127,0);const s=A.x*A.x+A.y*A.y+A.z*A.z;return A.w=Math.sqrt(Math.max(0,1-s)),A}function Xe(t){const A=t.clone().normalize();A.w<0&&A.set(-A.x,-A.y,-A.z,-A.w);const e=2*Math.acos(A.w),g=Math.sqrt(A.x*A.x+A.y*A.y+A.z*A.z),I=g<1e-6?new a.Vector3(1,0,0):new a.Vector3(A.x,A.y,A.z).divideScalar(g),s=Math.abs(I.x)+Math.abs(I.y)+Math.abs(I.z);let B=I.x/s,i=I.y/s;if(I.z<0){const r=B;B=(1-Math.abs(i))*(B>=0?1:-1),i=(1-Math.abs(r))*(i>=0?1:-1)}const Q=B*.5+.5,C=i*.5+.5,E=Math.round(Q*255),n=Math.round(C*255);return Math.round(e*(255/Math.PI))<<16|n<<8|E}function ZI(t,A){const e=t&255,g=t>>>8&255,I=t>>>16&255,s=e/255,B=g/255;let i=(s-.5)*2,Q=(B-.5)*2;const C=1-(Math.abs(i)+Math.abs(Q)),E=Math.max(-C,0);i+=i>=0?-E:E,Q+=Q>=0?-E:E;const n=new a.Vector3(i,Q,C).normalize(),r=I/255*Math.PI*.5,l=Math.sin(r),c=Math.cos(r);return A.set(n.x*l,n.y*l,n.z*l,c),A}function DC(t){const A=t.clone().normalize(),e=2*(A.w*A.x+A.y*A.z),g=1-2*(A.x*A.x+A.y*A.y),I=Math.atan2(e,g),s=2*(A.w*A.y-A.z*A.x),B=Math.abs(s)>=1?Math.sign(s)*(Math.PI/2):Math.asin(s),i=2*(A.w*A.z+A.x*A.y),Q=1-2*(A.y*A.y+A.z*A.z),C=Math.atan2(i,Q),E=(I+Math.PI)/(2*Math.PI),n=(B+Math.PI)/(2*Math.PI),o=(C+Math.PI)/(2*Math.PI),r=Math.round(E*255),l=Math.round(n*255);return Math.round(o*255)<<16|l<<8|r}function yC(t,A){const e=t&255,g=t>>>8&255,I=t>>>16&255,s=e/255,B=g/255,i=I/255,Q=s*(2*Math.PI)-Math.PI,C=B*(2*Math.PI)-Math.PI,E=i*(2*Math.PI)-Math.PI,n=Math.cos(Q*.5),o=Math.sin(Q*.5),r=Math.cos(C*.5),l=Math.sin(C*.5),c=Math.cos(E*.5),h=Math.sin(E*.5);return A.w=n*r*c+o*l*h,A.x=o*r*c-n*l*h,A.y=n*l*c+o*r*h,A.z=n*r*h-o*l*c,A.normalize(),A}function se(t,A,e,g){const I=Math.max(-127,Math.min(127,t*127)),s=Math.max(-127,Math.min(127,A*127)),B=Math.max(-127,Math.min(127,e*127)),i=Math.max(-127,Math.min(127,g*127));return I&255|(s&255)<<8|(B&255)<<16|(i&255)<<24}function pC(t,A,e){const g=A*2;for(let I=0;I<9;++I){const s=Math.max(-63,Math.min(63,e[I]*63))&127,B=I*7,i=B+7,Q=Math.floor(B/32),C=B-Q*32,E=s<<C&4294967295;if(t[g+Q]|=E,i>Q*32+32){const n=s>>>32-C&4294967295;t[g+Q+1]|=n}}}function fC(t,A,e){t[A*4+0]=se(e[0],e[1],e[2],e[3]),t[A*4+1]=se(e[4],e[5],e[6],e[7]),t[A*4+2]=se(e[8],e[9],e[10],e[11]),t[A*4+3]=se(e[12],e[13],e[14],0)}function dC(t,A,e){const g=A*4;for(let I=0;I<21;++I){const s=Math.max(-31,Math.min(31,e[I]*31))&63,B=I*6,i=B+6,Q=Math.floor(B/32),C=B-Q*32,E=s<<C&4294967295;if(t[g+Q]|=E,i>Q*32+32){const n=s>>>32-C&4294967295;t[g+Q+1]|=n}}}function _I(t,A){const e=[];let g=0,I=null;const s=new mg((Q,C)=>{if(e.push(Q),g+=Q.length,C||g>=A){const E=new Uint8Array(g);let n=0;for(const o of e)E.set(o,n),n+=o.length;I=E.slice(0,A)}}),B=1024;let i=0;for(;I==null&&i<t.length;){const Q=t.slice(i,i+B);s.push(Q,!1),i+=B}if(I==null&&(s.push(new Uint8Array,!0),I==null))throw new Error("Failed to decompress partial gzip");return I}class XI{constructor({fileBytes:A,chunkBytes:e=64*1024}){this.fileBytes=A,this.chunkBytes=e,this.offset=0,this.chunks=[],this.totalBytes=0,this.gunzip=new mg((g,I)=>{this.chunks.push(g),this.totalBytes+=g.length})}read(A){for(;this.totalBytes<A&&this.offset<this.fileBytes.length;){const s=Math.min(this.offset+this.chunkBytes,this.fileBytes.length);this.gunzip.push(this.fileBytes.subarray(this.offset,s),!1),this.offset=s}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 e=new Uint8Array(this.totalBytes);let g=0 Line truncated
`);function zI(t){const A=new a.Vector3;for(const e of t)A.add(e);return A.divideScalar(t.length)}function VI(t){if(t.length===0)return new a.Quaternion;const A=t[0].clone();for(let e=1;e<t.length;e++)t[e].dot(t[0])<0?(A.x-=t[e].x,A.y-=t[e].y,A.z-=t[e].z,A.w-=t[e].w):(A.x+=t[e].x,A.y+=t[e].y,A.z+=t[e].z,A.w+=t[e].w);return A.normalize()}function ZI(t,A){const e=new a.Vector3(0,0,0).applyMatrix4(t),g=new a.Vector3(0,0,0).applyMatrix4(A),I=new a.Vector3(0,0,-1).applyMatrix4(t).sub(e).normalize(),s=new a.Vector3(0,0,-1).applyMatrix4(A).sub(g).normalize(),Q=e.distanceTo(g),B=I.dot(s);return{distance:Q,coincidence:B}}function hC({matrix1:t,matrix2:A,maxDistance:e}){const g=new a.Vector3(0,0,0).applyMatrix4(t),I=new a.Vector3(0,0,0).applyMatrix4(A);return g.distanceTo(I)<=e}function lC({matrix1:t,matrix2:A,maxDistance:e,minCoincidence:g}){const{distance:I,coincidence:s}=ZI(t,A);return I<=e&&(g==null||s>=g)}function jI(t,A){const[e,g]=[new a.Vector3,new a.Quaternion],[I,s]=[new a.Vector3,new a.Quaternion];t.decompose(e,g,new a.Vector3),A.decompose(I,s,new a.Vector3);const Q=e.distanceTo(I),B=Math.abs(g.dot(s));return{distance:Q,coorient:B}}function he({matrix1:t,matrix2:A,maxDistance:e,minCoorient:g}){const{distance:I,coorient:s}=jI(t,A);return I<=e&&(g==null||s>=g)}function uC(t,A=.001){return Math.abs(t)<A?0:Math.sign(t)}function wC(t){const A=t.w<0,e=qt(A?-t.x:t.x),g=qt(A?-t.y:t.y),I=qt(A?-t.z:t.z),s=e&255,Q=g&255,B=I&255;return s|Q<<8|B<<16}function yC(t,A){const e=t<<24>>24,g=t<<16>>24,I=t<<8>>24;A.set(e/127,g/127,I/127,0);const s=A.x*A.x+A.y*A.y+A.z*A.z;return A.w=Math.sqrt(Math.max(0,1-s)),A}function Oe(t){const A=t.clone().normalize();A.w<0&&A.set(-A.x,-A.y,-A.z,-A.w);const e=2*Math.acos(A.w),g=Math.sqrt(A.x*A.x+A.y*A.y+A.z*A.z),I=g<1e-6?new a.Vector3(1,0,0):new a.Vector3(A.x,A.y,A.z).divideScalar(g),s=Math.abs(I.x)+Math.abs(I.y)+Math.abs(I.z);let Q=I.x/s,B=I.y/s;if(I.z<0){const r=Q;Q=(1-Math.abs(B))*(Q>=0?1:-1),B=(1-Math.abs(r))*(B>=0?1:-1)}const i=Q*.5+.5,C=B*.5+.5,E=Math.round(i*255),n=Math.round(C*255);return Math.round(e*(255/Math.PI))<<16|n<<8|E}function XI(t,A){const e=t&255,g=t>>>8&255,I=t>>>16&255,s=e/255,Q=g/255;let B=(s-.5)*2,i=(Q-.5)*2;const C=1-(Math.abs(B)+Math.abs(i)),E=Math.max(-C,0);B+=B>=0?-E:E,i+=i>=0?-E:E;const n=new a.Vector3(B,i,C).normalize(),r=I/255*Math.PI*.5,l=Math.sin(r),c=Math.cos(r);return A.set(n.x*l,n.y*l,n.z*l,c),A}function DC(t){const A=t.clone().normalize(),e=2*(A.w*A.x+A.y*A.z),g=1-2*(A.x*A.x+A.y*A.y),I=Math.atan2(e,g),s=2*(A.w*A.y-A.z*A.x),Q=Math.abs(s)>=1?Math.sign(s)*(Math.PI/2):Math.asin(s),B=2*(A.w*A.z+A.x*A.y),i=1-2*(A.y*A.y+A.z*A.z),C=Math.atan2(B,i),E=(I+Math.PI)/(2*Math.PI),n=(Q+Math.PI)/(2*Math.PI),o=(C+Math.PI)/(2*Math.PI),r=Math.round(E*255),l=Math.round(n*255);return Math.round(o*255)<<16|l<<8|r}function dC(t,A){const e=t&255,g=t>>>8&255,I=t>>>16&255,s=e/255,Q=g/255,B=I/255,i=s*(2*Math.PI)-Math.PI,C=Q*(2*Math.PI)-Math.PI,E=B*(2*Math.PI)-Math.PI,n=Math.cos(i*.5),o=Math.sin(i*.5),r=Math.cos(C*.5),l=Math.sin(C*.5),c=Math.cos(E*.5),h=Math.sin(E*.5);return A.w=n*r*c+o*l*h,A.x=o*r*c-n*l*h,A.y=n*l*c+o*r*h,A.z=n*r*h-o*l*c,A.normalize(),A}function se(t,A,e,g){const I=Math.max(-127,Math.min(127,t*127)),s=Math.max(-127,Math.min(127,A*127)),Q=Math.max(-127,Math.min(127,e*127)),B=Math.max(-127,Math.min(127,g*127));return I&255|(s&255)<<8|(Q&255)<<16|(B&255)<<24}function pC(t,A,e){const g=A*2;for(let I=0;I<9;++I){const s=Math.max(-63,Math.min(63,e[I]*63))&127,Q=I*7,B=Q+7,i=Math.floor(Q/32),C=Q-i*32,E=s<<C&4294967295;if(t[g+i]|=E,B>i*32+32){const n=s>>>32-C&4294967295;t[g+i+1]|=n}}}function fC(t,A,e){t[A*4+0]=se(e[0],e[1],e[2],e[3]),t[A*4+1]=se(e[4],e[5],e[6],e[7]),t[A*4+2]=se(e[8],e[9],e[10],e[11]),t[A*4+3]=se(e[12],e[13],e[14],0)}function NC(t,A,e){const g=A*4;for(let I=0;I<21;++I){const s=Math.max(-31,Math.min(31,e[I]*31))&63,Q=I*6,B=Q+6,i=Math.floor(Q/32),C=Q-i*32,E=s<<C&4294967295;if(t[g+i]|=E,B>i*32+32){const n=s>>>32-C&4294967295;t[g+i+1]|=n}}}function _I(t,A){const e=[];let g=0,I=null;const s=new mg((i,C)=>{if(e.push(i),g+=i.length,C||g>=A){const E=new Uint8Array(g);let n=0;for(const o of e)E.set(o,n),n+=o.length;I=E.slice(0,A)}}),Q=1024;let B=0;for(;I==null&&B<t.length;){const i=t.slice(B,B+Q);s.push(i,!1),B+=Q}if(I==null&&(s.push(new Uint8Array,!0),I==null))throw new Error("Failed to decompress partial gzip");return I}class WI{constructor({fileBytes:A,chunkBytes:e=64*1024}){this.fileBytes=A,this.chunkBytes=e,this.offset=0,this.chunks=[],this.totalBytes=0,this.gunzip=new mg((g,I)=>{this.chunks.push(g),this.totalBytes+=g.length})}read(A){for(;this.totalBytes<A&&this.offset<this.fileBytes.length;){const s=Math.min(this.offset+this.chunkBytes,this.fileBytes.length);this.gunzip.push(this.fileBytes.subarray(this.offset,s),!1),this.offset=s}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 e=new Uint8Array(this.totalBytes);let g=0 Line truncated
`)+this.between+e.map(g=>this.indent+g).join(`
`)+this.after}}const Qg=new Map;function mC(t){let A=Qg.get(t);return A||(A=new a.RawShaderMaterial({glslVersion:a.GLSL3,vertexShader:KI,fragmentShader:t.shader,uniforms:t.uniforms}),Qg.set(t,A),A)}function We(t,A,e="add"){const g=()=>{throw new Error(`Invalid ${e} types: ${t}, ${A}`)};if(t===A)return t;if(t==="int"){if(hA(A))return A;g()}if(A==="int"){if(hA(t))return t;g()}if(t==="uint"){if(lA(A))return A;g()}if(A==="uint"){if(lA(t))return t;g()}if(t==="float"){if(Qt(A))return A;g()}if(A==="float"){if(Qt(t))return t;g()}throw new Error(`Invalid ${e} types: ${t}, ${A}`)}function SC(t,A){return We(t,A,"sub")}function NC(t,A){const e=()=>{throw new Error(`Invalid mul types: ${t}, ${A}`)},g=I=>I;if(t==="int"){if(hA(A))return g(A);e()}if(A==="int"){if(hA(t))return g(t);e()}if(t==="uint"){if(lA(A))return g(A);e()}if(A==="uint"){if(lA(t))return g(t);e()}if(t==="float"){if(Qt(A))return g(A);e()}if(A==="float"){if(Qt(t))return g(t);e()}if(hA(t)||lA(t)||hA(A)||lA(A)){if(t===A)return g(t);e()}if(t==="vec2"){if(A==="vec2"||nt(A))return g("vec2");if(A==="mat3x2")return g("vec3");if(A==="mat4x2")return g("vec4");e()}if(t==="vec3"){if(A==="mat2x3")return g("vec2");if(A==="vec3"||Ct(A))return g("vec3");if(A==="mat4x3")return g("vec4");e()}if(t==="vec4"){if(A==="mat2x4")return g("vec2");if(A==="mat3x4")return g("vec3");if(A==="vec4"||Et(A))return g("vec4");e()}if(A==="vec2"){if(nt(t))return g("vec2");if(t==="mat2x3")return g("vec3");if(t==="mat2x4")return g("vec4");e()}if(A==="vec3"){if(t==="mat3x2")return g("vec2");if(Ct(t))return g("vec3");if(t==="mat3x4")return g("vec4");e()}if(A==="vec4"){if(t==="mat4x2")return g("vec2");if(t==="mat4x3")return g("vec3");if(Et(t))return g("vec4");e()}if(nt(t)){if(nt(A))return g("mat2");if(A==="mat3x2")return g("mat3x2");if(A==="mat4x2")return g("mat4x2");e()}if(t==="mat2x3"){if(nt(A))return g("mat2x3");if(A==="mat3x2")return g("mat3");if(A==="mat4x2")return g("mat4x3");e()}if(t==="mat2x4"){if(nt(A))return g("mat2x4");if(A==="mat3x2")return g("mat3x4");if(A==="mat4x2")return g("mat4");e()}if(t==="mat3x2"){if(A==="mat2x3")return g("mat2");if(Ct(A))return g("mat3x2");if(A==="mat4x3")return g("mat4x2");e()}if(Ct(t)){if(A==="mat2x3")return g("mat2x3");if(Ct(A))return g("mat3");if(A==="mat4x3")return g("mat4x3");e()}if(t==="mat3x4"){if(A==="mat2x3")return g("mat2x4");if(Ct(A))return g("mat3x4");if(A==="mat4x3")return g("mat4");e()}if(t==="mat4x2"){if(A==="mat2x4")return g("mat2");if(A==="mat3x4")return g("mat3x2");if(Et(A))return g("mat4x2");e()}if(t==="mat4x3"){if(A==="mat2x4")return g("mat2x3");if(A==="mat3x4")return g("mat3");if(Et(A))return g("mat4x3");e()}if(Et(t)){if(A==="mat2x4")return g("mat2x4");if(A==="mat3x4")return g("mat3x4");if(Et(A))return g("mat4");e()}throw new Error(`Invalid mul types: ${t}, ${A}`)}function FC(t,A){return We(t,A,"div")}function GC(t,A){if(t===A)return t;if(t==="int"){if(hA(A))return A}else if(A==="int"){if(hA(t))return t}else if(t==="uint"){if(lA(A))return A}else if(A==="uint"&&lA(t))return t;throw new Error(`Invalid imod types: ${t}, ${A}`)}function kC(t,A){if(t===A||A==="float")return t;throw new Error(`Invalid mod types: ${t}, ${A}`)}function xC(t){return t}function RC(t){return t}function UC(t){return t}function YC(t){return t}function LC(t){return t}function JC(t){return t}function vC(t){return t}function bC(t){return t}function TC(t){return t}function HC(t){return t}function KC(t){return t}function qC(t){return t}function zC(t){return t}function VC(t){return t}function jC(t){return t}function ZC(t){return t}function OI(t,A,e="min"){if(t===A)return t;if(A==="float"){if(Wt(t))return t}else if(A==="int"){if(hA(t))return t}else if(A==="uint"&&lA(t))return t;throw new Error(`Invalid ${e} types: ${t}, ${A}`)}function _C(t,A){return OI(t,A,"max")}function XC(t,A,e){if(A==="float"){if(Wt(t))return t}else if(A==="int"){if(hA(t))return t}else if(A==="uint"&&lA(t))return t;throw new Error(`Invalid clamp types: ${t}, ${A}`)}function OC(t,A,e){if(e===t||e==="float"||e==="bool"&&t==="float"||e==="bvec2"&&t==="vec2"||e==="bvec3"&&t==="vec3"||e==="bvec4"&&t==="vec4")return t;throw new Error(`Invalid mix types: ${t}, ${A}, ${e}`)}function PC(t,A){if(t===A||A==="float")return A;throw new Error(`Invalid step types: ${t}, ${A}`)}function WC(t,A,e){if(t===A&&(t===e||t==="float"))return e;throw new Error(`Invalid smoothstep types: ${t}, ${A}, ${e}`)}function PI(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 $C(t){return PI(t,"isInf")}const dA=(t,A)=>new ts({a:t,b:A}),Gt=(t,A)=>new es({a:t,b:A}),aA=(t,A)=>new gs({a:t,b:A}),ne=(t,A)=>new Is({a:t,b:A}),be=(t,A)=>new ss({a:t,b:A}),WI=(t,A)=>new Bs({a:t,b:A}),AE=t=>new is({a:t}).outputs,$e=t=>new Qs({a:t}),tE=t=>new ns({a:t}),eE=t=>new Cs({a:t}),gE=t=>new Es({a:t}),IE=t=>new as({a:t}),sE=t=>new os({a:t}),BE=t=>new rs({a:t}),Ce=t=>new cs({a:t}),iE=(t,A)=>new hs({a:t,b:A}),QE=t=>new ls({a:t}),nE=t=>ne Line truncated
`)+this.after}}const Cg=new Map;function mC(t){let A=Cg.get(t);return A||(A=new a.RawShaderMaterial({glslVersion:a.GLSL3,vertexShader:qI,fragmentShader:t.shader,uniforms:t.uniforms}),Cg.set(t,A),A)}function Ag(t,A,e="add"){const g=()=>{throw new Error(`Invalid ${e} types: ${t}, ${A}`)};if(t===A)return t;if(t==="int"){if(hA(A))return A;g()}if(A==="int"){if(hA(t))return t;g()}if(t==="uint"){if(lA(A))return A;g()}if(A==="uint"){if(lA(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 ${e} types: ${t}, ${A}`)}function SC(t,A){return Ag(t,A,"sub")}function FC(t,A){const e=()=>{throw new Error(`Invalid mul types: ${t}, ${A}`)},g=I=>I;if(t==="int"){if(hA(A))return g(A);e()}if(A==="int"){if(hA(t))return g(t);e()}if(t==="uint"){if(lA(A))return g(A);e()}if(A==="uint"){if(lA(t))return g(t);e()}if(t==="float"){if(it(A))return g(A);e()}if(A==="float"){if(it(t))return g(t);e()}if(hA(t)||lA(t)||hA(A)||lA(A)){if(t===A)return g(t);e()}if(t==="vec2"){if(A==="vec2"||nt(A))return g("vec2");if(A==="mat3x2")return g("vec3");if(A==="mat4x2")return g("vec4");e()}if(t==="vec3"){if(A==="mat2x3")return g("vec2");if(A==="vec3"||Ct(A))return g("vec3");if(A==="mat4x3")return g("vec4");e()}if(t==="vec4"){if(A==="mat2x4")return g("vec2");if(A==="mat3x4")return g("vec3");if(A==="vec4"||Et(A))return g("vec4");e()}if(A==="vec2"){if(nt(t))return g("vec2");if(t==="mat2x3")return g("vec3");if(t==="mat2x4")return g("vec4");e()}if(A==="vec3"){if(t==="mat3x2")return g("vec2");if(Ct(t))return g("vec3");if(t==="mat3x4")return g("vec4");e()}if(A==="vec4"){if(t==="mat4x2")return g("vec2");if(t==="mat4x3")return g("vec3");if(Et(t))return g("vec4");e()}if(nt(t)){if(nt(A))return g("mat2");if(A==="mat3x2")return g("mat3x2");if(A==="mat4x2")return g("mat4x2");e()}if(t==="mat2x3"){if(nt(A))return g("mat2x3");if(A==="mat3x2")return g("mat3");if(A==="mat4x2")return g("mat4x3");e()}if(t==="mat2x4"){if(nt(A))return g("mat2x4");if(A==="mat3x2")return g("mat3x4");if(A==="mat4x2")return g("mat4");e()}if(t==="mat3x2"){if(A==="mat2x3")return g("mat2");if(Ct(A))return g("mat3x2");if(A==="mat4x3")return g("mat4x2");e()}if(Ct(t)){if(A==="mat2x3")return g("mat2x3");if(Ct(A))return g("mat3");if(A==="mat4x3")return g("mat4x3");e()}if(t==="mat3x4"){if(A==="mat2x3")return g("mat2x4");if(Ct(A))return g("mat3x4");if(A==="mat4x3")return g("mat4");e()}if(t==="mat4x2"){if(A==="mat2x4")return g("mat2");if(A==="mat3x4")return g("mat3x2");if(Et(A))return g("mat4x2");e()}if(t==="mat4x3"){if(A==="mat2x4")return g("mat2x3");if(A==="mat3x4")return g("mat3");if(Et(A))return g("mat4x3");e()}if(Et(t)){if(A==="mat2x4")return g("mat2x4");if(A==="mat3x4")return g("mat3x4");if(Et(A))return g("mat4");e()}throw new Error(`Invalid mul types: ${t}, ${A}`)}function GC(t,A){return Ag(t,A,"div")}function xC(t,A){if(t===A)return t;if(t==="int"){if(hA(A))return A}else if(A==="int"){if(hA(t))return t}else if(t==="uint"){if(lA(A))return A}else if(A==="uint"&&lA(t))return t;throw new Error(`Invalid imod types: ${t}, ${A}`)}function kC(t,A){if(t===A||A==="float")return t;throw new Error(`Invalid mod types: ${t}, ${A}`)}function RC(t){return t}function UC(t){return t}function LC(t){return t}function YC(t){return t}function JC(t){return t}function bC(t){return t}function vC(t){return t}function HC(t){return t}function TC(t){return t}function KC(t){return t}function qC(t){return t}function zC(t){return t}function VC(t){return t}function ZC(t){return t}function jC(t){return t}function XC(t){return t}function OI(t,A,e="min"){if(t===A)return t;if(A==="float"){if(Pt(t))return t}else if(A==="int"){if(hA(t))return t}else if(A==="uint"&&lA(t))return t;throw new Error(`Invalid ${e} types: ${t}, ${A}`)}function _C(t,A){return OI(t,A,"max")}function WC(t,A,e){if(A==="float"){if(Pt(t))return t}else if(A==="int"){if(hA(t))return t}else if(A==="uint"&&lA(t))return t;throw new Error(`Invalid clamp types: ${t}, ${A}`)}function OC(t,A,e){if(e===t||e==="float"||e==="bool"&&t==="float"||e==="bvec2"&&t==="vec2"||e==="bvec3"&&t==="vec3"||e==="bvec4"&&t==="vec4")return t;throw new Error(`Invalid mix types: ${t}, ${A}, ${e}`)}function PC(t,A){if(t===A||A==="float")return A;throw new Error(`Invalid step types: ${t}, ${A}`)}function $C(t,A,e){if(t===A&&(t===e||t==="float"))return e;throw new Error(`Invalid smoothstep types: ${t}, ${A}, ${e}`)}function PI(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 AE(t){return PI(t,"isInf")}const fA=(t,A)=>new es({a:t,b:A}),xt=(t,A)=>new gs({a:t,b:A}),aA=(t,A)=>new Is({a:t,b:A}),ne=(t,A)=>new ss({a:t,b:A}),He=(t,A)=>new Qs({a:t,b:A}),$I=(t,A)=>new Bs({a:t,b:A}),tE=t=>new is({a:t}).outputs,tg=t=>new ns({a:t}),eE=t=>new Cs({a:t}),gE=t=>new Es({a:t}),IE=t=>new as({a:t}),sE=t=>new os({a:t}),QE=t=>new rs({a:t}),BE=t=>new cs({a:t}),Ce=t=>new hs({a:t}),iE=(t,A)=>new ls({a:t,b:A}),nE=t=>new us({a:t}),CE=t=>ne Line truncated
uint pcg_next(uint state) {
return state * 747796405u + 2891336453u;
}
`)],statements:({inputs:g,outputs:I})=>{const s=e==="uint"?`${g.state}`:e==="int"?`uint(${g.state})`:`floatBitsToUint(${g.state})`;return[`${I.state} = pcg_next(${s});`]}})}dynoOut(){return new q(this,"state")}}class UA extends j{constructor({state:A}){super({inTypes:{state:"uint"},outTypes:{hash:"uint"},inputs:{state:A},globals:()=>[rA(`
`)],statements:({inputs:g,outputs:I})=>{const s=e==="uint"?`${g.state}`:e==="int"?`uint(${g.state})`:`floatBitsToUint(${g.state})`;return[`${I.state} = pcg_next(${s});`]}})}dynoOut(){return new q(this,"state")}}class UA extends Z{constructor({state:A}){super({inTypes:{state:"uint"},outTypes:{hash:"uint"},inputs:{state:A},globals:()=>[rA(`
uint pcg_hash(uint state) {
uint hash = ((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u;
return (hash >> 22u) ^ hash;
}
`)],statements:({inputs:e,outputs:g})=>[`${g.hash} = pcg_hash(${e.state});`]})}dynoOut(){return new q(this,"hash")}}class Ut extends j{constructor({value:A}){const e=V(A),g=Rg(e);super({inTypes:{value:e},outTypes:{state:"uint"},inputs:{value:A},globals:()=>[rA(`
`)],statements:({inputs:e,outputs:g})=>[`${g.hash} = pcg_hash(${e.state});`]})}dynoOut(){return new q(this,"hash")}}class Lt extends Z{constructor({value:A}){const e=V(A),g=Ug(e);super({inTypes:{value:e},outTypes:{state:"uint"},inputs:{value:A},globals:()=>[rA(`
uint pcg_mix(uint value) {
return value;
}
@@ -96,7 +96,7 @@
uint pcg_mix(uvec4 value) {
return value.x + 0x9e3779b9u * value.y + 0x85ebca6bu * value.z + 0xc2b2ae35u * value.w;
}
`)],statements:({inputs:I,outputs:s})=>{const B=lA(e)?`${I.value}`:hA(e)?`${g}(${I.value})`:`floatBitsToUint(${I.value})`;return[`${g} bits = ${B};`,`${s.state} = pcg_mix(bits);`]}})}dynoOut(){return new q(this,"state")}}class Ii extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"uint"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");let g=new Ut({value:e}).outputs.state;return g=new RA({state:g}).outputs.state,new UA({state:g}).outputs}})}dynoOut(){return new q(this,"hash")}}class si extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"uvec2"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");let g=new Ut({value:e}).outputs.state;g=new RA({state:g}).outputs.state;const I=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const s=new UA({state:g}).outputs.hash;return{hash:qA({vectorType:"uvec2",x:I,y:s})}}})}dynoOut(){return new q(this,"hash")}}class Bi extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"uvec3"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");let g=new Ut({value:e}).outputs.state;g=new RA({state:g}).outputs.state;const I=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const s=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const B=new UA({state:g}).outputs.hash;return{hash:qA({vectorType:"uvec3",x:I,y:s,z:B})}}})}dynoOut(){return new q(this,"hash")}}class ii extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"uvec4"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");let g=new Ut({value:e}).outputs.state;g=new RA({state:g}).outputs.state;const I=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const s=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const B=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const i=new UA({state:g}).outputs.hash;return{hash:qA({vectorType:"uvec4",x:I,y:s,z:B,w:i})}}})}dynoOut(){return new q(this,"hash")}}class Qi extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"float"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");const g=PB(e);return{hash:aA(_s(g),K("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class ni extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"vec2"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");const g=WB(e);return{hash:aA(Xs(g),K("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class Ci extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"vec3"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");const g=$B(e);return{hash:aA(ht(g),K("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class Ei extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"vec4"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");const g=Ai(e);return{hash:aA(Os(g),K("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class ai extends j{constructor({z:A,zNear:e,zFar:g}){super({inTypes:{z:"float",zNear:"float",zFar:"float"},outTypes:{depth:"float"},inputs:{z:A,zNear:e,zFar:g},statements:({inputs:I,outputs:s})=>[`float clamped = clamp(${I.z}, ${I.zNear}, ${I.zFar});`,`${s.depth} = (log2(clamped + 1.0) - log2(${I.zNear} + 1.0)) / (log2(${I.zFar} + 1.0) - log2(${I.zNear} + 1.0));`]})}dynoOut(){return new q(this,"depth")}}const oi=(t,{scale:A,scales:e,rotate:g,translate:I})=>new ci({position:t,scale:A,scales:e,rotate:g,translate:I}).outputs.position,ri=(t,{scale:A,scales:e,rotate:g})=>new hi({dir:t,scale:A,scales:e,rotate:g}).outputs.dir,Fa=(t,{rotate:A})=>new li({quaternion:t,rotate:A}).outputs.quaternion;class ci extends j{constructor({position:A,scale:e,scales:g,rotate:I,translate:s}){super({inTypes:{position:"vec3",scale:"float",scales:"vec3",rotate:"vec4",translate:"vec3"},outTypes:{position:"vec3"},inputs:{position:A,scale:e,scales:g,rotate:I,translate:s},statements:({inputs:B,outputs:i})=>{const{position:Q}=i;if(!Q)return[];const{scale:C,scales:E,rotate:n,translate:o}=B;return[`${Q} = ${B.position??"vec3(0.0, 0.0, 0.0)"};`,C?`${Q} *= ${C};`:null,E?`${Q} *= ${E};`:null,n?`${Q} = quatVec(${n}, ${Q});`:null,o?`${Q} += ${o};`:null].filter(Boolean)}})}}class hi extends j{constructor({dir:A,scale:e,scales:g,rotate:I}){super({inTypes:{dir:"vec3",scale:"float",scales:"vec3",rotate:"vec4"},outTypes:{dir:"vec3"},inputs:{dir:A,scale:e,scales:g,rotate:I},statements:({inputs:s,outputs:B})=>{const{dir:i}=B;if(!i)return[];const{scale:Q,scales:C,rotate:E}=s;return[`${i} = ${s.dir??"vec3(0.0, 0.0, 0.0)"};`,Q?`${i} *= ${Q};`:null,C?`${i} *= ${C};`:null,E?`${i} = quatVec(${E}, ${i});`:null].filter(Boolean)}})}}class li extends j{constructor({quaternion:A,rotate:e}){super({ Line truncated
`)],statements:({inputs:I,outputs:s})=>{const Q=lA(e)?`${I.value}`:hA(e)?`${g}(${I.value})`:`floatBitsToUint(${I.value})`;return[`${g} bits = ${Q};`,`${s.state} = pcg_mix(bits);`]}})}dynoOut(){return new q(this,"state")}}class sB extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"uint"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");let g=new Lt({value:e}).outputs.state;return g=new RA({state:g}).outputs.state,new UA({state:g}).outputs}})}dynoOut(){return new q(this,"hash")}}class QB extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"uvec2"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");let g=new Lt({value:e}).outputs.state;g=new RA({state:g}).outputs.state;const I=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const s=new UA({state:g}).outputs.hash;return{hash:qA({vectorType:"uvec2",x:I,y:s})}}})}dynoOut(){return new q(this,"hash")}}class BB extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"uvec3"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");let g=new Lt({value:e}).outputs.state;g=new RA({state:g}).outputs.state;const I=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const s=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const Q=new UA({state:g}).outputs.hash;return{hash:qA({vectorType:"uvec3",x:I,y:s,z:Q})}}})}dynoOut(){return new q(this,"hash")}}class iB extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"uvec4"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");let g=new Lt({value:e}).outputs.state;g=new RA({state:g}).outputs.state;const I=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const s=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const Q=new UA({state:g}).outputs.hash;g=new RA({state:g}).outputs.state;const B=new UA({state:g}).outputs.hash;return{hash:qA({vectorType:"uvec4",x:I,y:s,z:Q,w:B})}}})}dynoOut(){return new q(this,"hash")}}class nB extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"float"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");const g=PQ(e);return{hash:aA(_s(g),K("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class CB extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"vec2"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");const g=$Q(e);return{hash:aA(Ws(g),K("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class EB extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"vec3"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");const g=AB(e);return{hash:aA(ht(g),K("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class aB extends VA{constructor({value:A}){super({inTypes:{value:V(A)},outTypes:{hash:"vec4"},inputs:{value:A},construct:({value:e})=>{if(!e)throw new Error("value is required");const g=tB(e);return{hash:aA(Os(g),K("float",1/2**32))}}})}dynoOut(){return new q(this,"hash")}}class oB extends Z{constructor({z:A,zNear:e,zFar:g}){super({inTypes:{z:"float",zNear:"float",zFar:"float"},outTypes:{depth:"float"},inputs:{z:A,zNear:e,zFar:g},statements:({inputs:I,outputs:s})=>[`float clamped = clamp(${I.z}, ${I.zNear}, ${I.zFar});`,`${s.depth} = (log2(clamped + 1.0) - log2(${I.zNear} + 1.0)) / (log2(${I.zFar} + 1.0) - log2(${I.zNear} + 1.0));`]})}dynoOut(){return new q(this,"depth")}}const rB=(t,{scale:A,scales:e,rotate:g,translate:I})=>new hB({position:t,scale:A,scales:e,rotate:g,translate:I}).outputs.position,cB=(t,{scale:A,scales:e,rotate:g})=>new lB({dir:t,scale:A,scales:e,rotate:g}).outputs.dir,Fa=(t,{rotate:A})=>new uB({quaternion:t,rotate:A}).outputs.quaternion;class hB extends Z{constructor({position:A,scale:e,scales:g,rotate:I,translate:s}){super({inTypes:{position:"vec3",scale:"float",scales:"vec3",rotate:"vec4",translate:"vec3"},outTypes:{position:"vec3"},inputs:{position:A,scale:e,scales:g,rotate:I,translate:s},statements:({inputs:Q,outputs:B})=>{const{position:i}=B;if(!i)return[];const{scale:C,scales:E,rotate:n,translate:o}=Q;return[`${i} = ${Q.position??"vec3(0.0, 0.0, 0.0)"};`,C?`${i} *= ${C};`:null,E?`${i} *= ${E};`:null,n?`${i} = quatVec(${n}, ${i});`:null,o?`${i} += ${o};`:null].filter(Boolean)}})}}class lB extends Z{constructor({dir:A,scale:e,scales:g,rotate:I}){super({inTypes:{dir:"vec3",scale:"float",scales:"vec3",rotate:"vec4"},outTypes:{dir:"vec3"},inputs:{dir:A,scale:e,scales:g,rotate:I},statements:({inputs:s,outputs:Q})=>{const{dir:B}=Q;if(!B)return[];const{scale:i,scales:C,rotate:E}=s;return[`${B} = ${s.dir??"vec3(0.0, 0.0, 0.0)"};`,i?`${B} *= ${i};`:null,C?`${B} *= ${C};`:null,E?`${B} = quatVec(${E}, ${B});`:null].filter(Boolean)}})}}class uB extends Z{constructor({quaternion:A,rotate:e}){super({ Line truncated
precision highp int;
precision highp sampler2D;
precision highp usampler2D;
@@ -131,18 +131,18 @@ void main() {
} else {
target = vec4(0.0, 0.0, 0.0, 0.0);
}
}`;const xA=class xA{constructor({renderer:A}={}){this.renderer=A,this.capacity=0,this.count=0}dispose(){this.target&&(this.target.dispose(),this.target=void 0)}ensureBuffer(A,e){const I=Math.ceil(Math.max(1,A)/P)*P*4;if(e.byteLength>=I)return e;const s=new ArrayBuffer(I);if(e instanceof ArrayBuffer)return s;const B=e.constructor;return new B(s)}ensureCapacity(A){const{width:e,height:g,depth:I,maxSplats:s}=MA(A);(!this.target||s>this.capacity)&&(this.dispose(),this.capacity=s,this.target=new a.WebGLArrayRenderTarget(e,g,I,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,magFilter:a.NearestFilter,minFilter:a.NearestFilter}),this.target.texture.format=a.RGBAFormat,this.target.texture.type=a.UnsignedByteType,this.target.texture.internalFormat="RGBA8",this.target.scissorTest=!0)}prepareProgramMaterial(A){let e=xA.readbackProgram.get(A);if(!e){const I=kA({index:"int"},{rgba8:"vec4"},({index:s})=>(A.inputs.index=s,{rgba8:new _e({rgba8:A.outputs.rgba8})}));xA.programTemplate||(xA.programTemplate=new Pe(to)),e=new Oe({graph:I,inputs:{index:"index"},outputs:{rgba8:"target"},template:xA.programTemplate}),Object.assign(e.uniforms,{targetLayer:{value:0},targetBase:{value:0},targetCount:{value:0}}),xA.readbackProgram.set(A,e)}const g=e.prepareMaterial();return xA.fullScreenQuad.material=g,{program:e,material:g}}saveRenderState(A){return{xrEnabled:A.xr.enabled,autoClear:A.autoClear}}resetRenderState(A,e){A.setRenderTarget(null),A.xr.enabled=e.xrEnabled,A.autoClear=e.autoClear}process({count:A,material:e}){const g=this.renderer;if(!g)throw new Error("No renderer");if(!this.target)throw new Error("No target");const I=P*It;e.uniforms.targetBase.value=0,e.uniforms.targetCount.value=A;let s=0;for(;s<A;){const B=Math.floor(s/I),i=B*I,Q=Math.min(It,Math.ceil((A-i)/P));e.uniforms.targetLayer.value=B,this.target.scissor.set(0,0,P,Q),g.setRenderTarget(this.target,B),g.xr.enabled=!1,g.autoClear=!1,xA.fullScreenQuad.render(g),s+=P*Q}this.count=A}async read({readback:A}){const e=this.renderer;if(!e)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 I=new Uint8Array(A instanceof ArrayBuffer?A:A.buffer),s=P*It;let B=0;const i=[];for(;B<this.count;){const Q=Math.floor(B/s),C=Q*s,E=Math.min(It,Math.ceil((this.count-C)/P));e.setRenderTarget(this.target,Q);const n=P*E*4,o=I.subarray(C*4,C*4+n),r=e==null?void 0:e.readRenderTargetPixelsAsync(this.target,0,0,P,E,o);i.push(r),B+=P*E}return Promise.all(i).then(()=>A)}render({reader:A,count:e,renderer:g}){if(this.renderer=g||this.renderer,!this.renderer)throw new Error("No renderer");this.ensureCapacity(e);const{program:I,material:s}=this.prepareProgramMaterial(A);I.update();const B=this.saveRenderState(this.renderer);this.process({count:e,material:s}),this.resetRenderState(this.renderer,B)}async readback({readback:A}){if(!this.renderer)throw new Error("No renderer");const e=this.saveRenderState(this.renderer),g=this.read({readback:A});return this.resetRenderState(this.renderer,e),g}async renderReadback({reader:A,count:e,renderer:g,readback:I}){if(this.renderer=g||this.renderer,!this.renderer)throw new Error("No renderer");this.ensureCapacity(e);const{program:s,material:B}=this.prepareProgramMaterial(A);s.update();const i=this.saveRenderState(this.renderer);this.process({count:e,material:B});const Q=this.read({readback:I});return this.resetRenderState(this.renderer,i),Q}getTexture(){var A;return(A=this.target)==null?void 0:A.texture}};xA.programTemplate=null,xA.readbackProgram=new Map,xA.fullScreenQuad=new lg(new a.RawShaderMaterial({visible:!1}));let jt=xA;const EA=class EA{constructor(A={}){this.capacity=0,this.count=0,this.array=null,this.readback=null,this.source=null,this.needsUpdate=!0,this.dyno=new x({key:"rgbaArray",type:vi,globals:()=>[bi],value:{texture:EA.getEmpty(),count:0},update:e=>{var g;return e.texture=((g=this.readback)==null?void 0:g.getTexture())??this.source??EA.getEmpty(),e.count=this.count,e}}),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 e;if(!this.array||A>(((e=this.array)==null?void 0:e.length)??0)/4){this.capacity=MA(A).maxSplats;const g=new Uint8Array(this.capacity*4);this.array&&g.set(this.array),this.array=g}return this.array}getTexture(){var e;let A=(e=this.readback)==null?void 0:e.getTexture();return(this.source||this.array)&&(A=this.maybeUpdateSource()),A??EA.getEmpty()}maybeUpdateSource(){if(!this.array)throw new Error("No array");if(this.needsUpdate||!this.source){if(this.needsUpdate=!1,this.source){const{width:A,height:e,depth:g}=this.source.image;this.capacity!==A*e*g&&(this.s Line truncated
}`;const kA=class kA{constructor({renderer:A}={}){this.renderer=A,this.capacity=0,this.count=0}dispose(){this.target&&(this.target.dispose(),this.target=void 0)}ensureBuffer(A,e){const I=Math.ceil(Math.max(1,A)/O)*O*4;if(e.byteLength>=I)return e;const s=new ArrayBuffer(I);if(e instanceof ArrayBuffer)return s;const Q=e.constructor;return new Q(s)}ensureCapacity(A){const{width:e,height:g,depth:I,maxSplats:s}=NA(A);(!this.target||s>this.capacity)&&(this.dispose(),this.capacity=s,this.target=new a.WebGLArrayRenderTarget(e,g,I,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,magFilter:a.NearestFilter,minFilter:a.NearestFilter}),this.target.texture.format=a.RGBAFormat,this.target.texture.type=a.UnsignedByteType,this.target.texture.internalFormat="RGBA8",this.target.scissorTest=!0)}prepareProgramMaterial(A){let e=kA.readbackProgram.get(A);if(!e){const I=GA({index:"int"},{rgba8:"vec4"},({index:s})=>(A.inputs.index=s,{rgba8:new We({rgba8:A.outputs.rgba8})}));kA.programTemplate||(kA.programTemplate=new $e(to)),e=new Pe({graph:I,inputs:{index:"index"},outputs:{rgba8:"target"},template:kA.programTemplate}),Object.assign(e.uniforms,{targetLayer:{value:0},targetBase:{value:0},targetCount:{value:0}}),kA.readbackProgram.set(A,e)}const g=e.prepareMaterial();return kA.fullScreenQuad.material=g,{program:e,material:g}}saveRenderState(A){return{xrEnabled:A.xr.enabled,autoClear:A.autoClear}}resetRenderState(A,e){A.setRenderTarget(null),A.xr.enabled=e.xrEnabled,A.autoClear=e.autoClear}process({count:A,material:e}){const g=this.renderer;if(!g)throw new Error("No renderer");if(!this.target)throw new Error("No target");const I=O*It;e.uniforms.targetBase.value=0,e.uniforms.targetCount.value=A;let s=0;for(;s<A;){const Q=Math.floor(s/I),B=Q*I,i=Math.min(It,Math.ceil((A-B)/O));e.uniforms.targetLayer.value=Q,this.target.scissor.set(0,0,O,i),g.setRenderTarget(this.target,Q),g.xr.enabled=!1,g.autoClear=!1,kA.fullScreenQuad.render(g),s+=O*i}this.count=A}async read({readback:A}){const e=this.renderer;if(!e)throw new Error("No renderer");if(!this.target)throw new Error("No target");const g=Math.ceil(this.count/O)*O;if(A.byteLength<g*4)throw new Error(`Readback buffer too small: ${A.byteLength} < ${g*4}`);const I=new Uint8Array(A instanceof ArrayBuffer?A:A.buffer),s=O*It;let Q=0;const B=[];for(;Q<this.count;){const i=Math.floor(Q/s),C=i*s,E=Math.min(It,Math.ceil((this.count-C)/O));e.setRenderTarget(this.target,i);const n=O*E*4,o=I.subarray(C*4,C*4+n),r=e==null?void 0:e.readRenderTargetPixelsAsync(this.target,0,0,O,E,o);B.push(r),Q+=O*E}return Promise.all(B).then(()=>A)}render({reader:A,count:e,renderer:g}){if(this.renderer=g||this.renderer,!this.renderer)throw new Error("No renderer");this.ensureCapacity(e);const{program:I,material:s}=this.prepareProgramMaterial(A);I.update();const Q=this.saveRenderState(this.renderer);this.process({count:e,material:s}),this.resetRenderState(this.renderer,Q)}async readback({readback:A}){if(!this.renderer)throw new Error("No renderer");const e=this.saveRenderState(this.renderer),g=this.read({readback:A});return this.resetRenderState(this.renderer,e),g}async renderReadback({reader:A,count:e,renderer:g,readback:I}){if(this.renderer=g||this.renderer,!this.renderer)throw new Error("No renderer");this.ensureCapacity(e);const{program:s,material:Q}=this.prepareProgramMaterial(A);s.update();const B=this.saveRenderState(this.renderer);this.process({count:e,material:Q});const i=this.read({readback:I});return this.resetRenderState(this.renderer,B),i}getTexture(){var A;return(A=this.target)==null?void 0:A.texture}};kA.programTemplate=null,kA.readbackProgram=new Map,kA.fullScreenQuad=new ug(new a.RawShaderMaterial({visible:!1}));let Zt=kA;const EA=class EA{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:vB,globals:()=>[HB],value:{texture:EA.getEmpty(),count:0},update:e=>{var g;return e.texture=((g=this.readback)==null?void 0:g.getTexture())??this.source??EA.getEmpty(),e.count=this.count,e}}),A.array?(this.array=A.array,this.capacity=Math.floor(this.array.length/4),this.capacity=Math.floor(this.capacity/O)*O,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 e;if(!this.array||A>(((e=this.array)==null?void 0:e.length)??0)/4){this.capacity=NA(A).maxSplats;const g=new Uint8Array(this.capacity*4);this.array&&g.set(this.array),this.array=g}return this.array}getTexture(){var e;let A=(e=this.readback)==null?void 0:e.getTexture();return(this.source||this.array)&&(A=this.maybeUpdateSource()),A??EA.getEmpty()}maybeUpdateSource(){if(!this.array)throw new Error("No array");if(this.needsUpdate||!this.source){if(this.needsUpdate=!1,this.source){const{width:A,height:e,depth:g}=this.source.image;this.capacity!==A*e*g&&(this.s Line truncated
struct RgbaArray {
sampler2DArray texture;
int count;
};
`);function eo(t,A){return new j({inTypes:{rgba:vi,index:"int"},outTypes:{rgba:"vec4"},inputs:{rgba:t,index:A},globals:()=>[bi],statements:({inputs:g,outputs:I})=>YA(`
`);function eo(t,A){return new Z({inTypes:{rgba:vB,index:"int"},outTypes:{rgba:"vec4"},inputs:{rgba:t,index:A},globals:()=>[HB],statements:({inputs:g,outputs:I})=>LA(`
if ((index >= 0) && (index < ${g.rgba}.count)) {
${I.rgba} = texelFetch(${g.rgba}.texture, splatTexCoord(index), 0);
} else {
${I.rgba} = vec4(0.0, 0.0, 0.0, 0.0);
}
`)}).outputs.rgba}var Ti=(t=>(t.ALL="all",t.PLANE="plane",t.SPHERE="sphere",t.BOX="box",t.ELLIPSOID="ellipsoid",t.CYLINDER="cylinder",t.CAPSULE="capsule",t.INFINITE_CONE="infinite_cone",t))(Ti||{});function go(t){switch(t){case"all":return 0;case"plane":return 1;case"sphere":return 2;case"box":return 3;case"ellipsoid":return 4;case"cylinder":return 5;case"capsule":return 6;case"infinite_cone":return 7;default:throw new Error(`Unknown SDF type: ${t}`)}}var Hi=(t=>(t.MULTIPLY="multiply",t.SET_RGB="set_rgb",t.ADD_RGBA="add_rgba",t))(Hi||{});function Io(t){switch(t){case"multiply":return 0;case"set_rgb":return 1;case"add_rgba":return 2;default:throw new Error(`Unknown blend mode: ${t}`)}}class Ki extends a.Object3D{constructor(A={}){super();const{type:e,invert:g,opacity:I,color:s,displace:B,radius:i}=A;this.type=e??"sphere",this.invert=g??!1,this.opacity=I??1,this.color=s??new a.Color(1,1,1),this.displace=B??new a.Vector3(0,0,0),this.radius=i??0}}const De=class De extends a.Object3D{constructor(A={}){const{name:e,rgbaBlendMode:g="multiply",sdfSmooth:I=0,softEdge:s=0,invert:B=!1,sdfs:i=null}=A;super(),this.rgbaBlendMode=g,this.sdfSmooth=I,this.softEdge=s,this.invert=B,this.sdfs=i,this.ordering=De.nextOrdering++,this.name=e??`Edit ${this.ordering}`}addSdf(A){this.sdfs==null&&(this.sdfs=[]),this.sdfs.includes(A)||this.sdfs.push(A)}removeSdf(A){this.sdfs!=null&&(this.sdfs=this.sdfs.filter(e=>e!==A))}};De.nextOrdering=1;let Zt=De;class qi{constructor({maxSdfs:A,maxEdits:e}){this.maxSdfs=Math.max(16,A??0),this.numSdfs=0,this.sdfData=new Uint32Array(this.maxSdfs*8*4),this.sdfFloatData=new Float32Array(this.sdfData.buffer),this.sdfTexture=this.newSdfTexture(this.sdfData,this.maxSdfs),this.dynoSdfArray=new x({key:"sdfArray",type:zi,globals:()=>[Vi],value:{numSdfs:0,sdfTexture:this.sdfTexture},update:g=>(g.numSdfs=this.numSdfs,g.sdfTexture=this.sdfTexture,g)}),this.maxEdits=Math.max(16,e??0),this.numEdits=0,this.editData=new Uint32Array(this.maxEdits*4),this.editFloatData=new Float32Array(this.editData.buffer),this.dynoNumEdits=new Vt({value:0}),this.dynoEdits=this.newEdits(this.editData,this.maxEdits)}newSdfTexture(A,e){const g=new a.DataTexture(A,8,e,a.RGBAIntegerFormat,a.UnsignedIntType);return g.internalFormat="RGBA32UI",g.needsUpdate=!0,g}newEdits(A,e){return new x({key:"edits",type:"uvec4",count:e,globals:()=>[ji],value:A})}ensureCapacity({maxSdfs:A,maxEdits:e}){let g=!1;return A>this.sdfTexture.image.height&&(this.sdfTexture.dispose(),this.maxSdfs=Math.max(this.maxSdfs*2,A),this.sdfData=new Uint32Array(this.maxSdfs*8*4),this.sdfFloatData=new Float32Array(this.sdfData.buffer),this.sdfTexture=this.newSdfTexture(this.sdfData,this.maxSdfs)),e>(this.dynoEdits.count??0)&&(this.maxEdits=Math.max(this.maxEdits*2,e),this.editData=new Uint32Array(this.maxEdits*4),this.editFloatData=new Float32Array(this.editData.buffer),this.dynoEdits=this.newEdits(this.editData,this.maxEdits),g=!0),g}updateEditData(A,e){const g=this.editData[A]!==e;return this.editData[A]=e,g}updateEditFloatData(A,e){Dt[0]=e;const g=this.editFloatData[A]!==Dt[0];return g&&(this.editFloatData[A]=Dt[0]),g}encodeEdit(A,{sdfFirst:e,sdfCount:g,invert:I,rgbaBlendMode:s,softEdge:B,sdfSmooth:i}){const Q=A*4;let C=!1;return C=this.updateEditData(Q+0,s|(I?256:0))||C,C=this.updateEditData(Q+1,e|g<<16)||C,C=this.updateEditFloatData(Q+2,B)||C,C=this.updateEditFloatData(Q+3,i)||C,C}updateSdfData(A,e){const g=this.sdfData[A]!==e;return this.sdfData[A]=e,g}updateSdfFloatData(A,e){Dt[0]=e;const g=this.sdfFloatData[A]!==Dt[0];return g&&(this.sdfFloatData[A]=Dt[0]),g}encodeSdf(A,{sdfType:e,invert:g,center:I,quaternion:s,scale:B,sizes:i},Q){const C=A*32,E=e|(g?256:0);let n=!1;n=this.updateSdfFloatData(C+0,(I==null?void 0:I.x)??0)||n,n=this.updateSdfFloatData(C+1,(I==null?void 0:I.y)??0)||n,n=this.updateSdfFloatData(C+2,(I==null?void 0:I.z)??0)||n,n=this.updateSdfData(C+3,E)||n,n=this.updateSdfFloatData(C+4,(s==null?void 0:s.x)??0)||n,n=this.updateSdfFloatData(C+5,(s==null?void 0:s.y)??0)||n,n=this.updateSdfFloatData(C+6,(s==null?void 0:s.z)??0)||n,n=this.updateSdfFloatData(C+7,(s==null?void 0:s.w)??0)||n,n=this.updateSdfFloatData(C+8,(B==null?void 0:B.x)??0)||n,n=this.updateSdfFloatData(C+9,(B==null?void 0:B.y)??0)||n,n=this.updateSdfFloatData(C+10,(B==null?void 0:B.z)??0)||n,n=this.updateSdfData(C+11,0)||n,n=this.updateSdfFloatData(C+12,(i==null?void 0:i.x)??0)||n,n=this.updateSdfFloatData(C+13,(i==null?void 0:i.y)??0)||n,n=this.updateSdfFloatData(C+14,(i==null?void 0:i.z)??0)||n,n=this.updateSdfFloatData(C+15,(i==null?void 0:i.w)??0)||n;const o=Math.min(4,Q.length);for(let r=0;r<o;++r){const l=C+16+r*4;n=this.updateSdfFloatData(l+0,Q[r].x)||n,n=this.updateSdfFloatData(l+1,Q[r].y)||n,n=this.updateSdfFloatData(l+2,Q[r].z)||n,n=this.updateSdfFloatData(l+3,Q[r].w)||n}return n}update(A){const e=A.reduce((n,{sdfs:o})=>n+o.length,0),g=this.ensureCapacity({maxEdits:A.length,maxSdfs:e}),I=[new a.Vector4,new a.Vector4],s=new a.Vector3,B=new a.Quaternion,i=new a.Vector3,Q=new a Line truncated
`)}).outputs.rgba}var TB=(t=>(t.ALL="all",t.PLANE="plane",t.SPHERE="sphere",t.BOX="box",t.ELLIPSOID="ellipsoid",t.CYLINDER="cylinder",t.CAPSULE="capsule",t.INFINITE_CONE="infinite_cone",t))(TB||{});function go(t){switch(t){case"all":return 0;case"plane":return 1;case"sphere":return 2;case"box":return 3;case"ellipsoid":return 4;case"cylinder":return 5;case"capsule":return 6;case"infinite_cone":return 7;default:throw new Error(`Unknown SDF type: ${t}`)}}var KB=(t=>(t.MULTIPLY="multiply",t.SET_RGB="set_rgb",t.ADD_RGBA="add_rgba",t))(KB||{});function Io(t){switch(t){case"multiply":return 0;case"set_rgb":return 1;case"add_rgba":return 2;default:throw new Error(`Unknown blend mode: ${t}`)}}class qB extends a.Object3D{constructor(A={}){super();const{type:e,invert:g,opacity:I,color:s,displace:Q,radius:B}=A;this.type=e??"sphere",this.invert=g??!1,this.opacity=I??1,this.color=s??new a.Color(1,1,1),this.displace=Q??new a.Vector3(0,0,0),this.radius=B??0}}const ye=class ye extends a.Object3D{constructor(A={}){const{name:e,rgbaBlendMode:g="multiply",sdfSmooth:I=0,softEdge:s=0,invert:Q=!1,sdfs:B=null}=A;super(),this.rgbaBlendMode=g,this.sdfSmooth=I,this.softEdge=s,this.invert=Q,this.sdfs=B,this.ordering=ye.nextOrdering++,this.name=e??`Edit ${this.ordering}`}addSdf(A){this.sdfs==null&&(this.sdfs=[]),this.sdfs.includes(A)||this.sdfs.push(A)}removeSdf(A){this.sdfs!=null&&(this.sdfs=this.sdfs.filter(e=>e!==A))}};ye.nextOrdering=1;let jt=ye;class zB{constructor({maxSdfs:A,maxEdits:e}){this.maxSdfs=Math.max(16,A??0),this.numSdfs=0,this.sdfData=new Uint32Array(this.maxSdfs*8*4),this.sdfFloatData=new Float32Array(this.sdfData.buffer),this.sdfTexture=this.newSdfTexture(this.sdfData,this.maxSdfs),this.dynoSdfArray=new k({key:"sdfArray",type:VB,globals:()=>[ZB],value:{numSdfs:0,sdfTexture:this.sdfTexture},update:g=>(g.numSdfs=this.numSdfs,g.sdfTexture=this.sdfTexture,g)}),this.maxEdits=Math.max(16,e??0),this.numEdits=0,this.editData=new Uint32Array(this.maxEdits*4),this.editFloatData=new Float32Array(this.editData.buffer),this.dynoNumEdits=new Vt({value:0}),this.dynoEdits=this.newEdits(this.editData,this.maxEdits)}newSdfTexture(A,e){const g=new a.DataTexture(A,8,e,a.RGBAIntegerFormat,a.UnsignedIntType);return g.internalFormat="RGBA32UI",g.needsUpdate=!0,g}newEdits(A,e){return new k({key:"edits",type:"uvec4",count:e,globals:()=>[jB],value:A})}ensureCapacity({maxSdfs:A,maxEdits:e}){let g=!1;return A>this.sdfTexture.image.height&&(this.sdfTexture.dispose(),this.maxSdfs=Math.max(this.maxSdfs*2,A),this.sdfData=new Uint32Array(this.maxSdfs*8*4),this.sdfFloatData=new Float32Array(this.sdfData.buffer),this.sdfTexture=this.newSdfTexture(this.sdfData,this.maxSdfs)),e>(this.dynoEdits.count??0)&&(this.maxEdits=Math.max(this.maxEdits*2,e),this.editData=new Uint32Array(this.maxEdits*4),this.editFloatData=new Float32Array(this.editData.buffer),this.dynoEdits=this.newEdits(this.editData,this.maxEdits),g=!0),g}updateEditData(A,e){const g=this.editData[A]!==e;return this.editData[A]=e,g}updateEditFloatData(A,e){yt[0]=e;const g=this.editFloatData[A]!==yt[0];return g&&(this.editFloatData[A]=yt[0]),g}encodeEdit(A,{sdfFirst:e,sdfCount:g,invert:I,rgbaBlendMode:s,softEdge:Q,sdfSmooth:B}){const i=A*4;let C=!1;return C=this.updateEditData(i+0,s|(I?256:0))||C,C=this.updateEditData(i+1,e|g<<16)||C,C=this.updateEditFloatData(i+2,Q)||C,C=this.updateEditFloatData(i+3,B)||C,C}updateSdfData(A,e){const g=this.sdfData[A]!==e;return this.sdfData[A]=e,g}updateSdfFloatData(A,e){yt[0]=e;const g=this.sdfFloatData[A]!==yt[0];return g&&(this.sdfFloatData[A]=yt[0]),g}encodeSdf(A,{sdfType:e,invert:g,center:I,quaternion:s,scale:Q,sizes:B},i){const C=A*32,E=e|(g?256:0);let n=!1;n=this.updateSdfFloatData(C+0,(I==null?void 0:I.x)??0)||n,n=this.updateSdfFloatData(C+1,(I==null?void 0:I.y)??0)||n,n=this.updateSdfFloatData(C+2,(I==null?void 0:I.z)??0)||n,n=this.updateSdfData(C+3,E)||n,n=this.updateSdfFloatData(C+4,(s==null?void 0:s.x)??0)||n,n=this.updateSdfFloatData(C+5,(s==null?void 0:s.y)??0)||n,n=this.updateSdfFloatData(C+6,(s==null?void 0:s.z)??0)||n,n=this.updateSdfFloatData(C+7,(s==null?void 0:s.w)??0)||n,n=this.updateSdfFloatData(C+8,(Q==null?void 0:Q.x)??0)||n,n=this.updateSdfFloatData(C+9,(Q==null?void 0:Q.y)??0)||n,n=this.updateSdfFloatData(C+10,(Q==null?void 0:Q.z)??0)||n,n=this.updateSdfData(C+11,0)||n,n=this.updateSdfFloatData(C+12,(B==null?void 0:B.x)??0)||n,n=this.updateSdfFloatData(C+13,(B==null?void 0:B.y)??0)||n,n=this.updateSdfFloatData(C+14,(B==null?void 0:B.z)??0)||n,n=this.updateSdfFloatData(C+15,(B==null?void 0:B.w)??0)||n;const o=Math.min(4,i.length);for(let r=0;r<o;++r){const l=C+16+r*4;n=this.updateSdfFloatData(l+0,i[r].x)||n,n=this.updateSdfFloatData(l+1,i[r].y)||n,n=this.updateSdfFloatData(l+2,i[r].z)||n,n=this.updateSdfFloatData(l+3,i[r].w)||n}return n}update(A){const e=A.reduce((n,{sdfs:o})=>n+o.length,0),g=this.ensureCapacity({maxEdits:A.length,maxSdfs:e}),I=[new a.Vector4,new a.Vector4],s=new a.Vector3,Q=new a.Quaternion,B=new a.Vector3,i=new a Line truncated
struct SdfArray {
int numSdfs;
usampler2D sdfTexture;
@@ -307,7 +307,7 @@ void main() {
return (softEdge == 0.0) ? ((distance < 0.0) ? 1.0 : 0.0)
: clamp(-distance / softEdge + 0.5, 0.0, 1.0);
}
`),ji=rA(`
`),jB=rA(`
const uint EDIT_FLAG_BLEND = 0xFFu;
const uint EDIT_BLEND_MULTIPLY = 0u;
const uint EDIT_BLEND_SET_RGB = 1u;
@@ -365,17 +365,17 @@ void main() {
decodeEdit(packedEdit, sdfFirst, sdfCount, invert, rgbaBlendMode, softEdge, sdfSmooth);
applyRgbaDisplaceEdit(sdfTexture, numSdfs, sdfFirst, sdfCount, pos, sdfSmooth, softEdge, invert, rgbaBlendMode, rgba);
}
`);function so(t,A,e,g){return new j({inTypes:{gsplat:W,sdfArray:zi,numEdits:"int",rgbaDisplaceEdits:"uvec4"},outTypes:{gsplat:W},globals:()=>[Vi,ji],inputs:{gsplat:t,sdfArray:A,numEdits:e,rgbaDisplaceEdits:g},statements:({inputs:s,outputs:B})=>{const{sdfArray:i,numEdits:Q,rgbaDisplaceEdits:C}=s,{gsplat:E}=B;return YA(`
`);function so(t,A,e,g){return new Z({inTypes:{gsplat:P,sdfArray:VB,numEdits:"int",rgbaDisplaceEdits:"uvec4"},outTypes:{gsplat:P},globals:()=>[ZB,jB],inputs:{gsplat:t,sdfArray:A,numEdits:e,rgbaDisplaceEdits:g},statements:({inputs:s,outputs:Q})=>{const{sdfArray:B,numEdits:i,rgbaDisplaceEdits:C}=s,{gsplat:E}=Q;return LA(`
${E} = ${s.gsplat};
if (isGsplatActive(${E}.flags)) {
for (int editIndex = 0; editIndex < ${Q}; ++editIndex) {
for (int editIndex = 0; editIndex < ${i}; ++editIndex) {
applyPackedRgbaDisplaceEdit(
${C}[editIndex], ${i}.sdfTexture, ${i}.numSdfs,
${C}[editIndex], ${B}.sdfTexture, ${B}.numSdfs,
${E}.center, ${E}.rgba
);
}
}
`)}}).outputs.gsplat}const Dt=new Float32Array(1);class Zi{constructor(A){this.modifier=A,this.cache=new Map}apply(A){let e=this.cache.get(A);return e||(e=kA({index:"int"},{gsplat:W},({index:g})=>{const{gsplat:I}=A.apply({index:g});return this.modifier.apply({gsplat:I})}),this.cache.set(A,e)),e}}class ot{constructor(){this.scale=new ct({value:Number.NEGATIVE_INFINITY}),this.rotate=new ee({value:new a.Quaternion(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}),this.translate=new Ft({value:new a.Vector3(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)})}apply(A){return oi(A,{scale:this.scale,rotate:this.rotate,translate:this.translate})}applyDir(A){return ri(A,{rotate:this.rotate})}applyGsplat(A){return Ze(A,{scale:this.scale,rotate:this.rotate,translate:this.translate})}updateFromMatrix(A){const e=new a.Vector3,g=new a.Quaternion,I=new a.Vector3;A.decompose(I,g,e);const s=(e.x+e.y+e.z)/3;let B=!1;return s!==this.scale.value&&(this.scale.value=s,B=!0),I.equals(this.translate.value)||(this.translate.value.copy(I),B=!0),g.equals(this.rotate.value)||(this.rotate.value.copy(g),B=!0),B}update(A){return A.updateMatrixWorld(),this.updateFromMatrix(A.matrixWorld)}}class kt extends a.Object3D{constructor({numSplats:A,generator:e,construct:g,update:I}){if(super(),this.numSplats=A??0,this.generator=e,this.frameUpdate=I,this.version=0,g){const s=g(this);Object.assign(this,s)}}updateVersion(){this.version+=1}set needsUpdate(A){A&&this.updateVersion()}}const et=class et extends kt{constructor(A={}){const e=new ot,g=new ot,I=new ot,s=new ot,B=new ee({value:new a.Vector4(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY)}),i=new ct({value:0}),Q=new ct({value:0}),C={transform:e,viewToWorld:g,worldToView:I,viewToObject:s,recolor:B,time:i,deltaTime:Q};if(super({update:({time:E,deltaTime:n,viewToWorld:o,globalEdits:r})=>this.update({time:E,deltaTime:n,viewToWorld:o,globalEdits:r})}),this.isInitialized=!1,this.recolor=new a.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 bA,this.numSplats=this.packedSplats.numSplats,this.editable=A.editable??!0,this.onFrame=A.onFrame,this.context=C,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 E=A.onLoad(this);E instanceof Promise&&await E}return this});else if(this.isInitialized=!0,this.initialized=Promise.resolve(this),A.onLoad){const E=A.onLoad(this);E instanceof Promise&&(this.initialized=E.then(()=>this))}}async asyncInitialize(A){const{url:e,fileBytes:g,fileType:I,fileName:s,maxSplats:B,constructSplats:i}=A;if(e||g||i){const Q={url:e,fileBytes:g,fileType:I,fileName:s,maxSplats:B,construct:i};this.packedSplats.reinitialize(Q)}this.packedSplats&&(await this.packedSplats.initialized,this.numSplats=this.packedSplats.numSplats,this.updateGenerator())}static async staticInitialize(){await Ng(),et.isStaticInitialized=!0}pushSplat(A,e,g,I,s){this.packedSplats.pushSplat(A,e,g,I,s)}forEachSplat(A){this.packedSplats.forEachSplat(A)}dispose(){this.packedSplats.dispose()}constructGenerator(A){const{transform:e,viewToObject:g,recolor:I}=A,s=kA({index:"int"},{gsplat:W},({index:B})=>{if(!B)throw new Error("index is undefined");let i=zt(this.packedSplats.dyno,B);if(this.maxSh>=1){const{sh1Texture:C,sh2Texture:E,sh3Texture:n}=this.ensureShTextures();if(C){const o=g.translate,{center:r}=rt(i).outputs,l=kB(Gt(r,o));let c=no(i,C,l);this.maxSh>=2&&E&&(c=dA(c,Co(i,E,l))),this.maxSh>=3&&n&&(c=dA(c,Eo(i,n,l)));let{rgba:h}=rt(i).outputs;h=dA(h,xB(c,K("float",0))),i=Bt({gsplat:i,rgba:h})}}if(this.splatRgba){const C=eo(this.splatRgba.dyno,B);i=Bt({gsplat:i,rgba:C})}this.skinning&&(i=this.skinning.modify(i)),this.objectModifier&&(i=this.objectModifier.apply({gsplat:i}).gsplat),i=e.applyGsplat(i);const Q=aA(I,rt(i).outputs.rgba);return i=Bt({gsplat:i,rgba:Q}),this.rgbaDisplaceEdits&&(i=this.rgbaDisplaceEdits.modify(i)),this.worldModifier&&(i=this.worldModifier.apply({gsplat:i}).gsplat),{gsplat:i}});this.generator=s}updateGenerator(){this.constructGenerator(this.context)}update({time:A,viewToWorld:e,deltaTime:g,globalEdits:I}){var h;this.numSplats=this.packedSplats.numSplats,this.context.time.value=A,this.context.deltaTime.value=g,et.dynoTime.value=A;const{transform:s,viewToObject:B,recolor:i}=this.context;let Q=s.update(this);this.context.viewToWorld.updateFromMatrix(e)&&this.enableViewToWorld&&(Q=!0);const C=e.clone().invert();this.context.worldToView.updateFromMatrix(C)&&this.enableWorldToView&&(Q=!0);const o=new a.Matrix4().compose(s.translate Line truncated
`)}}).outputs.gsplat}const yt=new Float32Array(1);class XB{constructor(A){this.modifier=A,this.cache=new Map}apply(A){let e=this.cache.get(A);return e||(e=GA({index:"int"},{gsplat:P},({index:g})=>{const{gsplat:I}=A.apply({index:g});return this.modifier.apply({gsplat:I})}),this.cache.set(A,e)),e}}class ot{constructor(){this.scale=new ct({value:Number.NEGATIVE_INFINITY}),this.rotate=new ee({value:new a.Quaternion(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}),this.translate=new Gt({value:new a.Vector3(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)})}apply(A){return rB(A,{scale:this.scale,rotate:this.rotate,translate:this.translate})}applyDir(A){return cB(A,{rotate:this.rotate})}applyGsplat(A){return _e(A,{scale:this.scale,rotate:this.rotate,translate:this.translate})}updateFromMatrix(A){const e=new a.Vector3,g=new a.Quaternion,I=new a.Vector3;A.decompose(I,g,e);const s=(e.x+e.y+e.z)/3;let Q=!1;return s!==this.scale.value&&(this.scale.value=s,Q=!0),I.equals(this.translate.value)||(this.translate.value.copy(I),Q=!0),g.equals(this.rotate.value)||(this.rotate.value.copy(g),Q=!0),Q}update(A){return A.updateMatrixWorld(),this.updateFromMatrix(A.matrixWorld)}}class kt extends a.Object3D{constructor({numSplats:A,generator:e,construct:g,update:I}){if(super(),this.numSplats=A??0,this.generator=e,this.frameUpdate=I,this.version=0,g){const s=g(this);Object.assign(this,s)}}updateVersion(){this.version+=1}set needsUpdate(A){A&&this.updateVersion()}}const et=class et extends kt{constructor(A={}){const e=new ot,g=new ot,I=new ot,s=new ot,Q=new ee({value:new a.Vector4(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY)}),B=new ct({value:0}),i=new ct({value:0}),C={transform:e,viewToWorld:g,worldToView:I,viewToObject:s,recolor:Q,time:B,deltaTime:i};if(super({update:({time:E,deltaTime:n,viewToWorld:o,globalEdits:r})=>this.update({time:E,deltaTime:n,viewToWorld:o,globalEdits:r})}),this.isInitialized=!1,this.recolor=new a.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 vA,this.numSplats=this.packedSplats.numSplats,this.editable=A.editable??!0,this.onFrame=A.onFrame,this.context=C,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 E=A.onLoad(this);E instanceof Promise&&await E}return this});else if(this.isInitialized=!0,this.initialized=Promise.resolve(this),A.onLoad){const E=A.onLoad(this);E instanceof Promise&&(this.initialized=E.then(()=>this))}}async asyncInitialize(A){const{url:e,fileBytes:g,fileType:I,fileName:s,maxSplats:Q,constructSplats:B}=A;if(e||g||B){const i={url:e,fileBytes:g,fileType:I,fileName:s,maxSplats:Q,construct:B};this.packedSplats.reinitialize(i)}this.packedSplats&&(await this.packedSplats.initialized,this.numSplats=this.packedSplats.numSplats,this.updateGenerator())}static async staticInitialize(){await Fg(),et.isStaticInitialized=!0}pushSplat(A,e,g,I,s){this.packedSplats.pushSplat(A,e,g,I,s)}forEachSplat(A){this.packedSplats.forEachSplat(A)}dispose(){this.packedSplats.dispose()}constructGenerator(A){const{transform:e,viewToObject:g,recolor:I}=A,s=GA({index:"int"},{gsplat:P},({index:Q})=>{if(!Q)throw new Error("index is undefined");let B=St(this.packedSplats.dyno,Q);if(this.maxSh>=1){const{sh1Texture:C,sh2Texture:E,sh3Texture:n}=this.ensureShTextures();if(C){const o=g.translate,{center:r}=rt(B).outputs,l=kQ(xt(r,o));let c=no(B,C,l);this.maxSh>=2&&E&&(c=fA(c,Co(B,E,l))),this.maxSh>=3&&n&&(c=fA(c,Eo(B,n,l)));let{rgba:h}=rt(B).outputs;h=fA(h,RQ(c,K("float",0))),B=Qt({gsplat:B,rgba:h})}}if(this.splatRgba){const C=eo(this.splatRgba.dyno,Q);B=Qt({gsplat:B,rgba:C})}this.skinning&&(B=this.skinning.modify(B)),this.objectModifier&&(B=this.objectModifier.apply({gsplat:B}).gsplat),B=e.applyGsplat(B);const i=aA(I,rt(B).outputs.rgba);return B=Qt({gsplat:B,rgba:i}),this.rgbaDisplaceEdits&&(B=this.rgbaDisplaceEdits.modify(B)),this.worldModifier&&(B=this.worldModifier.apply({gsplat:B}).gsplat),{gsplat:B}});this.generator=s}updateGenerator(){this.constructGenerator(this.context)}update({time:A,viewToWorld:e,deltaTime:g,globalEdits:I}){var h;this.numSplats=this.packedSplats.numSplats,this.context.time.value=A,this.context.deltaTime.value=g,et.dynoTime.value=A;const{transform:s,viewToObject:Q,recolor:B}=this.context;let i=s.update(this);this.context.viewToWorld.updateFromMatrix(e)&&this.enableViewToWorld&&(i=!0);const C=e.clone().invert();this.context.worldToView.updateFromMatrix(C)&&this.enableWorldToView&&(i=!0);const o=new a.Matrix4().compose(s.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;
@@ -399,7 +399,7 @@ void main() {
+ sh1_1 * (0.4886025 * viewDir.z)
+ sh1_2 * (-0.4886025 * viewDir.x);
}
`),io=rA(`
`),Bo=rA(`
vec3 evaluateSH2(Gsplat gsplat, usampler2DArray sh2, vec3 viewDir) {
// Extract sint8 values packed into 4 x uint32
uvec4 packed = texelFetch(sh2, splatTexCoord(gsplat.index), 0);
@@ -435,7 +435,7 @@ void main() {
+ sh2_3 * (-1.0925484 * viewDir.x * viewDir.z)
+ sh2_4 * (0.5462742 * (viewDir.x * viewDir.x - viewDir.y * viewDir.y));
}
`),Qo=rA(`
`),io=rA(`
vec3 evaluateSH3(Gsplat gsplat, usampler2DArray sh3, vec3 viewDir) {
// Extract sint6 values packed into 4 x uint32
uvec4 packed = texelFetch(sh3, splatTexCoord(gsplat.index), 0);
@@ -490,27 +490,27 @@ void main() {
+ sh3_5 * (1.4453057 * viewDir.z * (xx - yy))
+ sh3_6 * (-0.5900436 * viewDir.x * (xx - 3.0 * yy));
}
`);function no(t,A,e){return Ae({inTypes:{gsplat:W,sh1:"usampler2DArray",viewDir:"vec3"},outTypes:{rgb:"vec3"},inputs:{gsplat:t,sh1:A,viewDir:e},globals:()=>[GA,Bo],statements:({inputs:g,outputs:I})=>YA(`
`);function no(t,A,e){return Ae({inTypes:{gsplat:P,sh1:"usampler2DArray",viewDir:"vec3"},outTypes:{rgb:"vec3"},inputs:{gsplat:t,sh1:A,viewDir:e},globals:()=>[xA,Qo],statements:({inputs:g,outputs:I})=>LA(`
if (isGsplatActive(${g.gsplat}.flags)) {
${I.rgb} = evaluateSH1(${g.gsplat}, ${g.sh1}, ${g.viewDir});
} else {
${I.rgb} = vec3(0.0);
}
`)}).outputs.rgb}function Co(t,A,e){return Ae({inTypes:{gsplat:W,sh2:"usampler2DArray",viewDir:"vec3"},outTypes:{rgb:"vec3"},inputs:{gsplat:t,sh2:A,viewDir:e},globals:()=>[GA,io],statements:({inputs:g,outputs:I})=>YA(`
`)}).outputs.rgb}function Co(t,A,e){return Ae({inTypes:{gsplat:P,sh2:"usampler2DArray",viewDir:"vec3"},outTypes:{rgb:"vec3"},inputs:{gsplat:t,sh2:A,viewDir:e},globals:()=>[xA,Bo],statements:({inputs:g,outputs:I})=>LA(`
if (isGsplatActive(${g.gsplat}.flags)) {
${I.rgb} = evaluateSH2(${g.gsplat}, ${g.sh2}, ${g.viewDir});
} else {
${I.rgb} = vec3(0.0);
}
`)}).outputs.rgb}function Eo(t,A,e){return Ae({inTypes:{gsplat:W,sh3:"usampler2DArray",viewDir:"vec3"},outTypes:{rgb:"vec3"},inputs:{gsplat:t,sh3:A,viewDir:e},globals:()=>[GA,Qo],statements:({inputs:g,outputs:I})=>YA(`
`)}).outputs.rgb}function Eo(t,A,e){return Ae({inTypes:{gsplat:P,sh3:"usampler2DArray",viewDir:"vec3"},outTypes:{rgb:"vec3"},inputs:{gsplat:t,sh3:A,viewDir:e},globals:()=>[xA,io],statements:({inputs:g,outputs:I})=>LA(`
if (isGsplatActive(${g.gsplat}.flags)) {
${I.rgb} = evaluateSH3(${g.gsplat}, ${g.sh3}, ${g.viewDir});
} else {
${I.rgb} = vec3(0.0);
}
`)}).outputs.rgb}const dt=class dt{constructor({fileBytes:A}){this.header="",this.littleEndian=!0,this.elements={},this.comments=[],this.data=null,this.numSplats=0,this.fileBytes=A instanceof ArrayBuffer?new Uint8Array(A):A}async parseHeader(){const e=new ReadableStream({start:B=>{B.enqueue(this.fileBytes.slice(0,65536)),B.close()}}).pipeThrough(new TextDecoderStream).getReader();this.header="";const g=`end_header
`;for(;;){const{value:B,done:i}=await e.read();if(i)throw new Error("Failed to read header");this.header+=B;const Q=this.header.indexOf(g);if(Q>=0){this.header=this.header.slice(0,Q+g.length);break}}const I=new TextEncoder().encode(this.header).length;this.data=new DataView(this.fileBytes.buffer,I),this.elements={};let s=null;this.comments=[],this.header.trim().split(`
`).forEach((B,i)=>{const Q=B.trim();if(i===0){if(Q!=="ply")throw new Error("Invalid PLY header");return}if(Q.length===0)return;const C=Q.split(" ");switch(C[0]){case"format":if(C[1]==="binary_little_endian")this.littleEndian=!0;else if(C[1]==="binary_big_endian")this.littleEndian=!1;else throw new Error(`Unsupported PLY format: ${C[1]}`);if(C[2]!=="1.0")throw new Error(`Unsupported PLY version: ${C[2]}`);break;case"end_header":break;case"comment":this.comments.push(Q.slice(8));break;case"element":{const E=C[1];s={name:E,count:Number.parseInt(C[2]),properties:{}},this.elements[E]=s;break}case"property":if(s==null)throw new Error("Property must be inside an element");C[1]==="list"?s.properties[C[4]]={isList:!0,type:C[3],countType:C[2]}:s.properties[C[2]]={isList:!1,type:C[1]};break}}),this.elements.vertex&&(this.numSplats=this.elements.vertex.count)}parseData(A){let e=0;const g=this.data;if(g==null)throw new Error("No data to parse");for(const I in this.elements){const s=this.elements[I],{count:B,properties:i}=s,Q={},C=[];for(const[n,o]of Object.entries(i))o.isList?(Q[n]=[],C.push(()=>{const r=Q[n];r.length=ie[o.countType](g,e,this.littleEndian),e+=yt[o.countType];for(let l=0;l<r.length;l++)r[l]=ie[o.type](g,e,this.littleEndian),e+=yt[o.type]})):(Q[n]=0,C.push(()=>{Q[n]=ie[o.type](g,e,this.littleEndian),e+=yt[o.type]}));const E=A(s)??(()=>{});for(let n=0;n<B;n++){for(const o of C)o();E(n,Q)}}}parseSplats(A,e){if(this.elements.vertex==null)throw new Error("No vertex element found");let g=!1;const I=[];let s=0,B=[],i=[],Q=[],C,E,n;function o(){const u=oo[s];B=new Array(3).fill(null).flatMap((D,w)=>[0,1,2].map((y,f)=>`f_rest_${w+f*u/3}`)),i=new Array(5).fill(null).flatMap((D,w)=>[0,1,2].map((y,f)=>`f_rest_${3+w+f*u/3}`)),Q=new Array(7).fill(null).flatMap((D,w)=>[0,1,2].map((y,f)=>`f_rest_${8+w+f*u/3}`)),C=s>=1?new Float32Array(3*3):void 0,E=s>=2?new Float32Array(5*3):void 0,n=s>=3?new Float32Array(7*3):void 0}function r(u,D){if(!C)throw new Error("Missing sh1");for(const[w,y]of B.entries())C[w]=D[y]*8/255-4;if(E)for(const[w,y]of i.entries())E[w]=D[y]*8/255-4;if(n)for(const[w,y]of Q.entries())n[w]=D[y]*8/255-4;e==null||e(u,C,E,n)}function l(u){const{min_x:D,min_y:w,min_z:y,max_x:f,max_y:S,max_z:M,min_scale_x:d,min_scale_y:p,min_scale_z:R,max_scale_x:N,max_scale_y:m,max_scale_z:Y}=u.properties;if(!D||!w||!y||!f||!S||!M||!d||!p||!R||!N||!m||!Y)throw new Error("Missing PLY chunk properties");return g=!0,(G,k)=>{const{min_x:U,min_y:J,min_z:AA,max_x:z,max_y:gA,max_z:tA,min_scale_x:_,min_scale_y:b,min_scale_z:X,max_scale_x:Z,max_scale_y:O,max_scale_z:L,min_r:DA,min_g:CA,min_b:yA,max_r:pA,max_g:mA,max_b:cA}=k;I.push({min_x:U,min_y:J,min_z:AA,max_x:z,max_y:gA,max_z:tA,min_scale_x:_,min_scale_y:b,min_scale_z:X,max_scale_x:Z,max_scale_y:O,max_scale_z:L,min_r:DA,min_g:CA,min_b:yA,max_r:pA,max_g:mA,max_b:cA})}}function c(u){if(e&&u.name==="sh")return s=Cg(u.properties),o(),r;if(u.name!=="vertex")return null;const{packed_position:D,packed_rotation:w,packed_scale:y,packed_color:f}=u.properties;if(!D||!w||!y||!f)throw new Error("Missing PLY properties: packed_position, packed_rotation, packed_scale, packed_color");const S=Math.sqrt(2);return(M,d)=>{const p=I[M>>>8];if(p==null)throw new Error("Missing PLY chunk");const{min_x:R,min_y:N,min_z:m,max_x:Y,max_y:G,max_z:k,min_scale_x:U,min_scale_y:J,min_scale_z:AA,max_scale_x:z,max_scale_y:gA,max_scale_z:tA,min_r:_,min_g:b,min_b:X,max_r:Z,max_g:O,max_b:L}=p,{packed_position:DA,packed_rotation:CA,packed_scale:yA,packed_color:pA}=d,mA=(DA>>>21&2047)/2047*(Y-R)+R,cA=(DA>>>11&1023)/1023*(G-N)+N,LA=(DA&2047)/2047*(k-m)+m,SA=((CA>>>20&1023)/1023-.5)*S,PA=((CA>>>10&1023)/1023-.5)*S,WA=((CA&1023)/1023-.5)*S,v=Math.sqrt(Math.max(0,1-SA*SA-PA*PA-WA*WA)),uA=CA>>>30,jA=uA===0?SA:uA===1?v:PA,Yt=uA<=1?PA:uA===2?v:WA,Ie=uA<=2?WA:v,NA=uA===0?v:SA,T=Math.exp((yA>>>21&2047)/2047*(z-U)+U),ZA=Math.exp((yA>>>11&1023)/1023*(gA-J)+J),Me=Math.exp((yA&2047)/2047*(tA-AA)+AA),me=(pA>>>24&255)/255*((Z??1)-(_??0))+(_??0),Se=(pA>>>16&255)/255*((O??1)-(b??0))+(b??0),Ne=(pA>>>8&255)/255*((L??1)-(X??0))+(X??0),Fe=(pA&255)/255;A(M,mA,cA,LA,T,ZA,Me,jA,Yt,Ie,NA,Fe,me,Se,Ne)}}const h=u=>{if(u.name==="chunk")return l(u);if(g)return c(u);if(u.name!=="vertex")return null;const{x:D,y:w,z:y,scale_0:f,scale_1:S,scale_2:M,rot_0:d,rot_1:p,rot_2:R,rot_3:N,opacity:m,f_dc_0:Y,f_dc_1:G,f_dc_2:k,red:U,green:J,blue:AA,alpha:z}=u.properties;if(!D||!w||!y)throw new Error("Missing PLY properties: x, y, z");const gA=f&&S&&M,tA=d&&p&&R&&N,_=z!=null?Qe[z.type]:1,b=U!=null?Qe[U.type]:1,X=J!=null?Qe[J.type]:1,Z=AA!=null?Qe[AA.type]:1;return s=Cg(u.properties),o(),(O,L)=>{const DA=gA?Math.exp(L.scale_0):dt.defaultPointScale,CA=gA?Math.exp(L.scale_1):dt.defaultPointScale,yA=gA?Math.exp(L.scale_2):dt.defaultPointScale,pA=tA?L.rot_1:0,mA=tA?L.rot_2:0,cA=tA?L.rot_3:0,LA=tA?L.rot_0:1,SA=m!=null?1/(1+Math.exp(-L.opacity)):z!=null?L.alpha/_:1,PA=Y!=null?L.f_dc_0*Be+.5:U!=null?L.red/b:1,WA=G!=null?L.f_dc_1*Be+.5:J!=null?L.green/X:1,v=k!=null?L.f_dc_2 Line truncated
`)}).outputs.rgb}const ft=class ft{constructor({fileBytes:A}){this.header="",this.littleEndian=!0,this.elements={},this.comments=[],this.data=null,this.numSplats=0,this.fileBytes=A instanceof ArrayBuffer?new Uint8Array(A):A}async parseHeader(){const e=new ReadableStream({start:Q=>{Q.enqueue(this.fileBytes.slice(0,65536)),Q.close()}}).pipeThrough(new TextDecoderStream).getReader();this.header="";const g=`end_header
`;for(;;){const{value:Q,done:B}=await e.read();if(B)throw new Error("Failed to read header");this.header+=Q;const i=this.header.indexOf(g);if(i>=0){this.header=this.header.slice(0,i+g.length);break}}const I=new TextEncoder().encode(this.header).length;this.data=new DataView(this.fileBytes.buffer,I),this.elements={};let s=null;this.comments=[],this.header.trim().split(`
`).forEach((Q,B)=>{const i=Q.trim();if(B===0){if(i!=="ply")throw new Error("Invalid PLY header");return}if(i.length===0)return;const C=i.split(" ");switch(C[0]){case"format":if(C[1]==="binary_little_endian")this.littleEndian=!0;else if(C[1]==="binary_big_endian")this.littleEndian=!1;else throw new Error(`Unsupported PLY format: ${C[1]}`);if(C[2]!=="1.0")throw new Error(`Unsupported PLY version: ${C[2]}`);break;case"end_header":break;case"comment":this.comments.push(i.slice(8));break;case"element":{const E=C[1];s={name:E,count:Number.parseInt(C[2]),properties:{}},this.elements[E]=s;break}case"property":if(s==null)throw new Error("Property must be inside an element");C[1]==="list"?s.properties[C[4]]={isList:!0,type:C[3],countType:C[2]}:s.properties[C[2]]={isList:!1,type:C[1]};break}}),this.elements.vertex&&(this.numSplats=this.elements.vertex.count)}parseData(A){let e=0;const g=this.data;if(g==null)throw new Error("No data to parse");for(const I in this.elements){const s=this.elements[I],{count:Q,properties:B}=s,i={},C=[];for(const[n,o]of Object.entries(B))o.isList?(i[n]=[],C.push(()=>{const r=i[n];r.length=Be[o.countType](g,e,this.littleEndian),e+=Dt[o.countType];for(let l=0;l<r.length;l++)r[l]=Be[o.type](g,e,this.littleEndian),e+=Dt[o.type]})):(i[n]=0,C.push(()=>{i[n]=Be[o.type](g,e,this.littleEndian),e+=Dt[o.type]}));const E=A(s)??(()=>{});for(let n=0;n<Q;n++){for(const o of C)o();E(n,i)}}}parseSplats(A,e){if(this.elements.vertex==null)throw new Error("No vertex element found");let g=!1;const I=[];let s=0,Q=[],B=[],i=[],C,E,n;function o(){const u=oo[s];Q=new Array(3).fill(null).flatMap((y,w)=>[0,1,2].map((d,p)=>`f_rest_${w+p*u/3}`)),B=new Array(5).fill(null).flatMap((y,w)=>[0,1,2].map((d,p)=>`f_rest_${3+w+p*u/3}`)),i=new Array(7).fill(null).flatMap((y,w)=>[0,1,2].map((d,p)=>`f_rest_${8+w+p*u/3}`)),C=s>=1?new Float32Array(3*3):void 0,E=s>=2?new Float32Array(5*3):void 0,n=s>=3?new Float32Array(7*3):void 0}function r(u,y){if(!C)throw new Error("Missing sh1");for(const[w,d]of Q.entries())C[w]=y[d]*8/255-4;if(E)for(const[w,d]of B.entries())E[w]=y[d]*8/255-4;if(n)for(const[w,d]of i.entries())n[w]=y[d]*8/255-4;e==null||e(u,C,E,n)}function l(u){const{min_x:y,min_y:w,min_z:d,max_x:p,max_y:m,max_z:N,min_scale_x:f,min_scale_y:D,min_scale_z:R,max_scale_x:S,max_scale_y:M,max_scale_z:L}=u.properties;if(!y||!w||!d||!p||!m||!N||!f||!D||!R||!S||!M||!L)throw new Error("Missing PLY chunk properties");return g=!0,(G,x)=>{const{min_x:U,min_y:J,min_z:AA,max_x:z,max_y:gA,max_z:tA,min_scale_x:X,min_scale_y:v,min_scale_z:_,max_scale_x:j,max_scale_y:W,max_scale_z:Y,min_r:yA,min_g:CA,min_b:DA,max_r:dA,max_g:MA,max_b:cA}=x;I.push({min_x:U,min_y:J,min_z:AA,max_x:z,max_y:gA,max_z:tA,min_scale_x:X,min_scale_y:v,min_scale_z:_,max_scale_x:j,max_scale_y:W,max_scale_z:Y,min_r:yA,min_g:CA,min_b:DA,max_r:dA,max_g:MA,max_b:cA})}}function c(u){if(e&&u.name==="sh")return s=ag(u.properties),o(),r;if(u.name!=="vertex")return null;const{packed_position:y,packed_rotation:w,packed_scale:d,packed_color:p}=u.properties;if(!y||!w||!d||!p)throw new Error("Missing PLY properties: packed_position, packed_rotation, packed_scale, packed_color");const m=Math.sqrt(2);return(N,f)=>{const D=I[N>>>8];if(D==null)throw new Error("Missing PLY chunk");const{min_x:R,min_y:S,min_z:M,max_x:L,max_y:G,max_z:x,min_scale_x:U,min_scale_y:J,min_scale_z:AA,max_scale_x:z,max_scale_y:gA,max_scale_z:tA,min_r:X,min_g:v,min_b:_,max_r:j,max_g:W,max_b:Y}=D,{packed_position:yA,packed_rotation:CA,packed_scale:DA,packed_color:dA}=f,MA=(yA>>>21&2047)/2047*(L-R)+R,cA=(yA>>>11&1023)/1023*(G-S)+S,YA=(yA&2047)/2047*(x-M)+M,mA=((CA>>>20&1023)/1023-.5)*m,OA=((CA>>>10&1023)/1023-.5)*m,PA=((CA&1023)/1023-.5)*m,b=Math.sqrt(Math.max(0,1-mA*mA-OA*OA-PA*PA)),uA=CA>>>30,ZA=uA===0?mA:uA===1?b:OA,Yt=uA<=1?OA:uA===2?b:PA,Ie=uA<=2?PA:b,SA=uA===0?b:mA,H=Math.exp((DA>>>21&2047)/2047*(z-U)+U),jA=Math.exp((DA>>>11&1023)/1023*(gA-J)+J),Ne=Math.exp((DA&2047)/2047*(tA-AA)+AA),Me=(dA>>>24&255)/255*((j??1)-(X??0))+(X??0),me=(dA>>>16&255)/255*((W??1)-(v??0))+(v??0),Se=(dA>>>8&255)/255*((Y??1)-(_??0))+(_??0),Fe=(dA&255)/255;A(N,MA,cA,YA,H,jA,Ne,ZA,Yt,Ie,SA,Fe,Me,me,Se)}}const h=u=>{if(u.name==="chunk")return l(u);if(g)return c(u);if(u.name!=="vertex")return null;const{x:y,y:w,z:d,scale_0:p,scale_1:m,scale_2:N,rot_0:f,rot_1:D,rot_2:R,rot_3:S,opacity:M,f_dc_0:L,f_dc_1:G,f_dc_2:x,red:U,green:J,blue:AA,alpha:z}=u.properties;if(!y||!w||!d)throw new Error("Missing PLY properties: x, y, z");const gA=p&&m&&N,tA=f&&D&&R&&S,X=z!=null?ie[z.type]:1,v=U!=null?ie[U.type]:1,_=J!=null?ie[J.type]:1,j=AA!=null?ie[AA.type]:1;return s=ag(u.properties),o(),(W,Y)=>{const yA=gA?Math.exp(Y.scale_0):ft.defaultPointScale,CA=gA?Math.exp(Y.scale_1):ft.defaultPointScale,DA=gA?Math.exp(Y.scale_2):ft.defaultPointScale,dA=tA?Y.rot_1:0,MA=tA?Y.rot_2:0,cA=tA?Y.rot_3:0,YA=tA?Y.rot_0:1,mA=M!=null?1/(1+Math.exp(-Y.opacity)):z!=null?Y.alpha/X:1,OA=L!=null?Y.f_dc_0*Qe+.5:U!=null?Y.red/v:1,PA=G!=null?Y.f_dc_1*Qe+.5:J!=null?Y.green/_:1,b=x!=null?Y.f_dc_2 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 sA=class sA{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 Ig({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:e,fileBytes:g,construct:I}=A;if(e){const s=new Wi;s.packedSplats=this,await s.loadAsync(e)}else if(g){const s=await gg({input:g,fileType:A.fileType,pathOrUrl:A.fileName??e});this.initialize(s)}if(I){const s=I(this);s instanceof Promise&&await s}}dispose(){this.target&&(this.target.dispose(),this.target=null),this.source&&(this.source.dispose(),this.source=null)}ensureSplats(A){const e=A<=this.maxSplats?this.maxSplats:Math.max(A,2*this.maxSplats),g=this.packedArray?this.packedArray.length/4:0;if(!this.packedArray||e>g){this.maxSplats=MA(e).maxSplats;const I=new Uint32Array(this.maxSplats*4);this.packedArray&&I.set(this.packedArray),this.packedArray=I}return this.packedArray}ensureSplatsSh(A,e){let g,I;if(A===0)return this.ensureSplats(e);if(A===1)g=2,I="sh1";else if(A===2)g=4,I="sh2";else if(A===3)g=4,I="sh3";else throw new Error(`Invalid level: ${A}`);let s=this.extra[I]?this.extra[I].length/g:0;const B=e<=s?s:Math.max(e,2*s);if(!this.extra[I]||B>s){s=MA(B).maxSplats;const i=new Uint32Array(s*g);this.extra[I]&&i.set(this.extra[I]),this.extra[I]=i}return this.extra[I]}getSplat(A){if(!this.packedArray||A>=this.numSplats)throw new Error("Invalid index");return ce(this.packedArray,A)}setSplat(A,e,g,I,s,B){const i=this.ensureSplats(A+1);re(i,A,e.x,e.y,e.z,g.x,g.y,g.z,I.x,I.y,I.z,I.w,s,B.r,B.g,B.b),this.numSplats=Math.max(this.numSplats,A+1)}pushSplat(A,e,g,I,s){const B=this.ensureSplats(this.numSplats+1);re(B,this.numSplats,A.x,A.y,A.z,e.x,e.y,e.z,g.x,g.y,g.z,g.w,I,s.r,s.g,s.b),++this.numSplats}forEachSplat(A){if(!(!this.packedArray||!this.numSplats))for(let e=0;e<this.numSplats;++e){const g=ce(this.packedArray,e);A(e,g.center,g.scales,g.quaternion,g.opacity,g.color)}}ensureGenerate(A){if(this.target&&(A??1)<=this.maxSplats)return!1;this.dispose();const e=MA(A??1),{width:g,height:I,depth:s}=e;return this.maxSplats=e.maxSplats,this.target=new a.WebGLArrayRenderTarget(g,I,s,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,magFilter:a.NearestFilter,minFilter:a.NearestFilter}),this.target.texture.format=a.RGBAIntegerFormat,this.target.texture.type=a.UnsignedIntType,this.target.texture.internalFormat="RGBA32UI",this.target.scissorTest=!0,!0}generateMapping(A){let e=0;const g=A.map(I=>{const s=e,B=Math.ceil(I/P)*P;return e+=B,{base:s,count:I}});return{maxSplats:e,mapping:g}}getTexture(){return this.target?this.target.texture:this.source||this.packedArray?this.maybeUpdateSource():sA.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:e,depth:g}=this.source.image;this.maxSplats!==A*e*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:e,depth:g}=MA(this.maxSplats);this.source=new a.DataArrayTexture(this.packedArray,A,e,g),this.source.format=a.RGBAIntegerFormat,this.source.type=a.UnsignedIntType,this.source.internalFormat="RGBA32UI",this.source.needsUpdate=!0}this.source.needsUpdate=!0}return this.source}static getEmpty(){if(!sA.emptySource){const{width:A,height:e,depth:g,maxSplats:I}=MA(1),s=new Uint32Array(I*4);sA.emptySource=new a.DataArrayTexture(s,A,e,g),sA.emptySource.format=a.RGBAIntegerFormat,sA.emptySource.type=a.UnsignedIntType,sA.emptySource.internalFormat="RGBA32UI",sA.emptySource.needsUpdate=!0}return sA.emptySource}prepareProgramMaterial(A){let e=sA.generatorProgram.get(A);if(!e){const I=kA({index:"int"},{output:"uvec4"},({index:s})=>{A.inputs.index=s;const B=A.outputs.gsplat;return{output:Zg(B)}});sA.programTemplate||(sA.programTemplate=new Pe(po)),e=new Oe({graph:I,inputs:{index:"index"},outputs:{output:"target"},template:sA.programTemplate}),Object.assign(e.uniforms,{targetLayer:{value:0},targetBase:{value:0},targetCount:{value:0}}),sA.generatorProgram.set(A,e)}const g=e.prepareMaterial();return sA.fullScreenQuad.material=g,{program:e,material:g}}saveRenderState(A){return{xrEnabled:A.xr.enabled,autoClear:A.autoClear}}resetRenderState(A,e){A.setRenderTarget(null),A.xr.enabled=e.xr Line truncated
}`;const sA=class sA{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 Qg({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/O)*O,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:e,fileBytes:g,construct:I}=A;if(e){const s=new $B;s.packedSplats=this,await s.loadAsync(e)}else if(g){const s=await sg({input:g,fileType:A.fileType,pathOrUrl:A.fileName??e});this.initialize(s)}if(I){const s=I(this);s instanceof Promise&&await s}}dispose(){this.target&&(this.target.dispose(),this.target=null),this.source&&(this.source.dispose(),this.source=null)}ensureSplats(A){const e=A<=this.maxSplats?this.maxSplats:Math.max(A,2*this.maxSplats),g=this.packedArray?this.packedArray.length/4:0;if(!this.packedArray||e>g){this.maxSplats=NA(e).maxSplats;const I=new Uint32Array(this.maxSplats*4);this.packedArray&&I.set(this.packedArray),this.packedArray=I}return this.packedArray}ensureSplatsSh(A,e){let g,I;if(A===0)return this.ensureSplats(e);if(A===1)g=2,I="sh1";else if(A===2)g=4,I="sh2";else if(A===3)g=4,I="sh3";else throw new Error(`Invalid level: ${A}`);let s=this.extra[I]?this.extra[I].length/g:0;const Q=e<=s?s:Math.max(e,2*s);if(!this.extra[I]||Q>s){s=NA(Q).maxSplats;const B=new Uint32Array(s*g);this.extra[I]&&B.set(this.extra[I]),this.extra[I]=B}return this.extra[I]}getSplat(A){if(!this.packedArray||A>=this.numSplats)throw new Error("Invalid index");return ce(this.packedArray,A)}setSplat(A,e,g,I,s,Q){const B=this.ensureSplats(A+1);re(B,A,e.x,e.y,e.z,g.x,g.y,g.z,I.x,I.y,I.z,I.w,s,Q.r,Q.g,Q.b),this.numSplats=Math.max(this.numSplats,A+1)}pushSplat(A,e,g,I,s){const Q=this.ensureSplats(this.numSplats+1);re(Q,this.numSplats,A.x,A.y,A.z,e.x,e.y,e.z,g.x,g.y,g.z,g.w,I,s.r,s.g,s.b),++this.numSplats}forEachSplat(A){if(!(!this.packedArray||!this.numSplats))for(let e=0;e<this.numSplats;++e){const g=ce(this.packedArray,e);A(e,g.center,g.scales,g.quaternion,g.opacity,g.color)}}ensureGenerate(A){if(this.target&&(A??1)<=this.maxSplats)return!1;this.dispose();const e=NA(A??1),{width:g,height:I,depth:s}=e;return this.maxSplats=e.maxSplats,this.target=new a.WebGLArrayRenderTarget(g,I,s,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,magFilter:a.NearestFilter,minFilter:a.NearestFilter}),this.target.texture.format=a.RGBAIntegerFormat,this.target.texture.type=a.UnsignedIntType,this.target.texture.internalFormat="RGBA32UI",this.target.scissorTest=!0,!0}generateMapping(A){let e=0;const g=A.map(I=>{const s=e,Q=Math.ceil(I/O)*O;return e+=Q,{base:s,count:I}});return{maxSplats:e,mapping:g}}getTexture(){return this.target?this.target.texture:this.source||this.packedArray?this.maybeUpdateSource():sA.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:e,depth:g}=this.source.image;this.maxSplats!==A*e*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:e,depth:g}=NA(this.maxSplats);this.source=new a.DataArrayTexture(this.packedArray,A,e,g),this.source.format=a.RGBAIntegerFormat,this.source.type=a.UnsignedIntType,this.source.internalFormat="RGBA32UI",this.source.needsUpdate=!0}this.source.needsUpdate=!0}return this.source}static getEmpty(){if(!sA.emptySource){const{width:A,height:e,depth:g,maxSplats:I}=NA(1),s=new Uint32Array(I*4);sA.emptySource=new a.DataArrayTexture(s,A,e,g),sA.emptySource.format=a.RGBAIntegerFormat,sA.emptySource.type=a.UnsignedIntType,sA.emptySource.internalFormat="RGBA32UI",sA.emptySource.needsUpdate=!0}return sA.emptySource}prepareProgramMaterial(A){let e=sA.generatorProgram.get(A);if(!e){const I=GA({index:"int"},{output:"uvec4"},({index:s})=>{A.inputs.index=s;const Q=A.outputs.gsplat;return{output:Xg(Q)}});sA.programTemplate||(sA.programTemplate=new $e(po)),e=new Pe({graph:I,inputs:{index:"index"},outputs:{output:"target"},template:sA.programTemplate}),Object.assign(e.uniforms,{targetLayer:{value:0},targetBase:{value:0},targetCount:{value:0}}),sA.generatorProgram.set(A,e)}const g=e.prepareMaterial();return sA.fullScreenQuad.material=g,{program:e,material:g}}saveRenderState(A){return{xrEnabled:A.xr.enabled,autoClear:A.autoClear}}resetRenderState(A,e){A.setRenderTarget(null),A.xr.enabled=e.xr Line truncated
float computeSort(Gsplat gsplat, bool sortRadial, vec3 sortOrigin, vec3 sortDirection, float sortDepthBias, bool sort360) {
if (!isGsplatActive(gsplat.flags)) {
return INFINITY;
@@ -559,9 +559,9 @@ void main() {
return sortRadial ? length(center) : biasedDepth;
}
`);function og({gsplat:t,sortRadial:A,sortOrigin:e,sortDirection:g,sortDepthBias:I,sort360:s}){return Ae({inTypes:{gsplat:W,sortRadial:"bool",sortOrigin:"vec3",sortDirection:"vec3",sortDepthBias:"float",sort360:"bool"},outTypes:{metric:"float"},globals:()=>[GA,mo],inputs:{gsplat:t,sortRadial:A,sortOrigin:e,sortDirection:g,sortDepthBias:I,sort360:s},statements:({inputs:B,outputs:i})=>{const{gsplat:Q,sortRadial:C,sortOrigin:E,sortDirection:n,sortDepthBias:o,sort360:r}=B;return YA(`
${i.metric} = computeSort(${Q}, ${C}, ${E}, ${n}, ${o}, ${r});
`)}}).outputs.metric}class Ee{constructor(){this.splats=new bA,this.toWorld=new a.Matrix4,this.mapping=[],this.refCount=0,this.splatsVersion=-1,this.mappingVersion=-1}ensureGenerate(A){this.splats.ensureGenerate(A)&&(this.mapping=[])}generateSplats({renderer:A,modifier:e,generators:g,forceUpdate:I,originToWorld:s}){const B=this.mapping.reduce((C,E)=>(C.set(E.node,E),C),new Map);let i=0,Q=0;for(const{node:C,generator:E,version:n,base:o,count:r}of g){const l=B.get(C);if((I||E!==(l==null?void 0:l.generator)||n!==(l==null?void 0:l.version)||o!==(l==null?void 0:l.base)||r!==(l==null?void 0:l.count))&&E&&r>0){const c=e.apply(E);try{this.splats.generate({generator:c,base:o,count:r,renderer:A})}catch(h){C.generator=void 0,C.generatorError=h}i+=1}Q=Math.max(Q,o+r)}return this.splats.numSplats=Q,this.toWorld=s,this.mapping=g,i!==0}hasCorrespondence(A){return this.mapping.length!==A.mapping.length?!1:this.mapping.every(({node:e,base:g,count:I},s)=>{const{node:B,base:i,count:Q}=A.mapping[s];return e===B&&g===i&&I===Q})}}var So=`const float LN_SCALE_MIN = -12.0;
`);function Le({gsplat:t,sortRadial:A,sortOrigin:e,sortDirection:g,sortDepthBias:I,sort360:s}){return Ae({inTypes:{gsplat:P,sortRadial:"bool",sortOrigin:"vec3",sortDirection:"vec3",sortDepthBias:"float",sort360:"bool"},outTypes:{metric:"float"},globals:()=>[xA,Mo],inputs:{gsplat:t,sortRadial:A,sortOrigin:e,sortDirection:g,sortDepthBias:I,sort360:s},statements:({inputs:Q,outputs:B})=>{const{gsplat:i,sortRadial:C,sortOrigin:E,sortDirection:n,sortDepthBias:o,sort360:r}=Q;return LA(`
${B.metric} = computeSort(${i}, ${C}, ${E}, ${n}, ${o}, ${r});
`)}}).outputs.metric}class Ee{constructor(){this.splats=new vA,this.toWorld=new a.Matrix4,this.mapping=[],this.refCount=0,this.splatsVersion=-1,this.mappingVersion=-1}ensureGenerate(A){this.splats.ensureGenerate(A)&&(this.mapping=[])}generateSplats({renderer:A,modifier:e,generators:g,forceUpdate:I,originToWorld:s}){const Q=this.mapping.reduce((C,E)=>(C.set(E.node,E),C),new Map);let B=0,i=0;for(const{node:C,generator:E,version:n,base:o,count:r}of g){const l=Q.get(C);if((I||E!==(l==null?void 0:l.generator)||n!==(l==null?void 0:l.version)||o!==(l==null?void 0:l.base)||r!==(l==null?void 0:l.count))&&E&&r>0){const c=e.apply(E);try{this.splats.generate({generator:c,base:o,count:r,renderer:A})}catch(h){C.generator=void 0,C.generatorError=h}B+=1}i=Math.max(i,o+r)}return this.splats.numSplats=i,this.toWorld=s,this.mapping=g,B!==0}hasCorrespondence(A){return this.mapping.length!==A.mapping.length?!1:this.mapping.every(({node:e,base:g,count:I},s)=>{const{node:Q,base:B,count:i}=A.mapping[s];return e===Q&&g===B&&I===i})}}var mo=`const float LN_SCALE_MIN = -12.0;
const float LN_SCALE_MAX = 9.0;
const float LN_RESCALE = (LN_SCALE_MAX - LN_SCALE_MIN) / 254.0;
@@ -803,7 +803,7 @@ ivec3 splatTexCoord(int index) {
uint y = (uint(index) >> SPLAT_TEX_WIDTH_BITS) & SPLAT_TEX_HEIGHT_MASK;
uint z = uint(index) >> SPLAT_TEX_LAYER_BITS;
return ivec3(x, y, z);
}`,No=`precision highp float;
}`,So=`precision highp float;
precision highp int;
#include <splatDefines>
@@ -1056,7 +1056,7 @@ void main() {
vSplatUv = position.xy * maxStdDev;
vNdc = ndc;
gl_Position = vec4(ndc.xy * clipCenter.w, clipCenter.zw);
}`;let Ye=null;function Go(){return Ye||(a.ShaderChunk.splatDefines=So,Ye={splatVertex:Fo,splatFragment:No}),Ye}const rg=5;let ze=!1,Ve=!1,AQ;function ko(t){let A=!1;return t instanceof zA?!0:(t.traverse(e=>{A=A||e instanceof zA}),A)}const tQ=a.Scene.prototype.add;a.Scene.prototype.add=function(t){return ze=ze||ko(t),Ve=Ve||t instanceof Ot,tQ.call(this,t),this};const xo=a.Scene.prototype.onBeforeRender;a.Scene.prototype.onBeforeRender=function(t){if(ze){if(!Ve){const A=AQ||new Ot({renderer:t});this.add(A)}a.Scene.prototype.onBeforeRender=xo,a.Scene.prototype.add=tQ}};const QA=class QA extends a.Mesh{constructor(A){const e=QA.makeUniforms(),g=Go(),I=new a.ShaderMaterial({glslVersion:a.GLSL3,vertexShader:g.splatVertex,fragmentShader:g.splatFragment,uniforms:e,transparent:!0,blending:a.NormalBlending,depthTest:!0,depthWrite:!1,side:a.DoubleSide});super(cg,I),this.splatTexture=null,this.autoViewpoints=[],this.rotateToAccumulator=new ee({value:new a.Quaternion}),this.translateToAccumulator=new Ft({value:new a.Vector3}),this.lastFrame=-1,this.lastUpdateTime=null,this.defaultCameras=[],this.pendingUpdate=null,this.envViewpoint=null,this.frustumCulled=!1,this.renderer=A.renderer,this.material=I,this.uniforms=e;const s=kA({gsplat:W},{gsplat:W},({gsplat:B})=>{if(!B)throw new Error("gsplat not defined");return B=Ze(B,{rotate:this.rotateToAccumulator,translate:this.translateToAccumulator}),{gsplat:B}});this.modifier=new Zi(s),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.focalAdjustment=A.focalAdjustment??1,this.active=new Ee,this.accumulatorCount=1,this.freeAccumulators=[];for(let B=0;B<1;++B)this.freeAccumulators.push(new Ee),this.accumulatorCount+=1;this.defaultView=new Xt({...A.view,autoUpdate:!0,spark:this}),this.viewpoint=this.defaultView,this.prepareViewpoint(this.viewpoint),this.clock=A.clock?HI(A.clock):new a.Clock,AQ=this}static makeUniforms(){return{renderSize:{value:new a.Vector2},near:{value:.1},far:{value:1e3},numSplats:{value:0},renderToViewQuat:{value:new a.Quaternion},renderToViewPos:{value:new a.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},focalAdjustment:{value:1},splatTexEnable:{value:!1},splatTexture:{type:"t",value:QA.EMPTY_SPLAT_TEXTURE},splatTexMul:{value:new a.Matrix2},splatTexAdd:{value:new a.Vector2},splatTexNear:{value:.1},splatTexFar:{value:1e3},splatTexMid:{value:0},packedSplats:{type:"t",value:bA.getEmpty()},time:{value:0},deltaTime:{value:0},encodeLinear:{value:!1},debugFlag:{value:!1}}}canAllocAccumulator(){return this.freeAccumulators.length>0||this.accumulatorCount<rg}maybeAllocAccumulator(){let A=this.freeAccumulators.pop();if(A===void 0){if(this.accumulatorCount>=rg)return null;A=new Ee,this.accumulatorCount+=1}return A.refCount=1,A}releaseAccumulator(A){A.refCount-=1,A.refCount===0&&this.freeAccumulators.push(A)}newViewpoint(A){return new Xt({...A,spark:this})}onBeforeRender(A,e,g){var r,l;const I=this.time??this.clock.getElapsedTime(),s=I-(this.viewpoint.lastTime??I);this.viewpoint.lastTime=I;const B=A.info.render.frame,i=B!==this.lastFrame;this.lastFrame=B;const Q=this.viewpoint;if(Q===this.defaultView){if(i)if(!A.xr.isPresenting)this.defaultView.viewToWorld=g.matrixWorld.clone(),this.defaultCameras=[this.defaultView.viewToWorld];else{const c=A.xr.getCamera().cameras;this.defaultCameras=c.map(h=>h.matrixWorld),this.defaultView.viewToWorld=Ro(this.defaultCameras)??new a.Matrix4}this.autoUpdate&&this.update({scene:e,viewToWorld:this.defaultView.viewToWorld})}if(i&&(this.uniforms.time.value=I,this.uniforms.deltaTime.value=s,this.uniforms.debugFlag.value=performance.now()/1e3%2<1),Q.target)this.uniforms.renderSize.value.set(Q.target.width,Q.target.height);else{const c=A.getDrawingBufferSize(this.uniforms.renderSize.value);if(c.x===1&&c.y===1){const h=(r=A.xr.getSession())==null?void 0:r.renderState.baseLayer;h&&(c.x=h.framebufferWidth,c.y=h.framebufferHeight)}}const C=g;if(this.uniforms.near.value=C.near,this.uniforms.far.value=C.far,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,this.uniforms.focalAdjustment.value=this.focalAdjustment,this.splatTexture){const{enable:c,texture:h,multiply:u,add:D,near:w,far:y,mid:f}=this.splatTexture;c&&h?(this.uni Line truncated
}`;let Ye=null;function Go(){return Ye||(a.ShaderChunk.splatDefines=mo,Ye={splatVertex:Fo,splatFragment:So}),Ye}const cg=5;let Ze=!1,je=!1,ti;function xo(t){let A=!1;return t instanceof zA?!0:(t.traverse(e=>{A=A||e instanceof zA}),A)}const ei=a.Scene.prototype.add;a.Scene.prototype.add=function(t){return Ze=Ze||xo(t),je=je||t instanceof Wt,ei.call(this,t),this};const ko=a.Scene.prototype.onBeforeRender;a.Scene.prototype.onBeforeRender=function(t){if(Ze){if(!je){const A=ti||new Wt({renderer:t});this.add(A)}a.Scene.prototype.onBeforeRender=ko,a.Scene.prototype.add=ei}};const iA=class iA extends a.Mesh{constructor(A){const e=iA.makeUniforms(),g=Go(),I=new a.ShaderMaterial({glslVersion:a.GLSL3,vertexShader:g.splatVertex,fragmentShader:g.splatFragment,uniforms:e,transparent:!0,blending:a.NormalBlending,depthTest:!0,depthWrite:!1,side:a.DoubleSide});super(hg,I),this.splatTexture=null,this.autoViewpoints=[],this.rotateToAccumulator=new ee({value:new a.Quaternion}),this.translateToAccumulator=new Gt({value:new a.Vector3}),this.lastFrame=-1,this.lastUpdateTime=null,this.defaultCameras=[],this.pendingUpdate=null,this.envViewpoint=null,this.frustumCulled=!1,this.renderer=A.renderer,this.material=I,this.uniforms=e;const s=GA({gsplat:P},{gsplat:P},({gsplat:Q})=>{if(!Q)throw new Error("gsplat not defined");return Q=_e(Q,{rotate:this.rotateToAccumulator,translate:this.translateToAccumulator}),{gsplat:Q}});this.modifier=new XB(s),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.focalAdjustment=A.focalAdjustment??1,this.active=new Ee,this.accumulatorCount=1,this.freeAccumulators=[];for(let Q=0;Q<1;++Q)this.freeAccumulators.push(new Ee),this.accumulatorCount+=1;this.defaultView=new _t({...A.view,autoUpdate:!0,spark:this}),this.viewpoint=this.defaultView,this.prepareViewpoint(this.viewpoint),this.clock=A.clock?KI(A.clock):new a.Clock,ti=this}static makeUniforms(){return{renderSize:{value:new a.Vector2},near:{value:.1},far:{value:1e3},numSplats:{value:0},renderToViewQuat:{value:new a.Quaternion},renderToViewPos:{value:new a.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},focalAdjustment:{value:1},splatTexEnable:{value:!1},splatTexture:{type:"t",value:iA.EMPTY_SPLAT_TEXTURE},splatTexMul:{value:new a.Matrix2},splatTexAdd:{value:new a.Vector2},splatTexNear:{value:.1},splatTexFar:{value:1e3},splatTexMid:{value:0},packedSplats:{type:"t",value:vA.getEmpty()},time:{value:0},deltaTime:{value:0},encodeLinear:{value:!1},debugFlag:{value:!1}}}canAllocAccumulator(){return this.freeAccumulators.length>0||this.accumulatorCount<cg}maybeAllocAccumulator(){let A=this.freeAccumulators.pop();if(A===void 0){if(this.accumulatorCount>=cg)return null;A=new Ee,this.accumulatorCount+=1}return A.refCount=1,A}releaseAccumulator(A){A.refCount-=1,A.refCount===0&&this.freeAccumulators.push(A)}newViewpoint(A){return new _t({...A,spark:this})}onBeforeRender(A,e,g){var r,l;const I=this.time??this.clock.getElapsedTime(),s=I-(this.viewpoint.lastTime??I);this.viewpoint.lastTime=I;const Q=A.info.render.frame,B=Q!==this.lastFrame;this.lastFrame=Q;const i=this.viewpoint;if(i===this.defaultView){if(B)if(!A.xr.isPresenting)this.defaultView.viewToWorld=g.matrixWorld.clone(),this.defaultCameras=[this.defaultView.viewToWorld];else{const c=A.xr.getCamera().cameras;this.defaultCameras=c.map(h=>h.matrixWorld),this.defaultView.viewToWorld=Ro(this.defaultCameras)??new a.Matrix4}this.autoUpdate&&this.update({scene:e,viewToWorld:this.defaultView.viewToWorld})}if(B&&(this.uniforms.time.value=I,this.uniforms.deltaTime.value=s,this.uniforms.debugFlag.value=performance.now()/1e3%2<1),i.target)this.uniforms.renderSize.value.set(i.target.width,i.target.height);else{const c=A.getDrawingBufferSize(this.uniforms.renderSize.value);if(c.x===1&&c.y===1){const h=(r=A.xr.getSession())==null?void 0:r.renderState.baseLayer;h&&(c.x=h.framebufferWidth,c.y=h.framebufferHeight)}}const C=g;if(this.uniforms.near.value=C.near,this.uniforms.far.value=C.far,this.uniforms.encodeLinear.value=i.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,this.uniforms.focalAdjustment.value=this.focalAdjustment,this.splatTexture){const{enable:c,texture:h,multiply:u,add:y,near:w,far:d,mid:p}=this.splatTexture;c&&h?(this.uni Line truncated
struct GsplatSkinning {
int numSplats;
int numBones;
@@ -1122,15 +1122,15 @@ void main() {
center = quatVec(quat, center) + translate;
quaternion = quatQuat(quat, quaternion);
}
`);function qo(t,A){return new j({inTypes:{gsplat:W,skinning:sQ},outTypes:{gsplat:W},globals:()=>[BQ,Ko],inputs:{gsplat:t,skinning:A},statements:({inputs:g,outputs:I})=>{const{skinning:s}=g,{gsplat:B}=I;return YA(`
${B} = ${g.gsplat};
if (isGsplatActive(${B}.flags)) {
`);function qo(t,A){return new Z({inTypes:{gsplat:P,skinning:Qi},outTypes:{gsplat:P},globals:()=>[Bi,Ko],inputs:{gsplat:t,skinning:A},statements:({inputs:g,outputs:I})=>{const{skinning:s}=g,{gsplat:Q}=I;return LA(`
${Q} = ${g.gsplat};
if (isGsplatActive(${Q}.flags)) {
applyGsplatSkinning(
${s}.numSplats, ${s}.numBones,
${s}.skinTexture, ${s}.boneTexture,
${B}.index, ${B}.center, ${B}.quaternion
${Q}.index, ${Q}.center, ${Q}.quaternion
);
}
`)}}).outputs.gsplat}function zo({splats:t,extents:A,stepSize:e=1,pointRadius:g=.01,pointShadowScale:I=2,opacity:s=1,color:B}){const Q=new a.Vector3,C=new a.Vector3,E=new a.Quaternion(0,0,0,1);B==null&&(B=(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 n=new a.Color;for(let o=A.min.z;o<A.max.z+1e-6;o+=e)for(let r=A.min.y;r<A.max.y+1e-6;r+=e)for(let l=A.min.x;l<A.max.x+1e-6;l+=e){Q.set(l,r,o);for(let c=0;c<2;++c)C.setScalar(g*(c?1:I)),c?typeof B=="function"?B(n,Q):n.copy(B):n.setScalar(0),t.pushSplat(Q,C,E,s,n)}}function Vo({splats:t,scale:A=.25,axisRadius:e=.0075,axisShadowScale:g=2,origins:I=[new a.Vector3]}){const s=new a.Vector3,B=new a.Vector3,i=new a.Quaternion(0,0,0,1),Q=new a.Color,C=1;for(const E of I)for(let n=0;n<3;++n){s.set(E.x+(n===0?A:0),E.y+(n===1?A:0),E.z+(n===2?A:0));for(let o=0;o<2;++o)B.set((n===0?A:e)*(o?1:g),(n===1?A:e)*(o?1:g),(n===2?A:e)*(o?1:g)),Q.setRGB(o===0?0:n===0?1:0,o===0?0:n===1?1:0,o===0?0:n===2?1:0),t.pushSplat(s,B,i,C,Q)}}function jo({splats:t,origin:A=new a.Vector3,radius:e=1,maxDepth:g=3,filter:I=null,pointRadius:s=.02,pointThickness:B=.001,color:i=new a.Color(1,1,1)}){const Q={};function C(c){if(I&&!I(c))return;const h=`${c.x},${c.y},${c.z}`;Q[h]||(Q[h]=c)}function E(c,h,u,D){if(C(h),C(u),C(D),c>=g)return;const w=new a.Vector3().addVectors(h,u).normalize(),y=new a.Vector3().addVectors(u,D).normalize(),f=new a.Vector3().addVectors(D,h).normalize();E(c+1,h,w,f),E(c+1,w,u,y),E(c+1,f,y,D),E(c+1,w,y,f)}for(const c of[-1,1])for(const h of[-1,1])for(const u of[-1,1]){const D=new a.Vector3(c,0,0),w=new a.Vector3(0,h,0),y=new a.Vector3(0,0,u);E(0,D,w,y)}const n=Object.values(Q),o=new a.Vector3(s,s,B),r=new a.Quaternion,l=typeof i=="function"?new a.Color:i;for(const c of n)r.setFromUnitVectors(new a.Vector3(0,0,-1),c),typeof i=="function"&&i(l,c),c.multiplyScalar(e),c.add(A),t.pushSplat(c,o,r,1,l)}function Zo({text:t,font:A,fontSize:e,color:g,rgb:I,dotRadius:s,textAlign:B,lineHeight:i,objectScale:Q}){A=A??"Arial",e=e??32,g=g??new a.Color(1,1,1),s=s??.8,B=B??"start",i=i??1,Q=Q??1;const C=t.split(`
`),E=document.createElement("canvas"),n=E.getContext("2d");if(!n)throw new Error("Failed to create canvas context");n.font=`${e}px ${A}`,n.textAlign=B;const o=n.measureText(""),r=o.fontBoundingBoxAscent+o.fontBoundingBoxDescent;let l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let G=0;G<C.length;++G){const k=n.measureText(C[G]),U=r*i*G;l=Math.min(l,-k.actualBoundingBoxLeft),c=Math.max(c,k.actualBoundingBoxRight),h=Math.min(h,U-k.actualBoundingBoxAscent),u=Math.max(u,U+k.actualBoundingBoxDescent)}const D=Math.floor(l),w=Math.floor(h),y=Math.ceil(c)-D,f=Math.ceil(u)-w;E.width=y,E.height=f,n.font=`${e}px ${A}`,n.textAlign=B,n.textBaseline="alphabetic",n.fillStyle="#FFFFFF";for(let G=0;G<C.length;++G){const k=r*i*G-w;n.fillText(C[G],-D,k)}const S=n.getImageData(0,0,y,f),M=new Uint8Array(S.data.buffer),d=new bA,p=new a.Vector3,R=new a.Vector3().setScalar(s*Q),N=new a.Quaternion(0,0,0,1);I=I??new a.Color(1,1,1);let m=0;for(let G=0;G<f;++G)for(let k=0;k<y;++k){const U=M[m+3];if(U>0){const J=U/255;p.set(k-.5*(y-1),.5*(f-1)-G,0),p.multiplyScalar(Q),d.pushSplat(p,R,N,J,I)}m+=4}const Y=new zA({packedSplats:d});return Y.recolor=g,Y}function _o({url:t,dotRadius:A,subXY:e,forEachSplat:g}){return A=A??.8,e=Math.max(1,Math.floor(e??1)),new zA({constructSplats:async I=>new Promise((s,B)=>{const i=new Image;i.crossOrigin="anonymous",i.onerror=B,i.onload=()=>{const{width:Q,height:C}=i,E=document.createElement("canvas");E.width=Q,E.height=C;const n=E.getContext("2d");if(!n){B(new Error("Failed to create canvas context"));return}n.imageSmoothingEnabled=!0,n.imageSmoothingQuality="high";const o=Math.round(Q/e),r=Math.round(C/e);n.drawImage(i,0,0,o,r);try{const l=n.getImageData(0,0,o,r),c=new Uint8Array(l.data.buffer),h=new a.Vector3,u=new a.Vector3().setScalar(A),D=new a.Quaternion(0,0,0,1),w=new a.Color;let y=0;for(let f=0;f<r;++f)for(let S=0;S<o;++S){const M=y*4,d=c[M+3];if(d>0){let p=d/255;w.set(c[M+0]/255,c[M+1]/255,c[M+2]/255),h.set(S-.5*(o-1),.5*(r-1)-f,0),u.setScalar(A),D.set(0,0,0,1);let R=!0;if(g){const N=g(o,r,y,h,u,D,p,w);p=N??p,R=N!==null}R&&I.pushSplat(h,u,D,p,w)}y+=1}s()}catch(l){B(l)}},i.src=t})})}function Xo({box:t,cells:A,dotScale:e,color:g,opacity:I}){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)),I=I??1;const s=A.x*A.y*A.z,B=K("int",A.x),i=K("int",A.y);K("int",A.z);const Q=TA(0),C=new kt({numSplats:s,generator:kA({index:"int"},{gsplat:W},({index:n})=>{if(!n)throw new Error("index is undefined");const o=be(n,B),r=ne(n,B),l=be(r,i),c=ne(r,i),h=qA({vectorType:"ivec3",x:o,y:l,z:c}),u=Ps(Q),D=qA({vectorType:"ivec2",x:n,y:u}),w=ti(D),y=K("vec3",t.min),f=K("vec3",t.max),S=Gt(f,y),M=ne(dA(ht(h),w),K("vec3",A));let d,p,R;g?(d=K("float",g.r),p=K("float",g.g),R=K("float",g.b)):{r:d,g:p,b:R}=Nt(M).outputs;const N=qA({vectorType:"vec4",r:d,g:p,b:R,a:K("float",I)}),m=dA(y,aA(S,M)),Y=ht(K("float",e)),G=K("vec4",new a.Quaternion(0,0,0,1));let k=Bt({flags:ae("uint","GSPLAT_FLAG_ACTIVE"),index:n,center:m,scales:Y,quaternion:G,rgba:N});return k=E.applyGsplat(k),{gsplat:k}},{globals:()=>[GA]}),update:({time:n})=>{Q.value=n,E.update(C),C.updateVersion()}}),E=new ot;return C}const Oo={box:new a.Box3(new a.Vector3(-1,-1,-1),new a.Vector3(1,1,1)),density:100,fallDirection:new a.Vector3(-1,-3,1).normalize(),fallVelocity:.02,wanderScale:.04,wanderVariance:2,color1:new a.Color(1,1,1),color2:new a.Color(.5,.5,1),minScale:.001,maxScale:.005,anisoScale:new a.Vector3(1,1,1)},Po={box:new a.Box3(new a.Vector3(-2,-1,-2),new a.Vector3(2,5,2)),density:10,fallDirection:new a.Vector3(0,-1,0),fallVelocity:2,wanderScale:.1,wanderVariance:1,color1:new a.Color(1,1,1),color2:new a.Color(.25,.25,.5),minScale:.005,maxScale:.01,anisoScale:new a.Vector3(.1,1,.1)};function Wo({box:t,minY:A,numSplats:e,density:g,anisoScale:I,minScale:s,maxScale:B,fallDirection:i,fallVelocity:Q,wanderScale:C,wanderVariance:E,color1:n,color2:o,opacity:r,onFrame:l}){t=t??new a.Box3(new a.Vector3(-1,-1,-1),new a.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,e=e??Math.max(1,Math.min(1e6,Math.round(c*g)));const h=TA(s??.001),u=TA(B??.005),D=tt(((I==null?void 0:I.clone())??new a.Vector3(1,1,1)).normalize()),w=tt((i??new a.Vector3(0,-1,0)).normalize()),y=TA(Q??.02),f=TA(C??.01),S=TA(E??2),M=tt(n??new a.Color(1,1,1)),d=tt(o??new a.Color(.5,.5,1)),p=TA(r??1),R=TA(0),N=tt(new a.Vector3(0,0,0)),m=tt(t.min),Y=tt(t.max),G=TA(A??Number.NEGATIVE_INFINITY),k=Gt(Y,m),U=new kt({numSplats:e,generator:kA({index:"int"},{gsplat:W},({index:AA})=>{if(!AA)throw new Error("index not defined");const z=Te(AA),gA=Nt(z).outputs.w;let tA=ht(z),_=Ce(aA(gA,K("float",100)));_=He(aA(ae("float","PI"),_)),_=dA(h,aA(_,Gt(u,h)));const b=aA(_,D),X=Ce(aA(gA,K("float",10))),Z=Ce(gA),O=As(M,d,Z),L=aA(O,X),DA=Te(qA({vectorType:"ivec2",x:AA,y:K("int",6837)}));let CA=ht(DA),yA=aA(Nt(DA).outputs.w,S);yA=dA(R,yA),tA=dA(tA,N);const pA=WI(tA,K("vec3",new a.Vector3(1,1,1) Line truncated
`)}}).outputs.gsplat}function zo({splats:t,extents:A,stepSize:e=1,pointRadius:g=.01,pointShadowScale:I=2,opacity:s=1,color:Q}){const i=new a.Vector3,C=new a.Vector3,E=new a.Quaternion(0,0,0,1);Q==null&&(Q=(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 n=new a.Color;for(let o=A.min.z;o<A.max.z+1e-6;o+=e)for(let r=A.min.y;r<A.max.y+1e-6;r+=e)for(let l=A.min.x;l<A.max.x+1e-6;l+=e){i.set(l,r,o);for(let c=0;c<2;++c)C.setScalar(g*(c?1:I)),c?typeof Q=="function"?Q(n,i):n.copy(Q):n.setScalar(0),t.pushSplat(i,C,E,s,n)}}function Vo({splats:t,scale:A=.25,axisRadius:e=.0075,axisShadowScale:g=2,origins:I=[new a.Vector3]}){const s=new a.Vector3,Q=new a.Vector3,B=new a.Quaternion(0,0,0,1),i=new a.Color,C=1;for(const E of I)for(let n=0;n<3;++n){s.set(E.x+(n===0?A:0),E.y+(n===1?A:0),E.z+(n===2?A:0));for(let o=0;o<2;++o)Q.set((n===0?A:e)*(o?1:g),(n===1?A:e)*(o?1:g),(n===2?A:e)*(o?1:g)),i.setRGB(o===0?0:n===0?1:0,o===0?0:n===1?1:0,o===0?0:n===2?1:0),t.pushSplat(s,Q,B,C,i)}}function Zo({splats:t,origin:A=new a.Vector3,radius:e=1,maxDepth:g=3,filter:I=null,pointRadius:s=.02,pointThickness:Q=.001,color:B=new a.Color(1,1,1)}){const i={};function C(c){if(I&&!I(c))return;const h=`${c.x},${c.y},${c.z}`;i[h]||(i[h]=c)}function E(c,h,u,y){if(C(h),C(u),C(y),c>=g)return;const w=new a.Vector3().addVectors(h,u).normalize(),d=new a.Vector3().addVectors(u,y).normalize(),p=new a.Vector3().addVectors(y,h).normalize();E(c+1,h,w,p),E(c+1,w,u,d),E(c+1,p,d,y),E(c+1,w,d,p)}for(const c of[-1,1])for(const h of[-1,1])for(const u of[-1,1]){const y=new a.Vector3(c,0,0),w=new a.Vector3(0,h,0),d=new a.Vector3(0,0,u);E(0,y,w,d)}const n=Object.values(i),o=new a.Vector3(s,s,Q),r=new a.Quaternion,l=typeof B=="function"?new a.Color:B;for(const c of n)r.setFromUnitVectors(new a.Vector3(0,0,-1),c),typeof B=="function"&&B(l,c),c.multiplyScalar(e),c.add(A),t.pushSplat(c,o,r,1,l)}function jo({text:t,font:A,fontSize:e,color:g,rgb:I,dotRadius:s,textAlign:Q,lineHeight:B,objectScale:i}){A=A??"Arial",e=e??32,g=g??new a.Color(1,1,1),s=s??.8,Q=Q??"start",B=B??1,i=i??1;const C=t.split(`
`),E=document.createElement("canvas"),n=E.getContext("2d");if(!n)throw new Error("Failed to create canvas context");n.font=`${e}px ${A}`,n.textAlign=Q;const o=n.measureText(""),r=o.fontBoundingBoxAscent+o.fontBoundingBoxDescent;let l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let G=0;G<C.length;++G){const x=n.measureText(C[G]),U=r*B*G;l=Math.min(l,-x.actualBoundingBoxLeft),c=Math.max(c,x.actualBoundingBoxRight),h=Math.min(h,U-x.actualBoundingBoxAscent),u=Math.max(u,U+x.actualBoundingBoxDescent)}const y=Math.floor(l),w=Math.floor(h),d=Math.ceil(c)-y,p=Math.ceil(u)-w;E.width=d,E.height=p,n.font=`${e}px ${A}`,n.textAlign=Q,n.textBaseline="alphabetic",n.fillStyle="#FFFFFF";for(let G=0;G<C.length;++G){const x=r*B*G-w;n.fillText(C[G],-y,x)}const m=n.getImageData(0,0,d,p),N=new Uint8Array(m.data.buffer),f=new vA,D=new a.Vector3,R=new a.Vector3().setScalar(s*i),S=new a.Quaternion(0,0,0,1);I=I??new a.Color(1,1,1);let M=0;for(let G=0;G<p;++G)for(let x=0;x<d;++x){const U=N[M+3];if(U>0){const J=U/255;D.set(x-.5*(d-1),.5*(p-1)-G,0),D.multiplyScalar(i),f.pushSplat(D,R,S,J,I)}M+=4}const L=new zA({packedSplats:f});return L.recolor=g,L}function Xo({url:t,dotRadius:A,subXY:e,forEachSplat:g}){return A=A??.8,e=Math.max(1,Math.floor(e??1)),new zA({constructSplats:async I=>new Promise((s,Q)=>{const B=new Image;B.crossOrigin="anonymous",B.onerror=Q,B.onload=()=>{const{width:i,height:C}=B,E=document.createElement("canvas");E.width=i,E.height=C;const n=E.getContext("2d");if(!n){Q(new Error("Failed to create canvas context"));return}n.imageSmoothingEnabled=!0,n.imageSmoothingQuality="high";const o=Math.round(i/e),r=Math.round(C/e);n.drawImage(B,0,0,o,r);try{const l=n.getImageData(0,0,o,r),c=new Uint8Array(l.data.buffer),h=new a.Vector3,u=new a.Vector3().setScalar(A),y=new a.Quaternion(0,0,0,1),w=new a.Color;let d=0;for(let p=0;p<r;++p)for(let m=0;m<o;++m){const N=d*4,f=c[N+3];if(f>0){let D=f/255;w.set(c[N+0]/255,c[N+1]/255,c[N+2]/255),h.set(m-.5*(o-1),.5*(r-1)-p,0),u.setScalar(A),y.set(0,0,0,1);let R=!0;if(g){const S=g(o,r,d,h,u,y,D,w);D=S??D,R=S!==null}R&&I.pushSplat(h,u,y,D,w)}d+=1}s()}catch(l){Q(l)}},B.src=t})})}function _o({box:t,cells:A,dotScale:e,color:g,opacity:I}){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)),I=I??1;const s=A.x*A.y*A.z,Q=K("int",A.x),B=K("int",A.y);K("int",A.z);const i=HA(0),C=new kt({numSplats:s,generator:GA({index:"int"},{gsplat:P},({index:n})=>{if(!n)throw new Error("index is undefined");const o=He(n,Q),r=ne(n,Q),l=He(r,B),c=ne(r,B),h=qA({vectorType:"ivec3",x:o,y:l,z:c}),u=Ps(i),y=qA({vectorType:"ivec2",x:n,y:u}),w=eB(y),d=K("vec3",t.min),p=K("vec3",t.max),m=xt(p,d),N=ne(fA(ht(h),w),K("vec3",A));let f,D,R;g?(f=K("float",g.r),D=K("float",g.g),R=K("float",g.b)):{r:f,g:D,b:R}=Ft(N).outputs;const S=qA({vectorType:"vec4",r:f,g:D,b:R,a:K("float",I)}),M=fA(d,aA(m,N)),L=ht(K("float",e)),G=K("vec4",new a.Quaternion(0,0,0,1));let x=Qt({flags:ae("uint","GSPLAT_FLAG_ACTIVE"),index:n,center:M,scales:L,quaternion:G,rgba:S});return x=E.applyGsplat(x),{gsplat:x}},{globals:()=>[xA]}),update:({time:n})=>{i.value=n,E.update(C),C.updateVersion()}}),E=new ot;return C}const Wo={box:new a.Box3(new a.Vector3(-1,-1,-1),new a.Vector3(1,1,1)),density:100,fallDirection:new a.Vector3(-1,-3,1).normalize(),fallVelocity:.02,wanderScale:.04,wanderVariance:2,color1:new a.Color(1,1,1),color2:new a.Color(.5,.5,1),minScale:.001,maxScale:.005,anisoScale:new a.Vector3(1,1,1)},Oo={box:new a.Box3(new a.Vector3(-2,-1,-2),new a.Vector3(2,5,2)),density:10,fallDirection:new a.Vector3(0,-1,0),fallVelocity:2,wanderScale:.1,wanderVariance:1,color1:new a.Color(1,1,1),color2:new a.Color(.25,.25,.5),minScale:.005,maxScale:.01,anisoScale:new a.Vector3(.1,1,.1)};function Po({box:t,minY:A,numSplats:e,density:g,anisoScale:I,minScale:s,maxScale:Q,fallDirection:B,fallVelocity:i,wanderScale:C,wanderVariance:E,color1:n,color2:o,opacity:r,onFrame:l}){t=t??new a.Box3(new a.Vector3(-1,-1,-1),new a.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,e=e??Math.max(1,Math.min(1e6,Math.round(c*g)));const h=HA(s??.001),u=HA(Q??.005),y=tt(((I==null?void 0:I.clone())??new a.Vector3(1,1,1)).normalize()),w=tt((B??new a.Vector3(0,-1,0)).normalize()),d=HA(i??.02),p=HA(C??.01),m=HA(E??2),N=tt(n??new a.Color(1,1,1)),f=tt(o??new a.Color(.5,.5,1)),D=HA(r??1),R=HA(0),S=tt(new a.Vector3(0,0,0)),M=tt(t.min),L=tt(t.max),G=HA(A??Number.NEGATIVE_INFINITY),x=xt(L,M),U=new kt({numSplats:e,generator:GA({index:"int"},{gsplat:P},({index:AA})=>{if(!AA)throw new Error("index not defined");const z=Ke(AA),gA=Ft(z).outputs.w;let tA=ht(z),X=Ce(aA(gA,K("float",100)));X=qe(aA(ae("float","PI"),X)),X=fA(h,aA(X,xt(u,h)));const v=aA(X,y),_=Ce(aA(gA,K("float",10))),j=Ce(gA),W=ts(N,f,j),Y=aA(W,_),yA=Ke(qA({vectorType:"ivec2",x:AA,y:K("int",6837)}));let CA=ht(yA),DA=aA(Ft(yA).outputs.w,m);DA=fA(R,DA),tA=fA(tA,S);const dA=$I(tA,K("vec3",new a.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":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2,Line truncated
{"version":3,"file":"spark.cjs.min.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2,Line truncated
+52 -12
View File
@@ -684,7 +684,7 @@ async function __wbg_init(module_or_path) {
}
}
if (typeof module_or_path === "undefined") {
module_or_path = new URL("data:application/wasm;base64,AGFzbQEAAAAB8gEjYAJ/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+AGALfX19fX19fX1/b38Bb2AGf39/f39/AX9gBX9/fX9/AGAEf31/fwBgBX9/fn9/AGAEf35/fwBgBX9/fH9/AGAEf3x/fwBgA39+fgF/YAN/b28Bf2ACfX0BfQLyBBEDd2JnHV9fd2JnX2J1ZmZlcl82MDljYzNlZWU1MWVkMTU4AAoDd2JnGl9fd2JnX25ld185ZmVlOTdhNDA5YjMyYjY4AAoDd2JnGl9fd2JnX3NldF9mNGYxZjBkYWEzMDY5NmZjAAsDd2JnHV9fd2JnX2xlbmd0aF84Y2ZkMmM2NDA5YWY4OGFkAAwDd2JnMV9fd2JnX25ld3dpdGhieXRlb2Zmc2V0YW5kbGVuZ3RoX2YxZGVhZDQ0ZDFmYzcyMTIABwN3YmcaX193YmdfbmV3X2UzYjMyMWRjZmVmODlmYzcACgN3YmcaX193Ymdfc2V0X2QyMzY2MWQxOTE0OGIyMjkACwN3YmcdX193YmdfbGVuZ3RoXzZjYTUyNzY2NWQ4OTY5NGQADAN3YmcxX193YmdfbmV3d2l0aGJ5dGVvZmZzZXRhbmRsZW5ndGhfZTZiN2U2OWFjZDRjNzM1NAAHA3diZxpfX3diZ19zZXRfMTBiYWQ5YmVlMGU5YzU4YgALA3diZx1fX3diZ19sZW5ndGhfM2I0ZjAyMjE4OGFlOGRiNgAMA3diZx9fX3diZ19zdWJhcnJheV83NjllMWUwZjgxYmIyNTliAAcDd2JnH19fd2JnX3N1YmFycmF5XzNhYWVlYzg5YmIyNTQ0ZjAABwN3YmckX193YmdfbmV3d2l0aGxlbmd0aF81YTVlZmUzMTNjZmQ1OWYxABMDd2JnEF9fd2JpbmRnZW5fdGhyb3cAAgN3YmcRX193YmluZGdlbl9tZW1vcnkAFAN3YmcfX193YmluZGdlbl9pbml0X2V4dGVybnJlZl90YWJsZQAOA7wBugEEAAAGAAQCBAEADwQE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 Line truncated
module_or_path = new URL("data:application/wasm;base64,AGFzbQEAAAAB8gEjYAJ/fwF/YAN/f38Bf2ACf38AYAN/f38AYAF/AX9gAX8AYAV/f39/fwBgA29/fwFvYAV/f39/fwF/YAR/f39/AGABbwFvYANvb38AYAFvAX9gAAF/YAAAYAd/f39/f39/AX9gAX0BfWAGf39/f39/AGAEf39/fwF/YAN/b28Bf2ABfwFvYAABb2AHf39/f39/fwBgAn9+AX9gA39+fgBgC319fX19fX19f29/AW9gBn9/f39/fwF/YAV/f31/fwBgBH99f38AYAV/f35/fwBgBH9+f38AYAV/f3x/fwBgBH98f38AYAN/fn4Bf2ACfX0BfQLyBBEDd2JnHV9fd2JnX2J1ZmZlcl82MDljYzNlZWU1MWVkMTU4AAoDd2JnGl9fd2JnX25ld185ZmVlOTdhNDA5YjMyYjY4AAoDd2JnGl9fd2JnX3NldF9mNGYxZjBkYWEzMDY5NmZjAAsDd2JnHV9fd2JnX2xlbmd0aF84Y2ZkMmM2NDA5YWY4OGFkAAwDd2JnMV9fd2JnX25ld3dpdGhieXRlb2Zmc2V0YW5kbGVuZ3RoX2YxZGVhZDQ0ZDFmYzcyMTIABwN3YmcaX193YmdfbmV3X2UzYjMyMWRjZmVmODlmYzcACgN3YmcaX193Ymdfc2V0X2QyMzY2MWQxOTE0OGIyMjkACwN3YmcdX193YmdfbGVuZ3RoXzZjYTUyNzY2NWQ4OTY5NGQADAN3YmcxX193YmdfbmV3d2l0aGJ5dGVvZmZzZXRhbmRsZW5ndGhfZTZiN2U2OWFjZDRjNzM1NAAHA3diZxpfX3diZ19zZXRfMTBiYWQ5YmVlMGU5YzU4YgALA3diZx1fX3diZ19sZW5ndGhfM2I0ZjAyMjE4OGFlOGRiNgAMA3diZx9fX3diZ19zdWJhcnJheV83NjllMWUwZjgxYmIyNTliAAcDd2JnH19fd2JnX3N1YmFycmF5XzNhYWVlYzg5YmIyNTQ0ZjAABwN3YmckX193YmdfbmV3d2l0aGxlbmd0aF81YTVlZmUzMTNjZmQ1OWYxABQDd2JnEF9fd2JpbmRnZW5fdGhyb3cAAgN3YmcRX193YmluZGdlbl9tZW1vcnkAFQN3YmcfX193YmluZGdlbl9pbml0X2V4dGVybnJlZl90YWJsZQAOA8ABvgEEAAAGAAQCBAEADwQE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 Line truncated
}
const imports = __wbg_get_imports();
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
@@ -8234,7 +8234,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 async function __wbg_load(module, imports) {\n if (typeof Response === "function" && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === "function") {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n if (module.headers.get("Content-Type") != "application/wasm") {\n console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n", e);\n } else {\n throw e;\n }\n }\n }\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n }\n function __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_set_10bad9bee0e9c58b = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_d23661d19148b229 = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_f4f1f0daa30696fc = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_subarray_3aaeec89bb2544f0 = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_subarray_769e1e0f81bb259b = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_0;\n const offset = table.grow(4);\n table.set(0, void 0);\n table.set(offset + 0, void 0);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n };\n imports.wbg.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return ret;\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n return imports;\n }\n function __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n }\n async function __wbg_init(module_or_path) {\n if (wasm !== void 0) return wasm;\n if (typeof module_or_path !== "undefined") {\n if (Object.Line truncated
const jsContent = '(function() {\n "use strict";\n let wasm;\n const cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {\n throw Error("TextDecoder not available");\n } };\n if (typeof TextDecoder !== "undefined") {\n cachedTextDecoder.decode();\n }\n let cachedUint8ArrayMemory0 = null;\n function getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n }\n function getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n }\n function sort_splats(num_splats, readback, ordering) {\n const ret = wasm.sort_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n function sort32_splats(num_splats, readback, ordering) {\n const ret = wasm.sort32_splats(num_splats, readback, ordering);\n return ret >>> 0;\n }\n async function __wbg_load(module, imports) {\n if (typeof Response === "function" && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === "function") {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n if (module.headers.get("Content-Type") != "application/wasm") {\n console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n", e);\n } else {\n throw e;\n }\n }\n }\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n }\n function __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_6ca527665d89694d = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_8cfd2c6409af88ad = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_9fee97a409b32b68 = function(arg0) {\n const ret = new Uint16Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {\n const ret = new Uint32Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {\n const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {\n const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(arg0) {\n const ret = new Float32Array(arg0 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_set_10bad9bee0e9c58b = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_d23661d19148b229 = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_set_f4f1f0daa30696fc = function(arg0, arg1, arg2) {\n arg0.set(arg1, arg2 >>> 0);\n };\n imports.wbg.__wbg_subarray_3aaeec89bb2544f0 = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_subarray_769e1e0f81bb259b = function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_0;\n const offset = table.grow(4);\n table.set(0, void 0);\n table.set(offset + 0, void 0);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n };\n imports.wbg.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return ret;\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n return imports;\n }\n function __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n Line truncated
const blob = typeof self !== "undefined" && self.Blob && new Blob([jsContent], { type: "text/javascript;charset=utf-8" });
function WorkerWrapper(options) {
let objURL;
@@ -9282,7 +9282,8 @@ const _SparkViewpoint = class _SparkViewpoint {
this.sorting = null;
this.pending = null;
this.sortingCheck = false;
this.readback = new Uint16Array(0);
this.readback16 = new Uint16Array(0);
this.readback32 = new Uint32Array(0);
this.spark = options.spark;
this.camera = options.camera;
this.viewToWorld = options.viewToWorld ?? new THREE.Matrix4();
@@ -9321,6 +9322,7 @@ const _SparkViewpoint = class _SparkViewpoint {
this.sortCoorient = options.sortCoorient;
this.depthBias = options.depthBias;
this.sort360 = options.sort360;
this.sort32 = options.sort32;
this.orderingFreelist = new FreeList({
allocate: (maxSplats) => new Uint32Array(maxSplats),
valid: (ordering, maxSplats) => ordering.length === maxSplats
@@ -9609,6 +9611,7 @@ const _SparkViewpoint = class _SparkViewpoint {
const {
reader,
doubleSortReader,
sort32Reader,
dynoSortRadial,
dynoOrigin,
dynoDirection,
@@ -9616,8 +9619,16 @@ const _SparkViewpoint = class _SparkViewpoint {
dynoSort360,
dynoSplats
} = _SparkViewpoint.makeSorter();
const halfMaxSplats = Math.ceil(maxSplats / 2);
this.readback = reader.ensureBuffer(halfMaxSplats, this.readback);
const sort32 = this.sort32 ?? false;
let readback;
if (sort32) {
this.readback32 = reader.ensureBuffer(maxSplats, this.readback32);
readback = this.readback32;
} else {
const halfMaxSplats = Math.ceil(maxSplats / 2);
this.readback16 = reader.ensureBuffer(halfMaxSplats, this.readback16);
readback = this.readback16;
}
const worldToOrigin = accumulator.toWorld.clone().invert();
const viewToOrigin = viewToWorld.clone().premultiply(worldToOrigin);
dynoSortRadial.value = this.sort360 ? true : this.sortRadial;
@@ -9626,20 +9637,28 @@ const _SparkViewpoint = class _SparkViewpoint {
dynoDepthBias.value = this.depthBias ?? 1;
dynoSort360.value = this.sort360 ?? false;
dynoSplats.packedSplats = accumulator.splats;
const sortReader = sort32 ? sort32Reader : doubleSortReader;
const count = sort32 ? numSplats : Math.ceil(numSplats / 2);
await reader.renderReadback({
renderer: this.spark.renderer,
reader: doubleSortReader,
count: Math.ceil(numSplats / 2),
readback: this.readback
reader: sortReader,
count,
readback
});
const result = await withWorker(async (worker) => {
return worker.call("sortDoubleSplats", {
const rpcName = sort32 ? "sort32Splats" : "sortDoubleSplats";
return worker.call(rpcName, {
maxSplats,
numSplats,
readback: this.readback,
readback,
ordering
});
});
this.readback = result.readback;
if (sort32) {
this.readback32 = result.readback;
} else {
this.readback16 = result.readback;
}
ordering = result.ordering;
activeSplats = result.activeSplats;
}
@@ -9724,6 +9743,26 @@ const _SparkViewpoint = class _SparkViewpoint {
return { rgba8 };
}
);
const sort32Reader = dynoBlock(
{ index: "int" },
{ rgba8: "vec4" },
({ index }) => {
if (!index) {
throw new Error("No index");
}
const sortParams = {
sortRadial: dynoSortRadial,
sortOrigin: dynoOrigin,
sortDirection: dynoDirection,
sortDepthBias: dynoDepthBias,
sort360: dynoSort360
};
const gsplat = readPackedSplat(dynoSplats, index);
const metric = computeSortMetric({ gsplat, ...sortParams });
const rgba8 = uintToRgba8(floatBitsToUint(metric));
return { rgba8 };
}
);
_SparkViewpoint.dynos = {
dynoSortRadial,
dynoOrigin,
@@ -9732,7 +9771,8 @@ const _SparkViewpoint = class _SparkViewpoint {
dynoSort360,
dynoSplats,
reader,
doubleSortReader
doubleSortReader,
sort32Reader
};
}
return _SparkViewpoint.dynos;
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"spark.module.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, Line truncated
{"version":3,"file":"spark.module.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, Line truncated
+2445 -2416
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":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2,Line truncated
{"version":3,"file":"spark.module.min.js","sources":["../node_modules/three/examples/jsm/postprocessing/Pass.js","../node_modules/fflate/esm/browser.js","../rust/spark-internal-rs/pkg/spark_internal_rs.js","../src/defines.ts","../src/dyno/types.ts","../src/dyno/value.ts","../src/dyno/base.ts","../src/dyno/splats.ts","../src/dyno/output.ts","../src/dyno/uniforms.ts","../src/utils.ts","../src/dyno/program.ts","../src/dyno/mathTypes.ts","../src/dyno/math.ts","../src/dyno/logic.ts","../src/dyno/convert.ts","../src/dyno/vecmat.ts","../src/dyno/util.ts","../src/dyno/transform.ts","../src/dyno/control.ts","../src/dyno/texture.ts","../src/dyno/trig.ts","../src/shaders/computeVec4.glsl","../src/Readback.ts","../src/RgbaArray.ts","../src/SplatEdit.ts","../src/SplatGenerator.ts","../src/SplatMesh.ts","../src/ply.ts","../src/splatWorker.ts","../src/SplatLoader.ts","../src/shaders/computeUvec4.glsl","../src/PackedSplats.ts","../src/SplatGeometry.ts","../src/SparkViewpoint.ts","../src/SplatAccumulator.ts","../src/shaders/splatDefines.glsl","../src/shaders/splatFragment.glsl","../src/shaders/splatVertex.glsl","../src/shaders.ts","../src/SparkRenderer.ts","../src/antisplat.ts","../src/ksplat.ts","../src/spz.ts","../src/SplatSkinning.ts","../src/splatConstructors.ts","../src/generators/static.ts","../src/generators/snow.ts","../src/modifiers/normalColor.ts","../src/modifiers/depthColor.ts","../src/vrButton.ts","../src/hands.ts","../src/controls.ts"],"sourcesContent":["import {\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tOrthographicCamera,\n\tMesh\n} from 'three';\n\nclass Pass {\n\n\tconstructor() {\n\n\t\tthis.isPass = true;\n\n\t\t// if set to true, the pass is processed by the composer\n\t\tthis.enabled = true;\n\n\t\t// if set to true, the pass indicates to swap read and write buffer after rendering\n\t\tthis.needsSwap = true;\n\n\t\t// if set to true, the pass clears its buffer before rendering\n\t\tthis.clear = false;\n\n\t\t// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.\n\t\tthis.renderToScreen = false;\n\n\t}\n\n\tsetSize( /* width, height */ ) {}\n\n\trender( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\tconsole.error( 'THREE.Pass: .render() must be implemented in derived pass.' );\n\n\t}\n\n\tdispose() {}\n\n}\n\n// Helper for passes that need to fill the viewport with a single quad.\n\nconst _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\n// https://github.com/mrdoob/three.js/pull/21358\n\nclass FullscreenTriangleGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n\n\t}\n\n}\n\nconst _geometry = new FullscreenTriangleGeometry();\n\nclass FullScreenQuad {\n\n\tconstructor( material ) {\n\n\t\tthis._mesh = new Mesh( _geometry, material );\n\n\t}\n\n\tdispose() {\n\n\t\tthis._mesh.geometry.dispose();\n\n\t}\n\n\trender( renderer ) {\n\n\t\trenderer.render( this._mesh, _camera );\n\n\t}\n\n\tget material() {\n\n\t\treturn this._mesh.material;\n\n\t}\n\n\tset material( value ) {\n\n\t\tthis._mesh.material = value;\n\n\t}\n\n}\n\nexport { Pass, FullScreenQuad };\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2,Line truncated
+4 -1
View File
@@ -91,6 +91,7 @@ export type SparkViewpointOptions = {
* @default false
*/
sort360?: boolean;
sort32?: boolean;
};
export declare class SparkViewpoint {
spark: SparkRenderer;
@@ -110,6 +111,7 @@ export declare class SparkViewpoint {
sortCoorient?: boolean;
depthBias?: number;
sort360?: boolean;
sort32?: boolean;
display: {
accumulator: SplatAccumulator;
viewToWorld: THREE.Matrix4;
@@ -118,7 +120,8 @@ export declare class SparkViewpoint {
private sorting;
private pending;
private sortingCheck;
private readback;
private readback16;
private readback32;
private orderingFreelist;
constructor(options: SparkViewpointOptions & {
spark: SparkRenderer;