-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Make Nannou run in WASM environment #811
Conversation
95c015b
to
7f63c8e
Compare
@Woyten, this is so ridiculously cool, nice work on all these PRs! The microwave demo appears to work really well in my firefox browser too.
Yeah totally, I realise that audio support for CPAL is still difficult/lacking, hopefully we can improve upon it in the future and eventually see
I just tried checking for the commit linked for this but looks like it might have moved? Otherwise I think we should be ready to rebase this PR onto master for that last step of attaching the windows to the DOM and adding the wgpu webgl feature. Thanks again for all this work, can't wait to have a play at some point! It feels good to know we have the built-in CI for the wasm target too to hopefully keep this relatively stable. After this it could be cool to start something like a |
@mitchmindtree Yes it's awesome that so many people made Sorry the given link to my branch was broken. I had three WASM branches two of which I could remove eventually. The link should be working now. As for the PR: I will rebase the branch as soon as possible s.t. we can see what's still missing. |
I'm excited by this! Thanks @Woyten! |
@Woyten can I help with getting this PR complete? |
@AJTJ The last missing pieces for a very basic WASM experience are DOM mounting/unmounting. This PR contains code which mounts a window to the DOM after creation. What's missing?
@mitchmindtree How do yo want to proceed with this PR? I could make it merge-ready and we address the points mentioned above in separate PRs. This PR will only affect the |
I just started a new job and so I don't have the space for this anymore, but I'll check back in at a later date to see if this still needs work and I have more space. |
Is this in the release branch yet? |
@that-coder Everything needed to make a basic Nannou experience on WASM a reality has been merged into the master branch except for this PR. This PR could be merged right now (it will only have an effect if the |
470e9d6
to
0807a93
Compare
Thanks. Is there any docs related to nannou wasm integration that I can refer too? |
Long overdue on my part - great stuff @Woyten ❤️ |
Hi, am I understanding properly that I should be able to mount the canvas to a specific DOM element? If so, how is that done? When configuring the app window (e.g. some option of I tried looking into the code and documentation but could not find it |
I managed to execute my synthesizer microwave in Firefox using WGPU's WebGL2 backend. A running demo can be tested here. The graphics is super fast but the audio (without any parameter tuning) is surprisingly slow and underruns on my Firefox. As a side note, audio has always been a problem during my WASM experiments and seems to be a weak point of CPAL.
The path to WASM via WebGL seems straightforward:
async
Nannou functions since blocking is unsupported in browsers (Add async twin functions for WASM support #815)wgpu
'swebgl
feature (Enable wgpu/webgl when WASM feature is enabled #822)Backends::GL
to the list of default backends (Add GL backend to default backends for better WASM support #812)Limits::downlevel_webgl2_defaults()
(See https://github.com/Woyten/tune/commits/wasm)