Closed simbleau closed 5 months ago
I came here to dig into it myself, but haven't yet pulled down the source to see if can be adapted to target wasm... based on source as it stands, it looks like it should work in a wasm stack, but it doesn't look like Bevypunk was written to target wasm.
I think full support would largely depend on any GPU-driven effects you might want in the UI.
.. now I'm not so sure. The crate vendoring in Bevypunk makes it impossible to build without context on the build environment, and doesn't say whether it's a modified version of bevy_lunex or not.
Yes, it does. Lunex by itself is written entirely from scratch by me in pure Rust. It should be able to compile to any platform that Bevy can.
To compile the Bevypunk example, you have to remove the crate vlue_kinetoscope
as gif playing is not supported on WASM. If you do that, you can compile to WASM. Ofc there are drawbacks, like poor performance, but this is only because Bevypunk is intended to run native, so it uses high-end Bevy VFX to look good (Bloom, HDR, etc...). The crate itself does not have any drawbacks on WASM.
Here is Bevypunk WASM on github pages: https://idedary.github.io/Bevypunk/
EDIT: Oh, now I solved even the poor performance... By launching my browser to use my dedicated GPU instead of integrated GPU. Seems like Bevy did not have access to the other GPU so it run on what was provided, hence the poor performance.
.. now I'm not so sure. The crate vendoring in Bevypunk makes it impossible to build without context on the build environment, and doesn't say whether it's a modified version of bevy_lunex or not.
The crate vendoring is only for my convenience, because I use this example to dogfood Lunex. This way I don't have to push to git every single time I change something.
If you want to compile Bevypunk on your machine, just swap the crate for the git version. The dev branch is bleeding edge.
Does lunex support web/wasm? Is bevy punk on web already I can see?