Hey everyone!
I’m using pc.Picker.getSelection()
to select a gaussian splat object in my scene. Currently, I can pick and select an entire splat entity using it like this: example with FrameBufferPicking. But, I’d like to get the exact coordinates of the click point in my Scene and translate it to world coordinates. The goal is to add an annotation or hotspot precisely at the clicked location of the splat.
Does anyone know how I can recieve these specific coordinates or has any tips for implementing this? I cannot use rigidbody.raycastFirst(from, to)
.
I talking to Will Eascott, he mentioned that I should get the depth value of the click point and then translate this to world coordinates. But I don’t know how to even start here. Where can I access the deph value of the click because in my mind this has to be done with some sort of Raycast.
Thanks in advance!
Is there any news on this topic? Or is there anyone who could help me with this issue?
It’s not so simple with splats. Perhaps at the same time you generate splats you could also generate a mesh version, which multiple tools can save out. Use it without textures / perhaps even some simplified geometry for picking.
Creating another 3d Model is not an option, I’m afraid. Also the Splats that I am displaying are huge and performance and loading time is an issue.
This feature has been implemented in Superplat, hasn’t it? There you can pick coordinates on the Splat with your mouse and then the camera will look at that specific Point. Is there a way to geet to this feature and implement it in the Engine?
@slimbuck customized the shader in the supersplat to allow for this, so this can be done for sure. But to pick this way means the re-rendering of the whole scene to an offscreen render target, so it certainly has performance impact.
Hi @Axelandur ,
Yes SuperSplat renders a pick buffer using material’s PICK_PASS so each pixel contains a packed gaussian splat ids. (The pick buffer normally stores packed meshInstance ids).
The CPU then reads back the gaussian’s id at the pixel of interest and calculates the intersection based on that.
One thing to keep in mind is that all gaussians are actually semitransparent. They’re solid only right in the middle and then blend out to transparent at the edges. Since the PICK_PASS must be rendered without blending (you can’t blend ids), you must decide what part of gaussian is rendered into the pick buffer based on alpha. SuperSplat uses 0.2 in the centers mode.