--- title: WebGL slug: Web/API/WebGL_API tags: - WebGL translation_of: Web/API/WebGL_API ---
WebGL tuo 3D-grafiikan Webbin esittelemällä sovellusohjelmointirajapinnan (API), joka on läheisesti yhteensovpiva HTML5 canvas
-elementissä käytetttävän OpenGL ES 2.0 -määrittelyn kanssa. Tuki WebGL:lle on nykyisin Firefox 4+ -selaimissa, Google Chrome 9+ -selaimissa, Opera 12+ -selaimissa ja Safari 5.1+ -selaimissa.
{{CompatibilityTable()}}
Feature | Firefox (Gecko) | Chrome | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatGeckoDesktop("2.0")}} | 9 | {{CompatNo()}} | 12 | 5.1 |
Context name | experimental-webgl |
experimental-webgl |
n/a | experimental-webgl |
experimental-webgl |
OES_texture_float |
{{CompatGeckoDesktop("6.0")}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
OES_standard_derivatives |
{{CompatGeckoDesktop("10.0")}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
EXT_texture_filter_anisotropic |
{{CompatGeckoDesktop("13.0")}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
WEBGL_compressed_texture_s3tc |
{{CompatGeckoDesktop("15.0")}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
drawingBufferWidth and drawingBufferHeight attributes |
{{CompatGeckoDesktop("9.0")}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
Feature | Firefox Mobile (Gecko) | Android | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
Context name | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
OES_texture_float |
{{CompatGeckoMobile("6.0")}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
OES_standard_derivatives |
{{CompatGeckoMobile("10.0")}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
EXT_texture_filter_anisotropic |
{{CompatGeckoMobile("13.0")}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
WEBGL_compressed_texture_s3tc |
{{CompatGeckoMobile("15.0")}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
drawingBufferWidth and drawingBufferHeight attributes |
{{CompatGeckoMobile("9.0")}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} | {{CompatUnknown()}} |
Starting with Gecko 10.0 {{geckoRelease("10.0")}}, there are two preferences available which let you control the capabilities of WebGL for testing purposes:
webgl.min_capability_mode
true
, enables a minimum capability mode. When in this mode, WebGL is configured to only support the bare minimum feature set and capabilities required by the WebGL specification. This lets you ensure that your WebGL code will work on any device or browser, regardless of their capabilities. This is false
by default.webgl.disable_extensions
true
, disables all WebGL extensions. This is false
by default.