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

Introduce wgpu based re_renderer (experimental!) #175

Merged
merged 19 commits into from
Oct 11, 2022

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Oct 7, 2022

First stab at a wgpu based re_renderer crate and integration into re_viewer

Renders test triangle successfully on native and browser.
image

can be tested locally using cargo run -p rerun --features=wgpu --no-default-features -- ../car.rrd
(for web, it's easiest to hack the default feature on re_viewer, no point in streamlining this right now)

There's glitch in the browser right now:
The moment we stop rendering continously, the viewport resizes. Likely an eframe issue, need to investigate. (suspecting that something in the order of callbacks vs primitives causes issue with a viewport not being reset)
image

crates/re_viewer/Cargo.toml Outdated Show resolved Hide resolved
Comment on lines 5 to 8
output_format_color: wgpu::TextureFormat,
/// The depth format used by the eframe output buffer.
/// TODO(andreas): Should we maintain depth buffers per view and ask for no depth from eframe?
output_format_depth: Option<wgpu::TextureFormat>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
output_format_color: wgpu::TextureFormat,
/// The depth format used by the eframe output buffer.
/// TODO(andreas): Should we maintain depth buffers per view and ask for no depth from eframe?
output_format_depth: Option<wgpu::TextureFormat>,
color_output_format: wgpu::TextureFormat,
/// The depth format used by the eframe output buffer.
/// TODO(andreas): Should we maintain depth buffers per view and ask for no depth from eframe?
depth_output_format: Option<wgpu::TextureFormat>,

Copy link
Member Author

Choose a reason for hiding this comment

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

starting with output_format is more autocompletion friendly though ;)

@Wumpf Wumpf marked this pull request as ready for review October 11, 2022 10:10
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!

…but I left some nits :]

crates/re_renderer/src/context.rs Outdated Show resolved Hide resolved
crates/re_renderer/src/context.rs Outdated Show resolved Hide resolved
crates/re_renderer/src/frame_builder.rs Outdated Show resolved Hide resolved
crates/re_renderer/src/frame_builder.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/lib.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/lib.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/view3d/mod.rs Outdated Show resolved Hide resolved
Wumpf and others added 3 commits October 11, 2022 15:28
Co-authored-by: Emil Ernerfeldt <emil@rerun.io>
Co-authored-by: Emil Ernerfeldt <emil@rerun.io>
Co-authored-by: Emil Ernerfeldt <emil@rerun.io>
@Wumpf
Copy link
Member Author

Wumpf commented Oct 11, 2022

web glitch fixed in gfx-rs/wgpu#3093
actually doesn't happen for non-srgb targets (also enabled on wgpu master only so far)

@Wumpf Wumpf merged commit 65572c3 into main Oct 11, 2022
@Wumpf Wumpf deleted the andreas/introduce-re-renderer branch October 11, 2022 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants