-
Notifications
You must be signed in to change notification settings - Fork 373
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
Improve heuristics around 2D vs 3D space-view creation #3822
Conversation
…ut of 3d spaces when they don't have a pinhole
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm no expert in this whole space-view-heuristic business (yet!) but this makes perfect sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm missing rationals for why we do things. That will be pretty important when we return to this code.
Let's not let that block the merging of this PR, but @jleibs please go back and add that later.
// If this is a 3D view and there's no parent pinhole, do not include this part. | ||
if ctx.class == "3D" && !ctx.has_ancestor_pinhole { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can already read the Rust code and see what it does, I want to know why it does it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If this is a 3D view and there's no parent pinhole, do not include this part. | ||
if ctx.class == "3D" && !ctx.has_ancestor_pinhole { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again - why?
// If this is a 3D view and there's no parent pinhole, do not include this part. | ||
if ctx.class == "3D" && !ctx.has_ancestor_pinhole { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've read this many times now
// possible to correctly project 3d objects to a root 2d view since the | ||
// the pinhole would go past the root. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow this. "go past the root"?
Couldn't find a single heuristic issue with |
### What Address some PR concerns from: - #3822 ### 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 [demo.rerun.io](https://demo.rerun.io/pr/3836) (if applicable) * [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/3836) - [Docs preview](https://rerun.io/preview/9926b13d4f8bc925e37b506f46540058df211249/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/9926b13d4f8bc925e37b506f46540058df211249/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
What
Resolves:
rr.Boxes2D
is logged #3712 and probably moreAgainst my better judgement I ended up with one more pile of compelling hacks.
I believe it addresses many of the existing annoyances with awkwardly mixed 2d/3d views without (to my knowledge) causing regressions on the existing examples, though I haven't thoroughly tested everything yet, SFM, Human Motion, Arkit, etc. all look good.
The very high level idea is to prevent including 2D data in 3D views when it can't be projected via a pinhole, and then in a few other common edge-cases, more aggressively force 3D views.
This is done through 3 heuristic changes:
identify_entities_per_system_per_class
.HeuristicFilterContext
that allows the heuristic filter to observe which class it is being evaluated for as well as other information about the tree.Some examples of the improved behavior:
As reported in #3712
Before:
After:
And another particularly bad case I found while exploring:
Before:
After:
Checklist