Jump to content

OpenGL

From VR & AR Wiki
OpenGL
Information
Type Graphics application programming interface
Industry Computer graphics
Developer Khronos Group (originally Silicon Graphics)
Written In C
Operating System Cross-platform
License Royalty-free open standard
Supported Devices PC, mobile, embedded systems
Release Date June 30, 1992
Website khronos.org/opengl

Property "Developer" (as page type) with input value "Khronos Group]] (originally Silicon Graphics)" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.


OpenGL (Open Graphics Library) is a cross-platform, royalty-free application programming interface for rendering 2D and 3D vector graphics, typically using a graphics processing unit (GPU).[1] It defines a hardware-independent interface that a program calls to draw geometry, apply textures, and run shading programs, leaving the underlying GPU driver to translate those calls into device-specific commands. The specification is maintained by the Khronos Group, a non-profit industry consortium.[2]

OpenGL was created by Silicon Graphics (SGI) and first released on June 30, 1992.[2] For its first decade and a half it was governed by the OpenGL Architecture Review Board (ARB), a group of hardware and software vendors; in July 2006 the ARB transferred control of the standard to the Khronos Group.[2] Two derivative APIs extended OpenGL's reach: OpenGL ES, a streamlined profile for mobile and embedded devices, and WebGL, a JavaScript binding that brings the API into web browsers. These derivatives are the most direct connection between OpenGL and modern virtual reality and augmented reality hardware, most of which is built on mobile chipsets or runs experiences inside a browser.

The last core revision, OpenGL 4.6, was released on July 31, 2017. After that, Khronos directed new low-level development toward Vulkan, a separate, more explicit API that began as the "Next Generation OpenGL Initiative."[2] OpenGL remains widely deployed and continues to receive new vendor and cross-vendor extensions, but it is no longer the focus of major specification work.

History

SGI began developing OpenGL in 1991 as an open, vendor-neutral successor to IRIS GL, the proprietary graphics interface used on its workstations.[2] Version 1.0 was released on June 30, 1992, with Mark Segal and Kurt Akeley as principal authors of the specification.[2] SGI also established the OpenGL Architecture Review Board the same year to maintain and extend the standard, a structure that let competing vendors agree on a common interface.[2]

Microsoft released Direct3D in 1996, and the two APIs became the main competing 3D interfaces on Windows.[2] A 1997 SGI and Microsoft collaboration called Fahrenheit aimed to unify their graphics interfaces but was abandoned in 1999.[2]

The early versions used a fixed-function pipeline: lighting, transformation, and texturing were configured through fixed states rather than custom programs. OpenGL 2.0, released on September 7, 2004, added the OpenGL Shading Language (GLSL), a C-like language for writing programmable vertex and fragment shaders.[2] This shift to programmable shading is the basis of the lighting, distortion, and post-processing effects that later VR rendering relies on.

In July 2006 the ARB voted to hand control of OpenGL to the Khronos Group, which had been founded in 2000 by companies including 3Dlabs, ATI, Intel, SGI, and Sun Microsystems.[2][3] Under Khronos the specification advanced roughly yearly from 2008 through 2014, introducing the core and compatibility profile distinction in version 3.2 and reaching the final core release, OpenGL 4.6, on July 31, 2017.[2][4]

Version history

Selected core OpenGL releases and their major additions:

Version Release date Notable additions
1.0 June 30, 1992 Initial release
1.1 March 4, 1997 Texture objects, vertex arrays
1.2 March 16, 1998 3D textures, packed pixel formats
1.3 August 14, 2001 Multitexturing, cube maps, texture compression
1.4 July 24, 2002 Depth textures, automatic mipmap generation
1.5 July 29, 2003 Vertex buffer objects, occlusion queries
2.0 September 7, 2004 GLSL shaders, multiple render targets
2.1 July 2, 2006 Pixel buffer objects, sRGB textures
3.0 August 11, 2008 Deprecation model, framebuffer objects in core
3.1 March 24, 2009 Texture buffer objects, uniform buffer objects
3.2 August 3, 2009 Core and compatibility profiles, geometry shaders
3.3 March 11, 2010 Released alongside 4.0 for older hardware
4.0 March 11, 2010 Tessellation shaders, double-precision shaders
4.1 July 26, 2010 OpenGL ES 2.0 compatibility, separable shader objects
4.2 August 8, 2011 Shader atomic counters, image load and store
4.3 August 6, 2012 Compute shaders, ASTC texture compression
4.4 July 22, 2013 Buffer storage, bindless texture groundwork
4.5 August 11, 2014 Direct State Access, robustness features
4.6 July 31, 2017 SPIR-V ingestion, anisotropic filtering in core

Sources: Khronos and the OpenGL version history.[2][3]

How it works

A program issues OpenGL calls to a context, an object that holds the API's state and is tied to a window or off-screen surface. The driver feeds vertex data through a sequence of stages known as the graphics pipeline. In the modern programmable pipeline a vertex shader processes each vertex, optional tessellation and geometry shaders generate or refine geometry, the rasterizer converts primitives into fragments, and a fragment shader computes the color of each pixel before the result is written to a framebuffer. Shaders are written in GLSL and compiled by the driver at run time; OpenGL 4.6 also accepts shaders supplied as SPIR-V, the intermediate representation shared with Vulkan.[2]

OpenGL itself does not create windows or read input. Those tasks are handled by platform layers such as WGL on Windows, GLX on the X Window System, and EGL on mobile and embedded platforms, or by cross-platform helper libraries. The API is a state machine: calls set state (bound textures, blend modes, the active shader program) that persists until changed, then draw calls render using the current state.

The specification is implemented by GPU vendor drivers. Mesa 3D is an open-source implementation that provides both software rendering and hardware-accelerated drivers and implements OpenGL 4.6.[2] Compatibility layers also let OpenGL run on top of other APIs: ANGLE translates OpenGL ES calls to Direct3D, Vulkan, or Metal, and the Zink driver implements OpenGL on top of Vulkan.[5]

OpenGL ES

OpenGL ES (OpenGL for Embedded Systems) is a subset of OpenGL for devices with limited power and memory, such as smartphones, tablets, consoles, and the system-on-chip platforms that drive standalone headsets.[6] Khronos describes OpenGL ES as one of the most widely deployed 3D graphics APIs.[6] It is the rendering API exposed by Android and was the primary 3D API on iOS until Apple introduced Metal, and it is therefore the layer most VR and AR content on mobile and standalone hardware ultimately uses.

Version Release date Notes
ES 1.0 July 28, 2003 Fixed-function, based on OpenGL 1.3
ES 1.1 2004 Based on OpenGL 1.5; vertex buffer objects, multitexture
ES 2.0 March 2007 Programmable shaders (GLSL ES); dropped most fixed-function pipeline
ES 3.0 August 6, 2012 Multiple render targets, instancing, ETC2 texture compression
ES 3.1 March 2014 Compute shaders, indirect draw
ES 3.2 August 2015 Geometry and tessellation shaders, ASTC, advanced blending

Sources: Khronos and the OpenGL ES specification history.[6][7]

In 2017 Khronos stated that OpenGL ES would not receive new versions, concentrating instead on Vulkan and related technologies.[5] Existing OpenGL ES versions remain in wide use and continue to gain extensions.

WebGL

WebGL is a JavaScript API that exposes OpenGL ES rendering inside a web browser through the HTML canvas element, without plug-ins.[8] It is maintained by the Khronos Group. WebGL 1.0 was released on March 3, 2011 and is based on OpenGL ES 2.0; WebGL 2.0 was released on January 17, 2017 and is based on OpenGL ES 3.0.[8] WebGL is the rendering layer for browser-based VR and AR: the WebVR API and its successor, the WebXR Device API, manage device tracking, timing, and per-eye viewpoints but do not draw anything themselves, leaving the actual rendering to WebGL and to libraries built on it.[9]

Use in virtual and augmented reality

OpenGL and its derivatives sit at the rendering layer of much VR and AR software, even though VR-specific concerns (head tracking, lens distortion correction, per-eye stereo views, and frame timing) are handled by separate runtimes such as OpenXR, OpenVR, or vendor SDKs. Those runtimes accept rendered images from a graphics API and present them to the display. OpenGL has been one of the supported graphics APIs throughout the consumer VR era.

On PC, the Oculus PC SDK for the Oculus Rift let applications render with OpenGL by creating an OpenGL texture swap chain (the function ovr_CreateTextureSwapChainGL), alongside the Direct3D and Vulkan paths.[10] The application renders a view for each eye into these textures and submits them to the Oculus compositor, which applies lens distortion and timewarp before display.[10] The same OpenGL-or-Vulkan-or-Direct3D choice is exposed by other PC VR runtimes.

On standalone headsets the connection runs through OpenGL ES. Devices such as the Gear VR and later Android-based standalone headsets run on mobile system-on-chips whose 3D API is OpenGL ES, so engines targeting those platforms render through OpenGL ES (or, increasingly, Vulkan). Google Cardboard, the low-cost smartphone-based viewer, likewise relied on the phone's OpenGL ES stack to draw the stereo pair.

In the browser, WebGL is the rendering backend for immersive web content. WebXR reports the headset's pose and the projection for each eye, and the page draws the scene with WebGL, often through higher-level libraries such as Three.js or A-Frame.[9] Browsers including Chrome and Edge support WebXR, so a single WebGL-based page can run across a range of devices, from Google Cardboard to standalone headsets and PC-tethered ones.

Game engines abstract the choice of graphics API for VR developers. Unity and Unreal Engine can render through OpenGL, OpenGL ES, Vulkan, Direct3D, or Metal depending on the target, then hand frames to the active XR runtime. As a result, OpenGL is frequently the implicit rendering path on Android-based VR even when a developer never calls it directly. Because OpenGL predates the explicit-control design of Vulkan, it cannot expose some lower-level scheduling and multi-threading features that help VR applications hold a stable frame rate, which is part of why newer headset SDKs and engines have moved toward Vulkan for performance-sensitive titles.[2]

Current status

OpenGL is no longer in active core development; the final core version, 4.6, dates to 2017, and Khronos has focused new low-level work on Vulkan.[2] Apple deprecated OpenGL and OpenGL ES across iOS, macOS, and tvOS in June 2018 in favor of its Metal API, although the deprecated implementations have continued to function.[2]

The API still receives extensions outside the core specification. In 2025, AMD and Mesa developers proposed GL_EXT_mesh_shader, a cross-vendor OpenGL extension that brings mesh shading (a more flexible geometry pipeline already available in Vulkan and Direct3D) to OpenGL; the extension requires OpenGL 4.5 or OpenGL ES 3.1 and was driven in part by gaming projects such as a mesh-shader renderer for Minecraft.[11][12] Because of its broad driver support and the availability of translation layers like ANGLE and Zink, OpenGL and OpenGL ES remain in wide use across desktop, mobile, and embedded software, including parts of the VR and AR stack, even as new development gravitates to Vulkan and the emerging WebGPU.[5][8]

References