The Wayback Machine - https://web.archive.org/web/20200910223813/https://github.com/alanmacleod/wasm-render
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
c
 
 
 
 
lib
 
 
 
 
 
 
 
 
pub
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

wasm-render

Software rasteriser written in WASM/C & TypeScript to test WebAssembly and compare performance

Rasteriser draws a single texture-mapped polygon onto each face of a simple 3D mesh. The same code has been written in pure Javascript (well... TypeScript) and then again in WebAssembly / C.

Try the demo running here (link fixed again! - SSL cert problem, sorry!)

Read the article about all of this here

alt tag

You can switch between C and JS at run time to visually compare performance, and a realtime latency graph is included to measure each frame time in milliseconds.

Click the graph to switch between JS and WebAssembly/C.

Using the rather awesome wasm-init tool which relieved me of many, many headaches.

How to build and run

Install Emscripten
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

warning: this takes about an hour or more!

Clone and install
git clone https://github.com/alanmacleod/wasm-render.git
npm install

npm run buildall

node server

If all went well, it should be running: http://localhost:3000/

You can’t perform that action at this time.