Why use D3D instead of OpenGL?

Started by
94 comments, last by Flimflam 18 years, 4 months ago
I think one of the main points that no one has mentioned yet when comparing DirectX (as opposed to D3D) with OpenGL is the fact that OpenGL is only a Graphics library whereas DirectX has support for sound, media and networking altogether in one API. Microsoft's madness with changing the interfaces between versions aside... the interfaces are at least similar in design within a given version of DirectX whether you are working in D3D or one of the other parts of DirectX. When you are working with OpenGL you need other libraries for sound and video and whatever else.... I am not too familiar with the libraries that are available but I think something like Allegro is a better comparison to DirectX than comparing OpenGL to DirectX.
This was at least my original reason for selecting DirectX over OpenGL, since I never knew about Allegro and I did not want the hassle of having to learn 2 or 3 different APIs for graphics/sound/whatever else you want.
The cheese stands alone.
Advertisement
Quote:Original post by foobarbazqux
Quote:
Quote:
Original post by zedzeek
at the moment on windows gl is 0-20% (depending on the app) faster than d3d ie
if i converted my app to d3d i would easily lose 20% performance.

Bullstat?

Batch Batch Batch p.14
*sigh*
Yes, if you use far too many draw calls in D3D, and you don't use instancing -- in short, if you're a bloody moron -- then yes, you will see a performance hit.

Try calling VertexPointer a few thousand times per frame and see what that does to your frame rate. If you attack the particular points where an API has bad performance, you will see bad performance. That doesn't make zedzeek's claim any more legit -- at best it makes him guilty of misinformation, at worst an idiot.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
SDL would be the typical comparison, but SDL is usually using DX for a lot of things on Windows. When it comes to different libraries, many are trying to stick close to the OpenGL way. Look at devIL or OpenAL and you notice pretty much the same syntax and structure.

Btw. a first draft of mentioned file format is here. Animation chunk is missing and probably a lot of things I never use and hence forgot. Skip the numbers part. If the plain text format is too hard to read I could probably cook up some html or xml file. xml is what I would suggest using if the need for an ascii version arises. Debates are welcome, seeing how the current format mostly represents how I do things and might not be how everybody else handles them. If necessary, I can add a simple "how to easily load/save a file"-guide, but it's actually pretty trivial, especially when using a stack for saving.
f@dzhttp://festini.device-zero.de
Quote:at best it makes him guilty of misinformation,

huh, what part?
Quote:Original post by zedzeek
at the moment on windows gl is 0-20% (depending on the app) faster than d3d ie
if i converted my app to d3d i would easily lose 20% performance.
Like I said, this is completely wrong unless your app happens to be specially constructed to exploit a certain low performance path in the D3D API. Spouting it as fact for all cases (your post essentially implies that OGL is always as fast or faster for any app) falls under the category of misinformation. Note that misinformation isn't necessarily intentional.

[Edited by - Promit on December 7, 2005 2:58:41 AM]
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Quote:Original post by Promit
Quote:Original post by foobarbazqux
Batch Batch Batch p.14
*sigh*
Yes, if you use far too many draw calls in D3D, and you don't use instancing -- in short, if you're a bloody moron -- then yes, you will see a performance hit.

Try calling VertexPointer a few thousand times per frame and see what that does to your frame rate. If you attack the particular points where an API has bad performance, you will see bad performance. That doesn't make zedzeek's claim any more legit -- at best it makes him guilty of misinformation, at worst an idiot.


I think the point is that, it will hurt MORE in the D3D app than in the OGL app due to the lower draw overhead. Thats a fact, a fact you cant dispute as its well known that for every draw operation you need to do a ring switch in windows (why anyone every thought this was a good idea baffles the hell out of me, but meh), were as ofcourse in OGL it happens when the driver decides. This is practically the reason for instancing being included as in small batch conditions this switch would kill you. Once the batch sizes increase this becomes less pronounced as a problem as the time to copy the data begins to slow the OGL call down, with the D3D call staying constant (see the pdf I referenced).

Now that someone at MS has woken up and swapped things about so this switch isnt required from DX10 onwards this shouldnt be an issue.
Quote:Original post by phantom
I think the point is that, it will hurt MORE in the D3D app than in the OGL app due to the lower draw overhead.
And that's completely irrelevant to this thread. I don't mind having this whole discussion (and I believe we, as in you and I specifically, have had it at least once, maybe twice). It's simply not relevant to this comparison. Yes in D3D you can't just start oozing draw calls. There is instancing for precisely that reason.
Quote:Original PostI don't intend for this to intend to turn into OpenGL is better than D3D type war, rather I would be interested in your reasons for choosing D3D over the alternative.

Anyway, since this is going nowhere, I'll direct you to my own comparison. While written some years ago, it is largely accurate today. The only thing is, ignore anything it says about OpenGL 2.0. That was written before the spec was stripped and beaten into the sorry state it is in today. Some details about the OpenGL shading model have changed, as it is now standardized properly (it was not at the time). Additionally, the capabilities of D3DX have grown massively since then, leaving comparable plugin libraries for OpenGL way behind and in many cases non existent.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
I've noticed that a fairly large amount (~10%) of computer users have OpenGL drivers that are so bad that you will be lucky to get .5 frames per second even with a simple scene--and this is computers that have 3D hardware. I'm not sure if that is the fault of the video card manufacturers or if it is Microsoft installing crappy software-only OpenGL drivers during one of their magic "updates" or something (see http://www.vcnet.com/bms/features/3d.html for some history on Microsoft's relationship with OpenGL).

If you are targeting casual gamers you can't ask them to go download the latest drivers from their card's manufacturer--half of them won't even know what you are talking about. So you are stuck with D3D. I've heard that the newer versions of DirectX are nice, but again, if you want to support everyone you need to go with DX7, since we can't ask casual gamers to be sure to download the latest versions of DirectX. And, to be blunt, the DX7 API is just plain awful. And that's if you can even find the DX7 SDK--Microsoft sure won't give it to you.
Quote:Original post by Anonymous Poster
I'm not sure if that is the fault of the video card manufacturers or if it is Microsoft installing crappy software-only OpenGL drivers during one of their magic "updates"


The problem is that Windows is coming with drivers that support D3D, but not OpenGL. It's not like MS is even trying to hide their attempts of making OGL as unattractive as possible without completely breaking it. Start with the default drivers not supporting it, Windows still coming with stone age 1.1 or something (and hence forcing you to use extensions for stuff that has been part of the "core" for an eternity by now) or their role in the ARB (which somehow seemed to consist of nothing but vetoing everything to prevent any long overdue development). And then there's ATI and me constantly wondering if some of the embarrassing bugs in their OpenGL drivers can really be an accident *cough*. Just not quite sure how MS would benefit from everybody using DX, as it's free anyway. Unless they are afraid of cross platform games making Linux more attractive.

Seeing that even many "gamers" start threads like "help, where can I download OpenGL" or "help, <latest title using id-engine> not working" I'm surprised it's only 10%.

Quote:I've heard that the newer versions of DirectX are nice, but again, if you want to support everyone you need to go with DX7, since we can't ask casual gamers to be sure to download the latest versions of DirectX.


Most games are coming with the redist of the used version and typically confront you with "this game requires DX8, you have DX9c installed, do you want to install DX8 now?"-message boxes. So as with OpenGL the only problem is that they need recent enough drivers.
f@dzhttp://festini.device-zero.de
Quote:Original post by Promit
Quote:Original post by phantom
I think the point is that, it will hurt MORE in the D3D app than in the OGL app due to the lower draw overhead.
And that's completely irrelevant to this thread. I don't mind having this whole discussion (and I believe we, as in you and I specifically, have had it at least once, maybe twice). It's simply not relevant to this comparison. Yes in D3D you can't just start oozing draw calls. There is instancing for precisely that reason.


You can't just say "use instancing" since its only supported on cards with VS3. It will be great for your high-end players, but the people who really need it - low/mid-range gamers arent going to benefit.

Edit: actually, I'm not sure that was valid statement, low-end gamers are probably much more likely to have fast CPUs but slow GPUs.

This topic is closed to new replies.

Advertisement