From Wikipedia, the free encyclopedia - View original article
|Original author(s)||Silicon Graphics|
|Initial release||January 1992|
|Stable release||4.5 / August 11, 2014|
|Original author(s)||Silicon Graphics|
|Initial release||January 1992|
|Stable release||4.5 / August 11, 2014|
OpenGL (Open Graphics Library) is a cross-language, multi-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.
Silicon Graphics Inc. (SGI) started developing OpenGL in 1991 and released it in January 1992; applications use it extensively in the fields of CAD, virtual reality, scientific visualization, information visualization, flight simulation, and video games. OpenGL is managed by the non-profit technology consortium Khronos Group.
The OpenGL specification describes an abstract API for drawing 2D and 3D graphics. Although it is possible for the API to be implemented entirely in software, it is designed to be implemented mostly or entirely in hardware.
In addition to being language-independent, OpenGL is also platform-independent. The specification says nothing on the subject of obtaining, and managing, an OpenGL context, leaving this as a detail of the underlying windowing system. For the same reason, OpenGL is purely concerned with rendering, providing no APIs related to input, audio, or windowing.
OpenGL is an evolving API. New versions of the OpenGL specifications are regularly released by the Khronos Group, each of which extends the API to support various new features. The details of each version are decided by consensus between the Group's members, including graphics card manufacturers, operating system designers, and general technology companies such as Mozilla and Google.
In addition to the features required by the core API, GPU vendors may provide additional functionality in the form of extensions. Extensions may introduce new functions and new constants, and may relax or remove restrictions on existing OpenGL functions. Vendors can use extensions to expose custom APIs without needing support from other vendors or the Khronos Group as a whole, which greatly increases the flexibility of OpenGL. All extensions are collected in, and defined by, the OpenGL Registry.
Each extension is associated with a short identifier, based on the name of the company which developed it. For example, Nvidia's identifier is NV, which is part of the extension name
GL_NV_half_float, the constant
GL_HALF_FLOAT_NV, and the function
glVertex2hNV(). If multiple vendors agree to implement the same functionality using the same API, a shared extension may be released, using the identifier EXT. In such cases, it could also happen that the Khronos Group's Architecture Review Board gives the extension their explicit approval, in which case the identifier ARB is used.
The features introduced by each new version of OpenGL are typically formed from the combined features of several widely-implemented extensions, especially extensions of type ARB or EXT.
OpenGL's popularity is partially due to the quality of its official documentation. The OpenGL Architecture Review Board released a series of manuals along with the specification which have been updated to track changes in the API. These are almost universally known by the colors of their covers:
Historic books (pre-OpenGL 2.0):
The earliest versions of OpenGL were released with a companion library called GLU, the OpenGL Utility Library. It provided simple, useful features which were unlikely to be supported in contemporary hardware, such as mipmap generation, tessellation, and generation of primitive shapes. The GLU specification was last updated in 1998, and the latest version depends on features which were deprecated with the release of OpenGL 3.1 in 2009.
Given that creating an OpenGL context is quite a complex process, and given that it varies between operating systems, automatic OpenGL context creation has become a common feature of several game-development and user-interface libraries, including SDL, Allegro, SFML, FLTK, and Qt. A few libraries have been designed solely to produce an OpenGL-capable window. The first such library was GLUT (later superseded by freeglut). GLFW is a newer alternative.
Given the high workload involved in identifying and loading OpenGL extensions, a few libraries have been designed which load all available extensions and functions automatically. Examples include GLEE, GLEW and glbinding. Extensions are also loaded automatically by most language bindings, such as JOGL and PyOpenGL.
Mesa 3D is an open source implementation of OpenGL. It can do pure software rendering, and it may also use hardware acceleration on the Linux platform by taking advantage of the Direct Rendering Infrastructure. As of version 10.0, it implements version 3.3 of the OpenGL standard.
In the 1980s, developing software that could function with a wide range of graphics hardware was a real challenge. Software developers wrote custom interfaces and drivers for each piece of hardware. This was expensive and resulted in multiplication of effort.
By the early 1990s, SGI was a leader in 3D graphics for workstations. Their IRIS GL API was considered state-of-the-art and became the de facto industry standard, overshadowing the open standards-based PHIGS. This was because IRIS GL was considered easier to use, and because it supported immediate mode rendering. By contrast, PHIGS was considered difficult to use and outdated in terms of functionality.
SGI's competitors (including Sun Microsystems, Hewlett-Packard and IBM) were also able to bring to market 3D hardware, supported by extensions made to the PHIGS standard. This in turn caused SGI market share to weaken as more 3D graphics hardware suppliers entered the market. In an effort to influence the market, SGI decided to turn the IrisGL API into an open standard - OpenGL.
However, SGI had a large number of software customers for whom the change from IrisGL to OpenGL would require significant investment. Moreover, IrisGL had API functions that were not relevant to 3D graphics. For example, it included a windowing, keyboard and mouse API, in part because it was developed before the X Window System and Sun's NeWS systems were developed. And, IrisGL libraries were unsuitable for opening due to licensing and patent issues. These factors required SGI to continue to support the advanced and proprietary Iris Inventor and Iris Performer programming APIs while market support for OpenGL matured.
One of the restrictions of IrisGL was that it only provided access to features supported by the underlying hardware. If the graphics hardware did not support a feature, then the application could not use it. OpenGL overcame this problem by providing support in software for features unsupported by hardware, allowing applications to use advanced graphics on relatively low-powered systems. OpenGL standardized access to hardware, pushed the development responsibility of hardware interface programs (sometimes called device drivers) to hardware manufacturers, and delegated windowing functions to the underlying operating system. With so many different kinds of graphics hardware, getting them all to speak the same language in this way had a remarkable impact by giving software developers a higher level platform for 3D-software development.
In 1994, SGI played with the idea of releasing something called "OpenGL++" which included elements such as a scene-graph API (presumably based on their Performer technology). The specification was circulated among a few interested parties – but never turned into a product.
Microsoft released Direct3D in 1995, which eventually became the main competitor of OpenGL. On December 17, 1997, Microsoft and SGI initiated the Fahrenheit project, which was a joint effort with the goal of unifying the OpenGL and Direct3D interfaces (and adding a scene-graph API too). In 1998, Hewlett-Packard joined the project. It initially showed some promise of bringing order to the world of interactive 3D computer graphics APIs, but on account of financial constraints at SGI, strategic reasons at Microsoft, and general lack of industry support, it was abandoned in 1999.
The first version of OpenGL, version 1.0, was released in January 1992 by Mark Segal and Kurt Akeley. Since then, OpenGL has occasionally been extended by releasing a new version of the specification. Such releases define a baseline set of features which all conforming graphics cards must support, and against which new extensions can more easily be written. Each new version of OpenGL tends to incorporate a number of extensions which have widespread support among graphics-card vendors, although the details of those extensions may be changed.
Release Date: March 4, 1997
|EXT_vertex_array||Multiple vertices may be passed to the GL with a single function call.|
|EXT_polygon_offset||Depth values may be offset on a per-primitive basis.|
|EXT_blend_logic_op||Fragment colors may be blended into the framebuffer using bitwise operations.|
|EXT_texture||Various texturing improvements, including proxy textures and sized internal formats.|
|Various methods to alter texture images, including image copying and sub-image replacement.|
|EXT_texture_object||Texture state may be stored in a GL object, for greater efficiency.|
Release Date: March 16, 1998
One notable feature of OpenGL 1.2 was the introduction of the imaging subset. This is a set of features which are very useful to image-processing applications, but which have limited usefulness elsewhere. Implementation of this subset has always been optional; support is indicated by advertising the extension string ARB_imaging.
|EXT_bgra||Pixel data may be specified in BGR or BGRA order, to match the pixel format of Windows bitmaps.|
|EXT_packed_pixels||Pixel data may be "packed" into a larger primitive type. For example, all four components of an RGBA pixel may be specified as a single 32-bit integer.|
|EXT_rescale_normal||Normals may be automatically rescaled by the GL, which in some cases removes the need for an expensive normalization.|
|EXT_separate_specular_color||The GL's lighting capabilities are extended to support texture-independent specular highlighting.|
|SGIS_texture_edge_clamp||A new texture-coordinate clamping mode which, unlike GL_CLAMP, will never sample from the texture's border.|
|SGIS_texture_lod||The programmer is given greater control over the level-of-detail calculation used to select a texture's mipmap.|
|EXT_draw_range_elements||The DrawRangeElements function; a slightly more performant alternative to DrawElements.|
Release Date: October 14, 1998
Opengl 1.2.1 was a minor release, appearing only seven months after the release of version 1.2. It introduced the concept of ARB extensions, and defined the extension ARB_multitexture, without yet incorporating it into the OpenGL core specification.
Release Date: August 14, 2001
|ARB_texture_compression||A standard framework upon which compressed texture formats may be supported, without requiring any actual compression support.|
|ARB_multisample||A standard framework upon which multisample anti-aliasing may be supported, without requiring any actual MSAA support.|
|ARB_multitexture||Color values from several textures at once may be blended onto a single fragment.|
|Several new "texture environment functions": mechanisms for blending texture colors onto fragment colors.|
|ARB_texture_border_clamp||A new texture-coordinate clamping mode which forces out-of-bounds texture coordinates to sample from the texture's border.|
|ARB_transpose_matrix||Transformation matrices may be specified in either row-major order or column-major order.|
Release date: July 24, 2002
|SGIS_generate_mipmap||Texture mipmaps may be generated automatically by the GL.|
|NV_blend_square||RGB and Alpha values may be squared during alpha-blending.|
|Various ways to customize the blend equation, promoted from the optional imaging subset (introduced in version 1.2) to the core specification.|
|Textures which store depth values, rather than color values. Such textures are useful for shadow-casting and displacement maps.|
|EXT_fog_coord||A way to customize the fog intensity on a per-vertex basis.|
|EXT_multi_draw_arrays||A set of APIs which emulate multiple calls to DrawArrays or DrawElements, in a single function call. In some cases, this may be more efficient.|
|ARB_point_parameters||Greater control over the rasterization of point primitives.|
|EXT_secondary_color||The "secondary color" mechanism defined by EXT_separate_specular_color may be used in all circumstances, even when lighting is disabled.|
|EXT_blend_func_separate||Separate blending functions may be specified for the RGB and Alpha components of the blended pixels.|
|EXT_stencil_wrap||A stencil mode which causes stencil values to increment with wrapping.|
|ARB_texture_env_crossbar||Texture environment functions may access all other texture stages, rather than being restricted to the texture bound to their own texture unit.|
|ARB_texture_mirrored_repeat||A new texture-coording wrapping mode which causes the texture image to be horizontally or vertically mirrored.|
|ARB_window_pos||The WindowPos API, an alternative to RasterPos which sets the raster-output position in screen space rather than world space.|
Release Date: July 29, 2003
Alongside the release of OpenGL 1.5, the ARB released the OpenGL Shading Language specification, and the extensions ARB_shader_objects, ARB_vertex_shader, and ARB_fragment_shader. However, these would not be incorporated into the core specification until the next release.
|ARB_vertex_buffer_object||A new type of GL object, the "buffer", which stores various types of data (especially vertex data) in high-performance video memory.|
|ARB_occlusion_query||The programmer may query whether or not a primitive was occluded during rendering.|
|EXT_shadow_funcs||The capabilities of the ARB_shadow extension are slightly extended.|
Release Date: September 7, 2004
OpenGL 2.0 was originally conceived by 3Dlabs to address concerns that OpenGL was stagnating and lacked a strong direction. 3Dlabs proposed a number of major additions to the standard. Most of these were, at the time, rejected by the ARB or otherwise never came to fruition in the form that 3Dlabs proposed. However, their proposal for a C-style shading language was eventually completed, resulting in the current formulation of GLSL (the OpenGL Shading Language, also slang). Like the assembly-like shading languages that it was replacing, it allowed the programmer to replace the fixed-function vertex and fragment pipe with shaders, though this time written in a C-like high-level language.
The design of GLSL was notable for making relatively few concessions to the limitations of the hardware then available; this hearkened back to the earlier tradition of OpenGL setting an ambitious, forward-looking target for 3D accelerators rather than merely tracking the state of currently available hardware. The final OpenGL 2.0 specification includes support for GLSL.
|The high-level OpenGL Shading Language, which provides direct access to programmable vertex and fragment processors.|
|ARB_draw_buffers||Fragment shaders may output different colors to multiple render-targets in a single pass. (Note that actual support for multiple render-targets would not be guaranteed until OpenGL 3.0.)|
|ARB_texture_non_power_of_two||Texture images may have non-power-of-two dimensions.|
|ARB_point_sprite||Points may be rendered as small, screen-oriented texture quads. This is useful when developing particle systems.|
|EXT_blend_equation_separate||Separate blending equations may be specified for the RGB and Alpha components of the blended pixels. Similar to EXT_blend_func_separate.|
|Separate stencil algorithms may be used when rendering the front and back faces of primitives.|
Release Date: July 2, 2006
OpenGL 2.1 required implementations to support version 1.20 of the OpenGL Shading Language.
|ARB_pixel_buffer_object||Buffer objects may be used for asynchronous transfers of image data.|
|EXT_texture_sRGB||Texture pixel values may be specified in the gamma-corrected sRGB color space.|
Prior to the release of OpenGL 3.0, the new revision was known as the codename Longs Peak. At the time of its original announcement, Longs Peak was presented as the first major API revision in OpenGL's lifetime. It consisted of an overhaul to the way that OpenGL works, calling for fundamental changes to the API.
The draft introduced a change to object management. The GL 2.1 object model was built upon the state-based design of OpenGL. That is, in order to modify an object or to use it, one needs to bind the object to the state system, then make modifications to the state or perform function calls that use the bound object.
Because of OpenGL's use of a state system, objects must be mutable. That is, the basic structure of an object can change at any time, even if the rendering pipeline is asynchronously using that object. A texture object can be redefined from 2D to 3D. This requires any OpenGL implementations to add a degree of complexity to internal object management.
Under the Longs Peak API, object creation would become atomic, using templates to define the properties of an object which would be created with a single function call. The object could then be used immediately across multiple threads. Objects would also be immutable; however, they could have their contents changed and updated. For example, a texture could change its image, but its size and format could not be changed.
To support backwards compatibility, the old state based API would still be available, but no new functionality would be exposed via the old API in later versions of OpenGL. This would have allowed legacy code bases, such as the majority of CAD products, to continue to run while other software could be written against or ported to the new API.
Longs Peak was initially due to be finalized in September 2007 under the name OpenGL 3.0, but the Khronos Group announced on October 30 that it had run into several issues that it wished to address before releasing the specification. As a result, the spec was delayed, and the Khronos Group went into a media blackout until the release of the final OpenGL 3.0 spec.
The final specification proved far less revolutionary than the Longs Peak proposal. Instead of removing all immediate mode and fixed functionality (non-shader mode), the spec included them as deprecated features. The proposed object model was not included, and no plans have been announced to include it in any future revisions. As a result, the API remained largely the same with a few existing extensions being promoted to core functionality.
Among some developer groups this decision caused something of an uproar, with many developers professing that they would switch to DirectX in protest. Most complaints revolved around the lack of communication by Khronos to the development community and multiple features being discarded that were viewed favorably by many. Other frustrations included the requirement of DirectX 10 level hardware in order to use OpenGL 3.0 and the absence of geometry shaders and instanced rendering as core features.
Release Date: August 11, 2008
OpenGL 3.0 introduced a deprecation mechanism to simplify future revisions of the API. Certain features, marked as deprecated, could be completely disabled by requesting a forward-compatible context from the windowing system. OpenGL 3.0 features could still be accessed alongside these deprecated features, however, by requesting a full context.
Deprecated features include:
|EXT_gpu_shader4||API functions required by version 1.30 of the OpenGL Shading Language.|
|ARB_map_buffer_range||Mapping of buffer subranges into client space and flushing modified data.|
|Floating-point color and depth internal formats for textures and renderbuffers.|
|Half-float (16-bit) vertex array and pixel data formats.|
|EXT_framebuffer_object||A new type of GL object, the "framebuffer". Framebuffers enable offscreen rendering and rendering to textures.|
|EXT_framebuffer_sRGB||Use of the sRGB gamma-corrected image data in framebuffers.|
|Functions to perform a fast blit from one render-target to another.|
|Support for floating-point and non-normalized integer texture storage.|
|EXT_packed_depth_stencil||Packed depth/stencil internal formats for combined depth+stencil textures and renderbuffers.|
|EXT_draw_buffers2||Per-color-attachment blend enables and color writemasks.|
|GL_EXT_texture_array||One- and two-dimensional layered texture targets.|
|EXT_texture_compression_rgtc||The RGTC texture-compression format, for compressing one or two-channels of image data.|
|EXT_transform_feedback||The results of vertex processing can be captured into buffers, rather than (or in addition to) being passed to the rest of the pipeline.|
|ARB_vertex_array_object||A new type of GL object, the "vertex array object", which stores a set of bindings to vertex arrays. This allows vertex arrays to be rebound with a single function call rather than several calls to EnableVertexAttribArray, VertexAttribPointer, etc.|
|NV_conditional_render||Conditional rendering, based on the results of an occlusion query.|
Release Date: March 24, 2009
OpenGL 3.1 fully removed all of the features which were deprecated in version 3.0, with the exception of wide lines. From this version onwards, it's not possible to access new features using a full context, or to access deprecated features using a forward-compatible context. An exception to the former rule is made if the implementation supports the ARB_compatibility extension, but this is not guaranteed.
|ARB_draw_instanced||Instanced rendering: the ability to quickly render the same geometry data multiple times, with the vertex shader being given information specifying which instance it is operating on.|
|EXT_copy_buffer||A mechanism to copy data directly from one buffer object to another.|
|ARB_texture_buffer_object||Buffer textures: one-dimensional textures, where the pixel data store comes from a buffer object.|
|ARB_uniform_buffer_object||The ability to store a set of shader parameters in a buffer object.|
|NV_primitive_restart||The ability to specify that an index restarts a primitive, so that objects can be called with fewer calls to DrawElements.|
Release Date: August 3, 2009
OpenGL 3.2 further built on the deprecation mechanisms introduced by OpenGL 3.0, by dividing the specification into a core profile and compatibility profile. Compatibility contexts include the previously-removed fixed-function APIs, equivalent to the ARB_compatibility extension released alongside OpenGL 3.1, while core contexts do not. OpenGL 3.2 also included an upgrade to GLSL version 1.50.
|ARB_geometry_shader4 (heavily modified)||Geometry shaders.|
|ARB_sync||A set of GL objects representing synchronization primitives, which allow the client to detect when a specific set of tasks has completed.|
|ARB_vertex_array_bgra||Per-vertex color data may be specified in BGRA order, matching the convention used by Direct3D.|
|ARB_draw_elements_base_vertex||The DrawElements API is extended to automatically add a numerical offset (the "base vertex") to each array index.|
|ARB_seamless_cube_map||Forces blending between different faces when sampling from a cube map.|
|ARB_texture_multisample||A new type of texture, which can be used as a multisampled render target.|
|ARB_fragment_coord_conventions||Allow fragment shaders to read fragment coordinate locations in the same conventions as Direct3D.|
|ARB_provoking_vertex||The developer may configure which vertex determines the properties for flat-shaded vertex components.|
|ARB_depth_clamp||The developer may configure whether or not triangles are clipped against the near/far Z range.|
Release Date: March 11, 2010
OpenGL 3.3 was released alongside version 4.0. It was designed to target hardware capable of supporting Direct3D 10.
|ARB_shader_bit_encoding||Adds shading language functions to perform conversions from/to floating-point and integers. This extension only affects the shading language.|
|ARB_blend_func_extended||Fragment shaders can output multiple colors that can be used in a single blending operation.|
|ARB_explicit_attrib_location||Shader inputs and outputs may be assigned resource locations in the shader.|
|ARB_occlusion_query2||The occlusion-query system is extended to support querying whether entire objects were occluded, rather than querying the exact number of occluded pixels. In some cases, this may be more efficient.|
|ARB_sampler_objects||A new GL object which wraps some texture object state, such as interpolation and clamping. This allows a single texture to be simultaneously accessed in multiple ways.|
|ARB_texture_swizzle||The developer may configure the order that the components in a texture are presented to a shader when it samples them.|
|ARB_timer_query||Functions to accurately measure the time taken by an operation. This information is useful for profiling purposes.|
|ARB_instanced_arrays||When performing instanced rendering, instances may be configured using per-instance vertex attributes rather than using a vertex shader parameter to access an array.|
|Image and vertex data may be specified by packing three 10-bit normalized integer values into a single 32-bit integer.|
Release Date: March 11, 2010
OpenGL 4.0 was released alongside version 3.3. It was designed to target hardware capable of supporting Direct3D 11.
As in OpenGL 3.0, this version of OpenGL contains a high number of fairly inconsequential extensions, designed to thoroughly expose the capabilities of Direct3D 11-class hardware. Only the most influential extensions are listed below.
|ARB_tessellation_shader||Two new shader stages (tessellation-control and tessellation-evaluation) to support efficient generation of geometry on the GPU.|
|ARB_shader_subroutine||The ability to call different subroutines within a shader dynamically, without recompiling the source.|
|ARB_sample_shading||The programmer may request that a fragment program is evaluated for each sample within a fragment, which increases the fidelity of multisampled anti-aliasing.|
|ARB_draw_buffers_blend||The ability to set individual blend equations and blend functions for each color output.|
|ARB_draw_indirect||A mechanism to supply the arguments to certain Draw functions from buffer-object memory. Combined with transform feedback or OpenCL, this allows the GPU to render without synchronising with the CPU.|
|A set of improvements to EXT_transform_feedback.|
Release Date: July 26, 2010
|ARB_ES2_compatibility||Full API compatibility with OpenGL ES 2.0.|
|ARB_get_program_binary||The ability to retrieve the content of program objects in a binary, vendor-specific format. This eliminates the need to recompile shaders whenever the program is run, but the resulting binaries are not transferable from one GPU to another.|
|ARB_separate_shader_objects||Program objects may be separately associated with each of the five shading stages, instead of using separate shader stages linked into a monolithic program object. The extension also introduces glProgramUniform, which accepts a program object as parameter, thus enabling direct access to program's uniforms.|
|ARB_viewport_array||The ability to define multiple viewports and scissor rectangles, to be used when generating several scenes at once from a geometry shader.|
|ARB_vertex_attrib_64bit||Vertex attributes can be double-precision values.|
|ARB_shader_precision||The ability to specify the precision of certain operations in the shading language.|
Release Date: August 8, 2011
Supported video cards: Nvidia GeForce 400 series, Nvidia GeForce 500 series, Nvidia GeForce 600 series, Nvidia GeForce 700 series, ATI Radeon HD 5000 Series, AMD Radeon HD 6000 Series, AMD Radeon HD 7000 Series. Supported by Intel's Windows drivers for the Haswell's integrated GPU.
Release Date: August 6, 2012
Supported video cards: Nvidia GeForce 400 series, Nvidia GeForce 500 series, Nvidia GeForce 600 series, Nvidia GeForce 700 series, ATI Radeon HD 5000 Series, AMD Radeon HD 6000 Series, AMD Radeon HD 7000 Series, AMD Radeon HD 8000 Series
Release Date: July 22, 2013
Supported video cards: Nvidia GeForce 400 series, Nvidia GeForce 500 series, Nvidia GeForce 600 series, Nvidia GeForce 700 series, and Nvidia GeForce 800M series, AMD Radeon HD 5000 Series, AMD Radeon HD 6000 Series, AMD Radeon HD 7000 Series, AMD Radeon HD 8000 Series and AMD Radeon Rx 200 Series.
Supported SoC: Tegra K1
Supported video cards (Fermi and up): Nvidia GeForce 400 series , Nvidia GeForce 500 series , Nvidia GeForce 600 series , Nvidia GeForce 700 series , Nvidia GeForce 800M series , Nvidia GeForce 900 series as well as the Tegra K1 and Tegra X1.
This is a codename given by journalists to a grounds-up redesign effort (semi-officially called "The Next Generation OpenGL Initiative"), to unify OpenGL and OpenGL ES into one common API that will not be backwards compatible with existing OpenGL versions. AMD has offered its Mantle API without any conditions and for free as the base of the next generation of OpenGL.
|Wikibooks has a book on the topic of: Programming:OpenGL|