GaussianSplats3D icon indicating copy to clipboard operation
GaussianSplats3D copied to clipboard

Can't display splat on the itowns stage

Open DanielDLZ opened this issue 1 year ago • 9 comments
trafficstars

Hello!

I tried to place splat on the itowns globe and I can’t understand for what reason, splat is in the children of the scene, everything matches in coordinates, but it’s not on the globe. I would be grateful if you could help me solve this problem. Codesandbox

DanielDLZ avatar Apr 03 '24 13:04 DanielDLZ

If you don't add the globe to the scene, is the splat visible then? Also, you shouldn't have to add the code in gsplat.ts at line 30:

 scene.add(viewer.splatMesh);

Since you're already passing the threeScene to the viewer.

mkkellogg avatar Apr 03 '24 14:04 mkkellogg

If I turn off the visibility of the globe, then the splats can be seen, but I am afraid that the problem may be with the depth buffer. I set the camera to the splats and the horizon of the globe so that you can see it live in the sandbox. image

About gsplat.ts If I remove scene.add(viewer.splatMesh); after initializing the splat viewer, there is no splat in the scene with the globe

DanielDLZ avatar Apr 08 '24 13:04 DanielDLZ

Yeah it might have something to do with both the depth buffer and the scale of the splat scene not matching the scale of the globe. The fact that the splat scene is not visible unless you add the line scene.add(viewer.splatMesh); is a problem, because you have already added the three.js scene to the viewer, so it should all be rendering after that. Adding scene.add(viewer.splatMesh); would actually make it render the splat scene twice per frame.

What is causing the white flickering in the background? Is there any way to remove that?

mkkellogg avatar Apr 08 '24 15:04 mkkellogg

Fixed the background flickering. I don't have idea how to fix scene.add(viewer.splatMesh);. And how can I fix the problem with the depth buffer?

DanielDLZ avatar Apr 09 '24 21:04 DanielDLZ

You might be double rendering things, does the globe still render if you don't pass scene to the viewer?

mkkellogg avatar Apr 09 '24 22:04 mkkellogg

Are you talking about GSplats.Viewer?

DanielDLZ avatar Apr 18 '24 09:04 DanielDLZ

Correct, you are currently initializing GSplats.Viewer like so:

 const viewer = new GSplats.Viewer({
    threeScene: scene,
    renderer: renderer,
    camera: camera,
    sharedMemoryForWorkers: false,
    dynamicScene: true,
    useBuiltInControls: false,
    // showControlPlane: true,
    // showMeshCursor: true,
    ignoreDevicePixelRatio: false,
    gpuAcceleratedSort: true,
    halfPrecisionCovariancesOnGPU: false,
    integerBasedSort: true,
  });

Have you tried removing the first parameter: threeScene: scene ?

mkkellogg avatar Apr 18 '24 16:04 mkkellogg

I've removed it, but stage began to flicking again

DanielDLZ avatar Apr 18 '24 17:04 DanielDLZ

@mkkellogg I have faced with the same issue like @DanielDLZ. It looks like there is some problems with depthBuffer synchronization.

alexLuky avatar Apr 24 '24 10:04 alexLuky

Since this one is pretty out of date, I'm going to close it. If you're still struggling with this, please let me know.

mkkellogg avatar Sep 05 '24 01:09 mkkellogg