CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Join Date
    May 2009
    Posts
    2,413

    OpenGl vs. Direct3D

    Now lets be civilised, I know this cat has been skinned before. The issue is fully analyzed right? Well, I thought so too until I happened upon this article,

    http://www.tomshardware.com/reviews/...ectx,2019.html

    This article assigns victory to Direct3D flat out. It has won over OpenGL. OpenGL is hopelessly behind and will stay there.

    I know OpenGL is lagging and that Microsoft is calling the shots forcing OpenGL to move. But OpenGL still has one advantage, the portability.

    The question I'm asking is this: How much is portability worth? Is portability really such a great quality in itself that you'd always seek it, even before a technically much better proprietary alternative, like Direct3D? Where do you draw the line?

    And maybe the article is a lie. OpenGL will soon catch up with Direct3D and then surpass it in functionality and speed. How likely is that?
    Last edited by nuzzle; June 8th, 2009 at 05:30 PM.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: OpenGl vs. Direct3D

    I was on the OpenGL forums when the announcement of OGL3 finally came. It was a huge let down for all concerned, especially those of us who had been trying to use OpenGL + Cg for GPGPU programming.

    Frankly I'm not surprised by this. OpenGL 3 as it was meant to be was really the last chance to catch up. For a while there was talk about "3.1" being what 3 should have been, but I haven't been following that at all.

    Let's face it: OpenGL is a state machine in an object-oriented world. It needed to evolve to survive and that's been slow to happen.

    Now, there may still be hope for OpenCL. That's where my interest lies at the moment.

    As far as the importance of portability? Extremely. I grew up on Macs, so I understand the frustration with incompatibility. Unless there's a really good reason not to, I always choose the portable solution.

    It may be, however, that the future lies in implementing a D3D clone for other systems rather than in OpenGL itself taking the banner.
    Last edited by Lindley; June 8th, 2009 at 05:37 PM.

  3. #3
    Join Date
    May 2009
    Posts
    2,413

    Re: OpenGl vs. Direct3D

    Quote Originally Posted by Lindley View Post
    It may be, however, that the future lies in implementing a D3D clone for other systems rather than in OpenGL itself taking the banner.
    Thank you.

    Well, I'm in turmoil. I would rather go with OpenGL because of the portability, but at the same time Direct3D seems like a so much better option that the portability aspect dwindles.

    OpenCL is not directly connected to OpenGL (because it's a new standard recently intitiated by Apple) but still, it's indirectly assuming a good future for OpenGL because these standards are expected to work together.

    So one is back to the crucial point: What to do with OpenGL? Is the portability really worth being maybe 5 years behind the abilities offered by Direct3D?

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: OpenGl vs. Direct3D

    I don't think the abilities are the problem. It can do everything D3D can do. It's just a fairly clumsy interface sometimes, and it helps to have shader support from something like Cg rather than trying to use GLSL directly.

  5. #5
    Join Date
    May 2009
    Posts
    2,413

    Re: OpenGl vs. Direct3D

    Quote Originally Posted by Lindley View Post
    I don't think the abilities are the problem. It can do everything D3D can do. It's just a fairly clumsy interface sometimes, and it helps to have shader support from something like Cg rather than trying to use GLSL directly.
    The article I quoted suggests you cannot do in OpenGL 3 what you can do in Direct3D 11.
    Last edited by nuzzle; June 8th, 2009 at 06:40 PM.

  6. #6
    Join Date
    May 2007
    Posts
    811

    Re: OpenGl vs. Direct3D

    Quote Originally Posted by nuzzle View Post
    The article I quoted suggests you cannot do in OpenGL 3 what you can do in Direct3D 11.
    Yes, but that never stops graphics vendors from exposing additional extensions. And bottom line is that it really does not matter which API you are going to use, it only matters what makes sense for specific situation.

  7. #7
    Join Date
    May 2009
    Posts
    2,413

    Re: OpenGl vs. Direct3D

    Quote Originally Posted by STLDude View Post
    Yes, but that never stops graphics vendors from exposing additional extensions. And bottom line is that it really does not matter which API you are going to use, it only matters what makes sense for specific situation.
    You say it doesn't matter whether one uses Direct3D or OpenGL? Well the article I quoted suggests differently. It says you should use Direct3D.

  8. #8
    Join Date
    May 2007
    Posts
    811

    Re: OpenGl vs. Direct3D

    Do you believe in everything you read?

    I am speaking from experience, I have been working in game industry for the last 15 years and no it does not make a difference; besides the obvious one like portability, linux, windows or consoles. This arguments is so old and only people who argue this point are who never worked in related field or game hobby programmers.

    And at the end of the day, graphics calls to API (whether OpenGL or DX) are constitute very small portion of overall game code.

  9. #9
    Join Date
    Sep 2008
    Posts
    113

    Re: OpenGl vs. Direct3D

    Quote Originally Posted by STLDude View Post
    And at the end of the day, graphics calls to API (whether OpenGL or DX) are constitute very small portion of overall game code.
    That interests me. What does the majority of the code consist of?

    As for the importance of portability, I'd have to say it's extremely market. Especially with the popularity macs are gaining. But I wouldn't leave D3D out completely. It depends on what your aim or intended audience is. I imagine it depends on a lot of things, actually.

  10. #10
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: OpenGl vs. Direct3D

    Quote Originally Posted by nuzzle View Post
    You say it doesn't matter whether one uses Direct3D or OpenGL? Well the article I quoted suggests differently. It says you should use Direct3D.
    Using the core capabilities exclusively, that's correct. However, extensions cover the rest quite handily. And therein lies the fundamental philosophical difference between the two:

    Direct3D imposes requirements on hardware. If you don't have good enough hardware, you can't run a given D3D version. By the opposite token, you can't take advantage of any new hardware features that the current D3D version doesn't support. The advantage to developers is that they can aim for a fixed target, capability-wise.

    OpenGL allows one to simply use "as much as the hardware will allow". There's no requirements or restrictions---if the driver for your hardware exposes an extension, you can you use it. This both allows more flexibility in graphics card requirements, and (to a certain extent) imposes more workload on the programmer: Each extension feature they use, they must provide "fallbacks" to a less sophisticated alternative if it isn't available on the user's card. Plus, sometimes a feature is supported slightly differently on ATI vs NVIDIA. Sometimes these fallbacks may even include software paths as opposed to hardware. It's a moving target, but (theoretically) gives you an edge in support for the latest hardware over D3D versions that may be a year or more old.

    So OpenGL can do everything D3D can do, and maybe even a little bit more. It's just more clumsy at it in some cases.

    The big deal with OpenGL 3 was that it was supposed to provide a completely redesigned API which was much more object-centric; including factory-based logic which would make querying feature availability much more straightforward. This is what did not happen, and what everyone is so upset about. Instead, OGL 3 simply mainlined more extensions just like OGL 2 did. While this does reduce the need to provide vendor-specific support, it isn't the revolution everyone was hoping for. The difficulty with the old API is that while fast hardware paths are available, there are so many different ways to do a given task that isn't not always apparent which one is the fast path. OGL 3's new approach was supposed to make that much more readily apparent.
    Last edited by Lindley; June 8th, 2009 at 08:14 PM.

  11. #11
    Join Date
    May 2009
    Posts
    2,413

    Re: OpenGl vs. Direct3D

    Quote Originally Posted by STLDude View Post
    Do you believe in everything you read?

    I am speaking from experience, I have been working in game industry for the last 15 years and no it does not make a difference; besides the obvious one like portability, linux, windows or consoles. This arguments is so old and only people who argue this point are who never worked in related field or game hobby programmers.

    And at the end of the day, graphics calls to API (whether OpenGL or DX) are constitute very small portion of overall game code.
    So you've been working for 15 years and still cannot decide whether to go for OpenGL or Direct3D, is that right? Why can't you decide?

  12. #12
    Join Date
    May 2009
    Posts
    2,413

    Re: OpenGl vs. Direct3D

    Quote Originally Posted by Lindley View Post
    it isn't the revolution everyone was hoping for.
    Yes, that's what the article said.

    So what do you think about it?

  13. #13
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: OpenGl vs. Direct3D

    I think I'm not on any GPU-heavy projects right now. Next time I am I'll probably use CUDA rather than the OpenGL/Cg combo I did last time.

  14. #14
    Join Date
    May 2007
    Posts
    811

    Re: OpenGl vs. Direct3D

    Quote Originally Posted by nuzzle View Post
    So you've been working for 15 years and still cannot decide whether to go for OpenGL or Direct3D, is that right? Why can't you decide?
    If you are going to ask questions like this you should be better prepared or read all responses.

    My quote:
    And bottom line is that it really does not matter which API you are going to use, it only matters what makes sense for specific situation.
    This means that if I making game for PS3 or Wii I will use OpenGL variation, if I'm working on XBox/360 or PC, then I will use DX. Do you see the pattern here? It's not that we don't know which one to use, it is using appropriate one for specific situation. Please re-read this paragraph if you are still confused.

  15. #15
    Join Date
    May 2007
    Posts
    811

    Re: OpenGl vs. Direct3D

    Quote Originally Posted by Raislin View Post
    That interests me. What does the majority of the code consist of?

    As for the importance of portability, I'd have to say it's extremely market. Especially with the popularity macs are gaining. But I wouldn't leave D3D out completely. It depends on what your aim or intended audience is. I imagine it depends on a lot of things, actually.
    Physics, collision, input processing, game logic, AI, animation, network and various utilities functions. In almost all cases, the rendering code will be very much isolated from the rest of the source. This allows to swap rendering API without significant changes to core game, which comes very handy if you working on ports or making game to be cross platform.

    In many game studios/publisher we usually only care about various console systems and PC running some version of Windows OS. Linux or Mac ports are usually afterthought or in many cases we don't even bother.

    Again, we try to strive to write platform independent code as much as we can, and as I mentioned before most people in my profession do not care which one to use. If you know one graphics API, then learning any other is a cinch, same as with programming language, if you know one, you can learn second very quickly.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured