Which API is better?

Which API is Better?

  • DirectX9 is more elegant, easier to program

    Votes: 0 0.0%
  • Both about the same

    Votes: 0 0.0%
  • I use DirectX mainly because of market size and MS is behind it

    Votes: 0 0.0%

  • Total voters
    329

DemoCoder

Veteran
Let's hear what people think of OpenGL and DirectX. A few years ago for developers, this was a no brainer. Now, things may have changed. Is DirectX still more annoying than OpenGL? Still find OpenGL easier to learn, understand, and just plain old elegant?

BTW, OpenGL2 is compared to DX9, since I feel it would be unfair to compare DX9 to OGL1.4 do to the mismatched feature set.
 
Come on ! No Direct3D vs OpenGL here.

Could the thread be locked ?!

It's a purely subjective/taste question, that will lead us nowhere.
 
I don't think it's purely subjective, and it's not an argument, it's a poll. I'd be curious to see if Rev or someone else can "poll" commercial developers for their opinion similar to his polls on opinions of drivers, optimizations, and video cards.

There is such a thing as poorly designed APIs, and although there are some aesthetics involved, there are also easy metrics to determine code which violates well-agreed upon design principles. Usability is more than just pure sophistry.
 
Demo,

I would be more interested in poll that only was targeted at developers. Granted we have a buch of developers here, however I am worried that some one like me, could click on one of the items when I know almost nothing about them :) Hope the poll works!
 
Yes, it's not a "real poll". I'd prefer B3D to conduct a serious one on the "state of OpenGL mindshare"

Still, I'd like to gauge everyone's opinion, even the ignorant, since they too are "branded" with impressions of OGL/DX from reading other people's posts.
 
I could argue OpenGL 1.4 vs. DX9, but I think that OpenGL 2 hasn't entered the equation yet. If people point out to an implementation that runs on current consumer cards, then I'd reconsider this position.
 
I voted for GL2 not because it's easier to program (I don't have any knowledge on that right now, though given history, it probably is), but because I really like the philosophy of the high-level shader language, far more than I like how Microsoft developed their HLSL.
 
ET said:
I could argue OpenGL 1.4 vs. DX9, but I think that OpenGL 2 hasn't entered the equation yet. If people point out to an implementation that runs on current consumer cards, then I'd reconsider this position.

I was just chuckling about that to myself as well...

People here are expounding about how OpenGL 2 is the be-all-end-all graphics API and DirectX 9 is hopeless...

DirectX9 and its "flawed" shaders are here right now being used... OpenGL 2 and its limitless power is not. When OGL2 actually does arrive, perhaps it should be compared to what is available at the time from a DirectX perspective.

Its a good thing OpenGL and DirectX are not Video cards, or there would be some serious flaming going on right now on these boards it seems... Comparing unreleased X to already released Y... that would otherwise be a nono around here...
 
I don't know about GL2.0 because I haven't been using it yet, though from my experience I'd say current OpenGL implementations are easier to program for than DX - given your card supports the relevant extensions. Though it's still far from perfect, and it's surprising how such basic features as glWindowPos have been introduced that late.

About GL2.0 I can only say that I like the GLslang approach more than how DX HLSL is integrated into the API.
 
ET said:
I could argue OpenGL 1.4 vs. DX9, but I think that OpenGL 2 hasn't entered the equation yet. If people point out to an implementation that runs on current consumer cards, then I'd reconsider this position.

Well, the OpenGL 2.0 shading language has at least been approved by the ARB. It's not really OGL 2 anymore, but rather OpenGL 1.5. There's no public drivers exposing it yet, however, being approved by the ARB means that you can be pretty assured that IHVs are working on it. So it's a matter of time.
 
Oh, the poll, I voted for the OpenGL way. On the shader language both languages are way beyond previous assembly languages. If you try high level languages for some time, there's no way you're going back. So either language should make you satisfied for the time being. There are a number of things that make my favor the OpenGL approach.

First of all, that it targets the underlying hardware instead of assembly shader versions. Better utilisation of the hardware and encourages hardware innovation.
Also that it allows shaders of any length and does away with many uninteresting hardware specific limitations.
Then that the vertex and fragment shaders are linked together. This way you can share variables across both the vertex and fragment shader. This way you can also ditch the sematics tags on inputs and outputs, which makes the language cleaner and ensure you don't make any mistakes. The driver will assign them to interpolators appropriately. In DX9 HLSL you can be up for long debugging sessions if you for instance accidentally use the TEXTURE1 instead of TEXTURE0 semantics, trust me on that one. Linking them together also lets the compiler remove dead paths across both shaders that would be impossible for DX9 HLSL to detect, and of course issue a warning if certain outputs are written but never read, or are read but never written. DX9 HLSL simply can't do anything such.
And then you have the problem that HLSL is way too liberal in what kinds of constructs it allows. It allows assignment from vectors to scalars and scalars to vectors without a typecast. Then when vector variables are simply called float3 and scalars float it's very easy to make a mistake. And you might be up to an endless debugging session if you do, trust me on that one too. In OpenGL on the other hand you don't make such mistakes as easily since it's float vs. vec3, so the distinction is much clearer, and then you must have a typecast, which makes any mistakes easy to spot.
 
sorry for being a nitpick, but could somebody of those people who voted the second option elaborate on the reasons for their choice?
 
I'd actually asked a few developers this very same question in a, uh, informal/friendly way. Not all replied. Those that did basically said that they have been working with and is kept "better informed" (for lack of a better word) by MS about DX evolvements compared to the ARB. Add in the fact that they have become familiar with DX8 and very much less familiar with GL2 and the extremely important console consideration, I think the answer is quite clear.
 
Just for kicks, I think I'll state what Reverend seems to be implying:

"Despite the fact that there may be benefits to OpenGL 2.0, we have been working with DirectX 9 for some time now. We're used to it, and it works. I don't see any reason to switch."

Sound about right, Rev?
 
Well, the two other consoles (PS2 and Cube) don't run DX9. If I were developing a cross platform title (like EA games), I'd go with OpenGL definately because of the portability.

There only thing you need to learn for GL2.0 is how to bind parameters to HLSL variables. Everything else you can learn from OGL1.4/1.5 extensions.

Glslang will run as a OGL1.5 extension I believe.

DX benefits portability only if you are doing a PC<->X-Box conversion, e.g. DX8.0.
 
As one of those who voted for DX9, here is why:
Though I personally also like the OpenGL approach to high level shaders I think that approach MS currently took isn't bad either and I see one potentially very big problem with OpenGL approach. When you put a HL shader compiler into driver you basically say that IHV's have one more (complex) problem for their driver team. How many of them do you think are able to put a good Glslang compiler out now (Cg anyone)? And once they have a compiler out, you'll basically have to deal with lots of different versions of drivers/compilers (since compilers will evolve with drivers). And if you are a pro, I think it's a lot better that you see that a compiler X doesn't do a good job at one of your shaders, than that one of your users (gamers) comes to you: "why the hell does your game crawl on brand new graphics card Y? You suck!" Or are we all going to adopt John Carmack's philosophy: "...and if a compiler does a really bad job..." Becouse you WILL have X different vendors with C(X) different compilers.
This is my current opinion and I haven't seen a working Glslang solution (and not even a not working one) and so I think it's still to early to judge which approach is better, because we all we have now is one approach that works and one that is potentially better.
 
I voted for DX9 because:
1. High level shader compiling left to the drivers will most certainly be a royal pain in the ass. I'd rather let MS develop a good compiler, and have a chance to actually compile my shaders and see what is produced. Compare that to letting the driver do all the work: it can be sub-optimal (writing good compiler ain't easy), it can be buggy, and it can vary a lot among driver versions.
2. DX9, especially D3DX, has some really great stuff. We have high level shading languages in both APIs, but D3DX has whole "effects framework" also - and it rocks! I don't use other utilities (meshes, animations) much, but the effects alone are good.
3. Well, I'm used to it... DX8 was very good, DX9 is even better :) Now, I don't see any single problem in the design of API - all is clear, easy and logical.
 
Back
Top