Why openGl

Can u tell me why i use openGl instead of Direct X.

Thanx

Of course not. If you don’t have your own answer to that, you are indeed a truly confused person.

I think the question should read:
Can you tell me why I should use OpenGL instead of Direct3D?

If you want facts:

  • OpenGL runs on many platforms, Direct3D only on Windows.
  • New hardware features are generally faster available in OpenGL via extensions

If you want opinions:

  • OpenGL is easier to learn
  • OpenGL produces nicer, cleaner code

One last thing: Don’t expect to get an objective answer on an OpenGL board…

I agree with overmind, especially on the last two point :

Direct 3D is a real mess, in my opinion…

wizzo

Microsoft keeps waffling about what level of support there will be for OpenGL in Longhorn. Longhorn is only about two years out.

Hello,

Thanx for reply, I have a sound experience in different languages but fairly new to this environment, I mean a pure game programmig world. I want to start from scratch so that I know all plateform and programming details…

Thanx.

I use OpenGL because I am only writing for linux platforms. If you want to make windows-only games, d3d might be a better choice due to the fact that more graphics chips support d3d there, and d3d is a more pixel-exact specification than OpenGL, the chance that your program will run and look like you intented it do do are bigger. but as everyone has a gf or radeon anyway, this advante doesn’t count too much.

Another reason might be that it doesn’t sound like a good idea to rely on something that is proprietarily microsoft-only.

Jan

I would be interested which chips don’t support OpenGL but support Direct3D (with hw acceleration of course…), I can’t think of any. An please don’t say 3dfx, they are long dead…

As for the pixel exact spec: Who cares? It’s not that the OpenGL spec is so bad that you can actually see the difference without zooming in.

A real advantage of Direct3D is that there are no vendor specific extensions, so you only need one code path for each feature set (with shaders, with combiners, with multitexturing, …), not one for ATI, one for nVidia, … (although it could be better from a performance point of view, but you are not required to). But this is only true if you use the latest hardware features, and often these features are not present in D3D at all so you have to wait for the next DX release while in OpenGL you have a few vendor dependant extensions immidiately.

If you compare OpenGL to Direct3D without looking at the most advanced hardware features and if you don’t care about platforms other than Windows, I don’t think there are any important differences left except subjective things like nicer code and so on.

Originally posted by Overmind:
I would be interested which chips don’t support OpenGL but support Direct3D (with hw acceleration of course…), I can’t think of any. An please don’t say 3dfx, they are long dead…

I assume that when people mean a certain card or vendor doesn’t support GL, then they mean their drivers are broken. In which case, their d3d support may be poor as well.

Typically, Matrox, Intel, Sis, S3 and others have lousy drivers. Search the user forums and you will see. Old ATI drivers were problematic as well (Rage period)

Last I heard, Intel was making an effort in this area so that every user who buys a ready made box (Compaq, HP, Dell) gets a gaming machine ready to go.

I find that Intel has pretty decent OpenGL drivers these days. The problem with Intel is that a general-purpose CPU just isn’t able to keep up with what a custom parallel vertex processor can do, so you have to design highly scalable art if you want to push vertices to the max on HT&L but still run well on Intel Extreme.

Matrox does seem to care a bit about their drivers, as they use them also for their video processing boards, which seems to be where they can make money these days (just looking at their web site for that assessment).

3DLabs are said to have great drivers, tuned for DCC applications, but everytime we send a Wildcat into the compatibility lab, back comes a report that they couldn’t get the card/drivers installed properly, much less start our app. Go figure. Also, the Wildcats don’t support DXTC texture compression.

SiS, Trident and VIA/S3 are the three other brands that you’ll find on consumer hardware (actually, you’ll probably find more of those than of Matrox/3DLabs). All three of those ship some form of OpenGL driver, although it’ s usually locked in a time bubble from 1.1 days, and they probably only use Quake as a test case – stray from that path, and you’re probably not going to be too happy. Alas, it seems impossible to get any reply from those vendors regarding software compatibility problems (I’ve tried several times).

Microsoft may be closed and proprietary, but they have about 95% of the market. As long as you require Windows, you might as well also require Direct3D. I think Microsoft has a driver acceptance test which requires that you are Direct3D compatible; I don’t think they have the same thing (or to the same level) for OpenGL compatibility.

Originally posted by Overmind:
As for the pixel exact spec: Who cares? It’s not that the OpenGL spec is so bad that you can actually see the difference without zooming in.
I can’t agree with that …
OpenGL is a spec, and a very strict one at that. Direct 3D is far from strictly specified, when in doubt you’re supposed to “do it like refrast”, whatever that means.

A real advantage of Direct3D is that there are no vendor specific extensions, so you only need one code path for each feature set (with shaders, with combiners, with multitexturing, …), not one for ATI, one for nVidia, … (although it could be better from a performance point of view, but you are not required to). But this is only true if you use the latest hardware features, and often these features are not present in D3D at all so you have to wait for the next DX release while in OpenGL you have a few vendor dependant extensions immidiately.
This IMO is neither an advantage nor disadvantage. It’s just a difference in philosophy.
One could say that Direct 3D uses a “restriction model” while OpenGL uses an extension model.

Direct 3D versions allow some maximum functionality and IHVs are free to not implement features. They can never offer more features. OTOH OpenGL versions mandate a minimum functionality and allow arbitrary extensions.

D3D version n: feature set <= “n”
OpenGL version n: feature set >= “n”

Originally posted by Overmind:
As for the pixel exact spec: Who cares? It’s not that the OpenGL spec is so bad that you can actually see the difference without zooming in.

You are so wrong. Look at how inexact the results are across different renderers. The spec is especially ambiguous about the rendering of antialiased points and lines.

Who cares? Try writing an SVG or PDF renderer in OpenGL. You will suddenly care a lot.

>>>>
A real advantage of Direct3D is that there are no vendor specific extensions, so you only need one code path for each feature set
<<<<

Only if you code for the XBox.
Otherwise, you have to check for CAPS bits.

In the case of GL, the fact that multiple vendors can offer a similar extension, each with their own extra abilities can piss some people off.

Luckily, their are only 2 guys: ATI and NV
so it is acceptable.

I dont mind coding for both + ARB only for the rest.

what I meant is that with d3d your progam is more likely to work on windows computers than when using OpenGL. There are a lot of “dead” chips around in notebooks that do not support OpenGL very good, and yes you can see differences on different OpenGL implementations (for example, compare Quake 3 on a riva128 to quake 3 on a tnt).

But the one big reason against d3d is that it is microsoft-only… I cannot imagine why one would want to cope with that. Of course I cannot exspect everyone to love windows as much as I do, but to become dependant on one company never is a good idea, I think, and apart from that, OpenGL is an industry standard, d3d is a windows gaming standard.

Jan

I have one more reason why OpenGL - standardized support for in window stereoscopy. Nothinl like this exist in DirectX.
I have one more reason why not OpenGL - bas support for video data processing. DirectX integrate in the form of DirectShow video data processing and HW acceleration together. OpenML is unfortunately not mature yet …

@JanHH: generally I’ve never met a case that OpenGL would be slower then DX. I don’t understand this funny believe(like “OpenGL on windows is crap, because microsoft supports only DX”). Do you remember, there was a thread about WinnXP some years ago? People where afraid that Microsoft would provide only a DirectX wrapper for OpenGL, but not direct support for it(!!). Even now there are some people that believe that crap.

It is not of more advantage to use DirectX on Windows plaftorms.

> It is not of more advantage to use DirectX on Windows plaftorms.

If you’re willing to restrict yourself to < 50% of the installed market, then that’s true.

Ok, after visiting arekkusu’s link I have to admit I was wrong about differences not being visible without zoom, but these test cases use rather rare features. Who uses line width and strippling for example? I wouldn’t bother using it when I have got textured polygons with combiners or even fragment programs…

As for writing a PDF renderer: I wouldn’t use OpenGL to do this, neither would I use Direct3D. These APIs are not designed for this kind of application, I would rather use SDL or DirectDraw…

I didn’t say that d3d is faster, I only said that the program is more likely to run the way it is supposed to.

Apart from that, I personally would not choose d3d even when developing for windows, as I would like my programs to be portable to linux. Also, more innovation seems to come from the OpenGL front (Carmack), in fact I do not even see a reason for d3d to exist at all (apart from marketing reasons). As well as d3d, OpenGL could be the standard windows rendering solution integrated into directx. I really belive the whole reason is microsoftish monopolism. I LOVE these guys… for example, they are the ones who gave us the big big gift of visual basic eg

Originally posted by Overmind:
these test cases use rather rare features. Who uses line width and strippling for example? I wouldn’t bother using it when I have got textured polygons with combiners or even fragment programs…

This is a case of chicken and egg.

Are the features rarely used because the implementations are broken/different across renderers?

Or are the implementations broken/different because the features are rarely used?

Today’s consumer hardware market is largely driven by FPS games. So the hardware & driver vendors don’t really care if points and lines (one half of the GL primitive set) are broken. They only care about textured triangles. But that doesn’t change the fact that, as written, the GL spec is ambiguous to the point that some features are unusable (if you care at all about reproducibility.) As it is, on today’s hardware you have to re-implement points and lines using texture mapped triangles if you want them to look correct. Which is a pain.