Implement outlines for line renderer & use them for select & hover of "line-like" primitives in Viewer #1553
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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