-
Notifications
You must be signed in to change notification settings - Fork 209
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
DropInViewer Three scene always in foreground #372
Comments
Is your normal three.js mesh transparent? If so, you'll need to tell three.js how to explicitly order them relative to the splats for rendering. since the mesh containing the splats is also transparent. You can try setting the render order of the splats by doing something like: // `viewer.viewer` is not a typo :)
viewer.viewer.splatMesh.renderOrder = 1000; The It's definitely worth noting that mixing normal transparent three.js objects with splats, in general, will not look correct because the splats do not render to the depth buffer (as is typical with transparent objects) |
The mesh is fully opaque. I also checked the drawing order in specter.js which is identicaly to the Viewer class. 2024-11-19.10-54-25.mov |
I debugged more into it but it seems like the correct camera is used for the splat sorting. I'm currently not really sure what the DropInViewer does differently than the normal Viewer. |
We managed to find the issue: It is set in this line, but parameters is currently always empty:
|
Ah, that makes sense. It looks like this will require an update to multiple parts of the code. First I think a GaussianSplats3D/src/splatmesh/SplatMesh.js Line 1389 in f6f4ade
The new Viewer parameter will also need to be passed to the splat materials (SplatMaterial , SplatMaterial2D , and SplatMaterial3D ) so they can conditionally add the necessary shader code.
Would you be interested in a submitting a PR with all of that? |
Is there a plan to resolve this issue at some point? |
I'm currently trying to get the DropInViewer running together with a normal three.js scene.
If I use the normal Viewer class and specify the scene via the threeScene parameter, everything is working as intended. But when I use the DropInViewer and add it to scene, I can see the splat and the normal 3D mesh, but the splat is always rendered underneath the normal mesh independend of the camera position. In both cases the splat is drawn last. Do you have to provide more parameters to the DropInViewer, or compute the depth of the splat primitives?
This is basically the same issue as #5, but for the DropInViewer.
Here is the code I'm using. (I'm using three fiber):
The text was updated successfully, but these errors were encountered: