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

GPU based mesh picking in viewer #1737

Merged
merged 11 commits into from Mar 31, 2023
Merged

GPU based mesh picking in viewer #1737

merged 11 commits into from Mar 31, 2023

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Mar 30, 2023

Fixes #807

Screen.Recording.2023-03-30.at.19.57.30.mov

Puts GPU based picking into production by implementing it for meshes. We're not done with the overall ticket #1615 yet since this cuts a few corners.

Apart from only being used for meshes we're missing:

  • proper interaction with remaining CPU based picking (the plan is to keep it around for image-rectangles!)
  • use the entire picking rectangle for snapping selection to closest (or some even more clever thing? Not entirely sure yet what to do witih the extra information, delay compensation while possible seems overkill though)
  • read back depth and reconstruct picking ray from that
  • unrelated to most things: Upon veeery close inspection it seems that right now picking is still diagonally shifted to the top right by one or a half pixel (can't tell exactly). The debug overlay renders pixel perfectly over things though
  • less arguments on those picking methods, looks awful ;). Also 2d/3d picking code has stiiilll different entry points which is more than just annoying (but also error prone)

Checklist

@Wumpf Wumpf added ui concerns graphical user interface 📺 re_viewer affects re_viewer itself labels Mar 30, 2023
@teh-cmc teh-cmc self-requested a review March 31, 2023 08:02
Copy link
Member

@teh-cmc teh-cmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

Comment on lines +26 to +27
/// Displays an overlay for debugging picking.
pub show_picking_debug_overlay: bool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Comment on lines +219 to +221
// It is possible that some frames we don't get a picking result and the frame after we get several.
// We need to cache the last picking result and use it until we get a new one or the mouse leaves the screen.
// (Andreas: On my mac this *actually* happens in very simple scenes, I get occasional frames with 0 and then with 2 picking results!)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Base automatically changed from andreas/re_renderer/improved-readback-data-handling to main March 31, 2023 09:32
@Wumpf Wumpf force-pushed the andreas/viewer-gpu-mesh-picking branch from 0a38698 to 36a065e Compare March 31, 2023 09:36
@Wumpf Wumpf merged commit c54abe0 into main Mar 31, 2023
17 checks passed
@Wumpf Wumpf deleted the andreas/viewer-gpu-mesh-picking branch March 31, 2023 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📺 re_viewer affects re_viewer itself ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mesh hovering/selecting is broken
2 participants