clarte53 / GaussianSplattingVRViewerUnity

A VR viewer for gaussian splatting models developped as native plugin for unity with the original CUDA rasterizer.
Other
197 stars 25 forks source link

Left and Right eye Occlusion view in Unity #22

Open ga28299 opened 2 months ago

ga28299 commented 2 months ago

Hi there, Thank you for creating this plugin. I want to get the left and right eye view in the game view in unity. How do I do that? Currently I select the GaussianSplattingVR scene then add the Gaussia Splatting Camera script using add component > add the render and depth material parameters to get the one camera view of the splats.

Peamon commented 2 months ago

In the GaussianSplattingVR scene you already have a camera. Just plug you XR device press play and change the Game view render mode in unity for "Occlusion Mesh".

The option is above statistic panel in this image : https://github.com/clarte53/GaussianSplattingVRViewerUnity/blob/master/performance_vr.png

ga28299 commented 2 months ago

Hey thanks for the quick reply. Is there any way I can get the occluded view without connecting a XR device? Also my inspector after selecting the GaussianSplattingVR scene looks different from the one in the images shared. Here is how it looks: image

Peamon commented 2 months ago

No you cannot have this view without a headset connected.

Your screen looks ok, it start like this, then you can check the 'point_cloud.ply' button to load the file but if you don't have a headset connected you will not see the gaussian splatting.

If you want to see something start with the GaussianSplattingCam scene that is a scene without headset.

seblanc commented 3 weeks ago

I'm facing the same issue, I would like to load by default a *.ply file, and make sure it is placed at the right location. Otherwise, I always end up with the wrong position/rotation of my gaussian splat.

Is there a way to display it in the scene inspector?

Peamon commented 3 weeks ago

You cannot display it in the inspector but you can deactivate "isXR" on GaussianSplattingCamera Script attached to the camera and press Play without headset connected. With this you can see the gaussian in the game view, move it in inspector and copy paste the transform.

seblanc commented 3 weeks ago

Thanks for your advice Peamon. In GaussianSplattingCamera.cs, isXr is already equal to false: 10: public bool isXr = false; I tested the game with isXr = false and with true, without any VR headset connected, but no Gaussian Splat is visible in the "Game" view. Am I doing something wrong?

Peamon commented 3 weeks ago

First if you don't have done that, you have to download and copy "defaultmodel.bytes" file see Starting in the README.md

Then you need to check that "defaultmodel.bytes" is correctly referenced :

image

Then you have to uncheck the "isXR" on main camera :

image

Then you have to press Play and check the "defaultmodel.ply" checkbox (in red) and then move the object (in blue) image

Peamon commented 3 weeks ago

To Load your own "ply" file when the application start you just have to add a new GameObject and put the script GaussianSplattingModel on it, like this :

image

seblanc commented 3 weeks ago

This is awesome, it works like a charm. Although the quality is much lower than my original splat file when visualized in other viewers, is there a way to improve the quality?

Peamon commented 3 weeks ago

check the "tex factor" parameter on GaussianSplattingCamera Script put it to 1