Experiment No.1

Emscripten is a very cool piece of technology developed by Alon Zakai; a researcher at Mozilla. Its purpose is to serve as a backend to the LLVM compiler, translating LLVM intermediary code to JavaScript. This allows almost any code written for languages capable of targeting LLVM to be ported to JavaScript.

Another very cool feature of Emscripten is that many libraries are supported, including SDL, and OpenGL ES calls - which get mapped to the relevant WebGL calls.

As a preliminary test of this technology, I ported an old simplex noise based terrain generator written in C++ and OpenGL to be viewable in-browser. After installing the Emscripten SDK package and reading the documentation on GLFW to setup a WebGL context, the port was complete within half an hour.

A few things could vastly improve this demo; namely preventing the camera from intersecting the terrain - alas, here is experiment no.1:

Written on June 9, 2015