OpenGL vs DirectX

IBdaMac

Senior member
Jan 12, 2003
259
0
0
I would like to almost consider myself a gamer...considering the system I have, there would be no other use. I honestly
still to this day don't know exactly what is opengl and directx are, and how they differ.

I believe DirectX is solution to hardware specific games. Instead of the game being written for the actual hardware,
it's just written for directx, and then directx does runs the hardware.

OpenGL, is that the same type of thing? In 3dmark, what parts are opengl (if any). Are there many opengl games?

Thanks for the help, I realize the stupidity gets tiring after a while.
 

PliotronX

Diamond Member
Oct 17, 1999
8,883
107
106
First, before VIAN comes along spouting off how superior OpenGL is, they are both Application Programming Interfaces. Your observation is right on, it acts as a translation for standardized code between the software (game) and driver level. I haven't read too deeply into either lately, but AFAIK their current capabilities, as far as effects and programmability are similar. You can get much more info by Googling :)

3DMark is fully DirectX compliant if I'm not mistaken, I don't think there is any OpenGL content. HTH :beer:
 

Schadenfroh

Elite Member
Mar 8, 2003
38,416
4
0
im an openGL fanboy myself, the thing that sets it apart is that it is cross platform and microshaft completely controls DX and it wont work on anything besides windows
 

g3pro

Senior member
Jan 15, 2004
404
0
0
directX will always remain closed and controlled by microsoft. AND it will only be for windows.

hey, what does linux use? openGL. what do macs use? openGL.
 

Acanthus

Lifer
Aug 28, 2001
19,915
2
76
ostif.org
There is no OpenGL content at all in 3dmark.

The most popular OGL title today (by popular i mean number of owners) would be Quake 3 Arena. The original Unreal Tournament can run in both directx and OGL as well.

The most prominent OGL title coming out in the future is Doom 3. Its very likely that there will be dozens of games based off of this gfx engine.

As far as capabilities are concerned they are a little different, the way Direct X 9 is headed is for full programmability, you will be able to program any custom effect that your mind can muster. OpenGL is the same way, but requires special extensions within the graphics engine to run each effect.

 

PCTweaker5

Banned
Jun 5, 2003
2,810
0
0
On CS why does OpenGL run faster than DirectX? Is it just because the game is better optimized to run in GL? Or is OpenGL better?
 

g3pro

Senior member
Jan 15, 2004
404
0
0
HL engine --> quake 1 engine --> id software --> loves openGL.



just wait until doom3 makes it as a standard engine for many years to come (just look at how advanced the graphics are for that engine. :Q ), and then let's see openGL makes it.
 

Matthias99

Diamond Member
Oct 7, 2003
8,808
0
0
Okay... and what about the HL2 and Unreal engines? Both those are based on DirectX... two to one! :p

Seriously, though, the technical merits of both systems are about equal. You can write fast graphics code in both DirectX and OpenGL. From a programming/API perspective there are some differences, but even there it's not night-and-day. OGL may be an open standard, but all that means is that you have half the world squabbling over what features should go in rather than one company deciding on a standard feature set that will hopefully suit everyone's needs. Sort of a 'damned if you do, damned if you don't' situation.
 

kylebisme

Diamond Member
Mar 25, 2000
9,396
0
0
Originally posted by: PCTweaker5
On CS why does OpenGL run faster than DirectX? Is it just because the game is better optimized to run in GL? Or is OpenGL better?

it is because the graphics engine is writen in opengl and d3d support is just a wrapper.
 

Lonyo

Lifer
Aug 10, 2002
21,938
6
81
Originally posted by: Matthias99
Okay... and what about the HL2 and Unreal engines? Both those are based on DirectX... two to one! :p

Seriously, though, the technical merits of both systems are about equal. You can write fast graphics code in both DirectX and OpenGL. From a programming/API perspective there are some differences, but even there it's not night-and-day. OGL may be an open standard, but all that means is that you have half the world squabbling over what features should go in rather than one company deciding on a standard feature set that will hopefully suit everyone's needs. Sort of a 'damned if you do, damned if you don't' situation.


RenderDevice=D3DDrv.D3DRenderDevice
;RenderDevice=D3D9Drv.D3D9RenderDevice
;RenderDevice=Engine.NullRenderDevice
;RenderDevice=OpenGLDrv.OpenGLRenderDevice
;RenderDevice=PixoDrv.PixoRenderDevice

From the UT2k4 ini.

Unreal has always done software/OGL/DX (hence how they made a Linux version of UT2k3, and they had a Mac version of the original)
 

VIAN

Diamond Member
Aug 22, 2003
6,575
1
0
First, before VIAN comes along spouting off how superior OpenGL is, they are both Application Programming Interfaces.
I only feel that OpenGL has an edge because it is controlled by more than one company including Microsoft.
 

BFG10K

Lifer
Aug 14, 2000
22,709
2,997
126
still to this day don't know exactly what is opengl and directx are, and how they differ.
They are both APIs - generic libraries of code that allow developers to work in a uniform way and the drivers translate the calls to their specific hardware implementation.
 

Insomniak

Banned
Sep 11, 2003
4,836
0
0
Like everything else, they both have strengths and weaknesses - personally I think DirectX's strengths put it ahead of OpenGL pound for pound.
 

Childs

Lifer
Jul 9, 2000
11,313
7
81
IIRC OpenGL in Unreal was originally done in a Patch, I believe out of the box only Glide and DX were supported. Only thing you need to know in 50 characters or less is: DirectX=Microsoft API, OpenGL=Everyone elses API, including MS.
 

JonnyBlaze

Diamond Member
May 24, 2001
3,114
1
0
i prefer opengl over directx if theres a choice but it really dosent matter in the end. they both make games look great.

almost all professional 3d programs use opengl. 3dsmax supports both.

JB
 

Insomniak

Banned
Sep 11, 2003
4,836
0
0
Originally posted by: Childs
IIRC OpenGL in Unreal was originally done in a Patch, I believe out of the box only Glide and DX were supported. Only thing you need to know in 50 characters or less is: DirectX=Microsoft API, OpenGL=Everyone elses API, including MS.

Out of the Box Unreal 1 was Glide only. Direct3D and OGL support were added in the 226b patch, IIRC.
 

sandorski

No Lifer
Oct 10, 1999
70,427
5,972
126
Originally posted by: Insomniak
Originally posted by: Childs
IIRC OpenGL in Unreal was originally done in a Patch, I believe out of the box only Glide and DX were supported. Only thing you need to know in 50 characters or less is: DirectX=Microsoft API, OpenGL=Everyone elses API, including MS.

Out of the Box Unreal 1 was Glide only. Direct3D and OGL support were added in the 226b patch, IIRC.

D3D and OGL were added before that, but I believe that neither really worked well until around the final patch. S3's Metal(a great API, lousy vidcards) was also added at some time.
 

chsh1ca

Golden Member
Feb 17, 2003
1,179
0
0
Originally posted by: Insomniak
Like everything else, they both have strengths and weaknesses - personally I think DirectX's strengths put it ahead of OpenGL pound for pound.
In a sense of raw technological capabilities, I'd agree, DirectX is a step ahead of OpenGL. This is ironic however since a lot of the best looking games are OpenGL. It really falls to the developers on what they end up doing with each API and how they make use of the tools each provided.
 
Nov 22, 2003
36
0
0
Originally posted by: Acanthus
As far as capabilities are concerned they are a little different, the way Direct X 9 is headed is for full programmability, you will be able to program any custom effect that your mind can muster. OpenGL is the same way, but requires special extensions within the graphics engine to run each effect.

I just spent a bit of time on google;
http://www.opengl.org/about/arb/notes/meeting_note_2002-09-18.html#fragprog
Sept 18/19th 2002 the OpenGL review board made fragment programs (better than Pixel Shader 2.0) a standard extension for all venders. This isn't an ATI or NVIDIA extension, or even an EXT extension. It is a full standard OpenGL extension. It is an extension, not part of the core, because it is an option. This is to allow Radeon 8500 and GeForce3 level cards to fully support OpenGL 1.5. If something is in the OpenGL core then it must be supported so those cards would be required to provide a basically useless software rendering fallback.

I couldn't find the date DX9 was finished, but I found it was after OpenGL
http://www.theinquirer.net/?article=6640

If you wanted to ship an application in 2002 and take advantage of full programablity you needed OpenGL, DX9 wouldn't cut it. Not only does OpenGL have better than shading than PS2.0, but they had it before MS released DX9!

OpenGL and DX9 are both headed towards full programablity. Both are moving quickly, but as you've seen with fragment programs OpenGL is actually leading the way with standards! If you counted special nvidia extensions then OpenGL is really leading the way.
 
Nov 22, 2003
36
0
0
Originally posted by: Matthias99OGL may be an open standard, but all that means is that you have half the world squabbling over what features should go in rather than one company deciding on a standard feature set that will hopefully suit everyone's needs.

But this generally leads to a better implementation. As a replacement for plain vertex arrays we had ATI's VAO extension and NVIDIA's VAR extension. It took a while, but OpenGL ended up with the standard VBO system which is better than either of those vender's original extensions or the vertex buffers in D3D.

It's better to be a few months slower and get it right instead of having to live with something crappy for a few years.

And don't forget which API was first able to take advantage of DX9 level 3d cards :)
 
Nov 22, 2003
36
0
0
Originally posted by: chsh1ca
Originally posted by: Insomniak
Like everything else, they both have strengths and weaknesses - personally I think DirectX's strengths put it ahead of OpenGL pound for pound.
In a sense of raw technological capabilities, I'd agree, DirectX is a step ahead of OpenGL.

How is D3D ahead of OpenGL?
 

BenSkywalker

Diamond Member
Oct 9, 1999
9,140
67
91
If you wanted to ship an application in 2002 and take advantage of full programablity you needed OpenGL, DX9 wouldn't cut it. Not only does OpenGL have better than shading than PS2.0, but they had it before MS released DX9!

DX9 has a lot better shading then PS 2.0 or OGL 1.5- PS 3.0. It will all be spelled out even more explicitly then it has been stated the thousands of times to date when the next gen parts hit.

For the general question, DirectX is in an entirely different league then OpenGL when it comes to gaming, Carmack uses quite a bit of DirectX for his games- what people are trying to compare is Direct3D to OpenGL- D3D is one part of DirectX. OpenAL which last I was aware is a work in progress is supposed to be a cross platform standard to take care of one of the other major DX components(audio support). DX includes video support, audio, 3D visuals, 2D acceleration, control input, networking protocols- DirectX is close to a top to bottom gaming solution, OpenGL is just a 3D API.

Limiting the comparison to OpenGL versus D3D OpenGL has a rather large 'unfair' advantage- John Carmack. Without Carmack and all of his engines OGL would have been dead as a consumer level API a long time ago. Back when Carmack started D3D was an absolute mess, code was extremely complex to do even simple tasks and performance was poor. At the time there was Glide and OGL as reasonable 3D APIs and Glide limited support to 3Dfx boards. Due to this far more then Carmack's cross platform ideals(which really aren't as strong as many people make them out to be- although he does believe in supporting Linux and Mac) he ended up going with OpenGL and stuck with it. Since that point in time we have likely seen a couple hundred titles built off of Carmack's various engines and that level of penetration assures that IHV's must support the API on relatively equal footing with D3D. Now we have Croteam et al coming up with new engines not directly related to Carmack, but still owing the possiblity for their existance to Carmack's choice to stick with OpenGL over D3D. As of right now there is no realistic way to make a game for Windows without using DirectX, titles just rely on OpenGL for 3D support.

In terms of comparing the two it is fairly difficult to do. One's strength is the other's weakness and vice versa. D3D being controlled by MS has an enormous upside- you know what features are in and out of the API and as long as a board has hardware support you use those features in the same way(not saying performance will be optimal, but the fact that it will work as long as it's DX compliant). On the flip side of that, if any IHV's going beyond or outside of the direct specifications there isn't a good way to expose it under D3D while with OpenGL they can simply utilize a proprietary extension to enable features(talking about the IHV first, and then the developer).

Both API's are heavily influenced by politics, OpenGL just has a way to work around them if they don't come out in your favor while with D3D you are SOL if MS decides to go a different direction. Again from the other side with MS you get regular updates and significant changes to the API on a comparitively frequent basis while OpenGL's advancement in terms of API wide solutions is glacier like in comparison. This can make making a title work properly on a wide range of parts difficult. OGL 1.5 as a good example still doesn't have wide support(you could argue any real support) while DX9 is obviously supported by pretty much everyone(in terms of driver level functionality at least).

In terms of overall performance it is very hard to gauge accurately as overwhelmingly when you talk about an OpenGL game you are talking about a Carmack engine and he is the best in the business at squeezing the best performance with the most demanding visuals out of people's machines(not sure many people would argue that point either, though I'm open to debate if any are so inclined ;) ). Looking at Quake3 now it is scaling up in to the stratosphere with framerates, pusing in the 500FPS for some people while the original Unreal has trouble hitting 200FPS despite being significantly older and having, in terms of end results, far less demanding code to be dealt with. I use Unreal mainly as I consider Sweeney to be second only to Carmack in terms of engines, and he still has a long way to go. The Unreal2 engine looks like a fairly decent D3D7 level engine with fairly decent performance. From what we have seen of DooM3 performance is comparable while D3 utterly demolishes it in terms of visuals. You simply look at that end and OpenGL looks superior however Croteam's engine fails to match up with Sweeney's IMO(not bad by any means- actually pretty d@mn good, just not as good as Sweeney's) which you could say would give a leg up to D3D in that comparison. Then you have Lithtech who has come a long way but still can't really touch the 'big guns'.

When all is said and done both are solid APIs each with their own strengths and weaknesses. I think OpenGL ultimately sees the best games in terms of performance/visuals but only due to Carmack. Not saying it's an inferior API, but I would be very interested to see what he could do on the D3D side of the fence before I would use his engines as a baseline to compare APIs.
 

chsh1ca

Golden Member
Feb 17, 2003
1,179
0
0
Originally posted by: titananandtech

How is D3D ahead of OpenGL?
Less demand/arguing over what gets put into the API means quicker adoption of new features offered by hardware developers. OpenGL as a standardized API lacks many of the features that actually get implemented in OpenGL games, since in the games they tend to use different codepaths based on the hardware vendor.
 

Childs

Lifer
Jul 9, 2000
11,313
7
81
Originally posted by: Insomniak
Originally posted by: Childs
IIRC OpenGL in Unreal was originally done in a Patch, I believe out of the box only Glide and DX were supported. Only thing you need to know in 50 characters or less is: DirectX=Microsoft API, OpenGL=Everyone elses API, including MS.

Out of the Box Unreal 1 was Glide only. Direct3D and OGL support were added in the 226b patch, IIRC.


I believe you are correct!