Search My Blog

Friday, December 17, 2010

Getting a WebGL Implementation - WebGL Public Wiki

Getting a WebGL Implementation

From WebGL Public Wiki

Jump to: navigation, search

WebGL is currently under development, and is supported in the latest builds of several browsers. Here are instructions on how to obtain a copy of a browser supporting the provisional WebGL specification. As the specification nears completion, expect that browsers will have this functionality built in to their latest releases, and not require any manual steps to enable it.


WebGL is supported in Firefox/4.0b1 and in the nightly builds of Firefox. Visit for builds on Linux (32- and 64-bit), Mac OS X and Windows.

After downloading the browser, enable WebGL: type about:config into the address bar, search for "webgl", and double-click "webgl.enabled_for_all_sites" to set it to true.

The implementation requires working OpenGL 2.1 drivers and the availability of PBuffers.

If OpenGL is not available, or for testing/debugging purposes, software rendering can be used through OSMesa (off-screen Mesa), by setting the "webgl.osmesalib" variable to point to the OSMesa shared library (typically /usr/lib/ Note that the OSMesa library is required to use "gl" prefixes, not "mgl".


WebGL is supported on Mac OS X 10.6 in the WebKit nightly builds available at .

After downloading and installing the browser, open the Terminal and type the following:

defaults write WebKitWebGLEnabled -bool YES 

This command only needs to be run once. All future invocations of the browser will run with WebGL enabled.


Chromium is the Open Source project behind the Google Chrome browser, and its continuous builds are currently the best way to get WebGL support in a Chrome-style browser under Linux, Mac OS X, and Windows. The most recent builds are available here:

Linux/32, Mac point to the folder containing,, or Unpack the zip archive and cd into the resulting directory. Windows has the Chrome Canary build which should just install.

Chromium must be launched from the command line in order to enable WebGL.

  • Linux: ./chrome --enable-webgl
  • Mac OS X: ./ --enable-webgl
  • Windows: No command line options needed.

Support for accelerated compositing is also compiled in for all three platforms. Enabling the compositor improves WebGL performance by avoiding expensive frame buffer readbacks when drawing the rendering results to the screen. Add the command line argument --enable-accelerated-compositing to test it. Note that the compositor support for WebGL is in early stages and is likely to be less stable. Please report issues you find to either the public WebGL mailing list or via the Chromium issue tracker.

Go there...


No comments: