Getting a WebGL Implementation: Difference between revisions

From WebGL Public Wiki
Jump to navigation Jump to search
No edit summary
 
(40 intermediate revisions by 12 users not shown)
Line 1: Line 1:
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 1.0 ==


=== Firefox ===
WebGL 1.0 is supported in the stable releases of most major browsers on both desktop and mobile platforms. Chrome, Firefox, Internet Explorer, Opera, and Safari are all known to have good WebGL support on both desktop and mobile browsers. See http://caniuse.com/#feat=webgl for availability details.


WebGL is supported in Firefox/4.0b1 http://www.mozilla.com/en-US/firefox/all-beta.html and in the nightly builds of Firefox. Visit http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/ for builds on Linux (32- and 64-bit), Mac OS X and Windows.
Technical issues such as known hardware problems or lack of required GPU features may prevent WebGL from running in some cases.


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.
== WebGL 2.0 ==


The implementation requires working OpenGL 2.1 drivers and the availability of PBuffers.
The [https://www.khronos.org/registry/webgl/specs/latest/2.0/ WebGL 2.0 specification] has recently been released, and developers can now begin experiementing with the new functionality in some browsers. Existing implementations have known functionality gaps and may lack some validation that will be present once WebGL 2.0 is available in stable builds. They are provided to encourage early developer feedback.


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/libOSMesa.so). Note that the OSMesa library is required to use "gl" prefixes, not "mgl".
WebGL 2.0 requires hardware with OpenGL ES 3.0 support or comparable desktop OpenGL feature support. Not all systems capable of running WebGL 1.0 will be able to run WebGL 2.0.
 
=== Safari ===
 
WebGL is supported on Mac OS X 10.6 in the WebKit nightly builds available at http://nightly.webkit.org/ .
 
After downloading and installing the browser, open the Terminal and type the following:
 
<pre>
defaults write com.apple.Safari WebKitWebGLEnabled -bool YES
</pre>
 
This command only needs to be run once. All future invocations of the browser will run with WebGL enabled.


=== Firefox ===


=== Chrome/Chromium ===
See https://wiki.mozilla.org/Platform/GFX/WebGL2 for instructions on how to enable WebGL 2 in Firefox.


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:
Please file bugs for any issues you discover with Firefox’s WebGL 2.0 implementation at https://bugzilla.mozilla.org/


* Linux 32-bit: http://build.chromium.org/buildbot/continuous/linux/LATEST/
=== Chrome ===
* Linux 64-bit: http://build.chromium.org/buildbot/snapshots/chromium-rel-linux-64/
* Mac OS X: http://build.chromium.org/buildbot/continuous/mac/LATEST/
* Windows: http://build.chromium.org/buildbot/continuous/win/LATEST/


Linux/32, Mac and Windows point to the folder containing <code>chrome-linux.zip</code>, <code>chrome-mac.zip</code>, or <code>chrome-win32.zip</code>. For Linux/64, choose the highest numbered folder. Unpack the zip archive.
Experimental WebGL 2.0 support is available in recent [https://www.google.com/chrome/browser/canary.html Chrome Canary] builds. It can be enabled either by passing the “--enable-unsafe-es3-apis” flag on the command line, or enabling it in about:flags. The prototype is currently available on Android, Linux, Mac OS, and Windows.


Chromium must be launched from the command line in order to enable WebGL.
When enabled, WebGL 2.0 contexts can be created with the “webgl2” context ID.  


Note that recent versions of chrome appear to require --in-process-webgl to function (tested on Linux and a Windows IBM laptop.) Also, some users have reported that they must close all other versions of Chrome before starting Chromium.
Please file bugs for any issues you discover with Chrome’s WebGL 2.0 implementation at https://crbug.com In addition to describing the problem please navigate to about:gpu and attach the contents of that page to your report, which will help the developers identify the problem in the case that the issue is GPU or OS specific.


If the following commands do not work for you, remove the --in-process-webgl flag. The latest builds appear to no longer need it.
=== Demos ===


* Linux: <code>./chrome --enable-webgl --in-process-webgl</code>
Here are a few links to demos using WebGL 2.0 with which you can verify that your browser has it properly enabled. Note that due to bugs in implementations, these may not work correctly in all browsers.
* Mac OS X: <code>exec /Applications/Chromium.app/Contents/MacOS/Chromium --enable-webgl --in-process-webgl</code>
* Windows: <code>chrome.exe --enable-webgl --in-process-webgl</code>


In addition to the support in Chromium, slightly less frequently updated support for WebGL is now in the Chrome Dev channel, you can install/switch to the Dev Channel using the utility provided at http://dev.chromium.org/getting-involved/dev-channel
* [http://toji.github.io/webgl2-particles-2/ WebGL 2.0 Particles] ([https://github.com/toji/webgl2-particles-2 Github repository])
* [http://toji.github.io/webgl2-crowd/ WebGL 2.0 Crowd] ([https://github.com/toji/webgl2-crowd Github repository])
* [http://www.ibiblio.org/e-notes/webgl/webgl.htm Evgeny Demidov's WebGL demos] (see WebGL 2.0 links at the top of the page)
* [http://webglsamples.org/WebGL2Samples/ WebGL 2.0 Samples Pack] ([https://github.com/WebGLSamples/WebGL2Samples Github repository])

Latest revision as of 21:53, 18 October 2016

WebGL 1.0

WebGL 1.0 is supported in the stable releases of most major browsers on both desktop and mobile platforms. Chrome, Firefox, Internet Explorer, Opera, and Safari are all known to have good WebGL support on both desktop and mobile browsers. See http://caniuse.com/#feat=webgl for availability details.

Technical issues such as known hardware problems or lack of required GPU features may prevent WebGL from running in some cases.

WebGL 2.0

The WebGL 2.0 specification has recently been released, and developers can now begin experiementing with the new functionality in some browsers. Existing implementations have known functionality gaps and may lack some validation that will be present once WebGL 2.0 is available in stable builds. They are provided to encourage early developer feedback.

WebGL 2.0 requires hardware with OpenGL ES 3.0 support or comparable desktop OpenGL feature support. Not all systems capable of running WebGL 1.0 will be able to run WebGL 2.0.

Firefox

See https://wiki.mozilla.org/Platform/GFX/WebGL2 for instructions on how to enable WebGL 2 in Firefox.

Please file bugs for any issues you discover with Firefox’s WebGL 2.0 implementation at https://bugzilla.mozilla.org/

Chrome

Experimental WebGL 2.0 support is available in recent Chrome Canary builds. It can be enabled either by passing the “--enable-unsafe-es3-apis” flag on the command line, or enabling it in about:flags. The prototype is currently available on Android, Linux, Mac OS, and Windows.

When enabled, WebGL 2.0 contexts can be created with the “webgl2” context ID.

Please file bugs for any issues you discover with Chrome’s WebGL 2.0 implementation at https://crbug.com In addition to describing the problem please navigate to about:gpu and attach the contents of that page to your report, which will help the developers identify the problem in the case that the issue is GPU or OS specific.

Demos

Here are a few links to demos using WebGL 2.0 with which you can verify that your browser has it properly enabled. Note that due to bugs in implementations, these may not work correctly in all browsers.