WebGL: Difference between revisions
m remove junk |
No edit summary Tags: Reverted references removed Mobile edit Mobile web edit |
||
Line 23: | Line 23: | ||
| size = |
| size = |
||
| language = English |
| language = English |
||
| language count = <!-- DO NOT include this parameter unless |
| language count = <!-- DO NOT include this parameter unless |
||
| language footnote = |
|||
| genre = [[Application programming interface|API]] |
|||
| license = |
|||
| alexa = |
|||
| website = {{URL|https://www.khronos.org/webgl/}} |
|||
| standard = |
|||
| AsOf = |
|||
}} |
|||
{{HTML}} |
|||
'''WebGL''' (Short for '''Web Graphics Library''') is a [[JavaScript]] [[Application programming interface|API]] for rendering interactive 2D and 3D graphics within any compatible [[web browser]] without the use of [[plug-in (computing)|plug-ins]].<ref name=":0">{{cite web |title=WebGL Fundamentals |url=http://www.html5rocks.com/en/tutorials/webgl/webgl_fundamentals/ |publisher=HTML5 Rocks}}</ref> WebGL is fully integrated with other [[Web API|web standards]], allowing GPU-accelerated usage of physics and image processing and effects as part of the web page canvas. WebGL elements can be mixed with other [[HTML]] elements and composited with other parts of the page or page background.<ref>{{cite web|url=http://my.safaribooksonline.com/book/animation-and-3d/9781449326487/chapter-6dot-integrating-2d-and-3d/overlaying_3d_visuals_on_2d_pa|title=WebGL: Up and Running|last=Parisi|first=Tony|date=2012-08-15|publisher=O'Reilly Media, |
'''WebGL''' (Short for '''Web Graphics Library''') is a [[JavaScript]] [[Application programming interface|API]] for rendering interactive 2D and 3D graphics within any compatible [[web browser]] without the use of [[plug-in (computing)|plug-ins]].<ref name=":0">{{cite web |title=WebGL Fundamentals |url=http://www.html5rocks.com/en/tutorials/webgl/webgl_fundamentals/ |publisher=HTML5 Rocks}}</ref> WebGL is fully integrated with other [[Web API|web standards]], allowing GPU-accelerated usage of physics and image processing and effects as part of the web page canvas. WebGL elements can be mixed with other [[HTML]] elements and composited with other parts of the page or page background.<ref>{{cite web|url=http://my.safaribooksonline.com/book/animation-and-3d/9781449326487/chapter-6dot-integrating-2d-and-3d/overlaying_3d_visuals_on_2d_pa|title=WebGL: Up and Running|last=Parisi|first=Tony|date=2012-08-15|publisher=O'Reilly Media, |
||
WebGL programs consist of control code written in JavaScript and [[shader]] code that is written in [[OpenGL Shading Language|OpenGL ES Shading Language]] (GLSL ES), a language similar to [[C (programming language)|C]] or [[C++]], and is executed on a computer's [[graphics processing unit]] (GPU). WebGL is designed and maintained by the [[Non-profit organization|non-profit]] [[Khronos Group]].<ref name="WebGLWebsite" /> |
|||
On February 9, 2022 [[Khronos Group]] announced WebGL 2.0 support for all major browsers.<ref name=":3">{{Cite web|date=2022-02-09|title=WebGL 2.0 Achieves Pervasive Support from all Major Web Browsers|url=https://www.khronos.org/blog/webgl-2-achieves-pervasive-support-from-all-major-web-browsers|access-date=2022-02-13|website=The Khronos Group|language=en}}</ref> |
|||
== Design == |
== Design == |
Revision as of 17:12, 5 January 2023
{{Infobox software | name = WebGL | title = WebGL | logo = WebGL Logo.svg | logo size = x64px | logo caption = | screenshot = | caption = Screenshot from a WebGL-based application running in Google Chrome | collapsible = | author = Mozilla Foundation | developer = Khronos WebGL Working Group | released = March 3, 2011[1] | discontinued = | latest_release_version = 2.0 | latest_release_date = January 17, 2017 | latest preview version = | latest preview date = | programming language = | operating_system = | platform = Cross-platform | size = | language = English | language count = , but the Sony Ericsson Xperia range of Android smartphones have had WebGL capabilities following a firmware upgrade.[2] Samsung smartphones also have WebGL enabled (verified on Galaxy SII (4.1.2) and Galaxy Note 8.0 (4.2)). Supported in Google Chrome that replaced the Android browser in many phones (but is not a new standard Android Browser).
- 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.[3][4]
- Firefox OS[4]
- Google Chrome – WebGL 1.0 is available for Android devices since Google Chrome 25 and enabled by default since version 30.[5]
- Maemo – In Nokia N900, WebGL 1.0 is available in the stock microB browser from the PR1.2 firmware update onwards.[6]
- MeeGo – WebGL 1.0 is unsupported in the stock browser "Web." However, it is available through Firefox.[4]
- Microsoft Edge – Prefixed WebGL 1.0 is available on Windows 10 Mobile.[7]
- Opera Mobile – Opera Mobile 12 supports WebGL 1.0 (on Android only).[8]
- Sailfish OS – WebGL 1.0 is supported in the default Sailfish browser.[9]
- Tizen – WebGL 1.0 is supported[10]
- iOS – WebGL 1.0 is available for mobile Safari, in iOS 8.[11]
Tools and ecosystem
Utilities
The low-level nature of the WebGL API, which provides little on its own to produce desirable 3D graphics quickly, contributed to creation of libraries which are typically used to build things up in 3D graphics (e.g. view transformations for shaders, view frustum etc.). Basic tasks such as loading scene graphs and 3D objects in the popular industry formats is also abstracted by the libraries (some of which were ported to JavaScript from other languages) to provide additional functionality. A non-exhaustive list of libraries that provide many high-level features includes A-Frame (VR), BabylonJS, PlayCanvas, three.js, OSG.JS and CopperLicht. X3D also made a project called X3DOM to make X3D and VRML content running on WebGL. The 3D model will in XML tag <X3D>
in HTML5 and interactive script will use JavaScript and DOM. BS Content Studio and InstantReality X3D exporter can exported X3D in HTML and running by WebGL.[citation needed]
Games
There also has been a rapid emergence of game engines for WebGL, both 2D and 3D,[12] including Unreal Engine 4 and Unity.[13] The Stage3D/Flash-based Away3D high-level library also has a port to WebGL via TypeScript.[14][15] A more light-weight utility library that provides just the vector and matrix math utilities for shaders is sylvester.js.[16][17] It is sometimes used in conjunction with a WebGL specific extension called glUtils.js.[16][18]
There are also some 2D libraries built on top of 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.[19]
Removing the rendering bottleneck by giving almost direct access to the GPU also 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).[19]
Content creation
Like for any other graphics API, creating content for WebGL scenes requires using a regular 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. Particularly, 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.[20] 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
Additionally, Mozilla Foundation, in its Firefox browser, has implemented built-in WebGL tools starting with version 27 that allow editing vertex and fragment shaders.[21] A number of other debugging and profiling tools have also emerged.[22]
See also
- List of WebGL frameworks
- Experience Curiosity – WebGL simulation of the Mars rover Curiosity
- WebVR
- Java OpenGL – OpenGL library for the Java programming language
- WebGPU
References
- ^ "Khronos Releases Final WebGL 1.0 Specification". 3 March 2011. Retrieved 2015-05-18.
- ^ "Xperia™ phones first to support WebGL™ – Developer World". blogs.sonyericsson.com. The Sony Ericsson Developer Program. 2011-11-29. Archived from the original on 2011-12-03. Retrieved 2011-12-05.
- ^ "WebGL on Mobile Devices". iChemLabs. 2011-11-12. Archived from the original on 2013-01-27. Retrieved 2011-11-25.
- ^ a b c "Mobile HTML5 compatibility on iPhone, Android, Windows Phone, BlackBerry, Firefox OS and other mobile devices". Retrieved 2015-09-16.
- ^ Kersey, Jason. "Chrome Beta for Android Update". Chrome Releases Blog. Retrieved 2013-08-23.
- ^ Voipio, Riku (2010-06-07). "WebGL on N900". Suihkulokki.blogspot.com. Retrieved 2011-05-14.
- ^ "Dev guide: WebGL – Microsoft Edge Development". Microsoft. Retrieved 2016-06-10.
- ^ "Opera Mobile 12". Opera Software. Archived from the original on 1 March 2012. Retrieved 27 February 2012.
- ^ "HTML5test – How well does your browser support HTML5?". Retrieved 2015-09-16.
- ^ "HTML5test – How well does your browser support HTML5?". Retrieved 2015-09-16.
- ^ Cunningham, Andrew (2014-09-17). "iOS 8, Thoroughly Reviewed". Ars Technica. Retrieved 2014-09-19.
- ^ 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.
- ^ Barrett, Stephen. "Tegra K1 Lands in Acer's Newest Chromebook". anandtech.com.
- ^ Cite error: The named reference
L5956
was invoked but never defined (see the help page). - ^ "Blog > Away3D Typescript 4.1 Alpha > Away3D". away3d.com. Archived from the original on 2014-08-08. Retrieved 2014-08-05.
- ^ a b Boreskov, Alexey; Shikin, Evgeniy (2014). Computer Graphics: From Pixels to Programmable Graphics Hardware. CRC Press. p. 370. ISBN 978-1-4398-6730-3.
- ^ Anyuru, Andreas (2012). Professional WebGL Programming: Developing 3D Graphics for the Web. John Wiley & Sons. p. 140. ISBN 978-1-119-94059-3.
- ^ Fulton, Steve; Fulton, Jeff (2013). HTML5 Canvas (2nd ed.). "O'Reilly Media, Inc.". p. 624. ISBN 978-1-4493-3588-5.
- ^ a b "The WebGL potential - TypedArray.org". typedarray.org.
- ^ "Blend4Web Official Site - About". Blend4Web.com. Retrieved 2015-06-22.
- ^ "Live editing WebGL shaders with Firefox Developer Tools". Mozilla Hacks – the Web developer blog.
- ^ "Real-Time Rendering · WebGL Debugging and Profiling Tools". realtimerendering.com.
Cite error: A list-defined reference named "WebGLWebsite" is not used in the content (see the help page).
Cite error: A list-defined reference named "WebGLSpecification" is not used in the content (see the help page).
Cite error: A list-defined reference named "WebGL2Specification" is not used in the content (see the help page).
External links
- Official website
- WebGL Archived 2010-06-26 at the Wayback Machine at the Mozilla Developer Network