Why DirectX ? ( Discussion )

Started by
56 comments, last by Facehat 15 years, 9 months ago
Nowadays everybody knows that DirectX and OpenGL are the same in functionality as everything is going to be based on shaders and we can get the same performance with both of them. I’m a DirectX developer and you assume that we are going to develop games for "windows" at the moment with DirectX, but we face many OpenGL developers try to change your idea about using DirectX in this situation with some questions like below: 1) "DirectX is specific to Microsoft platforms but OpenGL is cross-platform, and they have the same functionality, so why don't you learn OpenGL which let you port your game to other platforms like Linux/Mac in the feature easier and without extra effort and even let you develop cross-platform 3D Apps instead of games if you like ?" 2) "Each version of DirectX breaks compatibility with the previous version and you always need a new compatible graphic card, but for OpenGL there are Extensions." 3) You say: 'Microsoft's Support'. What are serious supports of Microsoft for DirectX that OpenGL doesn't have?" 4) "And finally, what are advantages of DirectX rather than OpenGL to develop PC games? (Let us forget about Xbox 360) or vice versa, the weaknesses of OpenGL in this situation?" regardless of all my knowledge, I did not have enough answers to convince them why I’m using DirectX... Note that it is NOT a DirectX vs OpenGL question, and Please discuss about above questions. Thanks in advance [Edited by - Nima on July 4, 2008 3:40:17 AM]
Advertisement
It is my belief (though it may be wrong) that DirectX is more closely at the edge of current hardware. MS works closely with video card vendors to standardize the next generation of the API. OpenGL always seems to lag behind, using all those extensions that seem to say "well, it's not really part of OpenGL, but we'll support it if you jumps through these hoops".

DirectX just seems cleaner, more solid, thought-out. To me, at least.
Million-to-one chances occur nine times out of ten!
Quote:Original post by Nima
1) "DirectX is specific to Microsoft platforms but OpenGL is cross-platform, and they have the same functionality,
so why don't you learn OpenGL which let you port your game to other platforms like Linux/Mac in the feature easier and without extra effort and even let you develop cross-platform 3D Apps instead of games if you like ?"
Writing software to run on non-Windows platforms involves a lot more change than just changing graphics API. There aren't that many people who write cross-platform games, so this isn't usually much of an issue.

Quote:Original post by Nima
2) "Each version of DirectX breaks compatibility with the previous version and you always need a new compatible graphic card, but for OpenGL there are Extensions."
Just because a new version of the API comes out, it doesn't mean that your existing code won't work. Nobody is forcing you to upgrade. You can still compile and run DirectX 6 code if you want to (Provided you still have the SDK kicking around).

Quote:Original post by Nima
3) You say: 'Microsoft's Support'.
What are serious supports of Microsoft for DirectX that OpenGL doesn't have?"
I don't understand what you mean by this. Microsoft doesn't provide any more support for DirectX than OpenGL.

Quote:Original post by Nima
4) "And finally, what are advantages of DirectX rather than OpenGL to develop PC games? (Let us forget about Xbox 360) or vice versa, the weaknesses of OpenGL in this situation?"
If you want to develop for the Xbox 360, the API is apparently similar (But not identical to) Direct3D. Knowing Direct3D will help a lot here. As far as I know, OpenGL isn't supported at all on the 360.

Quote:Original post by Nima
regardless of all my knowledge, I did not have enough answers to convince them why I’m using DirectX...

Note that it is NOT a DirectX vs OpenGL question, and Please discuss about above questions.

Thanks in advance
Nitpick: It's Direct3D. DirectX does a lot more than just graphics, whereas OpenGL just handles graphics rendering.

The reason I prefer Direct3D is that that it's more object orientated, there's only one global function to create a Direct3D interface, and then the utility functions. Which is another reason I prefer D3D - with the SDK you get a full optimised math library, and no end of utility classes for things like rendering sprites and text, loading textures and loading models. All of that code needs written yourself (Or you need to use another library or libraries) for OpenGL.
Finally, I've never really had any reason to learn OpenGL. I've done very little OpenGL code, not much more than a spinning cube in immediate mode. It's still on my "Things to learn" list, but it's just not high priority. I suppose there's a lot of OpenGL users who feel the same about Direct3D though...
1)
I try to make all my games run on Linux/Mac/PC and by using OpenGL, there's very little code I have to alter to make it work. I'm an avid Linux user and if every game developer used OpenGL, most games would run on Linux just fine. I just don't understand why the game industry is so dominated by Direct3D at the moment. Ok, the Direct3D API might be a little bit cleaner, though that's just a matter of personal opinion, but cross-platform operation is just such a big plus that I wouldn't even think about using Direct3D for my games.

2)
New versions come and go, it's part of the software business. Personally, I could live with this.

I always thought OpenGL was more on the cutting edge of hardware possibilities. I think you could use geometry shaders through extensions before DX10 arrived.

3)
Microsoft supports gaming companies with a bag of money. How else would you explain it's market dominance in the industry when OpenGL offers about the same level of capabilities?

4)
Support for the 360 is a very good thing for game developers I guess. It's quite a popular platform. If you're not planning to develop for this system though, I see no reason to go for Direct3D.

Jeroen
Quote:Original post by godmodder
3)
Microsoft supports gaming companies with a bag of money. How else would you explain it's market dominance in the industry when OpenGL offers about the same level of capabilities?
As far as I know, Microsoft doesn't provide any sort of incentive to use D3D. The reason it's being used at the moment is probably because it's easier to get a high-performance engine up and running quickly with D3D (Due to the utility classes D3DX provides, although this is partially just my opinion), and many games use existing engines which already use D3D.

Quote:Original post by godmodder
4)
Support for the 360 is a very good thing for game developers I guess. It's quite a popular platform. If you're not planning to develop for this system though, I see no reason to go for Direct3D.
It's personal preference more than anything else. I have no intention of transitioning to using OpenGL over D3D, almost entirely because I prefer the layout of the API. And the reasons I mentioned above (Helper classes, etc).
Quote:The reason it's being used at the moment is probably because it's easier to get a high-performance engine up and running quickly with D3D (Due to the utility classes D3DX provides, although this is partially just my opinion).


I think this is the reason I use OpenGL. I'm a hobby programmer, so I want to learn all the details and I don't want to use built-in math libraries and such ;)
Ofcourse in a professional environment it could boost productivity by alot. But then again, the people who are professionals know (or at least are supposed to know) all the details about math and such, so they wouldn't have much trouble programming their own library.

I noticed alot of people are afraid to use OpenGL, because of the lack of a math library. This is why I made the PSSM demo in OpenGL for example. Everybody was already doing it in Direct3D, but the code wasn't showing all the mathematical details that well because of the high-level math functions in DX.

Jeroen
Quote:Original post by Nima
Nowadays everybody knows that DirectX and OpenGL are the same in functionality as everything is going to be based on shaders and we can get the same performance with both of them.


While you can use Shader Model 4.0 with OpenGL (even on Windows XP), you won't get virtualized video memory without DirectX 10 + Vista.

Quote:Original post by Nima
2) "Each version of DirectX breaks compatibility with the previous version and you always need a new compatible graphic card, but for OpenGL there are Extensions."


I think these are just two approaches resulting in the same. When a new generation of graphics cards with new features emerges, OpenGL adds extensions and Microsoft rolls out an updated API.

If you require the new extensions, you loose compatibility to older cards with OpenGL. If you use the new API, you loose backwards compatibility to older cards with DirectX.

- OpenGL portability really is a killer feature.

- Other than that, I prefer DirectX. In my eyes, the OpenGL extensions (especially if you consider there being vendor specific ones) are a mess, the API isn't very concise and quite error prone.

- If you target DirectX 10, you have a certain guaranteed feature set. Any card that claims to do DirectX 10 is requires to support this feature set. That makes consistency across a large number of systems very simple. Not so if OpenGL rules things, we'd have another bazillion extensions some would support and others won't.

[Edited by - Cygon on July 3, 2008 6:56:38 AM]
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
Quote:Original post by godmodder
I think this is the reason I use OpenGL. I'm a hobby programmer, so I want to learn all the details and I don't want to use built-in math libraries and such ;)
Ofcourse in a professional environment it could boost productivity by alot. But then again, the people who are professionals know (or at least are supposed to know) all the details about math and such, so they wouldn't have much trouble programming their own library.


Very few people know how to properly optimize code these days (quite a lot think they do, though). That holds true in the professional environment as well. At most, I would customize an existing (proven to be fast and correct) math library and be happy as long as I gives the correct results.

Quote:Original post by godmodder
I noticed alot of people are afraid to use OpenGL, because of the lack of a math library. This is why I made the PSSM demo in OpenGL for example. Everybody was already doing it in Direct3D, but the code wasn't showing all the mathematical details that well because of the high-level math functions in DX.


I think I don't quite get it, sorry. From what I could see, D3DX only provides a low-level math library (vectors, matrices, quaternions). If I wanted to understand how some algorithm works, I'd be happy to see a call to D3DXMatrixMultiply() instead of someone doing matrix multiplication right by hand. And ther are so many free math libraries out there that I wouldn't even consider D3DX an argument in API choice.

Probably I'm just misunderstanding what you're trying to say, so please clarify ;)
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
Quote:Original post by Nima
Nowadays everybody knows that DirectX and OpenGL are the same in functionality as everything is going to be based on shaders and we can get the same performance with both of them.

I think you meant to say Direct3D and OpenGL. OpenGL does not offer the same functionality as DirectX.

Edit: apparently Steve already pointed this out, although I think the difference is too significant to call it a nitpick. [smile]

Quote:Original post by Nima
1) "DirectX is specific to Microsoft platforms but OpenGL is cross-platform, and they have the same functionality,
so why don't you learn OpenGL which let you port your game to other platforms like Linux/Mac in the feature easier and without extra effort and even let you develop cross-platform 3D Apps instead of games if you like ?"

Although it's mostly used for games, Direct3D can just as well be used for other applications. Also, this argument might as well be used to advocate the use of a cross platform game or rendering engine instead of a certain API. If supporting multiple platforms is so important, this will make things even easier.
Wow. So much misinformation about D3D in the first post.

D3D doesn't require new hardware unless you want to use newer features. This is no different than new OpenGL extensions. It's up to the programmer to code in a fallback path if those features don't exist.

I don't care about Mac and Linux. Doesn't bother me that my stuff doesn't run there. I don't own a mac and I never will, and I'll probably never install another Linux distro again, because it's useless to me as a desktop OS. So what is so bad about being locked to windows? Also, the flavor of DX that I have been using lately also works on the Zune and the 360.

Personally, I stopped using OpenGL because I got fed up with it. It falls short in many areas.

Support is horrible. It's so hard for me to give one of my OpenGL programs to my casual friends and just let them run it. They always have no idea what OpenGL is, or what version they have. Trying to get all the info from them to try and find out what they need to DL to get to new GL drivers can be a real pain. DX works out of the box. And if not, it's fixed with a simple redist exe.

Extensions are a mess. Who wants to use some new experimental extension when it's just going to have it's name changed at a later date, and fail to load in your code, when it's not found? How many of your users will even have support for it anyways? I actually own games that give me errors for old extensions that aren't found. [rolleyes] I don't understand why GL just can't include the GLEE functionality directly in the library themselves. They rely on their userbase for everything.

I only learned OpenGL first as a convenience. I knew C more than C++ at the time, there was the nehe site, which was easy to follow along with, and I was using either DevC++, MingWStudio, or something else over GCC, which was a pain to compile any DX stuff with.

Besides, the 2 APIs exist for 2 reasons. OpenGL is a generic graphics language which tries to be all things to all people. DirectX was born when Win95 came out, and game developers needed direct access to the hardware. It is made to make games that run fast on the windows platform. It's not trying to be OpenGL, hell, OpenGL wasn't even an issue. Game programmers were having you drop to DOS to run their games because of the hardware access.

Any version of Direct3D is about getting the fastest graphics performance on the current generations of windows. So yes, the API changes, but for the better, because the platform has changed over time. The old API is included, but the new version will shed anything it doesn't need. Direct3D doesn't try to be the everything for everyone like OpenGL does. It's part of DX, which is a product to make Windows Games.

There is no reason not to use DX, and there is no reason not to use OpenGL. Use whichever one you know, and whichever one suits your needs. If you are on a forum full of people bsing you about DX, I advise you to find a better community to post on, because those people are unable to give you an unbiased answer, and simply want to push their own agenda.

If multi-platform isn't an issue for you, than just don't worry about it.

This topic is closed to new replies.

Advertisement