Why is Direct3D used in games over OpenGL

BlitzMax Forums/OpenGL Module/Why is Direct3D used in games over OpenGL

Drey(Posted 2006) [#1]
I've been doing some research on both and it seems like Direct X is just all over the place. It, in a sense, abuses OO. OpenGL seems so much cleaner and easier to use overall? Does Direct X have a speed advanage? It is do to the fact that they just marketed Direct X well so when people want to learn how to make games, they see what direct X is all about? I would think because Direct X only works on windows, it wouldn't take as much work to get up? I just trying to find why it'll be prefered over OpenGL in game programming. You guys have any answers?

Second question, why do you suppose mark used only OpenGL 1.1 instead of using the latest version of OpenGL. 1.3 has some nice functions and 1.5-2.0 has shader coding. I just got done converting the Constants in glext.h into glext.bmx with a lil converter program. How do i get the new functions in glext.h to work?

Thanks for your time.


Drey(Posted 2006) [#2]
I just rechecked my old post on cube mapping and i DLed Chris pointervars. Now i don't want a logger of the functions, he said it's slow himself. I just want the functions. I don't have time to test it out now. If you have any useful comments on his include though, please feel free to inform.

Thanks.


jhague(Posted 2006) [#3]
It has nothing to do with what is cleaner or easier to use, and everything to do with what is better supported under Windows. With a significant number of lower-end video chipsets--most notably ones from Intel built onto the motherboard--OpenGL drivers are not part of the default install. In order to get OpenGL drivers, you have to download them yourself. Some shareware authors have reported that this issue affects approximately 35% of all PCs out there.


Drey(Posted 2006) [#4]
So that explains the DX7 driver option for blitzmax a bit better. Is the OpenGL 1.1 support that comes with Blitzmax to help overcome the driver issue?

Hmm..that's too bad, because overall i like openGL better so far. I was wondering if there any graphical advanages that DirextX has over OpenGL? Speed for instance?

Overall i just want to learn 3D programming concepts since 3d APIs are platform depended in a sense. (ps2 and GC has their own API for graphics). I'm sure the fundamentals of 3D are common grounds for 3d API. Just like D3D has all the same concepts, just different management than OpenGL has. I've been learning new math and all sorts of interesting things through all this research. Soon i want to make something to show for it. I plan on making a game with Dreamcast quality graphics. I do have a small team of 4(1 programmer..me, 2 artist and a composer), but it's slowly growing. :)


Mindfield(Posted 2006) [#5]
Well, DirectX gets updated a lot more often than OpenGL. That's why it has all the possibilities of rolling more eye candy onto the screen. For example, take a look at Eliza3D-module for BlitzMax. http://www.tmyke.fr/indexGB.htm

On the other hand, OpenGL will enable you to create games for all the operating systems that BlitzMax supports. But like I've come to notice, very few care about creating games and applications with BM that support Linux and OS X.


Mustang(Posted 2006) [#6]
If you would built and sell BMWs, would you willingly support and endorse Mercedes engines in it too? Not likely... M$ -> Windows -> DX.


Dreamora(Posted 2006) [#7]
The reason was back the days when DX8 started to support shaders but OpenGL was not even capable of using all hardware powers. It still suffers its stupid decision to make any hardware manufacturer capable of create own extensions (you can recognize them by nv_ _nv or ati_ _ati and similar) which make it more work to behave the same on all configurations.


And why mark didn't include a higher OpenGL: He did. OpenGL 1.2 is the latest. Everything above are only extensions and they are included in BM up to the extensions for OpenGL 1.5+ and that in the same way as in most apps: GLEW. You can find it under pub.glew


Drey(Posted 2006) [#8]
well, i figured the reasons Dreamora and Mustang stated. I just like the way it's API works more. Anyways, thank you for informing me about glew. I wish i would have caught that sooner.


deps(Posted 2006) [#9]
Another reason is that OpenGL is for graphics only. DirectX got sound, input, fileformats, networking and other stuff too.


teamonkey(Posted 2006) [#10]
The reason was back the days when DX8 started to support shaders but OpenGL was not even capable of using all hardware powers. It still suffers its stupid decision to make any hardware manufacturer capable of create own extensions (you can recognize them by nv_ _nv or ati_ _ati and similar) which make it more work to behave the same on all configurations.

No, that's not it at all. Most extensions are standard and not vendor-specific, the ones beginning ARB (OpenGL Architecture Review Board, the body that determines what is standard and what is not). They start off as vendor-specific extensions then are made core. If only one graphics card manufacturer uses a feature then it's a vendor-specific feature whether you use OpenGL or D3D (and you can use vendor specific features with the Windows API).

An OpenGL graphics card will support all the features of version 1.2 on any operating system, but it may also support some of the additional extensions. Most will support all of the features of v1.5 or v2.0, which includes shaders, but these core features have to be treated as ARB standard extensions under Windows, because Windows only supports v1.2.

Basically there's very little difference. The only real difference is down to the drivers, as that's what turns the equivalent D3D/OpenGL calls into something you see on the screen. Most consumer 3D graphics cards have drivers optimised for D3D under Windows, because they're mainly used for games and most games use D3D. Commercial 3D graphics cards are traditionally optimised for OpenGL because over 90% of non-games 3D applications use OpenGL even under Windows.

Depending on the application and the setup either system can yield very different results. Support both and you're laughing.


Stoop Solo(Posted 2006) [#11]
Have to admit, I'm liking OpenGL. My first experience with it was merely trying to create a substitute pixel plotting function that could at least perform somewhere in the region of B+'s WritePixelFast. In OpenGL, I came up with something not particularly elegant, but small and pretty easy. Though it doesn't quite have the speed of WritePixelFast in the majority of test cases I've tried, it still performed reasonably quick and has the added bonus of supporting alpha.

Trying to create the same quick fix using D3D yielded repeated banging of head off keyboard and little else. Certainly no WPF function substitute. I'd be the first to throw my hands up and say I'm a mere bumbling amateur in the world of 3D programming, and indeed, my focus is on 2D games. All I know is that even I was able to grasp enough OpenGL to get something going, and that D3D is an unwieldily, unfriendly, festering pig that makes me hate kittens.

I've decided to just forget farting around with D3D and actually get started on some stuff. I regard OGL as the important one anyway, because as was stated formerly by someone, OGL = multiplatform support. D3D = hating kittens.

Of course this is merely IMHO. FWIW. TTFN.


Regular K(Posted 2006) [#12]
Another reason is that OpenGL is for graphics only. DirectX got sound, input, fileformats, networking and other stuff too.


That seems like a good enough to make me use DirectX as long as it was rather easy. OpenGL is really easy!


joncom2000(Posted 2006) [#13]
The arguement over Directx supporting more than just graphics is slightly redundant as Blitzmax has it's own sound and input modules which are also platform independant, so why use a single platform graphics engine like Directx over OpenGL?


Drey(Posted 2006) [#14]
yeah, well, there's OpenML too. I'm not sure how well it works, it seems like a new thing. It's a multimedia library. Sound, Video, whatever else.


Dreamora(Posted 2006) [#15]
teammonkey: You are right, OpenGL is now quite the same as DX featurewise.
But most of the now common stuff started out as either NV or ATI only thing in OpenGL (point sprites for example which are comming in DX since 8.0 compared to 1.5 or even 2.0 where they became standard part) and I fear back in the DX8 OpenGL 1.4 days, OpenGL just was about 2 - 3 generations back with its standards and thus got kicked out of the "game race" ...
But thats quite normal if XY different opinions form a standard and not only 1 small dedicated team.

And for modern system I think it isn't suited that good as well because it is non OO and modern games with their project size just need a very good OO design to prevent high costs for maintaining the code ...


Blitzogger(Posted 2006) [#16]
The problem with OpenGL being cross-platform is that no one can use it since, in order to compile for the mac you would need a mac. Nobody is gonna pay $$ for a new computer and give out their cross platform game for free. If it was possible to compile for Mac directly from Windows then i would say yes.


Alberto(Posted 2006) [#17]
"OpenGL is really easy! "

At basic levels , definitly ,but what about advanced features ?
Direct x supplies iis own library with a lot of useful classes for game programming as well as the .x file format .
Opengl let you down,you must code everything from the scratch, by yourself
I also prefer opengl architecture but it is a matter of fact that directx is is more game oriented


AdrianT(Posted 2006) [#18]
From what I understand from talking to some pretty good engine coders. D3D grew up a lot, and DX9 is pretty easy to work with, has better compatibility with a broader range of features.

When MS started D3D it was pretty poor, but each version improved immensely, whilst GL was better at the beginning they were slow to adapt and got stuck in the mud, never really recovering enough to catch up.

Thats how I see it anyway. Even pro 3D apps use D3D over GL now for realtime visualisation.


overmeeren(Posted 2006) [#19]
The advantage DirectX has over OpenGL is Micro$oft.


bradford6(Posted 2006) [#20]
The Big Guys make games to sell them. most people have Windows PCs. If i had to standardize on a platform, I would choose Windows/DirectX. It just makes $ense.

I love Linux and if I were hosting a website, I would use Apache. I think Ipods are cool and Macs are nice too but a bit pricey.

but religion and personal preference aside. Windows XP rules the consumer PC market now and Windows Vista will rule the consumer PC market tomorrow.


AdrianT(Posted 2006) [#21]
there's a discussion topic on this subject over at the indiegamer DEV forums:

http://forums.indiegamer.com/showthread.php?t=6199

Basicaly, Windows then D3D is best, D3D changed a lot since DX7, and is very similar to GL.

GL has a lot of compatibility problems on non Nvidia, ATI hardware. Particularly when using Arb extensions.

GL is the only option if you want cross platform. DX8 is the sweetspot for indies on Windows, since it has the best compatibility with older hardware and ships with XP.