Why You Should Use OpenGL and Not DirectX
stickyboot writes "The independent games developer Wolfire describes why they decided to use OpenGL instead of DirectX. The article mainly discusses the marketing strategies behind DirectX and how the API became so popular. It also goes over why a developer would choose OpenGL over DirectX and what this decision means for the gamer. 'Back in 1997, the situation was similar to how it is now. Microsoft was running a massive marketing campaign for Direct3D, and soon everyone "just knew" that it was faster and better than OpenGL. This started to change when Chris Hecker published his open letter denouncing DirectX. Soon after that, John Carmack posted his famous OpenGL rant, and put his money where his mouth was by implementing all of Id Software's games in OpenGL, proving once and for all that DirectX was unnecessary for high-end 3D gaming. This lesson appears to have been forgotten over the last few years. Most game developers have fallen under the spell of DirectX marketing, or into the whirlpool of vicious cycles and network advantages.'"
I am still kind of surprised that even after so many years, the open source communitys answer to marketing is only ranting about it.
Providing libraries, API's or platforms is NOT only about technical platform. *Nothing* in the world works like that. You must "market" it to companies, create a community around it with the right people and actually provide support and good tools to the developers. You can rant all you want about the technical sides of things, but if you do not understand this and completely ignore it you're only hurting yourself.
I have worked with both DirectX and OpenGL. In my opinion, OpenGL is loosing because:
1) DirectX has a comprehensive, well-documented references and documentation
2) DirectX provides a lot more than just 3D drawing - sounds, networking, fonts, input processing, and it used to have an API for 2D graphics before (relevant because the story is about why DirectX gained marketshare)
3) The DirectX libraries had more support in whatever coding language you wanted to use. You can argue this with the point that of course they had because Microsoft is a company so they can do it, but that doesn't change it. In fact, it would show that propretiery formats and libraries are better than open
4) Later it was possible to easily develop XBOX 360 games with DirectX and the tools were made good and easy to pick up. You may say it's irrelevant, that MS is using another market to improve their position, but it is not irrelevant. And unless OpenGL supporters start to work at it too, they're going to lose. Give more support and more value for the work!
5) DirectX was easy to pick up, and everyone supported it. If it's easy to pick up for beginners, they'll learn it and continue using it later as a professional (the same thing as why Adobe doesn't really care about home users Photoshop piracy)
It is NOT only about providing the technical platform. It is also about providing all the things that company it - some may call that "marketing", but it's mostly about giving support to those who use the platform, and giving more value for their time, work and money.
As a former OpenGL developer, I am not too fond of GL anymore.
Khronos really disappointed a lot of people when they announced the GL3 specs. They had promised SO much and delivered SO little. Khronos claimed that it didn't want to piss of the CAD community, which is heavily GL based. They basically chose to please the CAD community instead of the gaming community.
That move totally killed GL for me.
In an article a couple years back during the Doom 3 release he(John Carmack) said in later articles that they would be moving away from the OpenGL platform and considering he was one of the biggest backers of it. He even said in the article that they liked DirectX and the new features they have added, also that it was a lot better to work with these days and supported more. I can only imagine after the last fiasco update that OpenGL put out and all the missing features they promised, it looks pretty dismal for that development team as they cannot deliver what they promise.
Really the last place OpenGL stands strong is in AutoCAD and even they have indicated that the platform will not last longer, so we may see AutoCAD be using DirectX in the next few 5-10 years.
There is a huge difference between Pepsi and Coke, just for the record.
I exclusively use Windows for PC gaming. I could give two flying F's whether my game is developed in OGL or DX.
If more games were developed in OGL, they would be easier to port to other operating systems (or run under Wine)so you wouldn't need to use Windows anymore. That would save you a hundred bucks or so on a Windows license, or at the very least the need to reboot to play a game. That's got to be worth at least one flying F.
Give me Classic Slashdot or give me death!
My understanding is that devs should use OpenGL because they want to do a whole bunch more work writing code for each individual graphics card.
DirectX is made for games. You can use it for other kinds of applications, but if you want to do something that you do in a game, there is likely a function or construct specifically for what you need. It's docs assume you are making a game and when there are multiple ways to do something they often point out the faster way. heck it only works with triangulated mesh data.
Open GL is made for EVERYTHING. Sure, you can use it for games. There's nothing wrong with that, but i'm not John Carmack. That shit is hard for me. If i want to make a game, i'll take the platform that holds my hand.
Plus, like others said, direct x is a whole game api. it's not just graphics. it's input, it's networking, it's sound. the whole platform is very cohesive. I'd rather just keep up with one api, one download, etc than have to follow open gl, open al, etc.
anyway modern game development means licensing an engine. engine developers worry about supporting open gl or direct x.
The ultimate monetary advantage of using OpenGL for games (imo and ime) is it makes Mac porting a hell of a lot easier.
The ultimate monetary downside of making Mac games is that only a small fraction of the install base can upgrade their video cards - the one constantly-moving PC gaming component.
You can build a useable gaming PC for under $700 - the buy-in for a Mac with an upgradeable video card is presently $2499. With the vast majority of PC gamers using wintendos, Windows/DirectX is the LCD. It's where most (or all) of the money is.
I think it's fantastic that iD uses OpenGL and makes all of their games cross platform. I also think it's unfortunate that iD is the exception to the rule... but I also vote with my wallet, and I use a $600 non-upgradeable (video, anyway) Mac Mini for all of my Mac-oriented needs, and a massively-upgradeable, equally-priced Shuttle PC for everything else. Which includes a long list of games that haven't been released on the Mac - and even if they had been, wouldn't be playable on the GMA-950 video chipset. It's shite for games, fine for Photoshop... and Windows is the reverse for me.
If I need a wintendo to play Orange Box or S.T.A.L.K.E.R., does it really matter if the game uses DirectX or OpenGL?
Not really. :-|
I don't know whether to laugh or cry at people like you.
Let's just sum up the platforms our company supports:
PS3
Wii
Linux
Mac
Windows
Android
iPhone
Various embedded custom ARM based hardware
Guess which API is the one we use for all of those platforms - except the two consoles?
OpenGL
Guess which API will be used for the next media hardware platform no one has heard about yet?
OpenGL
So, yeah, go right ahead and keep babbling about how somehow OpenGL needs to 'prove' itself. DirectX is a dead end API to anyone except the fading Windows gaming market and teenage Windows only coders.
You mentioned Quake 3 (which is just a little over a decade old) that got me thinking, what software DOES run OpenGL?
http://en.wikipedia.org/wiki/List_of_OpenGL_programs
The fact that I didn't know most of those titles (many of which I have or have played) had support for OpenGL is a testament to the lack of marketing and the push the OpenGL community needs to make to get people excited about it.
crazy dynamite monkey
My car doesn't come with tires, so hey, you can't compare it to other cars that do!
I've dabbled in 3D programming, I haven't done anything amazing, let alone made my own game, but I will say that D3D is much easier to write working code than OpenGL. With OpenGL I got about as far as a spinning triangle on the screen. With D3D I was able to get to the point where I was rendering a model on the screen and manipulating it with pixel and vertex shaders.
Somebody earlier hit the the nail on the head when they said that because it's easier it's what people will start and subsequently stick with. Not only that, but as a business if it takes your programmers 10 months to write a graphics engine in D3D and 12 months to write one in OpenGL, which one are you going to go for? There aren't many instances where I will go to bat for MS, but DirectX has a better graphics API compared to OpenGL.
Oh, a lesson in history from Mr. I'm my own grandpa.
Said the anonymous coward
If you really wanna do that, knock yourself out: http://code.google.com/p/bfopengl/ :-)
Could you make those error bars a bit bigger? You almost said something.
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
There's one truly Killer App that's not on there - Mac OS X. The low-level APIs use OpenGL for hardware acceleration on supported GPUs (pretty much any discrete GPU in a late model Mac).
http://developer.apple.com/macosx/architecture/index.html
http://developer.apple.com/graphicsimaging/opengl/
http://en.wikipedia.org/wiki/Core_Image
Intel transfer the difficult from Hadware to software, for get more power, programmer need more technology. -- chinaitn
Irrefutable, feel welcome to try.
- OpenGL works on Mac, Linux, WindowsXP and Direct3D does not (or only partially as in no DX11 for XP)
- OpenGL compatible APIs are present on the PS3, Wii, iPhone and many other devices, wheras Direct3D works on none of those.
- Cutting edge features can be accessed in OpenGL as they come out, whereas in Direct3D you'll have to wait until M$uck decides to iterate++ DX.
- A wealth of good online and dead tree documentation can be had for OpenGL
- A host of "killer apps" has been done and is continuing to be done with OpenGL (such as Maya, 3ds max, softimage, all iPhone games, Mac Games etc.)
Experiments and other stuff
More disposable pens are sold every day than premium cars in a decade. But guess which is more profitable.
"It's such a fine line between stupid and clever" -- David St. Hubbins, Spinal Tap
google for frame matched sound or speculative rendering and you'll draw lots of blanks, so even if it's not made up, it's entirely out of context or completely esoteric. It's just "blahblahblah see, OpenGL is worse". If you can link me to *any* article that shows clearly how and why this makes OpenGL bad somehow, and Direct3D great, I will stand corrected.
Experiments and other stuff
The *nix Analogue for DirectX is SDL. Not OpenGL.
The thing is, for a few years now, there needed to be an SDL 2.0 that made it as easy to integrate things like Nintendo's Wiimotes, Playstation controllers, and other things. But After all these years, we seem to be stuck on SDL 1.2.x - I don't know why. GTK+ moved on. Qt Moved on, what happened to SDL?
Don't you mean "Too bad ATI card royally suck ass at implementing OpenGL"?
Cress, cress, lovely lovely cress
Now if someone came and blew Powerpoint away, sold the software for less-- you bet your ass Microsoft would start moving again.
The question is what move that would be. To judge by the past, they would, in order of feasibility: -
(Not comprehensive.)
All of this has happened before, and all of it will happen again.
(aka: Are you absolutely positive you are not new here?)
Wrong, the svn is empty, yes, but you can download the interpreter code and some docu as zip. Apparently it supports some 18 glut/gl calls.
*removed because: Filter error: Please use fewer 'junk' characters.
Please tell me how many companies care about the niche market of 0.1% of Linux users? How many Linux games do you see? And don't even get me started how much bitching there would be if the "bad" companies wouldn't open source their games when releasing Linux versions.
It's not really about the 1% of desktop users that use Linux. What you are failing to note is that there is an awful lot of software written for mobile systems (read: mobile phones and iPod like devices that double as gaming platforms) and many of those systems run Unix like OS'es such as iPhone/iPod OS and Linux. Writing games for mobile devices is a growing market and portability is a key component if you want to make any kind of money since the world of Mobile operating systems isn't quite the Microsoft dominated monoculture that the world of Desktop OS'es is. If Android gains any kind of a foothold and iPhone OS keeps gaining market share (and there is no reason to believe they won't) I'd say OpenGL has a bright future, if only thanks to people developing for mobile devices. Also keep in mind that the most popular mobile phone OS is Symbian. Mind you I don't think Symbian owes much to Unix but it isn't made by Microsoft either. Symbian has an OpenGL port that is also the official Symbian 3D graphics API (according to Wikipedia). Now I'm sure people can bitch and moan about how mobile games aren't really as sophisticated as as PC games and I suppose that's true. Nevertheless it still cracks me up every time some bozo puts in a book review on a game development book on Amazon and goes on endlessly about how Direct3D is a "game development industry standard" and how "OpenGL is a dying technology". OpenGL is alive and well and likely to stay that way. The (mobile software developing) world is not Microsoft.
Only to idiots, are orders laws.
-- Henning von Tresckow
I had higher hopes for the original article in discussing specific technical reasons for choose one API over the other aside from the issue of platform support.
From my perspective, the the controversy boils down to a handful of actual issues:
* Quality of drivers. D3D drivers have historically been more solid than OpenGL drivers on Windows. This is less of an issue these days with Nvidia. Unfortunately ATI OpenGL drivers remain a bit flaky.
* Market. I believe that the very high end graphics workstation market (think Hollywood CGI artists, CAD, etc) is still invested heavily Unix (Linux) based tools. Nvidia has a much bigger foothold in this market than ATI which explains why Nvidia has superior X.org drivers and better OpenGL support all around.
* Bleeding edge technical features, if you are trying to achieve some advantage in rendering quality over your competitors. This makes sense in the graphical arms race of gaming, but most of the rest of the visual simulation industry (3D modeling, CAD, scientific computing, government/military, etc) don't care about the cutting edge as much.
* What your 3D engine of choice supports. Writing a whole 3D engine from scratch is going to be silly most of the time with the many commercial and open source 3D engines now available, so you are not going to be writing a whole lot of bare D3D or OpenGL code.
Like a lot of other areas, Microsoft's development solutions work great if you stay in the Microsoft ecosystem. As a pure business decision sometimes it makes sense.
What irks people (including me) is when Microsoft deliberately or de factor freezes out the competition; this is where we end up with frustrating situations like the case of ATI having inferior support for OpenGL on Windows. There's no technical reason for it, just someone manager's decision on how to allocate developer resources. Longtime Linux users know this is a story that has played out with many devices; usually there is no technical reason a piece of hardware can't be used on Linux, it is simply a matter of the manufacture choosing whether or not to devote additional resources to supporting platforms other than the one with the biggest market share.
So ultimately it is about mindshare and putting pressure on Nvidia and ATI step up to the plate to have good OpenGL support, and encourage Microsoft it is not in their best interests to screw over Windows OpenGL users.
(did I mention enough times how much ATI OpenGL driver quirks annoy me?)
How the hell are you insightful? The OpenGL market owns the Smartphone industry. It's well on it's way in owning the game console industry. It own the highend CAD industry and Engineering modeling industry. It accelerates all OS X variants, it's becoming the defacto on Linux distributions where it makes sense, it's moving into the Web via WebGL and with the steadily eroding world around Microsoft is obviously doing well with the recent 3.1/3.2 updates and it's lovely new pal, OpenCL 1.1 being worked on has convinced all the GPGPU vendors that OpenGL/OpenCL is the one two punch for all Graphics.
I'm sorry, but... Qt? Yuck. Give me something with a plain C API and optional C++ wrapper, not a native C++ API. Give me something that doesn't have its own "make" variant to make building "easier". Give me something that doesn't rely on macros and a custom code pre-processor to implement signals & slots, when it's been fairly conclusively proven that these features can be implemented using plain old C/C++.
Please, if you're going to do something like this, don't take a reasonably well-written plain-old-C API like OpenGL and sully it by association with something which is, in comparison, broken by design.
For something which underpins so many open-source applications, and touts cross-platform compatibility as its major feature, Qt seems to make so many departures from library-writing best practices that I often wonder why it has been adopted as widely as it has. Thankfully I am currently succeeding in keeping Qt (and KDE) off my Linux installs - I run one closed-source Qt application for work purposes, and ironically, running the Windows version in WINE works better and provides more features than running the Linux-native version.