-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separation & improved book-keeping of entity -> visualizer assignment (…
…#4612) ### What * Part of: * #4377 * #4388 Previously, we assumed that the `heuristic_filter` on applicable entities (== entities that fullfill all required components and some additional global properties as determined by store subscriber) applies on a per space view _class_ basis. However, this is not entirely accurate and misses that "visualizability" is determined on a per-space-view-instance basis: The most prominent example of this is that a 2D primitive may or may not be visualizable in a 3D view depending on where the 3D origin is. Another, more forward looking problem was had in this area is that `heuristic_filter` of visualizers should be applied as part of the _query_ since a query determines whether visualizers are picked automaticall/all/single. This PR separates all these concerns more clearly and introduces types wrapping lists of entities to make it harder to confuse which set represents what: * `ApplicableEntities` * global set, already produced by a store subscriber * `VisualizableEntities` * produced per space view instance. Space view instances can compute a context (replaces `HeuristicContext`!) to guide their systems. This is an `Any` which allows visualizer systems to react to different "parent" space views! * `IndicatorMatchingEntities` * global set, already produced by a store subscriber * to be used as base for the "ActiveEntities" for each visualizer. For simplicity the "ActiveEntities" itself is right now not a type. Instead, the query uses `IndicatorMatchingEntities`and passed in `VisualizableEntities` on the fly to determine this final set. In the **future** it: * may opt out to do so because a query warrants a specific visualizer(s) * may opt out to do so because a query warrants all possible visualizers * visualizers and/or classes may modify the heuristic set Great care was taken to not regress performance of the (still per frame applied) heuristics. However, since we're doing a lot more work now there's still a bit of a performance hit: Before: ![image](https://github.com/rerun-io/rerun/assets/1220815/e6fe0acc-535b-40c4-be7a-e5e66a752834) After: ![image](https://github.com/rerun-io/rerun/assets/1220815/14d91e6f-2f9c-4de0-92af-03ea4fff0b74) I decided that any further improvements in this area should be done in the context of not recomputing heuristics every frame and instead react to relevant changes. (#4388) ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using newly built examples: [app.rerun.io](https://app.rerun.io/pr/4612/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/4612/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [app.rerun.io](https://app.rerun.io/pr/4612/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/4612) - [Docs preview](https://rerun.io/preview/7b0485ba1d74511929facf0c06a42f6c95eb5881/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/7b0485ba1d74511929facf0c06a42f6c95eb5881/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) --------- Co-authored-by: Jeremy Leibs <jleibs@users.noreply.github.com>
- Loading branch information
Showing
28 changed files
with
591 additions
and
517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.