GPU picking for hover/select #1615
Labels
enhancement
New feature or request
🔺 re_renderer
affects re_renderer itself
📺 re_viewer
affects re_viewer itself
We currently do picking of primitives on the CPU, which is slow, and doesn't work for the GPU-projected depth maps (and is not implemented for meshes).
The long-term best solution is to do all picking on the GPU.
This issue is done when all 2D and 3D picking is done via the GPU, including meshes and GPU-projected depth map point clouds.
The likely approach is to render all primitives to a secondary integer buffer encoding the instance-key. We then read-back a small area under the mouse cursor and to the picking via some smart algorithm that helps the user pick small features.
Naively picking the instance id directly under the cursor will make it difficult to ever select primitives that only cover a pixel or two. To fix this we can read back 7x7 pixels and pick the id that covered the fewest pixels AND are not on the border (things on the border could be the corner of something big). If all id:s are also on the border, then pick the id that covers the most pixels.
The text was updated successfully, but these errors were encountered: