I just discovered this package. Does this package support wasm out of the box? does it have examples?
Hi!
No we don't have out-of-the-box support for WASM yet, but it is a goal we'd like to get around to at some point.
The first step that comes to mind will be winit landing the EventLoop 2.0 PR changes into master (still pending macos and x11 support). The new API has been in the works for a long time and will lend itself much more nicely to WASM support than the current API. Integration of the new winit API should be fairly trivial for nannou.
The next major step is coming up for a solution for rendering. There are two major areas that come to mind:
The final step that comes to mind is webaudio support. The best approach for this would likely be contributing to the CPAL crate. We've already contributed the coreaudio and ASIO (pending merge) backends so this should be more than feasible.
In summary, support for this is certainly a goal for us, however refining the native application experience first has been a priority as most of our commercial work using nannou so far has gone in this direction.
Thanks for the thoughtful answer!
@mitchmindtree FWIW we're working through initial gfx-hal (~Vulkan) to WebGL translation in https://github.com/gfx-rs/gfx/pull/2554
Just as heads up:
Any news on this?
@mtnmts slow progress! Now that winit seems to be getting close to stabilising their event loop 2.0 work, the main areas left to address here are properly supporting graphics and audio on the web.
Graphics
Currently the plan of attack is to take advantage of the gfx stack via rendy - you can read a little more on this at #374. @freesig, @JoshuaBatty and I had some long meetings about this during RustFest BCN and have started some initial experiments with rendy locally in order to better familiarise with its codebase and to start on a conrod_rendy backend to start by getting Ui working. This along with updating the rest of nannou's graphics stack will likely take a few months as the three of us also have some contract work in the meantime. That said, anyone is welcome to step up and take the lead if interested in accelerating the process, we would be more than happy to provide assistance/guidance! It's worth keeping in mind that targeting WebGL with rendy is still a WIP, but as far as I'm aware the biggest blocker is the winit event loop 2.0 work becoming stable, so I expect to see some rendy WebGL examples in the near future.
Audio
We recently received a grant partly aimed at addressing rust audio on the web which you can read more about here. The final step in finalising the agreement with Mozilla is taking a little longer than anticipated, but as soon as that's sorted I'll dive in.
Most helpful comment
@mitchmindtree FWIW we're working through initial gfx-hal (~Vulkan) to WebGL translation in https://github.com/gfx-rs/gfx/pull/2554