OpenGL versus DirextX

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • OpenGL versus DirextX

      Hi,

      Which is better, OpenGL or DirectX?

      This is obviously an open-ended question and usually
      generates a bunch of answers that either don't have a
      clear and definitive answer or the answer is biased in
      some way to personal preference; neither help.
      I also realize my question has the "Well, depends on..."
      answer which again doesn't generally help, but may be
      unavoidable.

      So, here is what I would like to see answered:

      1) What are the advantages and disadvantages to both?

      2) When should you consider using OpenGL versus
      DirectX?

      3) For 'high profile' games such as "Half-life", "Battlefield
      1942", "Unreal Tournament", etc, which library is used?
      (This may be a hard question to answer)

      4) ??

      I need some "methodology" for picking either OpenGL or
      DirectX when developing a game.

      Thank you,

      Sabrina.


      Sorry admin, I just realized this post was placed in the
      wrong thread after I made the post. Please feel free to
      move, and I will be more carefull in the furture.

      The post was edited 1 time, last by Sabrina ().

    • RE: OpenGL versus DirextX

      It should be noted that sometimes DirectX vs. OpenGL has a winner when it comes to specific video cards, and even different driivers. So, on your own machine you may notice one outperforming the other, but it could be the card, it could be the drivers, it could be other things. And of course, it could be the code.
      -Larrik Jaerico

      www.LarrikJ.com
    • RE: OpenGL versus DirextX

      Hi,

      Thanks for the feedback. I realize that my question
      seems noobish at best, but I have been thinking about
      which library will provide 1) faster development time, 2)
      better video and driver support, 3) portability, 4) better
      versatility, 5) better 'blah'.

      After reviewing the posted comments, I am left with the
      thought that whatever library you choose just make sure
      you "cover all the bases", that is make it portable, and
      make sure that its compatible with the users video cards
      and drivers, as Quince alPillan and Larrik pointed out.

      I guess as I sit here writing this post I am left with the
      thought of disappointment or frustration. Not because of
      the comments, but because I guess I was hoping that
      someone would say "Go with ___library, it will solve all
      your problems." or "The ___ Library will support all your
      needs." but I should know better than to expect such a
      response. :)


      Since I dont know a thing about DirectX (I just downloaded the SDK and I'm TRYING to figure it out)
      I thought I would post my question on development
      using either/both of these libraries and get some insight
      on which library offers "the best" functionality.
      Oh well, so much for hopfull thinking.

      Thanks again for the thoughts and giving me some things
      to think about.

      Sabrina
    • RE: OpenGL versus DirextX

      Um, get a book. Reading through the API isn't going to get you where you want to be. Maybe Mike's book can help you enough, but if you find yourself wasting time looking stuff up on Google and not really understanding the answers, get a book. I have no recommendations, though I know that LaMothe's "Tricks of the 3d Game Programming Gurus" teaches you how to write an engine from scratch, and that may help (or be overkill). I haven't read it yet, though. (It's on my list).

      Mike has some recommendations in the book. Some are pricey (like Graphics Gems)
      -Larrik Jaerico

      www.LarrikJ.com
    • Both OpenGL and Direct3D are equally suitable for handling graphics rendering. A lot of it boils down to personal preference. I prefer the more procedural-based manner that OpenGL uses to get things done. Also it's supported on MacOS X and Linux systems, and since I wanted portability, that made the choice of API relatively simple.

      Go through some tutorial sites and sample code, get a feel for both, then choose one and stick with it. You can always go back and learn the other at a later time if you want.
    • If you asked this question about 4 or 5 years ago, I suspect that most people would say OpenGL was hands down better than Direct3D. But fast forward to today's Direct3D 9.0c and OpenGL 1.5 / 2.0 the differences between the 2 3D APIs is growing smaller and smaller. If anything they are more similar than they are different. With the advent of GPUs and the ability to write high level shader language programs for these GPUs the differences between OpenGL and Direct3D has become irrelevant IMHO.

      Both OpenGL and Direct3D today offer basically the same features 3D wise. The issue of which one is faster really comes down to the drivers and how the IHVs implement them. OpenGL drivers have always been more difficult to write because OpenGL drivers are monalithic - in that you have to support the entire OpenGL pipeline. Direct3D drivers follows a layered approach where by only the hardware accelerated portions of Direct3D need to be written.

      Go with OpenGL if cross platform compatibility is important to you (i.e., Linux, Mac, Windows, etc). Go with Direct3D if you're only targetting Windows and XBox. However most good engines will abstract its rendering subsystems in such a way that it will support both APIs.

      At the end of the day it really comes down to which one you like better. I'd suggest learning both and then going with the one you like better :D
    • Naw, Tricks is about how to write a software 3d engine from scratch!

      Other books in his Game Development series are better suited - like The Zen of Direct3D Game Programming to start. Unfortunately it's DX8, but it gets you up and running with DirectX's syntax and usage. After that you can start looking at the differences between DX8 and DX9.

      Rich
      "Your job is not to die for your country. Your job is to make some other poor sod die for his."
    • It's pointless to ask whether openGL or DirectX is better. openGL is just what its name implies: a 2D/3D graphics library. DirectX on the other hand is a windows-platform specific multimedia library: DirectAudio, DirectVideo, DirectMusic, DirectDraw, DirectBuzzword.

      You'd need to compare a set of libraries with DX. But, if you compare instead SDL (Simple DirectMedia Layer), a cross-platform multimedia library, with DirectX, then you'll get a much more interesting discussion. Read mrmike's book on the pitfalls and benefits of DirectX and ask yourself if you need/want cross-platform compatability.

      Designing your game in a library-independent way is hard. It adds to the already humongous level of complexity another level of filth and dirt and programmer hours.

      I doubt professional game developers even think of the possibility of porting their games or having platform-independence in mind. The audience is just too small, except if you develop hardcore games.

      Of course, anyone is welcomed to prove me wrong. I know that games are ported to unix platforms (see Loki Games, RIP), but almost never directly developed for. Here's a nice question for mrmike: How would you see cross-platform (i.e. Mac, Lunix) game development in the near/far future? When will we hit the sweet spot where cross-platform development is economically feasible?
      Brits: Shop at home and have goods imported because they live on an island.
      Aussies: Shop at home and have goods imported because they live on an island.
      Americans: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
      Canadians: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
    • Well, Blizzard always co-develops for the Mac, which looks like it is about to get a LOT easier, since Apple is switching to Intel.

      UNIX users tend to be savvy enough to do the porting FOR you, which is probably why most companies don't bother.
      -Larrik Jaerico

      www.LarrikJ.com
    • Not useful, but highly educational....

      And it's interesting how fast this can run in this day and age. Quake 1 was all software and they added Glide support at the end - see Mike Abrash's "Graphics Programming Black Book" for details.

      And Sledge is especially on the money in the statement that you need to look at Simple Directmedia Layer vs DirectX because it's a more complete comparison. I haven't looked at SDL much, personally, and I probably should....
      "Your job is not to die for your country. Your job is to make some other poor sod die for his."
    • Starting DirextX

      Ok. I am attempting to learn DirectX as we speak. I currently have the following books:
      -Programming Role Playing Games w/ DirectX (@nd Edition) by Jim Adams
      -Tips and Tricks of the Game Programming Gurus (2nd Edition) by Andre Lamothe
      -Tips and Tricks of the 3D Game Programming Gurus by Andre Lamothe
      -Game Coding Complete (2nd Edition) by the one Mr Mike.

      The best book i've found for starting DirectX so far is Programming Role Playing Games with DirectX. It has very good programs, good explanation, and even though it says RPGs it really wont get into that untill half way through the book. Negatives of the book, the writing is kind-of dry. A few attempts at humor every now and then, but thats about it. It's very informative, just not as intresting of a read as Mr. Mikes book or Andre Lamoth.

      I reccomend you check out gamedev.net. There is a section there for starting with DirectX, a list of books, and lots of discreptions and reviews on books there. It's a good place to start.

      Any questions, let me know. I'll see if i can help with what i have so far.
      Wort wort wort.