Slashdot Mirror


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.'"

16 of 515 comments (clear)

  1. Re:OpenGL and the rant about marketing by HermMunster · · Score: 3, Interesting

    If Windows didn't have these technologies used to prop it up we'd have far less Windows in the world, which, in many ways would be the greatest thing for the consumer and the industry (as far as innovation and progress goes). Without DirectX propping up the monopoly we'd have other technologies and far more companies that would provide innovative competition, thus providing more, and often better, products.

    We know that when you have a large number of competitors you get better products. The eReaders are a perfect example. First the Kindle and now about 10 competitors all showing that the competition has created a much greater choice for consumers as well as better features. Further netbooks and tablet PCs as well as touch capabilities in phones and the tablets are perfect examples of what happens when there's no technology to lock you in thus propping up the monopoly.

    --
    You can lead a man with reason but you can't make him think.
  2. Re:Former OpenGL developer by WilyCoder · · Score: 5, Interesting

    I know its taboo to respond to oneself, but I forgot to mention the recent release of the GL books (red and orange) adequately display the state that GL is in. They STILL do not have geometry shaders in the standard, and its freaking 2010! Yes, you can use those shaders via extensions, but anyone who recommends that path has not been personally burned by vendors supporting extensions to different levels. Writing code that uses extensions that only work on Nvidia and not ATi (or vice versa) is NOT what GL is about!
     

  3. Re:OpenGL and the rant about marketing by HermMunster · · Score: 3, Interesting

    The rant is no more of a rant than you find closed source rant about regarding open source.

    And, the updated spec for OpenGL had glorious ideas but somehow they fell through. Then Microsoft decided they'd cancel support for OpenGL in Vista/Win7 (yay, way to compete -- try to kill a solid viable product used by so many).

    OpenGL still has a bright future as soon as they can complete what they promised.

    --
    You can lead a man with reason but you can't make him think.
  4. More like Developers don't CARE. by solios · · Score: 3, Interesting

    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. :-|

  5. Re:John Carmack ditched OpenGL by Xest · · Score: 5, Interesting

    This is really it, the summary almost sounds like a complete troll.

    OpenGL didn't lose out because of Microsoft's marketing, it lost out because whilst OpenGL stagnated, DirectX grew and grew to become a completely unified games development framework. Carmack may have had a point 12 years ago, but whilst OpenGL development completely ignored criticisms, Microsoft took criticism from the likes of Carmack on board and improved performance of their API whilst adding new features, providing great documentation and tidying up the interface.

    Citing an argument from over a decade ago is desperate to say the least.

    OpenGL needed to become something more, it needed to become part of a unified game development library in itself- we had part of that with OpenAL but it needed everything, we simply need an Open Multimedia/Gaming framework that can do everything that DirectX can do.

    The fact is, game development requires more code and more content than ever before, developers can simply no longer justify spending time on filling in the gaps when other libraries like DirectX already have those gaps filled.

    I would love nothing more than a resurgence of a set of open libraries covering the various facets of game development like DirectX does because it'd mean near zero effort porting to Mac and Linux, but right now the extra effort required to use OpenGL and OpenAL and then fill in the other gaps yourself coupled with the additional support requirements just doesn't justify the relatively minimal extra userbase for many developers.

  6. Re:OpenGL has/had Killer Apps! by decipher_saint · · Score: 3, Interesting

    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
  7. Re:John Carmack ditched OpenGL by shutdown+-p+now · · Score: 3, Interesting

    whilst OpenGL development completely ignored criticisms, Microsoft took criticism from the likes of Carmack on board

    That kind of feedback is actually formalized - there's a committee called Microsoft DirectX Advisory Board. I'm not sure whether Carmack is on it, but e.g. Tim Sweeney (the Unreal guy) is, judging by one of his interviews.

    I don't know how much influence that board has over DX design, however ("advisory" in the name gives a hint, but there is still a wide range of possibilities). Would be interesting to know. Could it be that D3D9 was a significant leap that Carmack claims it to be precisely because of heavy participation in its design by people who actually use it?

  8. Re:Former OpenGL developer by ajs · · Score: 3, Interesting

    OpenGL is clearly behind DirectX ...

    You're contradicting TFA without any evidence. TFA provided quite a lot of evidence to support its position such as:

    It's common knowledge that OpenGL has faster draw calls than DirectX (see NVIDIA presentations like this one if you don't want to take my word for it), and it has first access to new GPU features via vendor extensions. OpenGL gives you direct access to all new graphics features on all platforms, while DirectX only provides occasional snapshots of them on their newest versions of Windows. The tesselation technology that Microsoft is heavily promoting for DirectX 11 has been an OpenGL extension for three years. It has even been possible for years before that, using fast instancing and vertex-texture-fetch. I don't know what new technologies will be exposed in the next couple years, I know they will be available first in OpenGL.

    So no, I don't think you can just drop such a comment and be taken seriously. You're going to have to back that up.

  9. Re:OpenGL and the rant about marketing by TheRaven64 · · Score: 4, Interesting

    5) OpenGL is easy(er?) to pick up

    It used to be, with the fixed-function pipeline. Unfortunately all of the easy bits were deprecated with 3.0 and removed with 3.1 (fortunately people like nVidia then re-introduced them all as extensions). OpenGL 3.1 is incredibly powerful, but I wouldn't describe it as easy.

    --
    I am TheRaven on Soylent News
  10. Re:I've used both by oGMo · · Score: 4, Interesting

    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.

    Please RTFA. Also, Chris Hecker's article, linked from TFA. Then give us specific, technical reasons that DX/D3D is somehow better for games than OpenGL. Your post is filled with assertions, but with nothing to back them up. It's pretty sad that got moderated "informative".

    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.

    Again, RTFA. Give specific, technical reasons that OpenGL is "harder" than D3D. If you'd bothered to read Carmack's position, his favoring of GL was because GL is easier. Your inability to deal with OpenGL putting your claims in doubt aside, you could at least be specific about the reasons. As per Chris Hecker's article, the only one making these claims are Microsoft evangelists. You wouldn't happen to work for Microsoft would you?

    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.

    This is a bit disingenuous. All of the articles involved are addressing the 3D aspect of DX. The rest of the stuff is either trivial (use SDL or similar which is about the simplest API you could imagine, has a billion support libs, and runs on everything), or you'd be doing it by hand anyway (implement your own networking stack for performance, a la EVE). Your point is therefore irrelevant.

    anyway modern game development means licensing an engine. engine developers worry about supporting open gl or direct x.

    You seem to be a lazy-enough or low-end-enough developer that this article does not apply to you. However, it does matter to developers who make engines (either primarily or otherwise). Perhaps you should move along; these are not the articles you are looking for.

    --

    Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

  11. Re:OpenGL has/had Killer Apps! by warrior · · Score: 3, Interesting

    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
  12. Re:I've used both by RAMMS+EIN · · Score: 3, Interesting

    ``anyway modern game development means licensing an engine. engine developers worry about supporting open gl or direct x.''

    Exactly. That makes me wonder why they actually bother supporting DirectX, though, seeing as DirectX really only works on Windows, which is also supported by the APIs that the other platforms use.

    ``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.''

    But you don't; you just use the engine and let the engine developers worry about platform specific APIs. You even said as much yourself.

    Also, I don't know to what extent DirectX is "one api". The way I understand it, DirectX is, first of all, made up of several different APIs for different purposes, e.g. Direct3D, DirectSound, and DirectInput. So there isn't really just one API. As for keeping up with it, to what extent is DirectX actually backward and forward compatible? I have never coded for it, so I don't know, but I got the impression that compatibility is often broken between releases. OpenGL seems (again, this is just my uninformed impression) to be rather stable, favoring extensions over completely changing things. Given these things, I find your argument that, with DirectX, you have to only keep up with one API hard to follow. To reiterate, I don't think it's one API, and I don't think it's easier to keep up with than its competing APIs.

    --
    Please correct me if I got my facts wrong.
  13. Re:OpenGL and the rant about marketing by chentiangemalc · · Score: 3, Interesting

    Microsoft is not stopping any one from creating competitors to DirectX. Just nobody has created something of the same caliber - you're free to create something with more power, better documentation, more flexibility then directX. OpenGL has failed to so far, that's not Microsoft's fault. Use DirectX in your development and with less effort realism is added into games, less effort for sounds etc, and there are plenty of examples and very high quality documentation. (openGL documentation doesn't come close) It's not Microsoft's fault nobody else has created something better ...

  14. Re:OpenGL and the rant about marketing by Spiked_Three · · Score: 4, Interesting

    Not bogus at. I am working on a project at this very moment that started in DirectX. Sat on the shelf for a number of years, and when I decided to start it up again, made the switch to openGL. I wished I had not.
    1) openGL documentation sucks at best. Examples are all of the same beginner draw a triangle type.
    2) Not only does directX provide more than just graphics, even within the graphics space it provides a lot more grunt code I have to do myself in openGL.
    3) I use managed languages. I am not developing a game, I am developing business software (CAD/CAM related). Both openGL and DirectX currently suck in this respect. At least directX has XNA for games. OpenGL has no native (managed) Windows forms or WPF implementations. If I was developing a game, XNA is the easy choice. But since I am developing a business app, I live with stale dead third party libraries (TAO in this case).
    4) Very relevant - for whatever reason, mind share is currently on DirectX - and from a community support perspective that is huge.
    5) I was able to be productive in directX 8 (where I started) enormously faster than openGL. Even now, I end up converting directX code to openGL most of the time, as opposed to finding openGL code that shows what I am trying to accomplish.

    Like I said, I wished I would have stayed with DirectX. If and when this project gets completed I will never use openGL again unless they provide better managed language support , better documentation and better built in functionality. I get tired of passing in integer values to set parameters. When I want to set a light color I want to call SetLightColor(Color), not setSomeParamater(12, 15); It makes for unreadable and unmaintainable code. I know, there are those who still think C is great, and they write some of the ugliest code on the planet, let them collect in the a little tiny small group for all I care.

    --
    slashdot troll = you make a compelling argument I do not like the implications of.
  15. SDL 2.0? by Zombie+Ryushu · · Score: 3, Interesting

    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?

  16. Re:OpenGL and the rant about marketing by Prune · · Score: 4, Interesting

    SDL has a number of problems and we've dropped it from our projects. It is definitely not performance oriented; for example, calls to WaitForSingleObject in the Windows port even when it can be determined that no blocking is necessary, and thus wasting 4000 cycles on a kernel call instead of 200 on an interlocked instruction. That's just one random example that came up when we were troubleshooting performance. Note that I'm not at all ranting against using other libraries, and I'm generally sour to DirectX. It's just that SDL is a mediocre example for anything other than input handling. For threading, pthreads works great for both Linux and Windows (the Windows port is much better optimized than SDL threads), or even better yet from a software engineering perspective, boost threads can be used. In a high performance optimized to a given engine architecture, a custom thread library with custom task scheduling etc. is the real choice, and would written at a lower level than these libraries, with OS primitives and interlocked instructions. With networking, there is a huge amount of libraries out there that are optimized for various tasks better than SDL Net, and for sound OpenAL is the obvious choice (using libavcodec/ffmpeg for decoding).

    --
    "Politicians and diapers must be changed often, and for the same reason."