Hi! First off, thank you for creating and maintaining this amazing tool. It has been incredibly useful to me, and I truly appreciate all the effort you’ve put into it! c:
Context
When using a viewer in dynamicScene mode, adding another scene (after one or more scenes are already loaded) results in an error. This issue seems potentially related to https://github.com/mkkellogg/GaussianSplats3D/issues/346.
Details
The following error occurs consistently:
Uncaught RangeError: offset is out of bounds
at Uint32Array.set (<anonymous>)
at mn.gatherSceneNodesForSort (Viewer.js:2042:46)
at mn.runSplatSort (Viewer.js:1857:60)
at mn.update (Viewer.js:1609:14)
at An.onBeforeRender (DropInViewer.js:124:16)
at Kt (three.module.js:16255:11)
at Zt (three.module.js:16245:6)
at Xt (three.module.js:16094:36)
at im.render (three.module.js:15912:5)
at update (viewersidebyside.html:159:15)
Viewer.js:1135 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'then')
at Viewer.js:1135:54
I suspect the root cause lies elsewhere, since the arrays sortWorkerIndexestoSort and allSplatsSortBuffer are already mismatched at that point. But here are my observations about the mismatch anyways:
*With dynamic mode active the the initial load hits that line 5 times vs. the static scenes 1. Not sure if that's expected behaviour?
Reproducible example
I've uploaded an example here. It's based on the code from the demos folder of your repo, so hopefully it should be easy for you to navigate. The source code can be read here and the most relevant file to check out would be viewersidebyside.html .
Note: if no splats at all load in the first time, try reloading the page to make sure the CORS trick kicks in
It happens with both .ksplat files and .ply files.
It doesn't seem to be related to the CSS styles, how the module is loaded or how the CORS issue is handled.
It happens with all methods for adding scenes: addSplatScene, addSplatScenes and even addSplatBuffers when loading the data by hand. Nor does it seem timing-dependent.
The parameters of the scene itself don't seem to matter, but I did not try all combinations.
The following viewer parameters don't seem to matter in isolation (I have not tested if combinations of them could maybe fix the issue):
splatSortDistanceMapPrecision tried with 1, 4, 16, 32, 64
halfPrecisionCovariancesOnGPU
renderMode
sceneRevealMode
antialiased
sphericalHarmonicsDegree
enableOptionalEffects
inMemoryCompressionLevel
optimizeSplatData
freeIntermediateSplatData
sceneFadeInRateMultiplier
BUT:
😰 I could not try gpuAccelerateSort because it does not seem to work at all on my computer, I am unsure if this is related or not.
I wish I could offer more insights, but I know nothing of WASM, web workers, or how the splat sorting works. So, if there's anything else I can do to help identify and solve the issue, please let me know!
Hi! First off, thank you for creating and maintaining this amazing tool. It has been incredibly useful to me, and I truly appreciate all the effort you’ve put into it! c:
Context
When using a viewer in
dynamicScene
mode, adding another scene (after one or more scenes are already loaded) results in an error. This issue seems potentially related to https://github.com/mkkellogg/GaussianSplats3D/issues/346.Details
The following error occurs consistently:
The error seems to originate from this line of code in the viewer: https://github.com/mkkellogg/GaussianSplats3D/blob/f6f4adea2e0a5745f942767214c7d3b335a10751/src/Viewer.js#L2051
I suspect the root cause lies elsewhere, since the arrays
sortWorkerIndexestoSort
andallSplatsSortBuffer
are already mismatched at that point. But here are my observations about the mismatch anyways:totalSplatCount
this.sortWorkerIndexesToSort
allSplatsSortBuffer
Uint32Array(175745) [0, 1, 2, 3, ...
Uint32Array(175745) [0, 1, 2, 3, ...
Uint32Array(351490) [0, 1, 2, 3, ...
Uint32Array(351490) [0, 1, 2, 3, ...
Uint32Array(175745) [0, 1, 2, 3, ...
Uint32Array(175745) [0, 1, 2, 3, ...
Uint32Array(175745) [175676, 175735, 172256, 172260, ...
Uint32Array(175745) [0, 1, 2, 3, ...
*With dynamic mode active the the initial load hits that line 5 times vs. the static scenes 1. Not sure if that's expected behaviour?
Reproducible example
I've uploaded an example here. It's based on the code from the demos folder of your repo, so hopefully it should be easy for you to navigate. The source code can be read here and the most relevant file to check out would be
viewersidebyside.html
.Note: if no splats at all load in the first time, try reloading the page to make sure the CORS trick kicks in
To reproduce the error, open "Side by side comparison" and then:
Observations:
Here are some extra observations that may (or may not) help narrow the issue down:
.ksplat
files and.ply
files.addSplatScene
,addSplatScenes
and evenaddSplatBuffers
when loading the data by hand. Nor does it seem timing-dependent.cameraUp
,initialCameraPosition
,initialCameraLookAt
useBuiltInControls
ignoreDevicePixelRatio
enableSIMDInSort
sharedMemoryForWorkers
integerBasedSort
splatSortDistanceMapPrecision
tried with 1, 4, 16, 32, 64halfPrecisionCovariancesOnGPU
renderMode
sceneRevealMode
antialiased
sphericalHarmonicsDegree
enableOptionalEffects
inMemoryCompressionLevel
optimizeSplatData
freeIntermediateSplatData
sceneFadeInRateMultiplier
gpuAccelerateSort
because it does not seem to work at all on my computer, I am unsure if this is related or not.I wish I could offer more insights, but I know nothing of WASM, web workers, or how the splat sorting works. So, if there's anything else I can do to help identify and solve the issue, please let me know!