Add WebAssembly support
mrDIMAS opened this issue · 6 comments
This feature was requested few times already, there even were some calls about WASM support. This is somewhat huge task for one person. Unfortunately I can't provide any possible solution in this case, it is some sort of RnD task.
WASM Support Status:
- Compile for wasm32-unknown-unknown target
- Rendering
- Files and resource management (via Fetch API)
- Sound
I added initial WebAssembly support. There are still lots of stuff to add/fix:
- Improve ResourceManager to be able to load resources from Web or memory (for resources embedded via
include_bytes!
macro) - Add WebAudio backend for rg3d-sound to add sound to WASM target.
- Fix rendering issues - there are some bugs in the renderer which were hidden renderer, but revealed in WebGL.
- Add anything you find 😃
Maybe ?
5. Run the others examples (3rd Person and more ) in WASM
This is not so easy because examples should be compiled as a library and then embedded into a web page.
Edit. This is not true, it is possible by using wasm-bindgen
directly, there is no reason to use npm at all. I just have very little experience in WASM and Web in general, so my statements may be not true.
Ok, so resource manager is now working with WebAssembly, next on the list is graphics issues - lighting is not working for some reason.
Rendering issues should be fixed now. Next on the list is audio backend.
I added WebAudio backend for rg3d-sound. I think from now WebAssembly support is complete. Please report any bugs you find.