-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Library upgrades and updates #940
Conversation
I can confirm that egui seems to be working correctly in my project. I will let you know if anything comes up. |
Wasm builds now break. I think this is due to converting to tokio. tokio+mio - seems to break on WASM
|
@tychedelia I attempted to test WASM compiling by pulling out tokio. But got suck (new to rust) - I have left a PR on your repo it might help it might not :) |
Thanks! I totally blanked on testing WASM. I'll give your change a shot today or otherwise make sure things are working with the WASM builds. |
@infinitylunacreative just pushed some fixes that should allow tokio to run on wasm targets. will you give it a shot and let me know if that works (on the head of my fork)? |
Looks like @mitchmindtree ran into some of the same questions re: |
Thanks, I will take a look today. |
@tychedelia I can confirm the WASAM build is working for me 🥳 - Thank you! |
@tychedelia I decided to do some more testing. I tried it on linux. WASAM works great. However the "normal" builds throw this error.
|
Looks like there was a breaking change in Not sure the best approach here. I think I'm going to enable xorg by default and make wayland an additional feature flag. |
@RobWalt @tychedelia - Is there anything you need/want me to test? |
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.
@tychedelia What's the motivation behind the switch to tokio
? I get that async-std
isn't the latest async runtime. In the context of graphics programming with wgpu I just saw a lot of use of pollster
instead and maybe that's useful here aswell since we're always just blocking anyways?
Imo it would be better if we split this PR into smaller ones which have a smaller scope. So the async refactor could be its own PR and so on.
I can't offer much help here, but just want to commend the effort to bring Nannou up to date regarding WGPU and Egui. I really like this framework - and have used it in at least one project in production - but I was getting concerned about the apparent lack of updates recently. |
Since I opened this,
It would be really nice to be able to land a |
36a724e fixes the issue with the egui demo app, but isn't the right pattern for our users. likely more to do here, it's rendering correctly now though. |
nannou_egui_demo_app/src/main.rs
Outdated
let proxy = app.create_proxy(); | ||
egui.do_frame_with_epi_frame(proxy, |ctx, epi_frame| { | ||
egui_demo_app.setup(&ctx, epi_frame, None); | ||
let mut egui_demo_app = egui_demo_lib::DemoWindows::default(); |
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.
Not sure the best way to clean this up. Maybe make the Egui
constructors accept an App
instance so we can wire that up internally?
egui.do_frame_with_epi_frame(proxy, |ctx, frame| { | ||
egui_demo_app.update(&ctx, frame); | ||
}); | ||
let ctx = egui.begin_frame(); |
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.
These should probably just be moved into a do_with_frame
method on egui
to keep it simple.
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.
Wicked work @tychedelia, I really appreciate you diving into this!
I've opened up a PR with some small tweaks and fixes if you're interested here - once those are merged I'd be more than happy to see this land :)
As a small side-note, it seems like this PR runs into the same issues that I ran into in #861 w.r.t. colours not quite matching up. From memory, this has something to do with egui changing something related to the way they do gamma correction in their fragment shader and some assumptions they make around web targets vs desktop targets. I think nannou uniquely runs into this as we don't target the window surface texture directly like most egui apps do - instead we draw to an intermediary frame with a linear colour format.
All that said, I think we might be best to:
- Land this as is (with aforementioned tweaks PR)
- Open an issue for tracking the egui colour problem.
- Aim to solve the problem through our bevy refactor when switching from
nannou_egui
to thebevy_egui
crate.
This still might require some thought around texture colour formats etc, but I think we're better off investing that effort as a part of the bevy-refactor, rather than delaying it longer? Open to other suggestions!
nannou_egui/src/lib.rs
Outdated
// impl epi::RepaintSignal for RepaintSignal { | ||
// fn request_repaint(&self) { | ||
// if let Ok(guard) = self.0.lock() { | ||
// guard.wakeup().ok(); | ||
// } | ||
// } | ||
// } |
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.
Happy for this to be removed if it's no longer required?
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.
good catch, thanks!
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.
Oh woops was going to address this in the other PR but I forgot 😅
@mitchmindtree yeah, seeing the colors are super noticeable here in the color picker example. i'm good with this plan! we can fast follow anything that might come up from further user testing. |
Okydokey let's land this! I'll follow-up with a PR bumping versions so we can publish to crates.io 👍 |
Mostly working, but need to double check a few things around egui. And make sure all the shaders are still working with wgsl changes.
async-std
totokio
.egui_wgpu_backend
to the in-treeegui-wgpu
.egui
version0.23
.wgpu
version0.17
.winit
version0.28
.TODO:
eframe
as a replacement forepi
in the new egui version. (answer: no)draw_capture_hi_res
example.