Software:WebGL
Original author(s) | Mozilla Foundation |
---|---|
Developer(s) | Khronos WebGL Working Group |
Initial release | March 3, 2011[1] |
Stable release | 2.0
/ June 29, 2023 |
Platform | Cross-platform |
Type | API |
Website | www |
HTML |
---|
Comparisons |
WebGL (short for Web Graphics Library) is a JavaScript API for rendering interactive 2D and 3D graphics within any compatible web browser without the use of plug-ins.[2] WebGL is fully integrated with other web standards, allowing GPU-accelerated usage of physics, image processing, and effects in the HTML canvas. WebGL elements can be mixed with other HTML elements and composited with other parts of the page or page background.[3]
WebGL programs consist of control code written in JavaScript, and shader code written in OpenGL ES Shading Language (GLSL ES), a language similar to C or C++. WebGL code is executed on a computer's GPU.
WebGL is designed and maintained by the non-profit Khronos Group.[4] On February 9, 2022, Khronos Group announced WebGL 2.0 support from all major browsers.[5]
Design
WebGL 1.0 is based on OpenGL ES 2.0 and provides an API for 3D graphics.[6] It uses the HTML5 canvas element and is accessed using Document Object Model (DOM) interfaces.
WebGL 2.0 is based on OpenGL ES 3.0. It guarantees the availability of many optional extensions of WebGL 1.0, and exposes new APIs.[7] Automatic memory management is provided implicitly by JavaScript.[4]
Like OpenGL ES 2.0, WebGL lacks the fixed-function APIs introduced in OpenGL 1.0 and deprecated in OpenGL 3.0. This functionality, if required, has to be implemented by the developer using shader code and JavaScript.
Shaders in WebGL are written in GLSL and passed to the WebGL API as text strings. The WebGL implementation compiles these strings to GPU code. This code is executed for each vertex sent through the API and for each pixel rasterized to the screen.
History
WebGL evolved out of the Canvas 3D experiments started by Vladimir Vukićević at Mozilla. Vukićević first demonstrated a Canvas 3D prototype in 2006. By the end of 2007, both Mozilla[8] and Opera[9] had made their own separate implementations.
In early 2009, the non-profit technology consortium Khronos Group started the WebGL Working Group, with initial participation from Apple, Google, Mozilla, Opera, and others.[4][10] Version 1.0 of the WebGL specification was released March 2011.[1] As of March 2012, the chair of the working group is Ken Russell.
An early application of WebGL was Zygote Body.[11][12] In November 2012 Autodesk announced that they ported most of their applications to the cloud running on local WebGL clients. These applications included Fusion 360 and AutoCAD 360.[13]
Development of the WebGL 2 specification started in 2013 and finished in January 2017.[14] The specification is based on OpenGL ES 3.0.[15] First implementations are in Firefox 51, Chrome 56 and Opera 43.[16]
Implementations
Almost Native Graphics Layer Engine
Almost Native Graphics Layer Engine (ANGLE) is an open source graphic engine which implements WebGL 1.0 (2.0 which closely conforms to ES 3.0) and OpenGL ES 2.0 and 3.0 standards. It is a default backend for both Google Chrome and Mozilla Firefox on Windows platforms and works by translating WebGL and OpenGL calls to available platform-specific APIs. ANGLE currently provides access to OpenGL ES 2.0 and 3.0 to desktop OpenGL, OpenGL ES, Direct3D 9, and Direct3D 11 APIs.[17] ″[Google] Chrome uses ANGLE for all graphics rendering on Windows, including the accelerated Canvas2D implementation and the Native Client sandbox environment.″[17]
Software
WebGL is widely supported by modern browsers. However, its availability depends on other factors, too, like whether the GPU supports it. The official WebGL website offers a simple test page.[18] More detailed information (like what renderer the browser uses, and what extensions are available) can be found at third-party websites.[19][20]
Desktop browsers[2]
- Google Chrome – WebGL 1.0 has been enabled on all platforms that have a capable graphics card with updated drivers since version 9, released in February 2011.[21][22] By default on Windows, Chrome uses the ANGLE (Almost Native Graphics Layer Engine) renderer to translate OpenGL ES to Direct X 9.0c or 11.0, which have better driver support.[23] However, on Linux and Mac OS X, the default renderer is OpenGL.[24] It is also possible to force OpenGL as the renderer on Windows.[23] Since September 2013, Chrome also has a newer Direct3D 11 renderer, which requires a newer graphics card.[25][26] Chrome 56+ supports WebGL 2.0.
- Firefox – WebGL 1.0 has been enabled on all platforms that have a capable graphics card with updated drivers since version 4.0.[27] Since 2013 Firefox also uses DirectX on the Windows platform via ANGLE.[23] Firefox 51+ supports WebGL 2.0.
- Safari – Safari 6.0 and newer versions installed on OS X Mountain Lion, Mac OS X Lion and Safari 5.1 on Mac OS X Snow Leopard implemented support for WebGL 1.0, which was disabled by default before Safari 8.0.[28][29][30][31][32] Safari version 12 (available in MacOS Mojave) has available support for WebGL 2.0 as an "Experimental" feature. Safari 15 enables WebGL 2.0 for all users.[33]
- Opera – WebGL 1.0 has been implemented in Opera 11 and 12, but was disabled by default in 2014.[34][35] Opera 43+ supports WebGL 2.0.
- Internet Explorer – WebGL 1.0 is partially supported in Internet Explorer 11.[36][37][38][39] Internet Explorer initially failed most of the official WebGL conformance tests, but Microsoft later released several updates. The latest 0.94 WebGL engine currently passes ~97% of Khronos tests.[40] WebGL support can also be manually added to earlier versions of Internet Explorer using third-party plugins such as IEWebGL.[41]
- Microsoft Edge – For Microsoft Edge Legacy, the initial stable release supports WebGL version 0.95 (context name: "experimental-webgl") with an open source GLSL to HLSL transpiler.[42] Version 10240+ supports WebGL 1.0 as prefixed. Latest Chromium-based Edge supports WebGL 2.0.
Mobile browsers
- Android Browser – WebGL 1.0 is supported on Android as of Chrome 25.[43] WebGL 2.0 is supported on Android as of Chrome 114.[44] Chrome is used for the Android system webview as of Android 5.[44]
- BlackBerry 10 – WebGL 1.0 is available for BlackBerry devices since OS version 10.00[45]
- BlackBerry PlayBook – WebGL 1.0 is available via WebWorks and browser in PlayBook OS 2.00[46]
- Internet Explorer – Prefixed WebGL 1.0 is available on Windows Phone 8.x (11+)
- Firefox for mobile – WebGL 1.0 is available for Android and MeeGo devices since Firefox 4.[47][48]
- Firefox OS[48]
- Google Chrome – WebGL 1.0 is available for Android devices since Google Chrome 25 and enabled by default since version 30.[49]
- Maemo – In Nokia N900, WebGL 1.0 is available in the stock microB browser from the PR1.2 firmware update onwards.[50]
- MeeGo – WebGL 1.0 is unsupported in the stock browser "Web." However, it is available through Firefox.[48]
- Microsoft Edge – Prefixed WebGL 1.0 is available on Windows 10 Mobile.[51]
- Opera Mobile – Opera Mobile 12 supports WebGL 1.0 (on Android only).[52]
- Safari on iOS – WebGL 1.0 is available for mobile Safari in iOS 8.[53] WebGL 2.0 is available for mobile Safari in iOS 15.[44]
- Sailfish OS – WebGL 1.0 is supported in the default Sailfish browser.[54]
- Tizen – WebGL 1.0 is supported[55]
Tools and ecosystem
Utilities
The low-level nature of the WebGL API, which provides little on its own to quickly create desirable 3D graphics, motivated the creation of higher-level libraries that abstract common operations (e.g. loading scene graphs and 3D objects in certain formats; applying linear transformations to shaders or view frustums). Some such libraries were ported to JavaScript from other languages. Examples of libraries that provide high-level features include A-Frame (VR), BabylonJS, PlayCanvas, three.js, OSG.JS, Google’s model-viewer and CopperLicht. Web3D also made a project called X3DOM to make X3D and VRML content run on WebGL.
Games
There has been an emergence of 2D and 3D game engines for WebGL,[56] such as Unreal Engine 4 and Unity.[57] The Stage3D/Flash-based Away3D high-level library also has a port to WebGL via TypeScript.[25][58] A more light-weight utility library that provides just the vector and matrix math utilities for shaders is sylvester.js.[59][60] It is sometimes used in conjunction with a WebGL specific extension called glUtils.js.[59][61]
There are also some 2D libraries built atop WebGL, like Cocos2d-x or Pixi.js, which were implemented this way for performance reasons in a move that parallels what happened with the Starling Framework over Stage3D in the Flash world. The WebGL-based 2D libraries fall back to HTML5 canvas when WebGL is not available.[62] Removing the rendering bottleneck by giving almost direct access to the GPU has exposed performance limitations in the JavaScript implementations. Some were addressed by asm.js and WebAssembly (similarly, the introduction of Stage3D exposed performance problems within ActionScript, which were addressed by projects like CrossBridge).[62]
Content creation
As with any other graphics API, creating content for WebGL scenes requires using a 3D content creation tool and exporting the scene to a format that is readable by the viewer or helper library. Desktop 3D authoring software such as Blender, Autodesk Maya or SimLab Composer can be used for this purpose. In particular, Blend4Web allows a WebGL scene to be authored entirely in Blender and exported to a browser with a single click, even as a standalone web page.[63] There are also some WebGL-specific software such as CopperCube and the online WebGL-based editor Clara.io. Online platforms such as Sketchfab and Clara.io allow users to directly upload their 3D models and display them using a hosted WebGL viewer.
Environment-based tools
Starting from Firefox Version 27, Mozilla has given Firefox built-in WebGL tools that allow the editing of vertices and fragment shaders.[64] A number of other debugging and profiling tools have also emerged.[65]
See also
- List of WebGL frameworks
- Experience Curiosity – WebGL simulation of the Mars rover Curiosity
- glTF – originally known as WebGL Transmissions Format or WebGL TF
- WebXR
- Java OpenGL – OpenGL library for the Java programming language
- WebGPU
References
- ↑ 1.0 1.1 "Khronos Releases Final WebGL 1.0 Specification". 3 March 2011. http://www.khronos.org/news/press/khronos-releases-final-webgl-1.0-specification.
- ↑ 2.0 2.1 "WebGL Fundamentals". HTML5 Rocks. http://www.html5rocks.com/en/tutorials/webgl/webgl_fundamentals/.
- ↑ Parisi, Tony (2012-08-15). "WebGL: Up and Running". O'Reilly Media, Incorporated. http://my.safaribooksonline.com/book/animation-and-3d/9781449326487/chapter-6dot-integrating-2d-and-3d/overlaying_3d_visuals_on_2d_pa.
- ↑ 4.0 4.1 4.2 "WebGL – OpenGL ES 2.0 for the Web". Khronos.org. http://www.khronos.org/webgl/.
- ↑ "WebGL 2.0 Achieves Pervasive Support from all Major Web Browsers" (in en). 2022-02-09. https://www.khronos.org/blog/webgl-2-achieves-pervasive-support-from-all-major-web-browsers.
- ↑ "WebGL Specification". Khronos.org. http://www.khronos.org/registry/webgl/specs/latest/.
- ↑ "WebGL 2.0 Specification". Khronos.org. https://www.khronos.org/registry/webgl/specs/latest/2.0/.
- ↑ "Canvas 3D: GL power, web-style". Blog.vlad1.com. http://blog.vlad1.com/2007/11/26/canvas-3d-gl-power-web-style/.
- ↑ "Taking the canvas to another dimension". My.opera.com. 2007-11-26. http://my.opera.com/timjoh/blog/2007/11/13/taking-the-canvas-to-another-dimension.
- ↑ "Khronos Details WebGL Initiative to Bring Hardware-Accelerated 3D Graphics to the Internet". Khronos.org. 2009-08-04. http://www.khronos.org/news/press/releases/khronos-webgl-initiative-hardware-accelerated-3d-graphics-internet.
- ↑ "Google Body – Google Labs". Bodybrowser.googlelabs.com. http://bodybrowser.googlelabs.com.
- ↑ Bhanoo, Sindya N. (2010-12-23). "New From Google: The Body Browser". Well.blogs.nytimes.com. http://well.blogs.nytimes.com/2010/12/23/new-from-google-the-body-browser/.
- ↑ "AUTODESK FUSION 360: THE FUTURE OF CAD, PT. 1". 3dcadworld.com. http://www.3dcadworld.com/autodesk-fusion-360-the-future-of-cad-part-1/.
- ↑ "WebGL 2 Specification". khronos.org. 2013-09-26. http://www.khronos.org/registry/webgl/specs/latest/2.0/.
- ↑ "WebGL 2.0 Specification". https://www.khronos.org/registry/webgl/specs/latest/2.0/.
- ↑ "WebGL - Web APIs". MDN. https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API.
- ↑ 17.0 17.1 "ANGLE - Almost Native Graphics Layer Engine". 2019. https://chromium.googlesource.com/angle/angle/+/master/README.md.
- ↑ "WebGL test page". webgl.org. http://get.webgl.org/.
- ↑ "WebGL Report". webglreport.com. http://webglreport.com/.
- ↑ "WebGL Browser Report — WebGL Detection — WebGL Tester — BrowserLeaks". browserleaks.com. http://www.browserleaks.com/webgl.
- ↑ Mah, Paul (February 8, 2011). "Google releases Chrome 9; comes with Google Instant, WebGL – FierceCIO:TechWatch". FierceCIO. http://www.fiercecio.com/techwatch/story/google-releases-chrome-9-comes-google-instant-webgl/2011-02-08.
- ↑ "WebGL in Chrome Stable! - Learning WebGL". learningwebgl.com. http://learningwebgl.com/blog/?p=3103.
- ↑ 23.0 23.1 23.2 "(WebGL) How to Enable Native OpenGL in your Browser (Windows)". geeks3d.com. http://www.geeks3d.com/20130611/webgl-how-to-enable-native-opengl-in-your-browser-windows/.
- ↑ "Chromium Blog: Introducing the ANGLE Project". Chromium Blog. https://blog.chromium.org/2010/03/introducing-angle-project.html.
- ↑ 25.0 25.1 "WebGL around the net, 17 Oct 2013 - Learning WebGL". learningwebgl.com. http://learningwebgl.com/blog/?p=5956.
- ↑ "At last! Chrome D3D11 day has come!". tojicode.com. http://blog.tojicode.com/2013/09/at-last-chrome-d3d11-day-has-come.html.
- ↑ "Mozilla Firefox 4 Release Notes". Mozilla.com. 2011-03-22. http://www.mozilla.com/en-US/firefox/4.0/releasenotes/.
- ↑ "New in OS X Lion: Safari 5.1 brings WebGL, Do Not Track and more". Fairerplatform.com. 2011-05-03. http://fairerplatform.com/2011/05/new-in-os-x-lion-safari-5-1-brings-webgl-do-not-track-and-more/.
- ↑ "Enable WebGL in Safari". Ikriz.nl. 2011-08-23. http://www.ikriz.nl/2011/08/23/enable-webgl-in-safari.
- ↑ "Getting a WebGL Implementation". Khronos.org. 2012-01-13. http://www.khronos.org/webgl/wiki/Getting_a_WebGL_Implementation.
- ↑ "Implementations/WebKit". Khronos.org. 2011-09-03. http://www.khronos.org/webgl/wiki/Implementations/WebKit.
- ↑ "WebGL Now Available in WebKit Nightlies". Webkit.org. http://www.webkit.org/blog/603/webgl-now-available-in-webkit-nightlies/.
- ↑ modeless (2021-09-24). "Safari 15 is released. WebGL 2 is now supported in every major browser and platform!". http://www.reddit.com/r/webgl/comments/puplza/safari_15_is_released_webgl_2_is_now_supported_in/.
- ↑ "WebGL and Hardware Acceleration". My.opera.com. 2011-02-28. http://my.opera.com/core/blog/2011/02/28/webgl-and-hardware-acceleration-2.
- ↑ "Introducing Opera 12 alpha". My.opera.com. 2011-10-13. http://my.opera.com/desktopteam/blog/2011/10/13/introducing-opera-12-alpha.
- ↑ "WebGL (Windows)". microsoft.com. Microsoft. http://msdn.microsoft.com/en-US/library/ie/bg182648%28v=vs.85%29.
- ↑ "Internet Explorer 11 Preview guide for developers". Microsoft. 2013-07-17. http://msdn.microsoft.com/library/ie/bg182636.aspx.
- ↑ "WebGL". Microsoft. 2013-07-17. http://msdn.microsoft.com/library/ie/bg182648.aspx.
- ↑ "Internet Explorer 11 to support WebGL and MPEG Dash". Engadget. 2013-06-26. https://www.engadget.com/2013/06/26/internet-explorer-11-to-support-webgl-and-mpeg-dash/.
- ↑ "IE11 fails more than half tests in official WebGL conformance test suite". Microsoft Connect. https://connect.microsoft.com/IE/feedback/details/795172.
- ↑ "IEWebGL". Iewebgl. https://github.com/iewebgl/iewebgl.
- ↑ "GitHub - Microsoft Edge WebGL Implementation". Microsoft. 2016-06-04. https://github.com/microsoftedge/webgl.
- ↑ "WebGL: 2D and 3D graphics for the web - Web APIs - MDN". https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API#browser_compatibility.
- ↑ 44.0 44.1 44.2 "WebGL 2.0 - Can I use...". https://caniuse.com/webgl2.
- ↑ McDonough, Larry. "WebGL: 3D Gaming on the Web Arrives". BerryReview. http://devblog.blackberry.com/2013/04/webgl-3d-gaming/.
- ↑ Halevy, Ronen. "PlayBook OS 2.0 Developer Beta Includes WebGL, Flash 11, & AIR 3.0". BerryReview. http://www.berryreview.com/2011/10/18/playbook-os-2-0-developer-beta-includes-webgl-flash-11-air-3-0/.
- ↑ "WebGL on Mobile Devices". iChemLabs. 2011-11-12. http://www.ichemlabs.com/1375.
- ↑ 48.0 48.1 48.2 "Mobile HTML5 compatibility on iPhone, Android, Windows Phone, BlackBerry, Firefox OS and other mobile devices". http://mobilehtml5.org/.
- ↑ Kersey, Jason. "Chrome Beta for Android Update". Chrome Releases Blog. http://googlechromereleases.blogspot.com/2013/08/chrome-beta-for-android-update_22.html.
- ↑ Voipio, Riku (2010-06-07). "WebGL on N900". Suihkulokki.blogspot.com. http://suihkulokki.blogspot.com/2010/06/webgl-on-n900.html.
- ↑ "Dev guide: WebGL – Microsoft Edge Development". Microsoft. https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/dev-guide/graphics/WebGL/.
- ↑ "Opera Mobile 12". Opera Software. http://my.opera.com/mobile/blog/2012/02/27/opera-mobile-12.
- ↑ Cunningham, Andrew (2014-09-17). "iOS 8, Thoroughly Reviewed". Ars Technica. https://arstechnica.com/apple/2014/09/ios-8-thoroughly-reviewed/7/.
- ↑ "HTML5test – How well does your browser support HTML5?". https://html5test.com/compare/browser/sailfish.html.
- ↑ "HTML5test – How well does your browser support HTML5?". https://html5test.com/compare/browser/tizen-2.3.html.
- ↑ Parisi, Tony (13 February 2014). Programming 3D Applications with HTML5 and WebGL: 3D Animation and Visualization for Web Pages. "O'Reilly Media, Inc.". pp. 364–366. ISBN 978-1-4493-6395-6. https://books.google.com/books?id=UvrYAgAAQBAJ&pg=PA364-366.
- ↑ Barrett, Stephen. "Tegra K1 Lands in Acer's Newest Chromebook". anandtech.com. http://www.anandtech.com/show/8354/tegra-k1-lands-in-acers-newest-chromebook.
- ↑ "Blog > Away3D Typescript 4.1 Alpha > Away3D". away3d.com. http://away3d.com/comments/away3d_typescript_4.1_alpha.
- ↑ 59.0 59.1 Boreskov, Alexey; Shikin, Evgeniy (2014). Computer Graphics: From Pixels to Programmable Graphics Hardware. CRC Press. p. 370. ISBN 978-1-4398-6730-3. https://books.google.com/books?id=VUPBAQAAQBAJ&pg=PA370.
- ↑ Anyuru, Andreas (2012). Professional WebGL Programming: Developing 3D Graphics for the Web. John Wiley & Sons. p. 140. ISBN 978-1-119-94059-3. https://books.google.com/books?id=F75bsvlmqQsC&pg=PA140.
- ↑ Fulton, Steve; Fulton, Jeff (2013). HTML5 Canvas (2nd ed.). "O'Reilly Media, Inc.". p. 624. ISBN 978-1-4493-3588-5. https://books.google.com/books?id=zLUyKvtdCQwC&pg=PA624.
- ↑ 62.0 62.1 "The WebGL potential - TypedArray.org". typedarray.org. http://typedarray.org/the-webgl-potential/.
- ↑ "Blend4Web Official Site - About". Blend4Web.com. https://www.blend4web.com/en/about/.
- ↑ "Live editing WebGL shaders with Firefox Developer Tools". Mozilla Hacks – the Web developer blog. https://hacks.mozilla.org/2013/11/live-editing-webgl-shaders-with-firefox-developer-tools/.
- ↑ "Real-Time Rendering · WebGL Debugging and Profiling Tools". realtimerendering.com. http://www.realtimerendering.com/blog/webgl-debugging-and-profiling-tools/.
External links
- WebGL at the Mozilla Developer Network
Original source: https://en.wikipedia.org/wiki/WebGL.
Read more |