What is WebGL?
WebGL is derived from OpenGL. OpenGL is a programming interface residing in your graphics processing unit ("graphics card" or GPU) that allows a graphics programmer to write programs that create and manipulate graphics. Essentially, WebGL allows you to display 3D graphics on a 2D surface through a series of transformations called the graphics pipeline. This process is called rendering. Older graphics cards employed a fixed-function pipeline that was not programmable while today's GPUs employ a programmable pipeline.
OpenGL is used in computer-aided design (CAD), virtual reality, scientific visualization, information visualization, flight simulation, and video games. It is maintained and developed by the non-profit technology consortium Khronos Group.
WebGL is a version of OpenGL that runs in a web browser. WebGL is based on the OpenGL ES version of OpenGL that is targeted at embedded devices. In devices without OpenGL drivers, there is a way to run WebGL programs using Direct3D. Direct3D is a graphics rendering programming interface which is available in all Windows desktop systems. WebGL makes use of Direct3D drivers by using the Almost Native Graphics Layer Engine, or ANGLE for short. ANGLE's objective is to use Direct3D drivers to access OpenGL GPU functions where insufficient native OpenGL drivers exists. ANGLE is a Windows solution. On MacOS and Linux/Unix when OpenGL is well supported, OpenGL is the preferred route to execute WebGL programs.
OpenGL ES is a version of OpenGL intended for devices such as mobile phones, tablets, game consoles, appliances and vehicles. While OpenGL has an associated language called OpenGL Shading Language (GLSL), OpenGL ES uses the OpenGL ES Shading Language. The "ES" means Embedded Systems but it is difficult to conceive of today's mobile phones and tablets as embedded systems. However appliances such as refrigerators and vehicles are embedded systems.
Versions of OpenGL ES exist ranging from 1.0 to 3.2. Version 1.0 supported so-called fixed-function graphics pipelines while 2.0 onwards support programmable graphics pipelines found in modern GPUs. "Fixed" implies that the pipeline is a fixed set of processed hardwired into the GPU while programmable implies the graphics pipeline processes can be controlled and customised via software.
A WebGL program consists of OpenGL ES statements hosted within Javascript code inside a web page. The graphics are generated in an HTML <canvas> element.
In the following blog posts, we shall look at the structure of a WebGL program
Comments
Post a Comment