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

Implement outlines for line renderer & use them for select & hover of "line-like" primitives in Viewer #1553

Merged
merged 10 commits into from
Mar 10, 2023

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Mar 10, 2023

Screen.Recording.2023-03-10.at.09.49.52.mov

Changing the outline mask for individual linestrips within a linebatch proved challenging. There's a bunch of conflicting requirements there:

  • If everything changes mask, we don't want to re-upload data
  • We ideally don't want to store a mask for every line strip even if they don't use it as this gets wasteful quickly
  • We don't want to render everything again & discard in vertex shader if only a single/few linestrips are selected

The expectation is typically that either the entire batch or a few subranges are selected. Therefore, the solution chosen here is to have the mask be a property of the line batch, but allow emitting additional sub-batches that re-use the same data of their parent batch with a different outline mask.
This is unreasonably costly for many sub-ranges, but very cheap for the expected case. The sub-batch creation is done inside the LineRenderer, allowing us to adjust these details easier in the future.

Unfortunately, this still requires per-instance checks in the viewer - for the point renderer I should maybe come up with something else to avoid per-instance queries (also, point batches with single points seem non-sensical).

Checklist

@Wumpf Wumpf added 🔺 re_renderer affects re_renderer itself 📺 re_viewer affects re_viewer itself labels Mar 10, 2023
Copy link
Member

@jleibs jleibs left a comment

Choose a reason for hiding this comment

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

Looks good!

crates/re_renderer/src/line_strip_builder.rs Outdated Show resolved Hide resolved
Base automatically changed from andreas/fix-outline-mask-combining to main March 10, 2023 18:28
@Wumpf Wumpf force-pushed the andreas/outline-based-selection-for-line-like branch from f6f9071 to 5862ca6 Compare March 10, 2023 18:51
@Wumpf Wumpf merged commit 3813dd1 into main Mar 10, 2023
@Wumpf Wumpf deleted the andreas/outline-based-selection-for-line-like branch March 10, 2023 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔺 re_renderer affects re_renderer itself 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants