OpenGL Or DirectX

Discussion in 'Game Development (Technical)' started by ProgrammingFreak, Feb 23, 2006.

  1. vjvj

    Indie Author

    Joined:
    Sep 25, 2004
    Messages:
    1,732
    Likes Received:
    0
    DX8 is when I finally said "Wow, this is really good!". They finally ripped out all the DDraw crap and made several important additions to the API. DX9 is even better.

    DX10 is shaping up to be really good; much more orthogonality, and stream out has some cool potential. I'm still kinda meh on their geometry shader implementation however.

    Anyway (I'm rambling), you could probably drop down to DX7 and still be pretty happy, although IIRC every dist of XP has DX8 installed by default. My last project was DX8, and no one reported any DirectX problems (caveat: we retained a software rendering mode option... I have no idea how many people are using it). And switching from OpenGL should be pretty easy for you... Probably easier than switching to GL from DX (many operations are more explicit, there are less "crap, what texture is bound right now?" situations).
     
  2. Sharpfish

    Original Member

    Joined:
    Feb 25, 2005
    Messages:
    1,309
    Likes Received:
    0

    Yeah, DirectX8(.1) was the one. DX9 is similar (I started off with DX9 before I realised it was too high a requirment - converting to 8 was just a few call changes here and there). DX8 is my sweet spot for productivity, features and end user availability (XP standard). However there are things that d3d8 didn't do as well as it should, and these were rectified in dx9 (DX9 is probably the "best" but out of reach for our market) improvements here and there (some speed boosts too) and some syntax clean up.

    Before I started to write a wrapped rendering engine in DX9.0c (my first mistake) I had messed around with DX7 (Direct Draw not 3D) which worked ok and wasn't too hard - but was imo more convoluted, having to set up clippers, surfaces etc, using 3D for 2D in DX8+ is almost trivial by comparision and you get the extra 3D features "for free".

    Having said this, I need to brush up on Open GL sometime soon as I think we should never just restrict our knowledge to one api (Especially when it's single platform).
     
  3. princec

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    4,873
    Likes Received:
    0
    A quick note on the quality of OpenGL drivers and crashing:

    There are two kinds of OpenGL drivers: ones that NVidia and ATI make, and the rest. Fortunately for us, most computers have NVidia and ATI chipsets in them, and fortunately for us, there are almost no problems with NVidia or ATI drivers - they either work or they don't, and usually the only time they don't work is when you use crazy new features like shaders.

    The rest of the vendors do a fairly patchy job of supporting drivers but mostly they work perfectly fine and are at least as good as DirectX drivers - just loads easier to debug and code. Because OpenGL operates in userland instead of kernel mode, crashes are usually far less drastic and easier to sift through, if they even happen at all (it's pretty difficult to crash a GL driver with a bluescreen).

    There are no issues on MacOS whatsoever.

    So enough of the comments about fragility! By comparison, about half the DirectX based games you guys punt in these forums don't work on most of my computers (and not at all on my Mac, hehe); but I've never ever ever had any issue at all ever with the OpenGL ones. Same went even for Half-Life when it first came out...

    My £2.

    Cas :)
     
  4. ProgrammingFreak

    Original Member

    Joined:
    Oct 22, 2005
    Messages:
    126
    Likes Received:
    0
    Well I am more into the cross-platform stuff, so I'll will stick openGL
     
  5. Sybixsus

    Original Member

    Joined:
    Aug 2, 2004
    Messages:
    959
    Likes Received:
    0
    Well if all the customers I was aiming for were game developers who work solely with OpenGL, I'd very relaxed about an OpenGL game working for them. Unfortunately, they're not ;)
     
  6. Fabio

    Original Member

    Joined:
    Sep 30, 2005
    Messages:
    499
    Likes Received:
    0
    I think most issues can be avoided with careful gl code. For example, I've read on a website that to know if a feature was supported or not, you should check the GL_VERSION string against e.g. "1.3". Even assuming proper string compare, this will fail for example on my notebook that has lousy 1.2 gl drivers but reports "2.0.5". It was just one example, I could do many others. With carefully designed code, error checking, etc.. I think gl code can be extremely reliable. Always be paranoid with possible errors/trouble.. most tutorials are not (notably NeHe), and unfortunately teach bad habits.
     
  7. Savant

    Original Member

    Joined:
    Feb 8, 2005
    Messages:
    1,674
    Likes Received:
    0
    For people who are still scared of OpenGL - did you miss the massive success of Atlantis and Fairies? Both hardware accelerated only, OpenGL, portal games.

    It's a non-issue these days.
     
  8. 1EyedJack

    Original Member

    Joined:
    Feb 14, 2005
    Messages:
    43
    Likes Received:
    0
    Well, Emmanuel said this about Fairies/Atlantis in another thread:

     
  9. Savant

    Original Member

    Joined:
    Feb 8, 2005
    Messages:
    1,674
    Likes Received:
    0
    Oh sorry, I must have missed that.
     
  10. soniCron

    Indie Author

    Joined:
    May 4, 2005
    Messages:
    3,664
    Likes Received:
    0
    Even so, if you're losing only 10% of your players because of broken drivers, you're also losing 10% of your money! :) There's no reason not to try and support as many players as possible, especially if it's as simple as supporting DirectX instead of OpenGL. Of course, if you actually (not "eventually") intend to release a Mac version, then those Mac sales could very well make up the difference. So it's certainly a decision to think about. ;)
     
  11. ProgrammingFreak

    Original Member

    Joined:
    Oct 22, 2005
    Messages:
    126
    Likes Received:
    0
    So It is a hard decision to decide weather to use DX or OpenGL, well I guess I could make a DX and GL version, but that would take a lot of work
     
  12. vjvj

    Indie Author

    Joined:
    Sep 25, 2004
    Messages:
    1,732
    Likes Received:
    0
    As Cas said, NVIDIA and ATI GL drivers are fine for the most part.

    What I'm most worried about are the Intel integrated parts. They have a sizeable userbase, and have a nasty habit of claiming feature "support" when it is usually too slow to be playable or flat out doesn't work. On Meridian we had to declare Intel Extreme 8xx cards unsupported because the FREAKING DIRECTX DRIVERS DIDN'T WORK. And here we are worried about OpenGL!

    Supposedly Intel's 9xx parts are much improved. I guess I'll find out soon enough. I'm still not afraid to write off Intel entirely again ;)

    One major disclaimer here of course is that my game is not strictly casual. If I was doing a Popcap-esque game, I'd probably just use their framework and be happy.
     
  13. princec

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    4,873
    Likes Received:
    0
    Ah ah ah soniCron, naughty naughty, bandying random figures around without facts... my magic logs tell me that the number of people with broken drivers is so vanishly small as to be irrelevant.

    Cas :)
     
  14. soniCron

    Indie Author

    Joined:
    May 4, 2005
    Messages:
    3,664
    Likes Received:
    0
    Hey, I just said if you're losing 10%. ;) But, yes, some real figures would be helful.
     
  15. ProgrammingFreak

    Original Member

    Joined:
    Oct 22, 2005
    Messages:
    126
    Likes Received:
    0
    Its just best to go with what you want to use
     
  16. DarkCore

    Original Member

    Joined:
    Feb 26, 2006
    Messages:
    27
    Likes Received:
    0
    OpenGL over DirectX

    It all depends what you are coding on and what system your game is going to released on. If you are coding/releasing a game on Linux then your only choice is OpenGL. If it is on Windows you have a choice of both. If you want something easy to learn I recommend OpenGL if you want something powerful and something that has great graphics choose DirectX. It really depends on what you are coding on and how you want your game to look.
     
  17. ProgrammingFreak

    Original Member

    Joined:
    Oct 22, 2005
    Messages:
    126
    Likes Received:
    0
    I want easy and cross-platform, so opengl
     
  18. Fabio

    Original Member

    Joined:
    Sep 30, 2005
    Messages:
    499
    Likes Received:
    0
    I've just noticed that an Intel 845G integrated board claims OpenGL 1.3 compatibility but lacks some 1.2 features!
    First of all, you should always follow the longest path when you do features checking or error checking: for the former, it means NEVER assume anything the easy way, for example by the GL_VERSION string (my notebook, which is 1.2 compliant at best, says 2.0.5.. better than my desktop's GeForce 6800!).
    Secondly, be safe and not only check the GL_EXTENSIONS string, but also check the functions entrypoints to be valid, you never know. Never ever assume an extension is present just because, overall, driver declares to be 1.x compliant.
    Last but not least, add a benchmark in your game: for example, GeForce2 cards do support the GL_ARB_texture_border_clamp extension BUT it is slow like a turtle (supposedly software emulated). IMHO it would have been maybe better if NVidia didn't add this extension at all in those cards. But, why not, (actually I esteem NVidia and adding a feature, even emulated, is not bad per se) it's even more "good programming" if you make a small benchmark in your game to see if a feature is truly *usable* or not.
    Finally, when I detect that the driver is not hw accelerated, I disable texture filtering and even mipmapping. This way, expecially at lower res, I still get excellent frame rate. I also disable GL_EDGE and use only GL_REPEAT (vastly quicker in GDI emulation driver, guess what, a result of benchmarking?).

    Said that, my 2 cents worth is coming: while I don't think that cross-platform must be a valid reason to go with OpenGL (for other I/O subsystems you're already used to write one version for each host OS/hardware anyway), I think that OpenGL is vastly better than DirectX ( >=8 included ). And with carefully written code, you can get great compatibility in my experience. In the worst case you can say "Please, install some real drivers!" and then offer an ultra smooth, but low-res, display. So the user still sees and enjoys the game, but gets a real incentive to install real drivers.

    Dump Microsoft as much as you can.. otherwise you're contributing to pollution and death of this world. ;)

    AVOID anything that is PROPRIETARY, anything that smells corporation. It's for your and our own good.

     
    #38 Fabio, Mar 1, 2006
    Last edited: Mar 1, 2006
  19. Fabio

    Original Member

    Joined:
    Sep 30, 2005
    Messages:
    499
    Likes Received:
    0
    And, by the way, Intel is part of the OpenGL committee!! Unforgivable.. like that one of the other members is Microsoft, that boycotts it all the time.

    The original members of the ARB were Digital Equipment Corporation, International Business Machines, Intel, Microsoft, and Silicon Graphics. Like to say that you got the enemy in your family. The black sheep. :D But when talking about veryveryverysmallsoft, I'd rather figure it as "the cancer inside your body".

    Anyway..

     
  20. mr n00b

    Original Member

    Joined:
    Sep 9, 2005
    Messages:
    40
    Likes Received:
    0
    Then I suggest you don't support the windows platform at all but release your games exclusively for Mac and Linux...

    (I'm so tired of this anti-microsoft nonsense)

    /mr n00b
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer