WebGL 是一种JavaScript API ,用于在不使用插件 的情况下在任何兼容的网页浏览器 中呈现交互式2D和3D图形[3] 。WebGL完全集成到浏览器的所有网页标准中,可将影像处理和效果的GPU加速使用方式当做网页Canvas的一部分。WebGL元素可以加入其他HTML元素之中并与网页或网页背景的其他部分混合[4] 。WebGL程序由JavaScript编写的句柄和OpenGL Shading Language (GLSL)编写的着色器 代码组成,该语言类似于C 或C++ ,并在电脑的图形处理器 (GPU)上执行。WebGL由非营利 Khronos Group 设计和维护[5] 。
设计
WebGL 1.0基于OpenGL ES 2.0 ,并提供了3D图形的API [6] 。它使用HTML5 Canvas 并允许利用文档对象模型 接口。WebGL 2.0基于OpenGL ES 3.0 ,确保了提供许多选择性的WebGL 1.0扩展,并引入新的API[7] 。可利用部分Javascript 实现自动存储器管理 [5] 。
历史
WebGL起源于Mozilla员工弗拉基米尔·弗基西维奇 一项称为Canvas 3D的实验项目。2006年,弗基西维奇首次展示了Canvas 3D的原型。2007年底在Firefox[8] 和Opera[9] 被实现。
在2009年初,非营利 技术联盟 Khronos Group启动了WebGL的工作组,最初的工作成员包括Apple 、Google 、Mozilla 、Opera 等[5] [10] 。2011年3月发布WebGL 1.0规范[1] 。截至2012年3月,工作组的主席由肯·罗素(Ken Russell,全名“Kenneth Bradley Russell”)担任。
WebGL的早期应用包括Zygote Body [11] [12] 。
WebGL 2规范的发展始于2013年,并于2017年1月完成[13] 。该规范基于OpenGL ES 3.0[14] 。首度实现在Firefox 51、Chrome 56和Opera 43中[15] 。
支持
目前,WebGL在最新的浏览器中被广泛支持。然而,其可用性取决于其他因素,如GPU支持。WebGL官方网站提供了一个简单的测试页[16] 。而第三方网站提供了更详细的消息(如浏览器使用的渲染器以及可用的扩展)[17] [18] 。
桌面浏览器
移动浏览器
参考文献
^ 1.0 1.1 Khronos Releases Final WebGL 1.0 Specification . [2015-05-18 ] . (原始内容存档 于2016-11-08).
^ https://www.khronos.org/registry/webgl/specs/ .
^ Gregg Tavares. WebGL Fundamentals . HTML5 Rocks. 2012-02-09 [2015-12-27 ] . (原始内容 存档于2022-02-08).
^ Parisi, Tony. WebGL: Up and Running . O'Reilly Media, Incorporated. 2012-08-15 [2017-06-11 ] . (原始内容存档 于2013-02-01).
^ 5.0 5.1 5.2 WebGL - OpenGL ES 2.0 for the Web
^ WebGL Specification . Khronos.org. [2011-05-14 ] . (原始内容存档 于2012-04-12).
^ WebGL 2.0 Specification . Khronos.org. [2017-02-27 ] . (原始内容 存档于2017-01-28).
^ Canvas 3D: GL power, web-style . Blog.vlad1.com. [2011-05-14 ] . (原始内容 存档于2011-07-17).
^ Taking the canvas to another dimension . My.opera.com. 2007-11-26 [2011-05-14 ] . (原始内容 存档于2007-11-17).
^ Khronos Details WebGL Initiative to Bring Hardware-Accelerated 3D Graphics to the Internet . Khronos.org. 2009-08-04 [2011-05-14 ] . (原始内容 存档于2012-04-12).
^ Google Body – Google Labs . Bodybrowser.googlelabs.com. [2011-05-14 ] . (原始内容 存档于2011-05-13).
^ Bhanoo, Sindya N. New From Google: The Body Browser . Well.blogs.nytimes.com. 2010-12-23 [2011-05-14 ] . (原始内容 存档于2015-02-06).
^ WebGL 2 Specification . khronos.org. 2013-09-26 [2013-10-28 ] . (原始内容 存档于2017-08-08).
^ 存档副本 . [2017-06-11 ] . (原始内容 存档于2017-01-28).
^ 存档副本 . [2017-06-11 ] . (原始内容 存档于2017-08-28).
^ WebGL test page . webgl.org. [2015-12-27 ] . (原始内容 存档于2015-04-18).
^ WebGL Report . webglreport.com. [2017-06-11 ] . (原始内容 存档于2015-05-28).
^ WebGL Browser Report — WebGL Detection — WebGL Tester — BrowserLeaks . browserleaks.com. [2017-06-11 ] . (原始内容 存档于2015-05-20).
^ Paul Mah. Google releases Chrome 9; comes with Google Instant, WebGL – FierceCIO:TechWatch . FierceCIO. February 8, 2011 [2012-03-20 ] . (原始内容 存档于2011-10-25).
^ WebGL in Chrome Stable! - Learning WebGL . learningwebgl.com. [2015-12-27 ] . (原始内容 存档于2015-05-28).
^ 21.0 21.1 (WebGL) How to Enable Native OpenGL in your Browser (Windows) | Geeks3D . [2022-03-24 ] . (原始内容 存档于2022-04-17) (美国英语) .
^ Introducing the ANGLE Project . Chromium Blog. [2022-03-24 ] . (原始内容 存档于2022-04-22) (英语) .
^ WebGL around the net, 17 Oct 2013 | Learning WebGL . web.archive.org. 2014-08-08 [2022-03-24 ] . 原始内容存档于2014-08-08.
^ Brandon Jones. At last! Chrome D3D11 day has come! . [2022-03-24 ] . (原始内容 存档于2022-04-19) (英语) .
^ WebGL (Windows) . 微软. [2014-03-05 ] . (原始内容 存档于2015-03-24).
^ IEWebGL . Iewebgl. [2014-08-14 ] . (原始内容 存档于2022-02-08).
^ Mozilla Firefox 4 Release Notes . Mozilla.com. 2011-03-22 [2012-03-20 ] . (原始内容 存档于2011-03-23).
^ New in OS X Lion: Safari 5.1 brings WebGL, Do Not Track and more . Fairerplatform.com. 2011-05-03 [2012-03-20 ] . (原始内容 存档于2012-03-19).
^ Enable WebGL in Safari . Ikriz.nl. 2011-08-23 [2012-03-20 ] . (原始内容 存档于2012-03-04).
^ Getting a WebGL Implementation . Khronos.org. 2012-01-13 [2012-03-20 ] . (原始内容 存档于2015-05-28).
^ Implementations/WebKit . Khronos.org. 2011-09-03 [2012-03-20 ] . (原始内容 存档于2015-03-21).
^ WebGL Now Available in WebKit Nightlies . Webkit.org. [2012-03-20 ] . (原始内容 存档于2012-03-08).
^ WebGL and Hardware Acceleration . My.opera.com. 2011-02-28 [2012-03-20 ] . (原始内容 存档于2011-03-03).
^ Introducing Opera 12 alpha . My.opera.com. 2011-10-13 [2012-03-20 ] . (原始内容 存档于2011-10-15).
^ 35.0 35.1 Mobile HTML5 compatibility on iPhone, Android, Windows Phone, BlackBerry, Firefox OS and other mobile devices . [2015-09-16 ] . (原始内容 存档于2022-04-15).
^ iclkevin. WebGL on Mobile Devices . iChemLabs. 2011-11-12 [2011-11-25 ] . (原始内容 存档于2013-03-12).
^ Kersey, Jason. Chrome Beta for Android Update . Chrome Releases Blog. Google. [2013-08-23 ] . (原始内容 存档于2015-04-03).
^ Opera Mobile 12 . Opera Software. [27 February 2012] . (原始内容 存档于2012年3月1日).
^ HTML5test - How well does your browser support HTML5? . [2015-09-16 ] . (原始内容 存档于2022-04-15).
^ Cunningham, Andrew. iOS 8, Thoroughly Reviewed . Ars Technica. 2014-09-17 [2014-09-19 ] . (原始内容存档 于2014-09-20).
外部链接
参见