Getting a WebGL Implementation: Difference between revisions

From WebGL Public Wiki
Jump to navigation Jump to search
updating this page to be more up-to-date
No edit summary
 
(29 intermediate revisions by 11 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 [http://www.mozilla.com/en-US/firefox/all-beta.html Firefox/4.0b8+] by default (and in previous betas with "webgl.enabled_for_all_sites" set to true in about:config.) It's also available in [http://nightly.mozilla.org/ Firefox Nightly builds].
Technical issues such as known hardware problems or lack of required GPU features may prevent WebGL from running in some cases.


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


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".
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.


=== Safari ===
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.


WebGL is supported on Mac OS X 10.6 in the [http://nightly.webkit.org/ WebKit nightly builds].
=== Firefox ===


After downloading and installing the browser, open the Terminal and type the following:
See https://wiki.mozilla.org/Platform/GFX/WebGL2 for instructions on how to enable WebGL 2 in Firefox.


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


=== Chrome/Chromium ===
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.


WebGL is available in the [http://www.google.com/chrome/ stable release of Chrome].
When enabled, WebGL 2.0 contexts can be created with the “webgl2” context ID.  


To test the most up-to-date code on Linux, Mac OS X and Windows, you can download the continuous builds of Chromium. Chromium is the Open Source project behind the Google Chrome browser.
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.


* Linux 32-bit: http://build.chromium.org/f/chromium/continuous/linux/LATEST/
=== Demos ===
* Linux 64-bit: http://build.chromium.org/f/chromium/continuous/linux64/LATEST/
* Mac OS X: http://build.chromium.org/f/chromium/continuous/mac/LATEST/
* Windows: http://tools.google.com/dlpage/chromesxs (the Chrome Canary Build)


Linux/32, Mac point to the folder containing <code>chrome-linux.zip</code>, <code>chrome-mac.zip</code>, or <code>chrome-win32.zip</code>. Unpack the zip archive and cd into the resulting directory. Windows has the Chrome Canary build which should just install.
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.


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 <code>--enable-accelerated-compositing</code> 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 [https://www.khronos.org/webgl/public-mailing-list/ public WebGL mailing list] or via the [http://code.google.com/p/chromium/issues/list Chromium issue tracker].
* [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.