Difference between revisions of "OpenGL"

Line 1: Line 1:
I used to be pretty passionate about the [http://www.opengl.org OpenGL] graphics API, and I spent a fair amount of my time working to make it successful on the PC for games.  I still think it's a pretty [[API Design|well designed API]], and it's certainly still much more pleasant to program with than Direct3D, even after all of these years and versions, but the heat has gone out of the issue for me.  Direct3D won the war.  SGI is basically dead, the OpenGL Architecture Review Board is mostly reactive instead of proactive, and Direct3D is the stable and mature platform that drives the features for each generation.
I used to be pretty passionate about the [http://www.opengl.org OpenGL] graphics API, and I spent a fair amount of my time working to make it successful on the PC for games.  I still think it's a pretty [[API Design|well designed API]], and it's certainly still much more pleasant to program with than Direct3D, even after all of these years and versions, but the heat has gone out of the issue for me.  Direct3D won the war.  SGI is basically dead, the OpenGL Architecture Review Board is mostly reactive instead of proactive, and Direct3D is the stable and mature platform that drives the features for each generation.


OpenGL still has some advantages, like vendor extensions that allow IHVs to expose custom features in a standardized way, the relative niceness of most of its programming interface (however, there are really wonky and byzantine parts of the OpenGL API, one must admit), and the fact that it's cross platform (although XBox makes it so Direct3D is actually somewhat cross platform on two platforms on which you can actually sell lots of copies of your games)But, if you want to make a 3D game on the PC and you want to have stable access to the latest 3D features...well, ''you're just screwed''.  Yes, after 10 years of effort, the 3D graphics situation on the PC is still pretty laughable.  You can, without trying very hard, find a serious 3D driver bug within minutes of sitting down to write code with either API, which is just sad.
OpenGL still has some advantages, like vendor extensions that allow IHVs to expose custom features in a standardized way, the relative niceness of most of its programming interface, and the fact that it's cross platform.  However, there are really wonky and byzantine parts of the OpenGL API, one must admit, and the XBox makes it so Direct3D is actually somewhat usefully cross platform on two platforms on which you can actually sell lots of copies of your games.  So, if you want to make a 3D game on the PC and you want to have stable access to the latest 3D features, you should use...well, actually, ''you're just screwed''.  Yes, after 10 years of effort, the 3D graphics situation on the PC is still pretty laughable.  You can, without trying very hard, find a serious 3D driver bug within minutes of sitting down to write code with either API, which is just pathetic.


However, finally getting to the actual advice, if you want a better chance of getting your code to work using "mainstream cutting edge features" (say, lots of render-to-texture, deep render target pixel formats, etc.), you're probably better off using Direct3D.  If you only need to use a safe subset of features that lags the cutting edge by a year or so, and you want the nicer programming experience, ''or'' if you want to use the most bleeding edge stuff that's only available in vendor extensions, then OpenGL is a fine choice.
However, finally getting to the actual advice, if you want a better chance of getting your code to work using "mainstream cutting edge features" (say, lots of render-to-texture, deep render target pixel formats, etc.), you're probably better off using Direct3D.  If you only need to use a safe subset of features that lags the cutting edge by a year or so, and you want the nicer programming experience, ''or'' if you want to use the most bleeding edge stuff that's only available in vendor extensions, then you should use OpenGL.  At the end of the day, for most games, it probably doesn't matter a bit.  There are [[Innovation in Games|more interesting problems]] than 3D graphics to solve in games anyway.


Ironically, the collapse of the PC 3D market down to NVidia, ATI, and Intel has actually helped OpenGL be competitive, driver- and coverage-wise, since those vendors tend to update their OpenGL drivers about as frequently as their Direct3D drivers.  The chance for OpenGL to "win" is long past, though.  Direct3D is easily a [[Good Enough|good enough]] API now.
Ironically, the collapse of the PC 3D market down to NVidia, ATI, and Intel has actually helped OpenGL be competitive, driver- and coverage-wise, since those vendors tend to update their OpenGL drivers about as frequently as their Direct3D drivers.  The chance for OpenGL to "win" is long past, though.  Direct3D is easily a [[Good Enough|good enough]] API now.
Line 11: Line 11:
===What If?===
===What If?===


People occasionally talk about what the PC 3D situation would be if it wasn't for Direct3D.  Some people claim that without Direct3D, OpenGL would still be at 1.0, and there would have been no innovation.  This is pretty silly and specious, I think.  The thing that spurred innovation in the market was the commoditization of good 3D hardware, and the outflow of SGI hardware designers starting companies to make 3D chips on the cheap, not any design decisions in Direct3D or OpenGL.  It was just time.  Microsoft could have easily embraced OpenGL to provide the API for this new generation of hardware, and I think the industry would have been much better off because it would have started out with a good solid proven design, rather than having to go through years and 5 API iterations to get to something that actually worked.
People occasionally talk about what the PC 3D situation would be if it wasn't for Direct3D.  Some people claim that without Direct3D, OpenGL would still be at 1.0, and there would have been no innovation.  This is pretty silly and specious, I think.  The thing that spurred innovation in the market was the commoditization of good 3D hardware, and the outflow of SGI hardware designers starting companies to make 3D chips on the cheap, not any design decisions made in Direct3D or OpenGL.  It was just time.  Microsoft could have easily embraced OpenGL to provide the API for this new generation of hardware, and I think the industry would have been much better off because it would have started out with a good, solid, proven design, rather than having to go through years and 5 API iterations to get to something that actually worked.


When I was at Microsoft, I originally thought OpenGL was a poorly design 3D API, but I was just [[Intelligence vs Experience|clueless and wrong]].  The fact that there was no fast OpenGL software renderer was more an artifact of history than of API design, even though we game graphics people thought it was fundamentally broken, since it didn't match up with our notions of how 3D graphics should work.  SGI eventually released a competitive software OpenGL just to fight the FUD coming out of Redmond.  And, of course, no one cares about software rendering performance anymore anyway, and even at the time no one wanted to use an API for their software renderer, because there's just too much domain-knowledge you can take advantage of by doing it yourself, so the whole question was a waste of time and a diversion.
When I was at Microsoft, I originally thought OpenGL was a poorly design 3D API, and I actually fought against it in meetings, but I was just [[Intelligence vs Experience|clueless and wrong]].  The fact that there was no fast OpenGL software renderer was more an artifact of history than of API design, even though we game graphics people thought it was fundamentally broken, since it didn't match up with our notions of how 3D graphics should work.  SGI eventually released a competitive software OpenGL just to fight the FUD coming out of Redmond.  And, of course, no one cares about software rendering performance anymore anyway, and even at the time no one wanted to use an API for their software renderer, because there's just too much domain-knowledge you can take advantage of by doing it yourself, so the whole question was a waste of time and a diversion.


It's painful for me to look back on that time, because it was the tail wagging the dog in so many ways.  Even incredibly brilliant and thoughtful people like John Carmack were giving the completely wrong advice to PC 3D hardware companies about how their chips should work (Carmack readily admits this, by the way).  3Dfx was the one company that ignored all the game developers, and Tarolli et al. just made the architecture that was based on their hardware experience at SGI, and they wiped the floor with everybody else.
It's painful for me to look back on that time, because it was the tail wagging the dog in so many ways.  Even incredibly brilliant, thoughtful, and well-meaning people like John Carmack were giving the completely wrong advice to PC 3D hardware companies about how their chips should work (Carmack readily admits this, by the way).  3Dfx was the one company that ignored all the game developers, and Tarolli et al. just made the architecture that was based on their hardware experience at SGI, and they wiped the floor with everybody else.


There were certainly plenty of changes that needed to be made to OpenGL to make it fit commodity hardware truly well, and to take it past 1.0, but those could have been made with far less disruption and churning than dragging everyone through so many bad and limited API iterations.  It was just a giant waste of the industry's resources, Microsoft's, IHV's, and game developers', and all just so Microsoft could control the API absolutely, rather than having to work with others.  I don't blame Microsoft for this, I actually [[Developer Power and the U Word|blame game developers]].
There were certainly plenty of changes that needed to be made to OpenGL to make it fit commodity hardware truly well, and to take it past 1.0, but those could have been made with far less disruption and churning than dragging everyone through so many bad and limited API iterations.  It was just a giant waste of industry resources--Microsoft's, IHV's, and game developers'--and all just so Microsoft could control the API absolutely, rather than having to work with others.  I don't blame Microsoft for this, I actually [[Developer Power and the U Word|blame game developers]].


So, yes, Direct3D spurred OpenGL to improve faster in the sense that people at the time were scrambling to do anything to enable 3D hardware and Direct3D was Microsoft's answer to that question.  And, SGI should have been ahead of the curve and figured out the commodity 3D hardware thing themselves rather than bleeding their engineers to startups and eventually dying.  But, no, Direct3D was a huge loss to the industry in terms of resources wasted compared to the alternative of just starting with OpenGL, understanding why it was designed the way it was, and iterating from there.
So, yes, Direct3D spurred OpenGL to improve in the sense that people at the time were scrambling to do anything to enable 3D hardware and Direct3D was Microsoft's answer to that question.  And, SGI should have been ahead of the curve and figured out the commodity 3D hardware thing themselves rather than bleeding their engineers to startups and eventually dying.  But, no, Direct3D was a huge loss to the industry in terms of resources wasted compared to the alternative of just starting with OpenGL, understanding why it was designed the way it was, and iterating from there.


===Blasts From the Past===
===Blasts From the Past===
Line 25: Line 25:
Here are some old writings about OpenGL and related topics:
Here are some old writings about OpenGL and related topics:


* [[Media:gdmogl.pdf|An Open Letter to Microsoft: Do the Right Thing for the 3D Game Industry]]<br>This was the first article I wrote about the issue.  It is a highly technical article about the ways in which OpenGL was better designed than Direct3D.  It is now completely out of date, as almost everything has changed about Direct3D since this article was published.  At the time when this article was written, Microsoft could have thrown out Direct3D, embraced and extended OpenGL, and I think the industry would be much better off now.  It took years for Microsoft to achieve cluefullness parity about how 3D graphics should work, and the industry paid the price in the interim.  There was no technical reason Microsoft needed to continue with Direct3D at this point in time.  Despite the immense amount of FUD coming out of Redmond, it was purely for control and power over IHVs and developers.  ''Much'' more frustrating to me than Microsoft behaving this way was that game developers just sat there and complained about it but did ''nothing'', for the most part, where I believe we could have banded together and changed the situation over night.
* [[Media:gdmogl.pdf|An Open Letter to Microsoft: Do the Right Thing for the 3D Game Industry]]<br>This was the first article I wrote about the issue.  It is a highly technical article about the ways in which OpenGL was better designed than Direct3D, once I finally got that clue.  It is now completely out of date, as almost everything has changed about Direct3D since this article was published.  At the time when this article was written, Microsoft could have thrown out Direct3D, embraced and extended OpenGL, and I think the industry would be much better off now.  ''Much'' more frustrating to me than Microsoft behaving this way was that game developers just sat there and complained about it but did ''nothing'', for the most part, where I believe we could have banded together and changed the situation over night.  See below.


* [[/Press Release|Top Game Developers Call on Microsoft to Actively Support OpenGL]]<br>This is the infamous OpenGL press release, including an open letter to Microsoft signed by 50 or so high-end game developers.
* [[/Press Release|Top Game Developers Call on Microsoft to Actively Support OpenGL]]<br>This is the infamous OpenGL press release, including an open letter to Microsoft signed by 50 or so high-end game developers.

Revision as of 01:04, 21 January 2007

I used to be pretty passionate about the OpenGL graphics API, and I spent a fair amount of my time working to make it successful on the PC for games. I still think it's a pretty well designed API, and it's certainly still much more pleasant to program with than Direct3D, even after all of these years and versions, but the heat has gone out of the issue for me. Direct3D won the war. SGI is basically dead, the OpenGL Architecture Review Board is mostly reactive instead of proactive, and Direct3D is the stable and mature platform that drives the features for each generation.

OpenGL still has some advantages, like vendor extensions that allow IHVs to expose custom features in a standardized way, the relative niceness of most of its programming interface, and the fact that it's cross platform. However, there are really wonky and byzantine parts of the OpenGL API, one must admit, and the XBox makes it so Direct3D is actually somewhat usefully cross platform on two platforms on which you can actually sell lots of copies of your games. So, if you want to make a 3D game on the PC and you want to have stable access to the latest 3D features, you should use...well, actually, you're just screwed. Yes, after 10 years of effort, the 3D graphics situation on the PC is still pretty laughable. You can, without trying very hard, find a serious 3D driver bug within minutes of sitting down to write code with either API, which is just pathetic.

However, finally getting to the actual advice, if you want a better chance of getting your code to work using "mainstream cutting edge features" (say, lots of render-to-texture, deep render target pixel formats, etc.), you're probably better off using Direct3D. If you only need to use a safe subset of features that lags the cutting edge by a year or so, and you want the nicer programming experience, or if you want to use the most bleeding edge stuff that's only available in vendor extensions, then you should use OpenGL. At the end of the day, for most games, it probably doesn't matter a bit. There are more interesting problems than 3D graphics to solve in games anyway.

Ironically, the collapse of the PC 3D market down to NVidia, ATI, and Intel has actually helped OpenGL be competitive, driver- and coverage-wise, since those vendors tend to update their OpenGL drivers about as frequently as their Direct3D drivers. The chance for OpenGL to "win" is long past, though. Direct3D is easily a good enough API now.

Personally, I write all of my prototypes, tools, and indie games in OpenGL, because it's just more agile and toolkit-y. And fun. Don't underestimate the motivational power of having fun while you program. The games I work on for big companies are almost all written in Direct3D.

What If?

People occasionally talk about what the PC 3D situation would be if it wasn't for Direct3D. Some people claim that without Direct3D, OpenGL would still be at 1.0, and there would have been no innovation. This is pretty silly and specious, I think. The thing that spurred innovation in the market was the commoditization of good 3D hardware, and the outflow of SGI hardware designers starting companies to make 3D chips on the cheap, not any design decisions made in Direct3D or OpenGL. It was just time. Microsoft could have easily embraced OpenGL to provide the API for this new generation of hardware, and I think the industry would have been much better off because it would have started out with a good, solid, proven design, rather than having to go through years and 5 API iterations to get to something that actually worked.

When I was at Microsoft, I originally thought OpenGL was a poorly design 3D API, and I actually fought against it in meetings, but I was just clueless and wrong. The fact that there was no fast OpenGL software renderer was more an artifact of history than of API design, even though we game graphics people thought it was fundamentally broken, since it didn't match up with our notions of how 3D graphics should work. SGI eventually released a competitive software OpenGL just to fight the FUD coming out of Redmond. And, of course, no one cares about software rendering performance anymore anyway, and even at the time no one wanted to use an API for their software renderer, because there's just too much domain-knowledge you can take advantage of by doing it yourself, so the whole question was a waste of time and a diversion.

It's painful for me to look back on that time, because it was the tail wagging the dog in so many ways. Even incredibly brilliant, thoughtful, and well-meaning people like John Carmack were giving the completely wrong advice to PC 3D hardware companies about how their chips should work (Carmack readily admits this, by the way). 3Dfx was the one company that ignored all the game developers, and Tarolli et al. just made the architecture that was based on their hardware experience at SGI, and they wiped the floor with everybody else.

There were certainly plenty of changes that needed to be made to OpenGL to make it fit commodity hardware truly well, and to take it past 1.0, but those could have been made with far less disruption and churning than dragging everyone through so many bad and limited API iterations. It was just a giant waste of industry resources--Microsoft's, IHV's, and game developers'--and all just so Microsoft could control the API absolutely, rather than having to work with others. I don't blame Microsoft for this, I actually blame game developers.

So, yes, Direct3D spurred OpenGL to improve in the sense that people at the time were scrambling to do anything to enable 3D hardware and Direct3D was Microsoft's answer to that question. And, SGI should have been ahead of the curve and figured out the commodity 3D hardware thing themselves rather than bleeding their engineers to startups and eventually dying. But, no, Direct3D was a huge loss to the industry in terms of resources wasted compared to the alternative of just starting with OpenGL, understanding why it was designed the way it was, and iterating from there.

Blasts From the Past

Here are some old writings about OpenGL and related topics:

  • An Open Letter to Microsoft: Do the Right Thing for the 3D Game Industry
    This was the first article I wrote about the issue. It is a highly technical article about the ways in which OpenGL was better designed than Direct3D, once I finally got that clue. It is now completely out of date, as almost everything has changed about Direct3D since this article was published. At the time when this article was written, Microsoft could have thrown out Direct3D, embraced and extended OpenGL, and I think the industry would be much better off now. Much more frustrating to me than Microsoft behaving this way was that game developers just sat there and complained about it but did nothing, for the most part, where I believe we could have banded together and changed the situation over night. See below.
  • Developer Power and the U Word
    This is a link to a speech I gave at the Seattle CGDC. It's about how we can prevent this kind of thing from happening again.
  • GLSetup
    I spent a few years working on a project called GLSetup, which tried to eliminate the driver install problem for updating OpenGL drivers.
This page was last edited on 21 January 2007, at 01:04.