@jdultra/threedtiles 13.2.1 → 13.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/assets/{PointsManager.worker-5fpGpVvf.js → PointsManager.worker-dH1fNyu8.js} +142 -112
- package/dist/assets/PointsManager.worker-dH1fNyu8.js.map +1 -0
- package/dist/splats/PointsManager.d.ts +7 -3
- package/dist/splats/SplatsMesh.d.ts +6 -2
- package/dist/threedtiles.cjs.js +22 -17
- package/dist/threedtiles.cjs.js.map +1 -1
- package/dist/threedtiles.es.js +2108 -2088
- package/dist/threedtiles.es.js.map +1 -1
- package/dist/threedtiles.umd.js +22 -17
- package/dist/threedtiles.umd.js.map +1 -1
- package/dist/tileset/OGC3DTile.d.ts +10 -1
- package/package.json +1 -1
- package/dist/assets/PointsManager.worker-5fpGpVvf.js.map +0 -1
|
@@ -38,7 +38,8 @@ export class OGC3DTile extends THREE.Object3D<THREE.Object3DEventMap> {
|
|
|
38
38
|
* - "IMMEDIATE" skips intermediate LODs. tiles are missing until loaded when moving to a new area
|
|
39
39
|
* @param {String} [properties.drawBoundingVolume = false] - optional draws the bounding volume (may cause flickering)
|
|
40
40
|
* @param {String} [properties.splatsFragmentShader = undefined] - optional pass a custom fragment shader for rendering splats
|
|
41
|
-
* @param {number} [properties.splatsQuality =
|
|
41
|
+
* @param {number} [properties.splatsQuality = 0.75] - optional pass a visual quality for splats between 0 and 1. Lower quality improves performance at the cost of visual approximations.
|
|
42
|
+
* @param {number} [properties.splatsCPUCulling = false] - optional if true, splats are culled on CPU asynchronously. Better frame-rate and faster sorting but splats are absent when camera moves quickly until sort finishes.
|
|
42
43
|
*/
|
|
43
44
|
constructor(properties?: {
|
|
44
45
|
url?: string | undefined;
|
|
@@ -71,9 +72,11 @@ export class OGC3DTile extends THREE.Object3D<THREE.Object3DEventMap> {
|
|
|
71
72
|
drawBoundingVolume?: string | undefined;
|
|
72
73
|
splatsFragmentShader?: string | undefined;
|
|
73
74
|
splatsQuality?: number | undefined;
|
|
75
|
+
splatsCPUCulling?: number | undefined;
|
|
74
76
|
});
|
|
75
77
|
splatsMesh: any;
|
|
76
78
|
splatsQuality: number;
|
|
79
|
+
splatsCPUCulling: number | boolean | undefined;
|
|
77
80
|
contentURL: any[];
|
|
78
81
|
rendererSize: THREE.Vector2;
|
|
79
82
|
loadingStrategy: string;
|
|
@@ -134,6 +137,12 @@ export class OGC3DTile extends THREE.Object3D<THREE.Object3DEventMap> {
|
|
|
134
137
|
* @param {number} cropRadius
|
|
135
138
|
*/
|
|
136
139
|
setSplatsCropRadius(cropRadius: number): void;
|
|
140
|
+
/**
|
|
141
|
+
* Set the splats to use CPU culling. Faster sort and better frame rate at the cost of splats being absent when camera moves quickly.
|
|
142
|
+
* @param {boolean} splatsCPUCulling
|
|
143
|
+
*/
|
|
144
|
+
setSplatsCPUCulling(splatsCPUCulling: boolean): void;
|
|
145
|
+
setSplatsQuality(splatsQuality: any): void;
|
|
137
146
|
/**
|
|
138
147
|
* Manually updates all the matrices of the tileset.
|
|
139
148
|
* To be called after transforming a {@link OGC3DTile tileset} instantiated with the "static" option
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PointsManager.worker-5fpGpVvf.js","sources":["../src/splats/radix/wasm_sorter.js","../src/splats/PointsManager.js","../src/splats/PointsManager.worker.js"],"sourcesContent":["let wasm;\n\nlet cachedUint32ArrayMemory0 = null;\n\nfunction getUint32ArrayMemory0() {\n if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {\n cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);\n }\n return cachedUint32ArrayMemory0;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nfunction passArray32ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 4, 4) >>> 0;\n getUint32ArrayMemory0().set(arg, ptr / 4);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction getArrayU32FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);\n}\n/**\n * Radix Sort implementation for sorting indices based on distances.\n * Both `indices` and `distances` should have the same length.\n * Returns a new vector of sorted indices in descending order based on distances.\n * @param {Uint32Array} indices\n * @param {Uint32Array} distances\n * @returns {Uint32Array}\n */\nexport function radix_sort_indices(indices, distances) {\n const ptr0 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray32ToWasm0(distances, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.radix_sort_indices(ptr0, len0, ptr1, len1);\n var v3 = getArrayU32FromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);\n return v3;\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.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_0;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n ;\n };\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint32ArrayMemory0 = null;\n\n\n wasm.__wbindgen_start();\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('wasm_sorter_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","import init, { radix_sort_indices } from './radix/wasm_sorter.js';\r\n\r\nconst buffer = new ArrayBuffer(4);\r\nconst floatView = new Float32Array(buffer);\r\nconst uintView = new Uint32Array(buffer);\r\n\r\nclass PointsManager {\r\n constructor(sortCallback) {\r\n this.points = new Float32Array(4096 * 3);\r\n this.distances = new Uint32Array(4096);\r\n this.pointSets = new Map(); // Map<number, object>\r\n this.numUsed = 0;\r\n this.sortOngoing = false;\r\n this.sortCallback = sortCallback;\r\n this.sortPromise = Promise.resolve();\r\n }\r\n\r\n\r\n\r\n hidePoints(insertionIndex) {\r\n //console.log(\"hide\");\r\n const pointSet = this.pointSets.get(insertionIndex);\r\n if (pointSet.used) {\r\n pointSet.used = false;\r\n }\r\n }\r\n removePoints(insertionIndex) {\r\n /* console.log(\"remove\"); */\r\n const pointSet = this.pointSets.get(insertionIndex);\r\n if (pointSet.used) {\r\n pointSet.used = false;\r\n }\r\n\r\n this.pointSets.delete(insertionIndex);\r\n\r\n // Determine newLength based on remaining points\r\n let newLength = 0;\r\n for (const [key, aPointSet] of this.pointSets.entries()) {\r\n if (key + aPointSet.length > newLength) {\r\n newLength = key + aPointSet.length;\r\n }\r\n }\r\n\r\n }\r\n showPoints(insertionIndex) {\r\n /* console.log(\"show\"); */\r\n const pointSet = this.pointSets.get(insertionIndex);\r\n if (!pointSet.used) {\r\n pointSet.used = true;\r\n }\r\n\r\n }\r\n\r\n resizeArrays(newLength) {\r\n\r\n if (isNaN(newLength)) {\r\n console.log(\"hit max splats\")\r\n }\r\n //console.log(newLength)\r\n if (newLength > this.points.length) {\r\n newLength = Math.max(this.points.length * 2, newLength);\r\n // Resize points array\r\n const newPoints = new Float32Array(newLength);\r\n newPoints.set(this.points, 0);\r\n this.points = newPoints;\r\n\r\n // Resize distances array\r\n const newNumPoints = Math.floor(newLength / 3);\r\n const newDistances = new Uint32Array(newNumPoints);\r\n newDistances.set(this.distances, 0);\r\n this.distances = newDistances;\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n addBatchesOffsetStrideCount(positions, insertionIndexes, offset, stride, batchSize) {\r\n\r\n const newLength = Math.max(this.points.length, insertionIndexes[insertionIndexes.length - 1] + batchSize * 3);\r\n\r\n this.resizeArrays(newLength);\r\n for (let batchIndex = 0; batchIndex < insertionIndexes.length; batchIndex++) {\r\n\r\n const insertionIndex = insertionIndexes[batchIndex];\r\n const start = Math.floor(insertionIndex / 3);\r\n const batchPositionStartIndex = batchIndex * batchSize * stride;\r\n const batchNumPoints = Math.min((positions.length - batchPositionStartIndex) / stride, batchSize);\r\n\r\n\r\n for (let i = 0; i < batchNumPoints; i++) {\r\n\r\n this.points[insertionIndex + i * 3] = positions[i * stride + offset + batchPositionStartIndex]\r\n this.points[insertionIndex + i * 3 + 1] = positions[i * stride + offset + batchPositionStartIndex + 1]\r\n this.points[insertionIndex + i * 3 + 2] = positions[i * stride + offset + batchPositionStartIndex + 2]\r\n\r\n }\r\n this.pointSets.set(insertionIndex, { length: batchNumPoints * 3, used: false });\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n\r\n\r\n computeDistances(x, y, z) {\r\n\r\n this.distances.fill(0);\r\n const keys = Array.from(this.pointSets.keys());\r\n const numKeys = keys.length;\r\n this.numUsed = 0;\r\n for (let i = 0; i < numKeys; i++) {\r\n const key = keys[i];\r\n const pointSet = this.pointSets.get(key);\r\n if (!pointSet.used) continue;\r\n const length = Math.floor(pointSet.length / 3);\r\n this.numUsed += length\r\n }\r\n //console.log(\"num used : \"+this.numUsed);\r\n this.indexes = new Uint32Array(this.numUsed);\r\n this.distances = new Uint32Array(this.numUsed);\r\n let c = 0;\r\n for (let i = 0; i < numKeys; i++) {\r\n const key = keys[i];\r\n const keyBase = Math.floor(key / 3);\r\n const pointSet = this.pointSets.get(key);\r\n if (!pointSet.used) continue;\r\n const length = Math.floor(pointSet.length / 3);\r\n //this.numUsed += length\r\n for (let j = 0; j < length; j++) {\r\n const idx = key + (j * 3);\r\n const dx = x - this.points[idx];\r\n const dy = y - this.points[idx + 1];\r\n const dz = z - this.points[idx + 2];\r\n const d = dx*dx + dy*dy + dz*dz;\r\n floatView[0] = d;\r\n this.distances[c] = uintView[0];\r\n this.indexes[c++] = keyBase + j;\r\n }\r\n }\r\n \r\n }\r\n\r\n sort(xyz, id) {\r\n // Always store the latest sort request\r\n\r\n this.pendingSort = xyz;\r\n this.pendingID = id;\r\n //console.log(`Received sort request with ID: ${id}`);\r\n\r\n // If no sort is currently ongoing, start processing\r\n if (!this.sortOngoing) {\r\n this.sortOngoing = true;\r\n this.processSortQueue();\r\n }\r\n }\r\n\r\n // Asynchronous loop to process sort requests sequentially\r\n async processSortQueue() {\r\n if(!this.initialized){\r\n await init();\r\n this.initialized = true;\r\n }\r\n while (this.pendingSort) {\r\n const currentSort = this.pendingSort;\r\n const currentID = this.pendingID;\r\n\r\n // Clear the pending sort to capture any new requests during processing\r\n this.pendingSort = null;\r\n this.pendingID = null;\r\n\r\n //console.log(`Starting sort with ID: ${currentID}`);\r\n\r\n const start = performance.now();\r\n\r\n // Perform the synchronous sort operations\r\n this.computeDistances(currentSort[0], currentSort[1], currentSort[2]);\r\n //console.log((performance.now() - start)+' ms');\r\n \r\n //console.log(this.indexes.length)\r\n \r\n this.indexes = radix_sort_indices(this.indexes, this.distances);\r\n /* radixSort(this.indexes, {\r\n get: (el) => this.distances[el],\r\n reversed: true\r\n }); */\r\n \r\n const duration = performance.now() - start;\r\n //console.log(`Sort with ID: ${currentID} completed in ${duration.toFixed(2)}ms`);\r\n\r\n // Callback after sorting is done\r\n this.sortCallback(this.indexes, this.numUsed, currentID);\r\n\r\n // Yield control to the event loop to handle new incoming sort requests\r\n await new Promise(resolve => setTimeout(resolve, 0));\r\n }\r\n\r\n // No more pending sorts\r\n this.sortOngoing = false;\r\n //console.log(\"No more pending sorts. SortWorker is idle.\");\r\n }\r\n} export { PointsManager }","import { PointsManager } from \"./PointsManager\";\r\n\r\nconst sortCallback = ((array, numUsed, id)=>{\r\n const copy = new Uint32Array(array)\r\n postMessage({\r\n order: copy.buffer,\r\n count: numUsed,\r\n id: id\r\n }, [copy.buffer]);\r\n})\r\nlet pointsManager;\r\nself.onmessage = function (e) {\r\n\r\n try {\r\n\r\n switch (e.data.method) {\r\n \r\n case \"addBatches\":\r\n if (!pointsManager) {\r\n pointsManager = new PointsManager(sortCallback);\r\n }\r\n pointsManager.addBatchesOffsetStrideCount(new Float32Array(e.data.positions), e.data.insertionIndexes, e.data.offset, e.data.stride, e.data.batchSize);\r\n break\r\n case \"hide\":\r\n\r\n if (!!pointsManager) {\r\n pointsManager.hidePoints(e.data.insertionIndex);\r\n }\r\n\r\n break\r\n case \"hideBatches\":\r\n\r\n if (!!pointsManager) {\r\n e.data.insertionIndexes.forEach(insertionIndex => {\r\n pointsManager.hidePoints(insertionIndex);\r\n });\r\n pointsManager.sort(e.data.xyz, e.data.id)\r\n }\r\n\r\n break\r\n case \"show\":\r\n\r\n if (!!pointsManager) {\r\n pointsManager.showPoints(e.data.insertionIndex);\r\n pointsManager.sort(e.data.xyz, e.data.id)\r\n }\r\n\r\n break;\r\n case \"showBatches\":\r\n\r\n if (!!pointsManager) {\r\n e.data.insertionIndexes.forEach(insertionIndex => {\r\n pointsManager.showPoints(insertionIndex);\r\n });\r\n pointsManager.sort(e.data.xyz, e.data.id)\r\n }\r\n\r\n break\r\n case \"remove\":\r\n if (!!pointsManager) {\r\n pointsManager.removePoints(e.data.insertionIndex);\r\n pointsManager.sort(e.data.xyz, e.data.id)\r\n }\r\n\r\n break\r\n case \"removeBatches\":\r\n\r\n if (!!pointsManager) {\r\n e.data.insertionIndexes.forEach(insertionIndex => {\r\n pointsManager.removePoints(insertionIndex);\r\n });\r\n pointsManager.sort(e.data.xyz, e.data.id)\r\n }\r\n\r\n break\r\n case \"sort\":\r\n if (!!pointsManager) {\r\n pointsManager.sort(e.data.xyz, e.data.id)\r\n }\r\n break\r\n default:\r\n throw new Error(`No method with name ${e.data.method}`)\r\n }\r\n } catch (error) {\r\n postMessage({ error: error.message })\r\n }\r\n}"],"names":["wasm","cachedUint32ArrayMemory0","getUint32ArrayMemory0","WASM_VECTOR_LEN","passArray32ToWasm0","arg","malloc","ptr","getArrayU32FromWasm0","len","radix_sort_indices","indices","distances","ptr0","len0","ptr1","len1","ret","v3","__wbg_load","module","imports","e","bytes","instance","__wbg_get_imports","table","offset","__wbg_finalize_init","__wbg_init","module_or_path","buffer","floatView","uintView","PointsManager","sortCallback","insertionIndex","pointSet","newLength","key","aPointSet","newPoints","newNumPoints","newDistances","positions","insertionIndexes","stride","batchSize","batchIndex","batchPositionStartIndex","batchNumPoints","i","x","y","z","keys","numKeys","length","c","keyBase","j","idx","dx","dy","dz","d","xyz","id","init","currentSort","currentID","start","resolve","array","numUsed","copy","pointsManager","error"],"mappings":"AAAA,IAAIA,GAEAC,IAA2B;AAE/B,SAASC,IAAwB;AAC7B,UAAID,MAA6B,QAAQA,EAAyB,eAAe,OAC7EA,IAA2B,IAAI,YAAYD,EAAK,OAAO,MAAM,IAE1DC;AACX;AAEA,IAAIE,IAAkB;AAEtB,SAASC,EAAmBC,GAAKC,GAAQ;AACrC,QAAMC,IAAMD,EAAOD,EAAI,SAAS,GAAG,CAAC,MAAM;AAC1C,SAAAH,EAAuB,EAAC,IAAIG,GAAKE,IAAM,CAAC,GACxCJ,IAAkBE,EAAI,QACfE;AACX;AAEA,SAASC,EAAqBD,GAAKE,GAAK;AACpC,SAAAF,IAAMA,MAAQ,GACPL,EAAuB,EAAC,SAASK,IAAM,GAAGA,IAAM,IAAIE,CAAG;AAClE;AASO,SAASC,EAAmBC,GAASC,GAAW;AACnD,QAAMC,IAAOT,EAAmBO,GAASX,EAAK,iBAAiB,GACzDc,IAAOX,GACPY,IAAOX,EAAmBQ,GAAWZ,EAAK,iBAAiB,GAC3DgB,IAAOb,GACPc,IAAMjB,EAAK,mBAAmBa,GAAMC,GAAMC,GAAMC,CAAI;AAC1D,MAAIE,IAAKV,EAAqBS,EAAI,CAAC,GAAGA,EAAI,CAAC,CAAC,EAAE,MAAO;AACrD,SAAAjB,EAAK,gBAAgBiB,EAAI,CAAC,GAAGA,EAAI,CAAC,IAAI,GAAG,CAAC,GACnCC;AACX;AAEA,eAAeC,EAAWC,GAAQC,GAAS;AACvC,MAAI,OAAO,YAAa,cAAcD,aAAkB,UAAU;AAC9D,QAAI,OAAO,YAAY,wBAAyB;AAC5C,UAAI;AACA,eAAO,MAAM,YAAY,qBAAq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