Write The Case Study of Open GL
Write The Case Study of Open GL
Specification
On 21 September 2006, control of OpenGL passed to the Khronos Group.[2] This was
done in order to improve the marketing of OpenGL, and to remove barriers between
the development of OpenGL and OpenGL ES.[3] The subgroup of Khronos that
manages OpenGL was called the OpenGL ARB Working Group,[4] for historical
reasons. There is a list of members which make up the OpenGL ARB Working Group
at section Members of Khronos Group. OpenGL is a general purpose API with lots of
different possibilities because of the great number of companies with different
interests which have made up the old ARB and the current group too.
Mark Segal and Kurt Akeley authored the original OpenGL specification. Chris
Frazier edited version 1.1. Jon Leech edited versions 1.2 through the present version
2.1. Jon Leech has retired as secretary of the old ARB, and Barthold Lichtenbelt has
taken his place as Khronos OpenGL ARB Steering Group Chair.
Design
OpenGL serves two main purposes:
OpenGL's basic operation is to accept primitives such as points, lines and polygons,
and convert them into pixels. This is done by a graphics pipeline known as the
OpenGL state machine. Most OpenGL commands either issue primitives to the
graphics pipeline, or configure how the pipeline processes these primitives. Prior to
the introduction of OpenGL 2.0, each stage of the pipeline performed a fixed function
and was configurable only within tight limits. OpenGL 2.0 offers several stages that
are fully programmable using GLSL.
OpenGL is a low-level, procedural API, requiring the programmer to dictate the exact
steps required to render a scene. This contrasts with descriptive (aka scene graph or
retained mode) APIs, where a programmer only needs to describe a scene and can let
the library manage the details of rendering it. OpenGL's low-level design requires
programmers to have a good knowledge of the graphics pipeline, but also gives a
certain amount of freedom to implement novel rendering algorithms.
Many modern 3D accelerators provide functionality far above this baseline, but these
new features are generally enhancements of this basic pipeline rather than radical
reinventions of it.
Example
This example will draw a green square on the screen. OpenGL has several ways to
accomplish this task, but this is the easiest to understand.
glClear( GL_COLOR_BUFFER_BIT );
This statement clears the color buffer, so that the screen will start blank.
glMatrixMode( GL_PROJECTION ); /* Subsequent matrix commands will affect
the projection matrix */
glLoadIdentity(); /* Initialise the projection matrix to identity */
glFrustum( -1, 1, -1, 1, 1, 1000 ); /* Apply a perspective-projection matrix */
These statements initialize the projection matrix, setting a 3d frustum matrix
that represents the viewable area. This matrix transforms objects from camera-
relative space to OpenGL's projection space.
glMatrixMode( GL_MODELVIEW ); /* Subsequent matrix commands will affect
the modelview matrix */
glLoadIdentity(); /* Initialise the modelview to identity */
glTranslatef( 0, 0, -3 ); /* Translate the modelview 3 units along the Z axis */
These statements initialize the modelview matrix. This matrix defines a
transform from model-relative coordinates to camera space. The combination
of the modelview matrix and the projection matrix transforms objects from
model-relative space to projection screen space.
glBegin( GL_POLYGON ); /* Begin issuing a polygon */
glColor3f( 0, 1, 0 ); /* Set the current color to green */
glVertex3f( -1, -1, 0 ); /* Issue a vertex */
glVertex3f( -1, 1, 0 ); /* Issue a vertex */
glVertex3f( 1, 1, 0 ); /* Issue a vertex */
glVertex3f( 1, -1, 0 ); /* Issue a vertex */
glEnd(); /* Finish issuing the polygon */
These commands draw a green square in the XY plane.
Documentation
OpenGL's popularity is partially due to the excellence of its official documentation.
The OpenGL ARB 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:
• The Red Book – OpenGL Programming Guide, 5th edition. ISBN 0-321-33573-2
A readable tutorial and reference book – this is a 'must have' book for OpenGL
programmers. The first edition is available online here and here.
• The Blue Book – OpenGL Reference manual, 4th edition. ISBN 0-321-17383-X
Essentially a hard-copy printout of the man pages for OpenGL. Includes a poster-
sized fold-out diagram showing the structure of an idealised OpenGL
implementation. It is available here .
• The Green Book – OpenGL Programming for the X Window System. ISBN 0-
201-48359-9
• A book about X11 interfacing and GLUT.
• The Alpha Book (which actually has a white cover) – OpenGL Programming for
Windows 95 and Windows NT. ISBN 0-201-40709-4 A book about interfacing
OpenGL with Microsoft Windows.Then, for OpenGL 2.0 and beyond:
• The Orange Book – The OpenGL Shading Language. ISBN 0-321-33489-2 A
readable tutorial and reference book for GLSL
Extensions
It may happen that more than one vendor agrees to implement the same extended
functionality. In that case, the abbreviation EXT is used. It may further happen that the
Architecture Review Board "blesses" the extension. It then becomes known as a
standard extension, and the abbreviation ARB is used. The first ARB extension was
GL_ARB_multitexture, introduced in version 1.2.1. Following the official extension
promotion path, multitexturing is no longer an optionally implemented ARB
extension, but has been a part of the OpenGL core API since version 1.3.
Before using an extension a program must first determine its availability, and then
obtain pointers to any new functions the extension defines. The mechanism for doing
this is platform-specific and libraries such as GLEW and GLEE exist to simplify the
process.
Specifications for nearly all extensions can be found at the official extension registry
Several libraries are built on top of or beside OpenGL to provide features not
available in OpenGL itself. Libraries such as GLU can always be found with OpenGL
implementations, and others such as GLUT and SDL have grown over time and
provide rudimentary cross platform windowing and mouse functionality and if
unavailable can easily be downloaded and added to a development environment.
Simple graphical user interface functionality can be found in libraries like GLUI or
FLTK. Still other libraries like AUX are deprecated and have been superseded by
functionality commonly available in more popular libraries, but code using them still
exists, particularly in simple tutorials. Other libraries have been created to provide
OpenGL application developers a simple means of managing OpenGL extensions and
versioning. Examples of these libraries include GLEW (the OpenGL Extension
Wrangler Library) and GLEE (the OpenGL Easy Extension Library).
In addition to the aforementioned simple libraries, other higher level object oriented
scene graph retained mode libraries exist such as PLIB, OpenSG, OpenSceneGraph,
and OpenGL Performer. These are available as cross platform free/open source or
proprietary programming interfaces written on top of OpenGL and systems libraries to
enable the creation of real-time visual simulation applications.
History
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 much
duplication of effort.
By the early 1990s, Silicon Graphics (SGI) was a leader in 3D graphics for
workstations. Their IRIS GL API[6] was considered the 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 considered that the IrisGL API itself wasn't suitable for opening due to licensing
and patent issues. Also, the 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.
In 1992,[7] SGI led the creation of the OpenGL architectural review board (OpenGL
ARB), the group of companies that would maintain and expand the OpenGL
specification for years to come. OpenGL evolved from (and is very similar in style to)
SGI's earlier 3D interface, IrisGL. 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.
In 1994 SGI played with the idea of releasing something called "OpenGL++" which
included elements such as a scene-graph API (presumably based around their
Performer technology). The specification was circulated among a few interested
parties – but never turned into a product.[8]
Microsoft released Direct3D in 1995, which would become the main competitor of
OpenGL. On 17 December 1997[9], 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.[10] 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.[11]