Successfully tweaked our build system to target WebAssembly today and it worked without much effort. Tested the 12_PhysicsStressTest using the Firefox Nightly confirmed the generated wasm file work. In my brief test I can see it has higher performance than the asm.js version. This is achieved without changing anything else yet in the code. Smaller output size is already a win.
I will commit my tweak into the “refactor-buildsystem” branch shortly. If you want to experiment with it now, you have to upgrade your Emscripten compiler toolchain to the bleeding edge (they have not been released yet) as follows:
$ git clone https://github.com/juj/emsdk.git
$ cd emsdk
$ ./emsdk install sdk-incoming-64bit binaryen-master-64bit
$ ./emsdk activate sdk-incoming-64bit binaryen-master-64bit
And when configuring/generating the Urho3D build tree, simply passing in an extra new build option called “EMSCRIPTEN_WASM” and set it to enabled. That’s it!