Why should you use OpenGL instead of DirectX
Everyone can think about it: why we choose a closed source API when the open source is equally good or better ?
When we encounter other game programmers and talk about using OpenGL to develop Overflow, we always encounter skeptical looks. Why use OpenGL? DirectX is the future. When we used OpenGL to tell the graphics card how to work, the temperature in the room dropped by 10 degrees (what does that mean? I always thought the difference between A and N cards, but I didn't expect the author to think it was an API problem? Holly...).
What is OpenGL
.
In 1982, Silicon developed and sold high-performance graphics display terminals using an API called Iris GL. In the following years, Iris GL became bloated and difficult to maintain, until Silicon decided to take a completely new step: completely refactoring Iris GL and opening it up. Their competitors can use this new open graphics library (OpenGL), but in return, they must help maintain and update the library.
Nowadays, OpenGL is managed by the Khronos Group. A non-profit organization composed of many companies, with a focus on maintaining high-quality multimedia APIs. At the bottom level, it is managed by the OpenGL Architecture Review Board (ARB). Various game platforms support OpenGL, including Mac, Windows, Linux, PS3, Wii, iPhone, PSP, and DS. In addition to XBox, we will now introduce it:
What is DirectX
.
Since the MS-DOS era, Microsoft has understood that games are an important basis for users to choose an operating system. These libraries include Direct3D, DirectInput, and DirectSound, and the entire collection is known as DirectX. When Microsoft entered the gaming market in 2001, XBOX intended to dominate the next-generation gaming market.
Looking at the current situation, Microsoft's strategy is undoubtedly successful. Most PC games use DirectX and run mostly on Windows or Xbox 360. But with some exceptions, they are no longer available on competing platforms such as Playstation, Mac OS, and Wii. So, it brings us a new problem:
Why do everyone use DirectX
The reason for using DirectX is because the choice of API is based on positive feedback from game development, which all happened in 2005:
If an API becomes more popular, then more people will use it, and then it will become more popular, so the loop... The result of this network effect is that more popular APIs receive better support from hardware vendors, and graphic programmers are subsequently more inclined to choose APIs they are already familiar with.
The victory of DirectX was due to two sharp battles by Microsoft, surrounding XBox 360 and Windows Vista, as well as the FUD (fear, uncertainty, doubt) faced by open-source projects like OpenGL, and the advantage of DirectX's exaggerated advertising. From now on, this network effect will gradually strengthen until OpenGL disappears from Earth. (The author is so pessimistic.).
1. Network effect and vicious cycle
.
On the Win platform, the graphics driver of DirectX is clearly better maintained than the driver of OpenGL. This is a vicious cycle caused by manufacturer support. The choice of whether game developers should use OpenGL or DirectX is determined by many factors. Graphics card manufacturers receive fewer OpenGL driver bugs because there are more people using DirectX, so they cannot support OpenGL drivers well.
Simply put, the more programmers understand DirectX over OpenGL, the more games are developed using the former. This will lead to another vicious cycle, with more projects using DX for development and more programmers needing to learn how to use it....
2. Regarding the FUD effect of OpenGL and Vista
.
Microsoft used FUD tactics on OpenGL when Vista was released. In 2003, Microsoft launched the previously introduced OARB organization for maintaining the underlying layer, indicating that Microsoft would no longer be interested in the future of OPGL. In 2005, Microsoft launched S The illusion given byIGGRAPH and WinHEC is that they will not support OPGL starting from Vista, except for backward compatibility with XP programs. This version of OPGL will be built on top of DirectX, which of course causes serious performance issues. This battle has led many excellent programmers to switch to DX.
After Vista was released, he also allowed manufacturers to create Quickly installable Client Drivers (ICDs) to retain support for native OpenGL. OpenGL announced that it is still in the first tier, but its performance on Vista is still not as good as Direct3D. Unfortunately, this kind of destruction has already dealt a huge blow to OPGL.
3. A campaign to mislead the market
.
The market strategy for the release of Windows 7 was similar to Vista, with Microsoft showcasing both before and after effects. Many players believe that transitioning from dx9 to dx10 can magically make graphics brighter, or in other words, from Halo1 to Crysis. Game reviews confirm that the DX9 version of Crysis is no different from the DX10 version, and the changes to the graphics are actually due to adjustments to certain config files.
Under the marketing strategy of Microsoft, which has a large number of games, some insightful programmers and the Kamak god refuse to pursue him. He said, "Personally, I won't jump into DX10 immediately. I will try to make some changes until I really need it.".
(I think the author is a tragedy. There are rumors that the next generation of ID engines will be based on DX, and Kamak did not say that there is no need for DX.).
Why do we need to use OpenGL
Getting less support from manufacturers, games no longer being heavily used, being closely pursued and fiercely attacked by Microsoft, and limited market survival space, why do we still use it? Isn't it easier for everyone to use dx? No, because in reality, OpenGL is more powerful than DX and supports more platforms, which is the foundation of future games.
1. OpenGL is more powerful than DirectX
.
OPGL has a faster draw call than DX (if you don't believe it, please refer to this one here), and it can use the new features of GPU in the first time through vendor extensions. OPGL allows you to directly access graphics card hardware on multiple platforms, while DirectX can only provide a display of some of the latest technologies on their latest operating systems. The Tessellation advocated by DX11 can actually be used with OPGL three years ago. I don't know what new technologies will emerge in the future, but I know OPGL will definitely be the first to be available (this selling point often attracts translators themselves).
2. OpenGL is cross platform
.
Blizzard always releases Mac versions of their games simultaneously, which is a key to their success.
Just like when asked if Rage is a DX game, Kamak said, "It actually uses OpenGL, even though we used the D3D ish API on the Xbox 360 platform and PS3 CG. The technology you use is very small, and only a few parts of the millions of lines of code you write use the API, but millions of lines of code depend on those unknown target platforms." As Kamak said, why not be prepared across platforms and be limited by DX ?
3. OpenGL is a better choice for future games
.
The non-profit open-source OpenGL is used to create a graphics library that allows users to efficiently perform on various platforms. He is constantly being attacked by monopolistic enterprises, which is actually harming your own interests. We need freedom and competition to improve quality and lower prices. A Microsoft monopoly is very challenging for both game developers and players.
Can OpenGL turn the tide
Back in 1997, the situation was so similar to what it is now. Microsoft launched a crazy market campaign for DX, and then everyone "knew" that it was faster than OpenGL. With the publication of the open letter denouncing DirectX by Chirs Hecker. The situation has changed. Subsequently, Kamak released the famous OpenGL rant and spent a lot of money developing the Id Studio project with OpenGL, which once proved the 3D performance that DX could not achieve.
This lesson has gradually been forgotten. Many developers have fallen into the temptation of the dx market.
If you use OpenGL, you can use faster and more powerful graphics card features earlier than DX11, and it can be used on all versions of Windows, Mac, and Linux, as well as PS3, Wii, PSP, DS, and iPhone. You can also use these features in the fast developing WebGL standard (for next-generation web games).
If you are a game developer, all you need to do is search for information and think, and then consider whether OpenGL is a better choice.
Classification: ue4.