Thursday, 3 December 2015

What Is OpenGL?


OpenGL

OpenGL is a software interface to graphics hardware. This interface consists of about 150 distinct commands that you use to specify the objects and operations needed to produce interactive three-dimensional applications.  

In other words, OpenGL is a low-level graphics library specification. It makes available to the programmer a small set of geomteric primitives - points, lines, polygons, images, and bitmaps.  

Brief Overview of OpenGL

   OpenGL is a software interface that allows the programmer to create 2D and 3D graphics images. OpenGL is both a standard API and the implementation of that API. You can call the functions that compriseOpenGL from a program you write and expect to see the same results no matter where your program is running.
 

   OpenGL is independent of the hardware, operating, and windowing systems in use. The fact that it is windowing-system independent, makes it portable. OpenGL program must interface with the windowing system of the platform where the graphics are to be displayed. Therefore, a number of windowing toolkits have been developed for use with OpenGL.

   OpenGL functions is a client/server environment. That is, the application program producing the graphics may run on a machine other than the one on which the graphics are displayed.The server part of OpenGL, which runs on the workstation where the graphics are displayed, can access whatever physical graphics device or frame buffer is available on that machine.

   OpenGL's rendering commands, however are "primitive". You can tell the program to draw points, lines, and polygons, and you have to build more complex entities upon these. There are no special-purpose functions that you can call to create graphs, contour plots, maps, or any of the other elements we are used to getting from "old standby programs”. With OpenGL, you have to build these
things up yourself.


    With OpenGL any commands that you execute are executed immediately. That is, when you tell the program to draw something, it does it right away. You also have the option of putting commands into display lists. A display list is a noteditable list of OpenGL commands stored for later execution. You can execute the same display list more than once. For example, you can use display lists to redraw the graphics whenever the user resizes the window. You can use a display  list to draw the same shape more than once if it repeats as an element of the picture.


   OpenGL is hardware-independent. Many different vendors have written implementations that run on different hardware. These implementations are all written to the same OpenGL standard and are required to pass strict conformance tests. Vendors with licenses include SGI, AT&T, DEC, Evans & Sutherland, Hitachi, IBM, Intel, Intergraph, Kendall Square Research, Kubota Pacific, Microsoft, NEC, and RasterOps. The RS/6000 version comes with X and Motif extensions. However X is not required to run OpenGL since OpenGL also runs with other windowing systems.

    Modern computers have dedicated GPU (Graphics Processing Unit) with its own memory to speed up graphics rendering. OpenGL is the software interface to graphics hardware. In other words, OpenGL graphic rendering commands issued by your applications could be directed to the graphic hardware and accelerated.

We use 3 sets of libraries in our OpenGL programs:
  1. Core OpenGL (GL): consists of hundreds of commands, which begin with a prefix "gl" (e.g., glColor, glVertex, glTranslate, glRotate). The Core OpenGL models an object via a set of geometric primitives such as point, line and polygon.
  2. OpenGL Utility Library (GLU): built on-top of the core OpenGL to provide important utilities (such as setting camera view and projection) and more building models (such as qradric surfaces and polygon tessellation). GLU commands start with a prefix "glu" (e.g., gluLookAt, gluPerspective).
  3. OpenGL Utilities Toolkit (GLUT): OpenGL is designed to be independent of the windowing system or operating system. GLUT is needed to interact with the Operating System (such as creating a window, handling key and mouse inputs); it also provides more building models (such as sphere and torus). GLUT commands start with a prefix of "glut" (e.g., glutCreatewindow, glutMouseFunc). GLUT is platform independent, which is built on top of platform-specific OpenGL extension such as GLX for X Window System, WGL for Microsoft Window, and AGL, CGL or Cocoa for Mac OS. 
  4. Quoting from the opengl.org: "GLUT is designed for constructing small to medium sized OpenGL programs. While GLUT is well-suited to learning OpenGL and developing simple OpenGL applications, GLUT is not a full-featured toolkit so large applications requiring sophisticated user interfaces are better off using native window system toolkits. GLUT is simple, easy, and small."
  5. OpenGL Extension Wrangler Library (GLEW): "GLEW is a cross-platform open-source C/C++ extension loading library. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform." Source and pre-build binary available at http://glew.sourceforge.net/. A standalone utility called "glewinfo.exe" (under the "bin" directory) can be used to produce the list of OpenGL functions supported by your graphics system.
  6. Others.

Features in OpenGL

3D Transformations
- Rotations, scaling, translation, perspective
• Colour models
- Values: R, G, B, alpha.
•Lighting
- Flat shading, Gouraud shading, Phong
shading
•Rendering
-Texture mapping
•Modeling
- non-uniform rational B-spline (NURB)
curves, surfaces


• Others
- atmospheric fog, alpha blending,
motion blur

No comments:

Post a Comment