Improve asmjs support, add wasm target.
[mandelwow.git] / README.md
index dd4f14a2343c90b47dda0a813a49b567fb6c0fa7..56b6c192f27cc4fa07d74aa4ecc735d3db8344bf 100644 (file)
--- a/README.md
+++ b/README.md
@@ -10,17 +10,59 @@ I wrote this hack to learn Rust & basic GLSL. Mind the mess.
 
 ## Building from source
 
+### Native
+
 Install cargo, then simply type:
 
 ```
 cargo run --release
 ```
 
+### asm.js
+
+Install emsdk 1.36.14:
+
+```
+cd ~
+curl -O https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
+tar xf emsdk-portable.tar.gz
+source emsdk-portable/emsdk_env.sh
+emsdk install emscripten-1.37.9 --build=MinSizeRel
+emsdk activate emscripten-1.37.9 --build=MinSizeRel
+```
+
+Install rustc:
+
+```
+cd ~
+curl https://sh.rustup.rs -sSf | sh
+source ~/.cargo/env
+rustup toolchain install nightly
+rustup default nightly
+rustup target install asmjs-unknown-emscripten
+rustup target install wasm32-unknown-emscripten
+```
+
+Build and run mandelwow:
+
+```
+cd mandelwow
+./release.sh
+```
+
+Build the WebAssembly binary:
+
+```
+cd mandelwow
+./release_wasm.sh
+```
 
 ## Requirements
 
-Requires OpenGL 3.1. Should perform well on reasonably modern hardware.
-Tested on Linux with Intel HD Graphics 4000 (Ivy Bridge) and NVidia GTX 970.
+The native binary requires OpenGL 3.1. Should perform well on reasonably modern
+hardware. Tested on Linux with Intel HD Graphics 4000 (Ivy Bridge) and NVidia GTX 970.
+
+The asmjs and WebAssembly versions were tested on Chromium 57 and Firefox 53.
 
 ## License