mkkellogg / GaussianSplats3D

Three.js-based implementation of 3D Gaussian splatting
MIT License
1.37k stars 168 forks source link

RemoveSplatScene is never done if there is only one scene. #254

Closed fred-ais-pl closed 2 months ago

fred-ais-pl commented 3 months ago

I am using version 0.4.2 with sharedMemoryForWorkers: false, progressiveLoad: true options. If I call removeSplatScene on the only scene, the viewer will freeze and Removing splat scene... message never disappears. Looks like addSplatBuffers is never resolved because there is no more message from sortWorker.

Here is snippet code to reproduce the issue

viewer.addSplatScene(url, { 'progressiveLoad': true })
    .then(() => new Promise(resolve => setTimeout(resolve, 5000))) // wait for scene to load
    .then((() => viewer.removeSplatScene(0)))

removeSplatScene works as expected if there are at least two scenes, but if I want progressiveLoad only one is allowed.

mkkellogg commented 3 months ago

Ah, thanks for pointing this out! I'll try to get a fix for this into the next release. In the meantime a work-around would be to just to dispose and then re-create the viewer when there is only one scene (I know it's a bit of a pain to do it that way).

fred-ais-pl commented 3 months ago

Thank you, do you know when I can expect the next release? Is it a matter of a week or a month?

mkkellogg commented 3 months ago

The next release is at least another couple of weeks away, possibly up to a month away (I don't have a ton of time to dedicate to development right now).

mkkellogg commented 3 months ago

I made an update in the 2dgs branch that should address this issue, would you be willing to see if it fixes it for you?

fred-ais-pl commented 2 months ago

I made an update in the 2dgs branch that should address this issue, would you be willing to see if it fixes it for you?

I confirm it works now as expected.

mkkellogg commented 2 months ago

Quick update: this fix is now in main and Release v0.4.3