Skip to content
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

Keep in mind WASM support. Have some examples. #7

Open
mitchmindtree opened this issue Oct 18, 2017 · 7 comments
Open

Keep in mind WASM support. Have some examples. #7

mitchmindtree opened this issue Oct 18, 2017 · 7 comments

Comments

@mitchmindtree
Copy link
Member

No description provided.

@matthewharwood
Copy link

I just discovered this package. Does this package support wasm out of the box? does it have examples?

@mitchmindtree
Copy link
Member Author

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:

  1. HTML rendering. Most webapps need at least some HTML at the top level of the app for searchability / browsability. @freesig mentioned yew seemed like a nice solution to this, though still has a lot of work to go.
  2. WebGL rendering. nannou v0.9 removes the OpenGL support for native applications in favour of using Vulkan under the hood (see some reasoning etc at nannou v0.9 - Vulkan graphics, simpler event API and much more #240 for info on the choice and more info on v0.9). This does mean that we'll need to come up with some sort of solution that involves either 1. a vulkan -> webgl translation layer of some sort (I'm not currently aware of any) or 2. a platform-specific webgl backend for the wasm target.

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.

@matthewharwood
Copy link

Thanks for the thoughtful answer!

@grovesNL
Copy link

@mitchmindtree FWIW we're working through initial gfx-hal (~Vulkan) to WebGL translation in gfx-rs/gfx#2554

@pepyakin
Copy link
Contributor

Just as heads up:

@mtnmts
Copy link

mtnmts commented Nov 20, 2019

Any news on this?

@mitchmindtree
Copy link
Member Author

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

mitchmindtree added a commit to mitchmindtree/nannou that referenced this issue Mar 30, 2020
Fix bug where point rate change could panic
mitchmindtree added a commit to mitchmindtree/nannou that referenced this issue Mar 31, 2020
Add missing steps to the platform-specific setup chapter. Update nannou dep in tests crate to point to master branch.
mitchmindtree added a commit to mitchmindtree/nannou that referenced this issue May 15, 2022
Add some basic free CI testing using github actions
@milgner milgner mentioned this issue Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants