bytestring-net / bevy_lunex

Blazingly fast path based retained layout engine for Bevy entities, built around vanilla Bevy ECS.
https://bytestring-net.github.io/bevy_lunex/
Apache License 2.0
478 stars 18 forks source link

web/wasm support? #39

Closed simbleau closed 1 month ago

simbleau commented 1 month ago

Does lunex support web/wasm? Is bevy punk on web already I can see?

tsal commented 1 month 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.

tsal commented 1 month ago

.. 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.

IDEDARY commented 1 month ago

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.

IDEDARY commented 1 month ago

.. 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. image