Thu Jun 28 2018

What is OpenGL and how does it different from DirectX?

Technology2466 views

OpenGL

Most of the time people asking a question about what they should use or learn for their application development - OpenGL or DirectX. But they never get a definite answer. Don't worry about that, we are here discussing OpenGL and then we will find out the reasons why you should choose OpenGL over DirectX.

So, let's see what is OpenGL?

OpenGL (Open Graphics Library) is the computer industry's standard application program interface ( API ) for defining 2D and 3D graphics images. Any company developing a graphical application typically had to rewrite the graphics part of it for each operating system platform and had to be cognizant of the graphics hardware as well. With OpenGL, an application can create the same effects in any operating system using any OpenGL-adhering graphics adapter.

How did it come in the graphics field?

Silicon Graphics (referred as SGI) was a company founded in 1981 that specialized in 3D computer graphics and developed software and hardware. In the early 1990s, SGI was the market leader in 3D graphics workstations because of their high-performance hardware and easy to use the software. IRIS GL was the de facto industry standard 3D graphics library, overshadowing all other developments and attempts to standardize a 3D graphics interface. But despite its popularity, IRIS GL had one major problem: it was a proprietary system fused to SGI's own platforms, and competitors were closing in on SGI's advantage with their own APIs. SGI cleaned up IRIS GL, removed all functionality that did not relate to computer graphics and released it to the public in 1992 as OpenGL, a cross-platform standardized API for real-time computer graphics.

How does it work?

OpenGL specifies a set of commands or immediately executed functions. Each command directs a drawing action or causes special effects. A list of these commands can be created for repetitive effects. OpenGL is independent of the windowing characteristics of each operating system but provides special "glue" routines for each operating system that enable OpenGL to work in that system's windowing environment. OpenGL comes with a large number of built-in capabilities requestable through the API. These include hidden surface removal, alpha blending (transparency), antialiasing, texture mapping, pixel operations, viewing and modeling transformations, and atmospheric effects.

Let's see, what is DirectX?

In 1995, Microsoft created a proprietary set of libraries in order to encourage exclusive games for their new Windows 95 operating system. These libraries included Direct3D, DirectInput, and DirectSound, and the entire collection came to be known as DirectX. When Microsoft entered the gaming market in 2001, it introduced the DirectX Box, or XBox for short.

Now, let's find out how OpenGL different from DirectX

  • OpenGL is governed by the Architecture Review Board, an independent consortium of the leading graphics vendors. New functionalities are exposed through vendor-specific extensions. On the hand, DirectX is developed by Microsoft in cooperation. New functionalities are exposed through API changes. Microsoft changed the API quite severely several times, mirroring some changes of paradigms in graphics programming.

  • DirectX contains tools to deal with sound, input, networking, and multimedia. On the other hand, OpenGL is strictly a graphics API.

  • OpenGL by default starts from the bottom left whereas DirectX starts from the top left. Meaning pixel 0,0 in DX is top left, pixel 0,0 in OpenGL is bottom left. However, this can be changed in code so it's not always an issue,

  • OpenGL has long been known to be easier to understand.

  • OpenGL is cross-platform open standard. If you use OpenGL, you have a very good

  • chance to be able to port your game to other platforms, like Windows, Linux, MacOS,

  • etc. In contrast, DirectX is a Windows-specific proprietary standard, known to be a bit harder to understand, but with Managed DirectX, it is much easier to use than before.

  • The shader compilers is a pretty big one, it means that HLSL (DirectX) compilers may or may not have some features that GLSL (OpenGL) compilers have.

  • The graphics card manufacturers (vendors) get fewer bug reports for their OpenGL drivers, extensions, and documentation.

  • OpenGL gives you direct access to all new graphics features on all platforms, while DirectX only provides occasional snapshots of them on their newest versions of Windows.

  • OpenGL is a non-profit open standard created to allow users on any platform to experience the highest quality graphics that their hardware can provide. Its use is being crushed by a monopolistic attack from a monolithic corporate giant trying to dominate an industry that is too young to protect itself. As Direct3D becomes the only gaming graphics API supported on Windows, Microsoft is gaining a stranglehold on PC gaming.

  • Microsoft is a profit making organization but Khronos is not.

  • DirectX needs Windows operating system, OpenGL is os independent.

 

In the end, besides the differences, OpenGL and DirectX have a lot of similarities as well. Both of them use programmable graphics pipeline, both support 3D operations, though, OpenGL is just for graphics, rendering stuff. While DirectX has control over sound, networking, multimedia. So, check your requirements before choosing one. Thank you!

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.