WebGL, WebCL, GLFW and GYP in Node.js

This is a past event

51 people went

Location image of event venue


Mikael Bourges-Sevenier (https://github.com/mikeseven) of Motorola-Mobility (https://github.com/Motorola-Mobility) will be talking on three WebGL and WebCL modules that he’s written for Node, and Nathan (https://tootallnate.net/) Rajlich (https://github.com/TooTallNate) of LearnBoost (https://www.learnboost.com/) will be talking on node-gyp (https://github.com/TooTallNate/node-gyp). Ryan Dahl (@ryah (https://twitter.com/ryah)) had requested, Nathan give the presentation at nodeconf, but after running out of time, Nathan has offered to present at BayNode instead!

Will be hosting BayNode at RedRobot (http://redrobot.com/#jobs) this month.

Red Robot Labs is a mobile gaming start-up developing and publishing games that leverage consumers' location around the globe. Its location-based mobile crime game, Life Is Crime for Android and iOS was named by Entertainment Weekly as one of the top 10 Apps of 2011. Investors include Social+Capital Partnership, Shasta Ventures, Rick Thompson co-founder of Playdom and Mitch Lasky, general partner, Benchmark Capital. Red Robot Labs was founded in January 2011 by a team of industry veterans who are passionate about creating innovative, highly-polished social, mobile, location based games.


node-webcl (GitHub: Motorola-Mobility / node-webcl (https://github.com/Motorola-Mobility/node-webcl), License: BSD, npm:node-webcl (http://npmjs.org/package/node-webcl)) from Motorola Mobility is an implementation of the Khronos WebCL working draft (https://cvs.khronos.org/svn/repos/registry/trunk/public/webcl/spec/latest/index.html) using Node. It has been tested on Mac OS X 10.7 and Linux. It should also work on Windows 7. Its only dependency is node-webgl, another Node module that implements the WebGL standard.

The module contains various tests and sample applications to help developers leverage multiple CPU and GPU cores. It is also used as a tool to develop experimental features that may or may not be in the WebCL standard.

Installing node-webcl with npm will fetch node-webgl and node-glfw. Since they rely on native libraries, make sure they’re available:

freeimage (http://freeimage.sourceforge.net/) GLEW (http://glew.sourceforge.net/) AntTweakBar (http://www.antisphere.com/Wiki/tools:anttweakbar) There are more details in the project’s readme. Intel’s OpenCL SDK (http://software.intel.com/en-us/articles/vcsource-tools-opencl-sdk/) can also be installed as a pure WebCL implementation, and be sure to check you’ve got the latest drivers installed for your graphics card.


node-webgl (GitHub: mikeseven / node-webgl (https://github.com/mikeseven/node-webgl), License: BSD, npm: node-webgl (http://npmjs.org/package/node-webgl)) is an implementation of the Khronos WebGL specification (https://www.khronos.org/registry/webgl/specs/1.0/). This is a fork of Tim Caswell’s WebGL project that started life as Blue GPU Lava (http://nodeknockout.com/teams/minimason) at Node Knockout.

This module allows WebGL applications originally created for browsers to run using Node on the desktop without modification. It provides support for DOM methods commonly used to create WebGL content.

Like node-webcl, this module has been tested with Mac OS X and Linux. It relies on GLEW, GLFW, and AntTweakBar. Lots of samples have been included – some show how to use AntTweakBar to create a compelling GUI.


Finally, node-glfw (GitHub: mikeseven / node-glfw (https://github.com/mikeseven/node-glfw), License: BSD, npm: node-glfw (http://npmjs.org/package/node-glfw)) is a JavaScript wrapper around GLFW. This provides implementations, where possible, of WebGL methods on top of desktop OpenGL as well as a browser compliant event model.

Although this module will run on Node 0.6, at least 0.7.5 is recommended for the typed array support. This module is intended as a platform-level binding – node-webgl should be used to create OpenGL applications.


From Github:

Node.js native addon build tool

node-gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js, which takes away the pain of dealing with the various differences in build platforms. It is the replacement to the node-waf program which is removed for node v0.8.


Easy to use, consistent interface Same commands to build your module on every platform Supports multiple target versions of Node