Sign in with
Sign up | Sign in
Your question

DirectX vs. Open GL

Last response: in Graphics & Displays
Share
July 9, 2008 12:52:43 PM

Open GL. can be used (and is used) on:

MS Windows
PS 3
PS 2
PSP
Linux
Apple OS X
Wii


DirectX is used on:

MS Windows
Xbox
Xbox360

(the 3 microsoft products)



When game developers are making games for the consoles and PCs, why are they not just using Open GL? Surely it requires less adaption from console to PC. :??: 


(Oh, and they could tell MS to get stuffed and allow Open GL on the xbox)


With game development becoming ever more costly... surely it makes sense.

More about : directx open

July 9, 2008 1:08:49 PM

Well, it's like the reason why some programmers use Visual Basic instead of C in making programs for Windows. It's a bit easier. At least at first glance..... :bounce: 
July 9, 2008 6:32:06 PM

Uhm. Not that easy, though.
OpenGL was first slated at workstation graphics, not game graphics. Therefore it has some "weirdness"es that makes it harder to use OpenGL in general than DirectX.
One more drawback of OpenGL is, it isn't hardware agnostic. The vendors add their own extensions to the OpenGL stack and this causes confusion, when you need to support all OpenGL hardware for a given game with all features cranked up.
Related resources
July 9, 2008 8:31:48 PM

duzcizgi said:
Uhm. Not that easy, though.
Therefore it has some "weirdness"es that makes it harder to use OpenGL in general than DirectX.



But they already use it for the console game, so why not use it for the PC version?
July 9, 2008 8:57:23 PM

If you have a screwdriver at hand, you don't use a hammer to put those screws on the wall. ;) 
July 9, 2008 10:23:08 PM

Much more effort were put into directx than opengl over the years, resulting in directx being far ahead technologically. It would be impossible to render the higher end PC games like Crysis with the same visual results using opengl, as it is now.
a b U Graphics card
July 9, 2008 10:51:35 PM

Not true. Look at Nvidia's Human Head demo. That is done with OpenGL.
July 9, 2008 11:06:38 PM

duzcizgi said:
If you have a screwdriver at hand, you don't use a hammer to put those screws on the wall. ;) 



If you have a screw in the wall, you don't take it out and put a nail in instead do you?




They have the OpenGL coding done - why not use it?
July 9, 2008 11:22:44 PM

Amiga500 said:
If you have a screw in the wall, you don't take it out and put a nail in instead do you?




They have the OpenGL coding done - why not use it?

Compared to directx, opengl's implementation is more difficult, thus resulting in drivers that generally perform less well. They choose to make it easier for themselves to develop the API, but end up offloading the work to develpers of applications that use Opengl.

It limits the way in which developers can allocate resources, thus decrease performance in real world applications.

PCs are more complex, requiring more flexibility to attend to various configurations of different machines.
July 10, 2008 8:03:57 AM

@Amiga500

Well as I told before, OpenGL *is* designed for workstations by Silicon Graphics. It's not designed for games. It *was* used for games *before* DirectX was published.
DirectX is designed games in mind. OpenGL is designed graphics workstations in mind. If you have millions of polygon meshes, that you need to preview before production rendering, use OpenGL. If you need to get consistently 30+ fps from a game, with low polygon count, use DirectX.
Is it clear?
You can use a Ferrari as a cab, but is it logical?
a c 130 U Graphics card
July 10, 2008 8:49:55 AM


Amiga 500,

Just one little thing. "(Oh, and they could tell MS to get stuffed and allow Open GL on the xbox)"
Is it just me or would it be a bit difficult for Microsoft to tell itself to go get stuffed and then let a rival API to code its hardware ?

I can see where you are coming from but as has been said its not that easy. Its like when you are putting something together furniture/kids bikes/cars etc. For some reason you get so far then the guide/manual says something like. "Using special tool x/y/z attach this part to that part. (sound familiar). No ? Oh well. Basically DX will let you use whichever tool is available or most suited to the task needed at the time. Open GL says use Alfa fog here and sharpen mode there, if your hardware doesnt support it you get stuffed for performance.
Thats my understanding of it anyway, I could be wrong. As always if I am please correct me.

Mactronix
July 10, 2008 11:45:53 AM

@mactronix
You're correct, mactronix.
Besides, OpenGL is *NOT* hardware agnostic. It's functions are tied to the hardware. OpenGL functions for ATi doesn't work for nVidia.
Common functionality is the same for all, but shader functions are hardware dependent.
July 10, 2008 1:28:20 PM

Just so I understand this...


ATI's cards in PCs do not support the same functionality as ATI's Xenos (R600) in the Xbox 360...

Or conversely Nvidia in PCs compared to the RSX (based on G70) in the PS3?




So basically, 2 of the key members of the PC gaming alliance are **** themselves over by not making it easier for developers to port from console to PC?

Way to go, way to go.
July 10, 2008 2:21:16 PM

They are making what their customers wish: The console producers. If you were a console producer, would you like the latest super hot game available on the rival consoles and pcs etc? Or would you make it harder to port from one platform to other?
This is the reason there are game engines which do the abstraction of hardware and API from the game itself. :)  It has nothing to do with ATi or nVidia. They both supply all the libraries required for their hardware. The problem is, whether the programmers use this or that library. (I prefer a make as little modifications as possible to cover as many hardware as possible approach)
July 10, 2008 2:24:59 PM

duzcizgi said:
They are making what their customers wish: The console producers. If you were a console producer, would you like the latest super hot game available on the rival consoles and pcs etc? Or would you make it harder to port from one platform to other?



If it meant my platform missing out - I'd want them easy to port.


Besides:

Reduced cost for development = reduced game costs = more money for consumer to spend on games = more license revenues to console builder.
July 10, 2008 2:37:03 PM

Well, I can't tell much about the business decisions behind them. The thing I know is, OpenGL is, although used to program games, not suitable to program games. DirectX better suits for this purpose. (Solely from a programmers point of view)
July 10, 2008 10:53:58 PM

dagger said:
It would be impossible to render the higher end PC games like Crysis with the same visual results using opengl, as it is now.


Uh, no.

I can't comment on the situation right now, but for the last few years OpenGL shader technology has often been well ahead of what was possible in D3D; the downside being that mainstream graphics cards are designed for D3D, so they often couldn't support the more advanced OpenGL features as their hardware was limited to what Microsoft required.

I suspect the real issue is precisely that; in the games market OpenGL drivers have generally been less mature than D3D drivers and had too much variation in the extensions they supported. If companies are selling games solely on Windows, then there's no real reason to go through the hassle of using OpenGL instead of D3D.
July 10, 2008 10:55:40 PM

duzcizgi said:
The thing I know is, OpenGL is, although used to program games, not suitable to program games.


That'll be news to John Carmack.

Though he does seem to have been warming up to D3D recently.
July 11, 2008 11:20:37 AM

@MarkG
I agree that OpenGL shader technology is more advanced than DX shader technology, but this doesn't make it suitable for high framerate gaming applications.
With OGL, you can have much higher level of precision and realistic effects than D3D. This is what you need when you're working on Maya or 3DS Max:
As good precise previews as possible with a good framerate. (As it's not a matter of life and death, when you're working with 3DS Max or Maya or Cinema4D, you can go with 10-15 FPS, but with a First person shooter, you're already dead with such a performance) And you don't care too much about the precision of rendering of that leaf or tree there, when you're trying to blow the monster behind it.
Bottom line: If you need workstation quality graphics, go with OpenGL; if you need high speed gaming, go with D3D. You can use them interchangably, but it's not the best practice.
And yes, if the platform you are supposed to use doesn't have a dedicated 3D API but has only OpenGL, well, you then have to use OpenGL.
July 11, 2008 11:55:45 PM

MarkG said:
Uh, no.

I can't comment on the situation right now, but for the last few years OpenGL shader technology has often been well ahead of what was possible in D3D; the downside being that mainstream graphics cards are designed for D3D, so they often couldn't support the more advanced OpenGL features as their hardware was limited to what Microsoft required.

I suspect the real issue is precisely that; in the games market OpenGL drivers have generally been less mature than D3D drivers and had too much variation in the extensions they supported. If companies are selling games solely on Windows, then there's no real reason to go through the hassle of using OpenGL instead of D3D.

What I meant was with development and system resources factored in. Opengl is just too difficult and inflexable to implement efficiently in different PCs. For something like Crysis, that would mean either running at 5fps or drastically reduce quality. In most games running of opengl, they reduce quality.

This is not rendering a cutscene for some movies. Where you have as much time as you need. It's for live gaming.
a c 130 U Graphics card
July 12, 2008 7:20:41 PM


@ Dagger,
Thats just about the size of it. That seems to be what the OP isn't getting. If you are still about Amiga 500 what Dagger just posted sums it up really well.
The point is that everyone that has an Xbox 360 is running on the exact same hardware so you can use openGL because you know every machine that will play the game has the hardware to do what is being asked of it.
Pc owners by the very nature of the beast all have machines that though in the whole can be placed in certain categories performance wise, will differ in hardware by many various combinations. This is why they use DX or 3D3 for PC games because you can ask it to do the best it can with what its got available. Well as long as its coded properly or at least half decently, whatever people say Crysis is coded well with this aspect in mind as was Oblivion. Assassins creed is one of the worst examples of coding i am aware of and just goes to show what happens when games are just ported, or in this case dragged over to a different platform.

mactronix
August 6, 2008 12:59:46 AM

John Carmack of Id Software gave an interview years ago about
Open Gl vs Direct X programming in conjunction with the game
engines they were coding....the short-short is that even though
he personally favors Open Gl, Direct X was in the mainstream
of Gaming (at the time) so therefore, the games would be using
direct x tech.
Today..Im no longer so sure, with the advent of Console and 3G
gaming becoming so popular....perhaps some console as well
as pc game makers might reconsider on the viability of what is and
what is not mainstream gaming.
Most pc games use direct x, and some have the option to switch
to open gl today.
However I am unaware of any console game with the option to
switch to Direct x....?
a b U Graphics card
August 6, 2008 6:46:26 AM

Missed this the first time around, but the thing to remembr is that desktop OGL libraries are not the same as the customized PSGL, which needs to be converted to OGL-ES usinig Cg to be transferable to other formats. It's like Linux, sure it's open and there's lots of versions, but it doesn't mean they are any easier to use. It balkanizes the OGL APIs, where not only did people like Sony not want to deal with HLSL, they didn't want to worry about the standard ARB path either, and didn't make it easy to code for both Wii and Sony. Wiis hardware makes that hard already. It becomes infighting with extensions and implementations that makes them into their own like niches within the niche. It would be fine if OGL were dominant, but this split just makes it harder to focus on OGL versus the more widespread, more standardized DX.

Out of all the options, most developers say it's easiest to program for the PC and X360 than any other two platforms thanks to the ease of use of XNA, which is more facile than Cg and other cross-platform compilers.
August 7, 2008 3:12:19 PM

:)  Good said... :) 
!