setzer22 / blackjack

A procedural, node-based modelling tool, made in rust 🦀
Mozilla Public License 2.0
1.41k stars 59 forks source link

Use `eframe`? #86

Open virtualritz opened 1 year ago

virtualritz commented 1 year ago

I saw the app is currently not using egui's eframe.

Is there a reason for this? eframe would possibly enable web assembly/running in browser trivially and also make a bunch of platform specific integrations available effortlessly.

E.g:

etc.

setzer22 commented 1 year ago

Hi @virtualritz!

There is currently an ongoing rewrite to a different UI system. I haven't written a full consistent rationale yet, but you can find some of it here: https://github.com/setzer22/blackjack/discussions/74

In that case, the project is moving further away from eframe, and I'm currently considering building on top of epaint so far with promising results: new_gui_viewport

would possibly enable web assembly/running in browser trivially

Unfortunately, wasm support wouldn't work out of the box even when using eframe. On one hand, blackjack relies on some wgpu features (mainly storage buffers) that will only be available on WebGPU, not the WebGL backend of wgpu. And on the other hand, there are some non-Rust dependencies (currently, Luau itself, but I'm taking a look at libigl) that would make it a bit more complicated to natively compile for wasm.

That's not to say blackjack can't run on wasm, it would just take some extra work and hasn't been my priority so far.