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

Can't display splat on the itowns stage #188

Open
DanielDLZ opened this issue Apr 3, 2024 · 9 comments
Open

Can't display splat on the itowns stage #188

DanielDLZ opened this issue Apr 3, 2024 · 9 comments

Comments

@DanielDLZ
Copy link

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 DanielDLZ changed the title I can't display splat on the itowns stage Can't display splat on the itowns stage Apr 3, 2024
@mkkellogg
Copy link
Owner

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.

@DanielDLZ
Copy link
Author

DanielDLZ commented Apr 8, 2024

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

@mkkellogg
Copy link
Owner

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?

@DanielDLZ
Copy link
Author

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?

@mkkellogg
Copy link
Owner

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

@DanielDLZ
Copy link
Author

Are you talking about GSplats.Viewer?

@mkkellogg
Copy link
Owner

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 ?

@DanielDLZ
Copy link
Author

DanielDLZ commented Apr 18, 2024

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

@alexLuky
Copy link

alexLuky commented Apr 24, 2024

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

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

3 participants