I am loading multiple gaussian splatting (.splat) files to my code and trying to render them as a single scene. The rendering order is a bit weird. It first renders all the splats from the file which has the nearest splat (depth-wise). Then it renders all the splats from the file which has the second nearest splat (depth-wise).
I can merge the files and show them as single scene. But, I want to keep the objects/gaussians from all the files separate as I want to let the user interact with that, but I also want to show the objects from all the files as one single scene.
Is there any way in which I can get the correct rendering order and also keep the objects/gaussians separate? Or do I need to create a custom rendering pipeline for that?
GS are sorted back to front because they are transparent meshes.
But if the mesh center Z is almost the same between meshes then this can happen.
As splats are mixed front/back between the 2, it makes sense to merge the splats.
Splats do not write in depth buffer so they need to be sorted and rendered in correct order. Tweaking renderingGroupId will not fix it either as 1 or the other GS will always be front or behind the other.
Maybe break the bench GS into 4 quadrant parts will fix it as at least half of the part will be behind the tree.
My main use case is to keep the splats from both the files as separate as later I want to select (by mouse click) the splats from the file and manipulate those splats (translate, rotate, scale, etc.).
Also, I was thinking if I can somehow read the file such that Babylon renders it as one, still keeping the splats separate. Like, I read splats from all the files, assign IDs to them (splats from one file gets same IDs), and then store it in GPU buffer and let Babylon render the splats from there. Is this possible? If yes, how?
Yes, I will use bounding box technique to pick corresponding GS.
But the thing is, I am making a kind of a web viewer for Gaussian Splatting using Babylon and want to let the user upload multiple GS files and they can render them as one scene (without having rendering order issues). Also, once the scene is rendered properly, I want to let them click and select objects (Gaussians from single file with same IDs) and they can manipulate them. For this reason, I want to know that is it good to create a custom readers for GS files or will this be possible using Babylon in-built methods or any other suggestions if you have.
Okay, so I can create a custom loader and use it with GaussianSplattingMesh().
Just one final question is that since I am creating a custom loader, do I need to change the shaders or just need to create a custom loader such that it works with GaussianSplattingMesh() and the default shaders will work fine?
If it’s the common case with splat orientation, position, color, scaling…then nothing more to do that load the data and call updateData on the GS mesh