DirectX or OpenGL?
by Andreas Bergstr · in Technical Issues · 08/17/2001 (12:38 pm) · 10 replies
I'm a new programmer and wonder witch direction to choose. DirectX or OpenGL? I belive that DirectX is the right way for the future but........
/-Andreas
/-Andreas
About the author
#2
So, if you're not concerned with portability and want to learn one interface to handle everything, then it's DirectX. If you want cross-platform compatibility, then it's OpenGL. Of course, you could learn both...
Schnapple
08/22/2001 (10:15 am)
If you want a long, drawn out (and some would say pointless) discussion on OpenGL vs. DirectX, go here. At one point, John Carmack even weighs in on the conversation. Like he said at QuakeCon, whereas he absolutely hated Direct3D back in '97 when he attempted to port Quake to it (prompting in part the switch to OpenGL), he states that it's coming along very nicely now. id, however, stays with OpenGL for various reasons, chief among them is the desire to port to non-Win32 platforms. That's the main rub - OpenGL is platform independent, whereas DirectX is Win32 specific and always will be. Also realize that OpenGL is for graphics only - it handles nothing else. DirectX handles (or attempts to, at least) everything - graphics, sound, networking, input. Some developers use OpenGL for the rendering and DirectX for the rest (word is that id uses DirectX to place things on the screen, but still uses OpenGL to render it).So, if you're not concerned with portability and want to learn one interface to handle everything, then it's DirectX. If you want cross-platform compatibility, then it's OpenGL. Of course, you could learn both...
Schnapple
#3
08/22/2001 (11:47 am)
edit - didn't go to previous links
#4
Tom's comment about id and OpenGL is somewhat incorrect. id uses OpenGL for all 3D hardware accelerated graphics. Having seen the source code for Quake, and knowing 3D programming well, I can be certain about this.
I believe historically id liked OpenGL because their level design was done on Silicon Graphics machines, which had OpenGL (SG created OpenGL, initially a proprietary API for their machines). They thus had already programmed using OpenGL for level design. I can't be certain about this though.
If you're using OpenGL, you can use OpenAL (www.openal.org) for sound if you want platform independance. However, no similar input API is available, although if you use GLUT (see www.opengl.org for links) you can use that libraries input methods, which are not really game adapted but do work and allow your source to be recompiled on other platforms.
As an earlier post said, try both, make a simple program in each (rotating cube is good) and see which you like best.
Doug. EnkiSoftware Limited
08/23/2001 (1:40 am)
DirectX vs OpenGL debates are pretty useless, but I though I'd chime in.Tom's comment about id and OpenGL is somewhat incorrect. id uses OpenGL for all 3D hardware accelerated graphics. Having seen the source code for Quake, and knowing 3D programming well, I can be certain about this.
I believe historically id liked OpenGL because their level design was done on Silicon Graphics machines, which had OpenGL (SG created OpenGL, initially a proprietary API for their machines). They thus had already programmed using OpenGL for level design. I can't be certain about this though.
If you're using OpenGL, you can use OpenAL (www.openal.org) for sound if you want platform independance. However, no similar input API is available, although if you use GLUT (see www.opengl.org for links) you can use that libraries input methods, which are not really game adapted but do work and allow your source to be recompiled on other platforms.
As an earlier post said, try both, make a simple program in each (rotating cube is good) and see which you like best.
Doug. EnkiSoftware Limited
#5
The main reason DirectX would be better is because OpenGL does not directly support new card features such as per-pixel lighting (bump-mapping, specular), vertex, or pixel shaders. Yes, you can use OpenGL extentions to take advantage of these features, but each vendor has different extensions for the same features. For example, before I was unceremoniously laid off from Dynamix, I added bump-mapping to the Tribes 2 water. In order to do it, I had to add all kinds of new nVidia extentions to header files and learn about how nVidia uses their register combiners for the bump and specular effects. Since I used the nVidia extentions, the effects are not supported on cards such as the ATI Radeon which also offers per-pixel effects. I could research the Radeon and figure out how to do it on that card, but I'm doubling my work (plus I have to get a Radeon and install the damn thing on my machine).
In the long run, OpenGL is not a good API for games and is not well supported by the vendors. You might want to give the GG guys a little nudge and let them know that the engine should A) be converted to DirectX, or B)have a graphics abstraction layer that would allow multiple graphics API's. I'd prefer option A for performance reasons, but I don't think they're going for it. I've been bugging Mark every once in a while; if you guys could send him an email it might speed up the process a bit. You're welcome Mark :)
08/23/2001 (10:54 pm)
If you are planning a long project and don't care much about cross-platform development(Macintosh), then I would recommend attempting to use DirectX rather than OpenGL for a new project.The main reason DirectX would be better is because OpenGL does not directly support new card features such as per-pixel lighting (bump-mapping, specular), vertex, or pixel shaders. Yes, you can use OpenGL extentions to take advantage of these features, but each vendor has different extensions for the same features. For example, before I was unceremoniously laid off from Dynamix, I added bump-mapping to the Tribes 2 water. In order to do it, I had to add all kinds of new nVidia extentions to header files and learn about how nVidia uses their register combiners for the bump and specular effects. Since I used the nVidia extentions, the effects are not supported on cards such as the ATI Radeon which also offers per-pixel effects. I could research the Radeon and figure out how to do it on that card, but I'm doubling my work (plus I have to get a Radeon and install the damn thing on my machine).
In the long run, OpenGL is not a good API for games and is not well supported by the vendors. You might want to give the GG guys a little nudge and let them know that the engine should A) be converted to DirectX, or B)have a graphics abstraction layer that would allow multiple graphics API's. I'd prefer option A for performance reasons, but I don't think they're going for it. I've been bugging Mark every once in a while; if you guys could send him an email it might speed up the process a bit. You're welcome Mark :)
#6
Take a look at the specs for the upcoming OpenGL 2.0 and notice the incorporation of all extension into a unified interface. This should take care of different hardware extensions and you'll get a much cleaner API than DirectX.
01/09/2002 (1:10 am)
I totally disagree with Brian about not using OpenGL in the long run. Take a look at the specs for the upcoming OpenGL 2.0 and notice the incorporation of all extension into a unified interface. This should take care of different hardware extensions and you'll get a much cleaner API than DirectX.
#7
Id used opengl for ALL rendering, no directX involved initially (they may support it in the later games, but certainly not before Q3. Although they'll use directsound and directinput like everyone else.
Another point, Doug, they used Next machines for the first versions of thier editor, so it didnt have anything to do with SGI (although I believe Next used OpenGL anyway).
As far as it goes, there's not an awful lot to choose between the two. Ive used both, it really comes down to preference and support. If you prefer one api over the other, then as long as it has the hardware support you require (cross platform versus multiple cards) then go with it. The two are converging nicely (as JC suggests) so there's no real reason to think that one is better than the other.
Finally, Torque DOES have an abstraction layer, which means it supports DX AND OGL, this is both a good and bad thing, its good in that it works and provides more platforms to access, its bad in that it requires a lot of work to keep current with hardware available (which is on GG.com's work list to update and I suspect now they have geforce3's and support for nvidia and the rest may happen sooner rather than later).
Phil.
01/09/2002 (2:09 am)
Just to clear up a couple of innacurracies...Id used opengl for ALL rendering, no directX involved initially (they may support it in the later games, but certainly not before Q3. Although they'll use directsound and directinput like everyone else.
Another point, Doug, they used Next machines for the first versions of thier editor, so it didnt have anything to do with SGI (although I believe Next used OpenGL anyway).
As far as it goes, there's not an awful lot to choose between the two. Ive used both, it really comes down to preference and support. If you prefer one api over the other, then as long as it has the hardware support you require (cross platform versus multiple cards) then go with it. The two are converging nicely (as JC suggests) so there's no real reason to think that one is better than the other.
Finally, Torque DOES have an abstraction layer, which means it supports DX AND OGL, this is both a good and bad thing, its good in that it works and provides more platforms to access, its bad in that it requires a lot of work to keep current with hardware available (which is on GG.com's work list to update and I suspect now they have geforce3's and support for nvidia and the rest may happen sooner rather than later).
Phil.
#8
I know this is pretty old, but I have a question. If Id ever used OpenGL at all, how come the default for Quake 1 and Quake II bought for Windows is Directx?
08/12/2006 (6:54 pm)
@PhillI know this is pretty old, but I have a question. If Id ever used OpenGL at all, how come the default for Quake 1 and Quake II bought for Windows is Directx?
#9
Instead of arguing about which is better. Do you know if you are able to code a torque based game to allow the user to switch between OpenGL and DirectX?
I have a potentail requirement to run both.
Thanks
C
10/06/2006 (10:56 pm)
Hi everyone!Instead of arguing about which is better. Do you know if you are able to code a torque based game to allow the user to switch between OpenGL and DirectX?
I have a potentail requirement to run both.
Thanks
C
#10
10/27/2006 (11:44 am)
You can already go to options then there is a choice of d3d opengl on tge then just click apply
Dave Wilson