DirectX vs OpenGL: Why Are We Here?
Posted by Michael SimpsonLooking around this blog and its comments, I’ve noticed that the argument of DirectX vs OpenGL seems to be discussed quite regularly. Therefore, I thought it relevant to bring up the topic a bit more formally.
For those who aren’t completely familiar, DirectX/Direct3D/D3D and OpenGL are the two most popular graphics API’s (Application Programming Interfaces) utilized in game development. While the complete description of what a graphics API does and their history would fill quite a few blog posts, they essentially provide sets of abstracted functions designed to be used and reused in a game’s source code. In short, they make game programmers’ lives much easier.
The Great Debate
Probably the hottest debate between the two API’s has to do with their relative performance. I find this to be a bit misguided. The fact of the matter is, the performance the end user witnesses isn’t going to rely just on the API used, but also things like video card drivers. I’d like to quote Brad Oliver in his response to James found here:
James: “But until developers code games to explicitly for OpenGL and graphics card manufacturers build their cards to utilize OpenGL, we are at a disadvantage.”
Brad: “This is pretty much not true. In our fantasy world where Apple licenses Direct3D from Microsoft, they still have the issue of getting ATI and Nvidia to write the drivers — which is the exact situation we have now with OpenGL. The front-end API, be it OpenGL or D3D, is a non-factor for performance.”
I couldn’t agree more, Brad. I feel as though the API is ultimately more of a choice of preference, application, and what a programmer is comfortable with than anything else. Looking around the vast realm of The Internet, one can find numerous debates about the topic with one side (DX/OGL) being faster or offering better performance than the other. For instance, this article outright claims OpenGL superiority. Of course, I have a qualm immediately with the claim when the author references an NVIDIA OpenGL Update that’s around three and a half years old at the time of the blog posting. That’s a bit outdated, especially where technology is concerned. I also don’t like the use of Wikipedia as a reference, but that may just be my personal standard. In any case, the post does bring up some other interesting information, which I’ll explore a bit later. On the other side of the coin, the D3D purist can reference articles like this showing dominance of D3D 11 vs OpenGL 4.0 across several graphic cards (and this is actually fairly recent!) I also feel the API’s were designed with different intentions in mind (OGL having a wide variety of professional uses beyond just gaming, and D3D being a game development specific API). This could also account for some differing performances between the two.
The Greater Question
What I’m trying to convey here is that we could debate about respective performances of the API’s until we’re blue in the face and not really get anywhere. A far more interesting topic is looking at how we’ve gotten to a point in the game industry where D3D is so dominantly used among AAA PC titles over the once “tried and true” OGL. This is increasingly intriguing when one is to consider that greatly influential game programmers (read: John Carmack) lambasted D3D in the late 90’s (though admittedly he’s since come around a bit on his feelings toward DirectX, though seems to still prefer OGL). Under such scrutiny, how did DirectX become so prevalent?
Reasons
I once again reference the Wolfire Games blog vehemently supporting OpenGL; the post definitely brings up some very valid arguments about DirectX becoming the API of choice. Microsoft has good control over the software industry. This is undeniable. By leaving the OpenGL Architecture Review Board followed by hinting that Vista wouldn’t natively support OpenGL, and given Microsoft’s vast majority control of the PC market, it becomes clear why gaming companies would be frightened to continue development with OpenGL. As the blog continues to state, despite Microsoft later reneging on this decision, “the damage had already been done.” This then begets the “vicious cycle” also mentioned in the blog, where because so many developers are using DirectX functionality to create their games, the documentation becomes better, the hardware support becomes better, and so on. I also have to agree with the point about marketing. Some of the marketing to hype DirectX 10 was just absurd. It reminds me of weight loss supplement commercials where the before shot always features a person frowning and looking about as unhappy and unattractive as they can, while the after photos are often touched up. The truth is that the largest difference between DX9 and DX10 is probably in particle effects and shadows (A good example in Bioshock). Otherwise, the two versions offer very similar graphical detail. DirectX 10 was not at all what Microsoft billed it to be.

These images are both from Crysis. One is running under DirectX 9, and the other is running under DirectX 10. Can you tell which is which?
What do YOU think?
I’m very curious to hear everyone’s thoughts on the API debate. Do you feel OpenGL will be able to come back and be as widely used in the PC arena as DirectX? Why/why not? It’s hard for me to imagine this in the near future, given Microsoft’s ability to pour money and time into developing DirectX further and further so that it suits the needs of even the most scrupulous of developers.




