Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A question about using WebXRMode.VR in GaussianSplats3D.DropInViewer. #308

Open
pollyon opened this issue Aug 17, 2024 · 8 comments
Open

Comments

@pollyon
Copy link

pollyon commented Aug 17, 2024

I used your 'GaussianSplats3D.DropInViewer' method to load a splat file and added the viewer into 'Object3D' so that I can later control its position and size within the scene. Everything was working fine until I added the WebXR VR button. After entering VR mode, the splat model only partially renders or doesn’t render at all, and it seems like the camera is no longer calculating the distance to the splat correctly. Is there a way to resolve this issue?

Additionally, since I need to control the position and size of the splat within the scene, I am unable to use your 'GaussianSplats3D.Viewer' method to activate VR mode.

@mkkellogg
Copy link
Owner

There may actually be some problems with using DropInViewer with VR, I don't think I've ever tried doing that myself :) Can you post your source code? Maybe I can help you debug.

@mkkellogg
Copy link
Owner

Just circling back -- did you make any progress with this one?

@pollyon
Copy link
Author

pollyon commented Sep 4, 2024

I sincerely apologize for the late response. I've been extremely busy with work over the past few weeks, but I finally have time to prepare the test files for the project.

Below is the link to the test project.
download link

We used the DropInViewer method to import the splat file, and after entering VR mode with the Meta Quest headset, the issue we previously discussed occurs. I've also attached a video recording of the VR view. I hope to receive your assistance. Thank you very much.

@pollyon
Copy link
Author

pollyon commented Sep 4, 2024

We tried using your 'GaussianSplats3D.Viewer' method to start VR mode, but since your VR mode automatically generates a new WebXR configuration, it caused a conflict with our original WebXR settings, resulting in an error. We had to remove our own WebXR settings to run your VR mode properly.

On the other hand, when using the 'GaussianSplats3D.DropInViewer' method, since it does not trigger the WebXR generation mechanism in your JavaScript, no errors occur, and we can enter our own WebXR settings. However, for some reason, the Gaussian Splats appear broken and incomplete, as shown in the attached video, and the surface variations of the Gaussian Splats stop computing. These are the results of our testing over the past few weeks. We hope to receive your assistance. Thank you very much.

@mkkellogg
Copy link
Owner

One thing you can also try (if I understand the issue around the WebXR config) is to use the new memory-optimizations branch, which has a Viewer parameter for specifying WebXR initialization parameters: webXRSessionInit. Maybe that will work for you?

@pollyon
Copy link
Author

pollyon commented Sep 6, 2024

We are using the version from the memory-optimizations branch and have tested webXRSessionInit. We made the settings as shown in the image,
1725644464428
but after clicking "ENTER VR," an error occurred, as shown in the image.
1725644840269
1725644643878
Aside from the issue of unsupported hand-tracking in the webXRSessionInit settings, the internally written layers also encountered the same unsupported issue. Even after we removed both settings, the issue persists with the error: "Cannot render to a XRWebGLLayer framebuffer outside of an XRSession animation frame callback."

@pollyon
Copy link
Author

pollyon commented Sep 6, 2024

Currently, when testing with the viewer method, if we integrate our custom three.js scene, errors occur after clicking "ENTER VR." The only case where there is no error is when using the "DropInViewer" method, but this results in the splat model stopping surface computation and being incomplete, as shown in the image.
1725646577701
1725646562562

Is there a solution for the issues with the splat model stopping surface computation and its incompleteness?

Since "DropInViewer" does not execute the init() and setupWebXR() functions from gaussian-splats-3d.module.js, and we use our own VR button method in the three.js scene to enter VR, perhaps we don’t need to handle the WebXR settings in gaussian-splats-3d.module.js?

@mkkellogg
Copy link
Owner

FYI Using the DropInViewer should still result in init() and setupWebXR() being called.

For the error you're seeing using the GaussianSplats3D.Viewer mode, is it possible that the renderer that you're passing to GaussianSplats3D.Viewer when you initialize it is being used outside of the animation loop that it is supposed used in? When you tell the viewer to use WebXR, all rendering needs to occur in the callback function passed to renderer.setAnimationLoop(), and that is set up here:

this.renderer.setAnimationLoop(this.selfDrivenUpdateFunc);

Because you're passing in an external renderer, the viewer makes it a WebXR render here:
this.renderer.xr.enabled = true;

After which it may not be able to be used anywhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants