Hacker News new | comments | show | ask | jobs | submit login
The Tale of OpenGL vs. Direct3D (stackexchange.com)
266 points by tilltheis on June 29, 2011 | hide | past | web | favorite | 33 comments

Though well written, I think the article misses an important point. Microsoft designed Direct3D with games in mind and the culture surrounding OpenGL gave priority to productivity applications for engineering and design as is appropriate for something that was developed by Silicon Graphics.

The characterization of Microsoft being disorganized because they were working on OpenGL at the same time as Direct3D is a direct result of misunderstanding this difference. Microsoft had to address to entirely different markets: gamers for whom high frame rates were much more important than fidelity and engineers for whom accurate rendering was important (Even today, high end graphics cards for Windows workstations run OpenGL.)

[http://www.nvidia.com/object/autocad_pd_perf_drivers.html] [http://en.wikipedia.org/wiki/Quake_engine#Reducing_3D_comple...]

3dLabs involvement with the development of improvements to OpenGL is symptomatic of OpenGL's emphasis on fidelity in rendering and the legacy of SGI from whence it evolved. The slow pace was perfectly acceptable to a group of serious people who care about standards and don't care about games.

3dLabs is also an example of the distinct segmentation of the consumer and engineering market for graphic cards in the PC market. The second PC I inherited in my first CAD job had was a 386 with an Nth Engine B752 - you could have built a kickass gaming system for the price of the card alone but it wouldn't put much of a dent in the price of an Iris.


Keep in mind that back in the 1990's all sorts of consumer grade graphic card craziness was going on in Windows boxes - e.g. VESA local bus [http://en.wikipedia.org/wiki/VESA_Local_Bus] and the volume of new Windows machines was exploding and many of them were running graphically intensive games.

This is a really good point. OpenGL favored precision, which could slow things down significantly. D3D favored speed at the expense of pixel-level precision. I remember my ATI driver having a slider that I could turn up and down the D3D precision.

Also missing in the article was the incredibly strong marketing efforts Microsoft made towards game developers. I was in the industry at the time (first at a game company, then a 3D modeling package company, then a 3D modeling company) and you couldn't turn around without getting hit in the face with something about D3D.

My undergraduate degree in CS came from the place that developed the tea pot that sat on the cover of the original OpenGL developer books. I really wanted to see OpenGL win, but between Microsoft exerting its unstoppable mid-90's force in that space and SGI drying up, I think everything could have gone right with the ARB and D3D still would have won.

Serious people don't care about games.

The moderate experience I have with OpenGL confirms this explanation. However, it sort of misses the point. The author may be a bit too close to OpenGL to judge the relative significance of the all the historical details he knows.

Take a step back:

A) There's no way in hell Microsoft would allow OpenGL to take the lead from Direct3D on Windows and Xbox. They would wield the carrots and the sticks to prop up Direct3D (and perhaps even disadvantage OpenGL) if it ever came down to it.

B) OpenGL is a success by any objective measure. Nearly every platform except Windows and Xbox uses it exclusively. E.g. mobiles. Game consoles may have dedicated APIs but I'm sure there's a better OpenGL compat layer than a Direct3D.

Recently I've developed some code on Linux for OpenGL 3.3 with GLSL and it is awesome.

OpenGL is a success by any objective measure

OpenGL is a success. D3D is a success. Two competing products/APIs/services can both be successes. The game is about providing solutions. Both D3D and OpenGL did that for a large customer base. It's not about winning/losing, but does it help solve your problem.

Microsoft went down the D3D (well, the entire DirectX) path to court developers. They knew Windows95 could be much more successful if they could make it so developers could more easily write games for it. Developers were dying for reasonable abstraction layer on PC hardware. When 3D hardware became affordable, OpenGL continued its primary focus on perfection, which didn't give game developers what they needed (good enough, but FAST).

(Side note: If you ever want to pull your hair out, try going back in time to convert a DOS game written in X86 assembly using Mode X[0] blts that had been converted and tweaked from 68k assembly standing arcade game into a DirectX game a few months after DirectX is released for Windows95. Just figuring out how to convert the game time [which came from the sound card] into the DirectX world was unreal.)

[0] http://en.wikipedia.org/wiki/Mode_X

This is probably the most accurate view of the history of OpenGL vs. Direct3D I've seen on the internet. It goes into the actual implementation details of why OpenGL or D3D have been more or less popular for games\graphics programming over the years. Also follows my personal adoption of the APIs for projects pretty closely. Most other comparisons are too political or anti-MS, and are often written by people that have limited (if any) experience with Direct3D.

I don't know. If a historical account gives the details it knows correctly but leaves a bunch of details out is it still accurate?

There's actually a great book written about the creation of Direct3D called Renegades of the Empire (http://tinyurl.com/3n4jnru).

Having read that book I can tell you this account, while accurate in its technical details, misses a lot of other issues that were going on. For Instance...

1. The team pursuing OpenGL was part of the Windows NT group (back when NT and '95 were two different products). The Direct3D team was part of the consumer Windows group. So Microsoft's support (or lack thereof) for OpenGL games was largely based on an internal issue. With Microsoft dragging its feet on implementation in consumer Windows it forced a lot of developers to move.

2. On that note Microsoft's Consumer Windows group was all about moving developers to Windows and making Windows the defacto game standard (and as a result killing off other platforms like Mac, OS/2, etc...). Both the Mac and OS/2 supported OpenGL while they couldn't support Direct3D

3. Direct3D benefited from other parts of the DirectX API. DirectSound, for example, made it very easy for developers to support Aureal's 3d sound technology while still being backwards compatible. DirectInput made it easy to support things like ForceFeedback joysticks. And so on...

4. Microsoft bribed Developers (They did, read the book)

So while the technical analysis is correct here OpenGL's fall was due more to a powerful company doing everything it could to kill the technology off.

Oh I don't doubt that Microsoft politics and their "own the API" policy helped hurt adoption of OpenGL on Windows, but blaming the state of OpenGL on non-Windows platforms on Microsoft is giving them a little too much credit. The ARB was just as much at fault. Apple has had a lot invested in OpenGL, both on the desktop and OpenGL ES and in theory has just as much pull (if not more) as MS, and hasn't done much to improve the state of OpenGL either. Things have been better post ARB, Khronos does a pretty good job, especially with OpenGL ES (which still has its faults... http://aras-p.info/blog/2011/03/04/mobile-graphics-api-wishl...).

In an alternate reality where Windows is still the #1 desktop PC gaming platform, and MS adopted OpenGL instead of developing Direct3D, we'd end up with Microsoft specific extensions and vendor specific extensions to keep OpenGL up to speed with current hardware.

Surprised no one's mentioned the Fahrenheit project. Microsoft's aborted alliance with Silicon Graphics. http://www.microsoft.com/presspass/press/1997/dec97/fahrpr.m...

Re: 1. The NT-OpenGL connection made sense for things like CAD "workstations". Win95 and the DirectX stuff was designed for games. It really was completely separate back then, the kernel driver models were completely different.

1. But how does that explain that Direct3D came out in Windows NT first? From what I remember the NT version was more advanced version released at that point (DX5 to 95's DX3) and they even managed to pack in a few games that took advantage of it (Pinball stands out). By my accounts it looked like Microsoft was using NT to position Direct3d with poor OGL thrown in for those too stubborn to move.

2. I think it's a bit more nuanced than that. OGL was a bear to program for. Microsoft wrote an easier API but it didn't get good until much later. If anything the OGL group should have seen this coming and done something about it. Instead they chose to ignore it at their own peril. Those other OSes were effectively dead by this point MS didn't need to move developers anywhere they were already captured.

3. Agreed. Even now there is no API like it except SDL, and even SDL is very very limited.

4. Agreed.

OpenGL collapsed due to a lot of things. The primary reason was the group itself. And this is the thing that anti-MS people ignore.

As if Glide never existed

In all seriousness, I did 1 graphics programming course back in the day, and it was pretty insane. This was all in OpenGL. The amount of code required to draw the simplest scene was massive. I seem to remember there's a built-in teapot primitive, and I ended up just using that to construct everything (yes, there are simpler built-in primitives, but none nearly as cool as a teapot). I didn't do very well in that course.

The space of OpenGL programs that fail to produce anything visible onscreen is surprisingly vast.

This was my experience during my brief foray into graphics programming at uni. I remember failing a lot, thinking "this can't be me, somebody else somewhere is doing it wrong" and abandoning it in lieu of something more productive.

My first 3D graphics course in college was the same story. You go in thinking you're going to learn to make "Crysis", and you're lucky to leave with a texture-mapped plane. In fact, we probably didn't write a line of code for the first month, we instead spent all our time deriving the mathematics involved in 3D graphics.

As an analogy, it's like taking a "basics of the web" course, and instead of the expected lessons on HTML and CSS, you learn to write a web server and a web browser.

That said, in retrospect, I'm glad we learned those things. If they would have just turned us loose with Ogre (http://www.ogre3d.org/) or something, no one would have spent the time going back to actually learn how 3D graphics really works.

> As an analogy, it's like taking a "basics of the web" course, and instead of the expected lessons on HTML and CSS, you learn to write a web server and a web browser.

Funny you mention this - when I was an undergrad, the first complex group project in my EE/CE curriculum (second year; first year was all individual) had us building a web server.

OpenGL doesn't have a teapot primitive -- common misconception. GLUT (the OpenGL utility toolkit) provides glut[Solid/Wire]Teapot for convenience, but that's by no means core OpenGL; it just backends to a bunch of quads.

True, but without GLUT or an equivalent utility library (hit or miss) you're writing even more scaffolding code. Much more.

Wikipedia also has an extensive page on this topic http://en.wikipedia.org/wiki/Comparison_of_OpenGL_and_Direct...

Another thing that isn't exactly helping OpenGL is Apple's slow creeping adoption of recent versions. I'm running the latest Snow Leopard and my code is reporting OpenGL 2.1.

I'm not really blaming Apple. I mean, on top of the core version they've implemented about 100 extensions with names like GL_ATI_separate_stencil, GL_NV_fragment_program2, GL_ARB_instanced_arrays, etc.. But the OpenGL 4.1 specs were released a year ago and I've got 3D code that runs significantly faster when I boot into Windows. Exact same hardware, but it's OpenGL 2.1 (+ extensions) vs. Direct3D 9.

I would suggest that Apple's historic attitude toward the Mac as a gaming platform is reflected in the effort your graphic engine provider invested in creating drivers for each OS and in the case of OSX perhaps a driver specification which may stifle flexibility - for example NVIDIA's latest Snow Leopard driver is designed so that it runs on everything from chipset to worksation graphics engine. [http://www.nvidia.com/object/quadro-macosx-256.02.25f01-driv...]

I didn't have games in mind, really. I am not developing one.

I would suggest Apple could do a better job of keeping up to date with more recent OpenGL specifications. In fact, I am suggesting it.

The ability to support a particular OpenGL standard is dependent on the hardware (software implementation aside). It is not something that Apple can choose to implement on less capable hardware. That's almost certainly why both Windows and Mac are running OpenGL 2.1 - OpenGL 2.1 is all the hardware will support.

On the other hand, based on your report it appears that NVIDIA has invested more effort in the performance of their Windows driver than in the performance of their Mac driver. Given their economic interests and the fact that many people using their hardware under Windows are NVIDIA customers whereas the vast majority of people using their hardware are Apple customers, it is hardly surprising that they would do so.

I will point out that for people who give a high priority to 3d graphic performance, there is little reason to select an Apple product - a meaningful range of hardware options simply does not exist and the drivers simply receive less attention. Keep in mind that one of the major differences between workstation class graphics cards such as NVIDIA's Quadro and gaming cards is the quality of the drivers - the same GPU's are often used in both segments with driver performance justifying much of the cost premium workstation cards command.

Not particularly worth reading, no. It's a pretty poor mistelling of the story, and inaccurate and foolishly partisan throughout to boot. It comes off as fanboyism and flamebait.

From reading the comments, it seems like the blog's audience is people who spell the name of that big company in Redmond as "Micro$oft". They are definitely an appreciative audience for Wolfire's silliness, but it in no way has any sort of step on the post linked at the top of this HN thread.

It's ok for some of the comments, for example Aras Pranckevičius' responses show a pretty balanced view of the situation. Not for the flamebait blog post that just gets a lot of things wrong.

I feel a lot less ignorant of all that was going on behind the scenes whilst I was rocket-jumping, exploring black mesa, destroying diablo's soulstone, driving around liberty city etc

As a complement, Chris Hecker has kept some of his notes regarding OpenGL vs. Direct3D around:


It seemed quite important at the time that he- who begat WinG, which begat DirectX, some of which is covered in Renegades of the Empire, which someone else mentioned, which is certainly worth reading- went on to agitate for OpenGL over Direct3D. Now there's kind of a scrapheap of history vibe off of the whole thing.

The article misses one of the more interesting recent developments - that via OpenGL ES, GL is effectively doing an end-run around the whole Direct3D roadblock. As several posters have mentioned, GL ES is the standard in all the major mobile platforms. Now WebGL is threatening, not without some MS pushback, to become the standard for native 3D on the web.

Almost by default - simply because DX is a Windows/Xbox technology, and these platforms (particularly Windows, but also the traditional consoles) are fading - and GL is ruling the new world of games - online games, Facebook games, web and so on.

It's rare indeed on HN to see much talk of Microsoft's continuing dominance, because in the web/tech world, that dominance doesn't exist. Games are changing too. And it's games we're talking about here - OpenGL has always run the show in serious applications of 3D, and that shows no signs of abating.

As a gamer all I knew was that Quake ran fast and Monster Truck Madness was framey as hell on my box. Thus I knew that OpenGL was good and Carmack was god and D3D was terrible.

Carmack recently changed his opinion on D3D: http://www.bit-tech.net/news/gaming/2011/03/11/carmack-direc...

I just wrote about this recently, although with more focus on Microsoft's mistakes post DirectX 9.0:



slow clap

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact