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

Support projecting 3D entities in 2D views #2008

Merged
merged 41 commits into from May 3, 2023

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Apr 30, 2023

  • always use a perspective transform to render 2d views now, taking over a pinhole camera is there is one
  • "late stage" projection transform in view builder for easy panning and zooming inside otherwise fixed perspective transform
    • shares some code with the same transform used for picking
  • transform cache deals strictly with Affine3 now
  • explicit 2D modes for point & line rendering - mainly so that we don't get perspective distortion on 2D objects now that 2D things render with perspective camera, but seems useful in general!

Fixes gfx-rs/naga#1581

3D.to.2D.2.mp4

What

Checklist

PR Build Summary: https://build.rerun.io/pr/2008

Wumpf added 24 commits April 17, 2023 16:53
@Wumpf Wumpf changed the title Fix 3d to 2d projections 3d to 2d projections Apr 30, 2023
@Wumpf Wumpf added 🔺 re_renderer affects re_renderer itself 📺 re_viewer affects re_viewer itself labels Apr 30, 2023
Copy link
Member

@emilk emilk 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 overall, but I have some questions I want to talk through :)

crates/re_renderer/shader/point_cloud.wgsl Show resolved Hide resolved
crates/re_renderer/shader/utils/sphere_quad.wgsl Outdated Show resolved Hide resolved
crates/re_renderer/src/line_strip_builder.rs Show resolved Hide resolved
crates/re_renderer/src/renderer/lines.rs Show resolved Hide resolved
crates/re_renderer/src/renderer/point_cloud.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/misc/transform_cache.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/misc/transform_cache.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/view_spatial/ui_2d.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/view_spatial/ui_2d.rs Outdated Show resolved Hide resolved
crates/re_log_types/src/component_types/transform.rs Outdated Show resolved Hide resolved
@Wumpf
Copy link
Member Author

Wumpf commented May 2, 2023

almost done. Only the NDC function left (wanted to rename the fields of recttransform, add tests, add comments) and the fwidth issue @jprochazk pointed out.

@Wumpf Wumpf force-pushed the andreas/fix-3d-to-2d-projections branch from 9242d65 to ec0a980 Compare May 3, 2023 10:01
@Wumpf Wumpf requested a review from emilk May 3, 2023 10:03
@Wumpf Wumpf merged commit f1c580f into main May 3, 2023
15 checks passed
@Wumpf Wumpf deleted the andreas/fix-3d-to-2d-projections branch May 3, 2023 13:22
@emilk emilk changed the title 3d to 2d projections Support projecting 3D entities in 2D views May 25, 2023
@emilk emilk mentioned this pull request May 25, 2023
1 task
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

3 participants